From 49ee3a7a2eb25dc5144e154b4dfebfcc2477021c Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Wed, 18 Jul 2012 11:25:24 -0300 Subject: [PATCH] [licenses] Adding license in the content view page --- app/views/cms/_blog.rhtml | 2 ++ app/views/cms/_event.rhtml | 1 + app/views/cms/_folder.rhtml | 1 + app/views/cms/_forum.rhtml | 2 ++ app/views/cms/_gallery.rhtml | 2 ++ app/views/cms/_general_fields.html.erb | 1 + app/views/cms/_published_article.rhtml | 1 + app/views/cms/_raw_html_article.rhtml | 1 + app/views/cms/_rss_feed.rhtml | 2 ++ app/views/cms/_textile_article.rhtml | 1 + app/views/cms/_tiny_mce_article.rhtml | 1 + app/views/content_viewer/view_page.rhtml | 22 ++++++++++++++++------ public/stylesheets/application.css | 12 ++++++++++++ 13 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 app/views/cms/_general_fields.html.erb diff --git a/app/views/cms/_blog.rhtml b/app/views/cms/_blog.rhtml index 7ee6054..3ee3f8a 100644 --- a/app/views/cms/_blog.rhtml +++ b/app/views/cms/_blog.rhtml @@ -6,6 +6,8 @@ <%= required f.text_field(:name, :size => '64', :onchange => "updateUrlField(this, 'article_slug')") %> +<%= render :partial => 'general_fields' %> + +<% if @page.display_hits? || @page.license.present? %> +
+ <% if @page.display_hits? %> +
+ <%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %> +
+ <% end %> + + <% if @page.license.present? %> +
+ <%= _('Licensed under %s') % (@page.license.url.present? ? link_to(@page.license.name, @page.license.url, :target => '_blank') : @page.license.name) %> +
+ <% end %> +
+<% end %> + <% if !@page.tags.empty? %>
<%= _("This article's tags:") %> @@ -19,12 +35,6 @@
<% end %> -<% if @page.display_hits? %> -
- <%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %> -
-<% end %> - <% if @page.parent && !@page.parent.path.blank? %>
<%= button(:back, _('Go back to %s') % @page.parent.short_title, @page.parent.url) %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index c03eb93..174bd48 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1019,14 +1019,26 @@ code input { #article-tags { font-size: 10px; text-align: right; + margin-bottom: -10px; } #article-tags a { text-decoration: none; } +#article-sub-header { + height: 15px; +} + #article-hits { font-size: 10px; + float: left; +} + +#article-license { + font-size: 10px; + float: right; text-align: right; + color: #AAA; } #article-cat { -- libgit2 0.21.2