diff --git a/lib/view.rb b/lib/view.rb
index 72b7275..cc854ac 100644
--- a/lib/view.rb
+++ b/lib/view.rb
@@ -1,329 +1,347 @@
# Copyright (C) 2011 Cornelius Schumacher
This includes:
The goal of Inqlude is to provide a comprehensive listing of all existing libraries for developers of Qt applications. If you are creating applications using the Qt toolkit, and are looking for libraries, components or modules to use, Inqlude is the place where you find all information and pointers to get started.
This is a young project, we are still collecting information, and are building up the web site and the tools around it. If you would like to get involved, read more about how to contribute, or go to the mailing list inqlude.kde.org to directly talk to us. See you there.
' expect(paragraphs_content).to eq(expected_content) end end + + context "footer" do + include_context "manifest_files" + + include GivenFilesystemSpecHelpers + + use_given_filesystem + + before(:each) do + mh = ManifestHandler.new(settings) + mh.read_remote + @v = View.new mh + @v.templates = "two-column" + + @dir = given_directory + end + + it "generates footer for home page" do + @v.render_template("index", @dir) + rendered = @v.add_footer + expected = 'Last updated on ' + Date.today.to_s + expect(rendered).to include expected + end + + it "generates footer for sub pages" do + @v.render_template("about", @dir) + rendered = @v.add_footer + expected = 'Last updated on ' + Date.today.to_s + expect(rendered).not_to include expected + end + end end diff --git a/view/two-column/index.html.haml b/view/two-column/index.html.haml index b7b1889..b484998 100644 --- a/view/two-column/index.html.haml +++ b/view/two-column/index.html.haml @@ -1,194 +1,191 @@ %h3 Stable libraries %table.table-hover.col-sm-12 - libraries(:stable).each do |library| %tr %td.name - if library.latest_manifest.display_name = link_to_library(library.latest_manifest.name, library.latest_manifest.display_name) - else = link_to_library(library.latest_manifest.name, library.latest_manifest.name) %td.summary = library.manifests.last.summary %td.platforms - if library.manifests.last.platforms.include? 'Linux' %i.fa.fa-linux - if library.manifests.last.platforms.include? 'OS X' %i.fa.fa-apple - if library.manifests.last.platforms.include? 'Windows' %i.fa.fa-windows - if library.manifests.last.platforms.include? 'Android' %i.fa.fa-android - if library.manifests.last.platforms.include? 'iOS' %img{:src => "ios.ico", :height => "15%;"} %td.topics - if library.manifests.last.topics - library.manifests.last.topics.each do |topic| - if (topic != library.manifests.last.topics.last) = topic + ", " - else = topic %td.licenses - library.manifests.last.licenses.each do |license| - if (license != library.manifests.last.licenses.last) = license + ", " - else = license %h3 Developer releases %table.table-hover.col-sm-12 - libraries(:beta).each do |library| %tr %td.name - if library.latest_manifest.display_name = link_to_library(library.latest_manifest.name, library.latest_manifest.display_name) - else = link_to_library(library.latest_manifest.name, library.latest_manifest.name) %td.summary = library.manifests.last.summary %td.platforms - if library.manifests.last.platforms.include? 'Linux' %i.fa.fa-linux - if library.manifests.last.platforms.include? 'OS X' %i.fa.fa-apple - if library.manifests.last.platforms.include? 'Windows' %i.fa.fa-windows - if library.manifests.last.platforms.include? 'Android' %i.fa.fa-android - if library.manifests.last.platforms.include? 'iOS' %img{:src => "ios.ico", :height => "15%;"} %td.topics - if library.manifests.last.topics - library.manifests.last.topics.each do |topic| - if (topic != library.manifests.last.topics.last) = topic + ", " - else = topic %td.licenses - library.manifests.last.licenses.each do |license| - if (license != library.manifests.last.licenses.last) = license + ", " - else = license - libraries(:alpha).each do |library| %tr %td.name - if library.latest_manifest.display_name = link_to_library(library.latest_manifest.name, library.latest_manifest.display_name) - else = link_to_library(library.latest_manifest.name, library.latest_manifest.name) %td.summary = library.manifests.last.summary %td.platforms - if library.manifests.last.platforms.include? 'Linux' %i.fa.fa-linux - if library.manifests.last.platforms.include? 'OS X' %i.fa.fa-apple - if library.manifests.last.platforms.include? 'Windows' %i.fa.fa-windows - if library.manifests.last.platforms.include? 'Android' %i.fa.fa-android - if library.manifests.last.platforms.include? 'iOS' %img{:src => "ios.ico", :height => "15%;"} %td.topics - if library.manifests.last.topics - library.manifests.last.topics.each do |topic| - if (topic != library.manifests.last.topics.last) = topic + ", " - else = topic %td.licenses - library.manifests.last.licenses.each do |license| - if (license != library.manifests.last.licenses.last) = license + ", " - else = license - libraries(:edge).each do |library| %tr %td.name - if library.latest_manifest.display_name = link_to_library(library.latest_manifest.name, library.latest_manifest.display_name) - else = link_to_library(library.latest_manifest.name, library.latest_manifest.name) %td.summary = library.manifests.last.summary %td.platforms - if library.manifests.last.platforms.include? 'Linux' %i.fa.fa-linux - if library.manifests.last.platforms.include? 'OS X' %i.fa.fa-apple - if library.manifests.last.platforms.include? 'Windows' %i.fa.fa-windows - if library.manifests.last.platforms.include? 'Android' %i.fa.fa-android - if library.manifests.last.platforms.include? 'iOS' %img{:src => "ios.ico", :height => "15%;"} %td.topics - if library.manifests.last.topics - library.manifests.last.topics.each do |topic| - if (topic != library.manifests.last.topics.last) = topic + ", " - else = topic %td.licenses - library.manifests.last.licenses.each do |license| - if (license != library.manifests.last.licenses.last) = license + ", " - else = license %h3 Unreleased libraries %table.table-hover.col-sm-12 - unreleased_libraries.each do |library| %tr %td.name - if library.latest_manifest.display_name = link_to_library(library.latest_manifest.name, library.latest_manifest.display_name) - else = link_to_library(library.latest_manifest.name, library.latest_manifest.name) %td.summary = library.manifests.last.summary %td.platforms - if library.manifests.last.platforms.include? 'Linux' %i.fa.fa-linux - if library.manifests.last.platforms.include? 'OS X' %i.fa.fa-apple - if library.manifests.last.platforms.include? 'Windows' %i.fa.fa-windows - if library.manifests.last.platforms.include? 'Android' %i.fa.fa-android - if library.manifests.last.platforms.include? 'iOS' %img{:src => "ios.ico", :height => "15%;"} %td.topics - if library.manifests.last.topics - library.manifests.last.topics.each do |topic| - if (topic != library.manifests.last.topics.last) = topic + ", " - else = topic %td.licenses - library.manifests.last.licenses.each do |license| - if (license != library.manifests.last.licenses.last) = license + ", " - else = license %hr -%span.footer - Last updated on #{Date.today} - :javascript $('table.table-hover.col-sm-12 tr').click( function() { window.location = $(this).find('a').attr('href'); }).hover( function() { $(this).toggleClass('hover'); }); \ No newline at end of file diff --git a/view/two-column/layout.html.haml b/view/two-column/layout.html.haml index 3c8b5c6..5c92c7c 100644 --- a/view/two-column/layout.html.haml +++ b/view/two-column/layout.html.haml @@ -1,102 +1,95 @@ !!! %head %meta{ :charset => 'utf-8' } = style_sheet - if enable_search %body .container-fluid.header - .col-sm-8.left .ribbon = link_to "Alpha", "about" %h1 %span.logo>< = link_to "#in", "index" %span.logo.green>< = link_to "q", "index" %span.logo>< = link_to "lude", "index" %h2 %span.subtitle>< = link_to "The Qt library archive", "index" - .col-sm-4.right - if enable_search %gcse:searchbox-only{ resultsUrl: "https://inqlude.org/search.html" } Loading... %br{ :clear => "all" } - .container-fluid.content - - .col-sm-3.side-bar - %p{:class => "description"} - Inqlude provides a comprehensive listing of all existing libraries for developers of applications using the #{link_to "Qt toolkit", "http://qt-project.org"}. Inqlude is run by the community and open for contributions. - %ul.titles-list - %li - = link_to "About", "about" - %li - = link_to "How to get libraries", "get" - %li - = link_to "How to contribute", "contribute" + .col-sm-3.side-bar + %p{:class => "description"} + Inqlude provides a comprehensive listing of all existing libraries for developers of applications using the #{link_to "Qt toolkit", "http://qt-project.org"}. Inqlude is run by the community and open for contributions. + %ul.titles-list + %li + = link_to "About", "about" + %li + = link_to "How to get libraries", "get" + %li + = link_to "How to contribute", "contribute" - %p{:class => "title"} Latest releases - %hr - %ul.side-list - %li - - latest_libraries.each do |library| - - if library.latest_manifest.group == "kde-frameworks" - = link_to_group('kde-frameworks', 'KDE Frameworks') - -else - - if library.latest_manifest.display_name - = link_to_library(library.latest_manifest.name, library.latest_manifest.display_name) - - else - = link_to_library(library.latest_manifest.name, library.latest_manifest.name) - %date - = '(' + library.latest_manifest.release_date + ')' - %br + %p{:class => "title"} Latest releases + %hr + %ul.side-list + %li + - latest_libraries.each do |library| + - if library.latest_manifest.group == "kde-frameworks" + = link_to_group('kde-frameworks', 'KDE Frameworks') + -else + - if library.latest_manifest.display_name + = link_to_library(library.latest_manifest.name, library.latest_manifest.display_name) + - else + = link_to_library(library.latest_manifest.name, library.latest_manifest.name) + %date + = '(' + library.latest_manifest.release_date + ')' + %br - %p{:class => "title"} Topics - %hr - %ul.side-list - %li - = link_to "All", "all" + %p{:class => "title"} Topics + %hr + %ul.side-list + %li + = link_to "All", "all" + %number + = ' (' + libraries.length.to_s + ')' + %li + - topics.each do |topic| + = link_to_topic(topic) %number - = ' (' + libraries.length.to_s + ')' - %li - - topics.each do |topic| - = link_to_topic(topic) - %number - = ' (' + no_of_libraries(topic).to_s + ')' - %br + = ' (' + no_of_libraries(topic).to_s + ')' + %br - .col-sm-9.main-pane - = yank + .col-sm-9.main-pane + = yank - %br{ :clear => "all" } + %br{ :clear => "all" } %hr - .col-sm-12.legal - Inqlude is a - = link_to "KDE project", "http://kde.org" - = "|" - = link_to "Legal", "http://www.kde.org/community/whatiskde/impressum.php" + .col-sm-12.footer + = add_footer - - if enable_search - :javascript - (function() { - var cx = '012526638842992167133:g7thmrlp2uw'; - var gcse = document.createElement('script'); - gcse.type = 'text/javascript'; - gcse.async = true; - gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + - '//cse.google.com/cse.js?cx=' + cx; - var s = document.getElementsByTagName('script')[0]; - s.parentNode.insertBefore(gcse, s); - })(); + - if enable_search + :javascript + (function() { + var cx = '012526638842992167133:g7thmrlp2uw'; + var gcse = document.createElement('script'); + gcse.type = 'text/javascript'; + gcse.async = true; + gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + + '//cse.google.com/cse.js?cx=' + cx; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(gcse, s); + })(); diff --git a/view/two-column/public/inqlude.css b/view/two-column/public/inqlude.css index d15eafc..b668754 100644 --- a/view/two-column/public/inqlude.css +++ b/view/two-column/public/inqlude.css @@ -1,265 +1,262 @@ body { color: #111; margin: 0px; font-family: 'Droid Sans', arial, serif; font-size: 155%; } a:link { color: #44a51c; text-decoration: none; } a:visited { color: #2F7213; text-decoration: none; } a:hover { color: #44a51c; text-decoration: underline; } a:active { color: #2F7213; text-decoration: underline; } .ribbon { background-color: #a00; overflow: hidden; position: absolute; left: -2em; top: 1em; -moz-transform: rotate(-45deg); -webkit-transform: rotate(-45deg); -moz-box-shadow: 0 0 1em #888; -webkit-box-shadow: 0 0 1em #888; } .ribbon a { border: 1px solid #faa; color: #fff; display: block; font: bold 81.25% 'Helvetiva Neue', Helvetica, Arial, sans-serif; margin: 0.05em 0 0.075em 0; padding: 0.5em 3.5em; text-align: center; text-decoration: none; text-shadow: 0 0 0.5em #444; } h1 { font-family: monospace; font-size: 180%; margin-bottom: 0px; } h1 .logo { font-size: 180%; font-weight: bold; } h2 { margin-top: -5px; } h2 .subtitle { font-weight: bold; font-size: 78%; } .logo a { color: #111; text-decoration: none; } .logo.green a { color: #80C342; text-decoration: none; } .subtitle a { color: #111; text-decoration: none; } h3 { font-weight: bold; font-size: 140%; margin-top: 0px; padding-bottom: 15px; } h4 { font-weight: bold; font-size: 120%; } .container-fluid.header { -webkit-box-shadow: 0px 6px 0px rgba(50, 50, 50, 0.5); -moz-box-shadow: 0px 6px 0px rgba(50, 50, 50, 0.5); box-shadow: 0px 2px 4px rgba(0,0,0,.2); background-color: #eee; padding-left: 0px; padding-right: 0px; } .col-sm-8.left { margin-top: 0px; padding: 0px; padding-bottom: 5px; padding-left: 55px; } .col-sm-4.right { float: right; text-align: right; padding-top: 40px; padding-right: 30px; } .container-fluid.content { padding-right: 15px; padding-left: 15px; } .col-sm-3.side-bar { - padding: 20px; - padding-top: 30px; + padding: 30px; } .description { text-align: justify; } ul.titles-list { list-style-type: circle; padding-left: 15px; } .title { font-weight: bold; margin-top: 30px; } ul.side-list { list-style-type: none; padding-left: 0px; } date { float: right; } number { font-size: 80%; } .col-sm-9.main-pane { - padding-top: 30px; - padding-left: 15px; - padding-right: 20px; + padding: 30px; } table.table-hover.col-sm-12 { margin-bottom: 20px; } table.table-hover.col-sm-12 tr:hover td { background-color: #a4d477; cursor: pointer; } tr:nth-child(odd) { background-color: #eee; } td { vertical-align: top; padding: 5px; padding-left: 6px; } td.name { width: 15%; } td.summary { width: 32%; } td.platforms { width: 15%; } td.topics { width: 19%; } td.licenses { width: 19%; } .code { background-color: #111; color: #eee; padding: 10px; font-family: monospace; margin: 6px; } .release-date { font-size: 80%; margin-left: 5px; margin-right: 5px; } .old-versions { font-size: 80%; } home { float: right; font-style: italic; } -.footer { +.footer-text { float: right; - font-size: 80%; font-style: italic; } .edit-link { float: right; font-size: 80%; } -.col-sm-12.legal { +.col-sm-12.footer { text-align: center; font-size: 75%; - padding-bottom: 10px; + padding: 30px; + padding-top: 0px; } .attribute { margin: 8px; margin-left: 10%; } .attribute .label { display: inline; color: #555; width: 120px; text-align: right; float: left; margin-right: 8px; font-size: inherit; font-weight: normal; } .attribute .value { display: inline; } i.fa { font-size: 16px; margin-left: 2px; } hr { margin-top: 0px; }