Commit 49ee3a7a2eb25dc5144e154b4dfebfcc2477021c
1 parent
68a4fe77
Exists in
staging
and in
42 other branches
[licenses] Adding license in the content view page
(ActionItem2379)
Showing
13 changed files
with
43 additions
and
6 deletions
Show diff stats
app/views/cms/_blog.rhtml
@@ -6,6 +6,8 @@ | @@ -6,6 +6,8 @@ | ||
6 | 6 | ||
7 | <%= required f.text_field(:name, :size => '64', :onchange => "updateUrlField(this, 'article_slug')") %> | 7 | <%= required f.text_field(:name, :size => '64', :onchange => "updateUrlField(this, 'article_slug')") %> |
8 | 8 | ||
9 | +<%= render :partial => 'general_fields' %> | ||
10 | + | ||
9 | <script type="text/javascript"> | 11 | <script type="text/javascript"> |
10 | function submit_button(index) { | 12 | function submit_button(index) { |
11 | return $("article_slug").form.select("input.submit")[index]; | 13 | return $("article_slug").form.select("input.submit")[index]; |
app/views/cms/_event.rhtml
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | 5 | ||
6 | <%= required f.text_field('name', :size => '64') %> | 6 | <%= required f.text_field('name', :size => '64') %> |
7 | 7 | ||
8 | +<%= render :partial => 'general_fields' %> | ||
8 | <%= render :partial => 'translatable' %> | 9 | <%= render :partial => 'translatable' %> |
9 | 10 | ||
10 | <%= labelled_form_field(_('Start date'), pick_date(:article, :start_date)) %> | 11 | <%= labelled_form_field(_('Start date'), pick_date(:article, :start_date)) %> |
app/views/cms/_folder.rhtml
1 | <%= required_fields_message %> | 1 | <%= required_fields_message %> |
2 | 2 | ||
3 | <%= required f.text_field('name', :size => '64') %> | 3 | <%= required f.text_field('name', :size => '64') %> |
4 | +<%= render :partial => 'general_fields' %> | ||
4 | 5 | ||
5 | <%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 3, :cols => 64)) %> | 6 | <%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 3, :cols => 64)) %> |
app/views/cms/_forum.rhtml
@@ -6,6 +6,8 @@ | @@ -6,6 +6,8 @@ | ||
6 | 6 | ||
7 | <%= required f.text_field(:name, :size => '64', :onchange => "updateUrlField(this, 'article_slug')") %> | 7 | <%= required f.text_field(:name, :size => '64', :onchange => "updateUrlField(this, 'article_slug')") %> |
8 | 8 | ||
9 | +<%= render :partial => 'general_fields' %> | ||
10 | + | ||
9 | <%= labelled_form_field(_('Description:'), text_area(:article, :body, :cols => 64, :rows => 10)) %> | 11 | <%= labelled_form_field(_('Description:'), text_area(:article, :body, :cols => 64, :rows => 10)) %> |
10 | 12 | ||
11 | <%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, [5, 10, 20, 50, 100])) %> | 13 | <%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, [5, 10, 20, 50, 100])) %> |
app/views/cms/_gallery.rhtml
@@ -2,4 +2,6 @@ | @@ -2,4 +2,6 @@ | ||
2 | 2 | ||
3 | <%= required f.text_field('name', :size => '64') %> | 3 | <%= required f.text_field('name', :size => '64') %> |
4 | 4 | ||
5 | +<%= render :partial => 'general_fields' %> | ||
6 | + | ||
5 | <%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 3, :cols => 64)) %> | 7 | <%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 3, :cols => 64)) %> |
@@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
1 | +<%= labelled_form_field(_('License'), select(:article, :license_id, [[_('None'), nil]] + profile.environment.licenses.map {|license| [license.name, license.id]})) %> |
app/views/cms/_published_article.rhtml
1 | <%= f.text_field 'name', :size => '64' %> | 1 | <%= f.text_field 'name', :size => '64' %> |
2 | +<%= render :partial => 'general_fields' %> | ||
2 | 3 | ||
3 | <p><%= _('This is a republication of "%s", by %s.') % [link_to(h(@article.reference_article.name), @article.reference_article.url), @article.reference_article.profile.name] %></p> | 4 | <p><%= _('This is a republication of "%s", by %s.') % [link_to(h(@article.reference_article.name), @article.reference_article.url), @article.reference_article.profile.name] %></p> |
app/views/cms/_raw_html_article.rhtml
@@ -2,5 +2,6 @@ | @@ -2,5 +2,6 @@ | ||
2 | 2 | ||
3 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64')) %> | 3 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64')) %> |
4 | 4 | ||
5 | +<%= render :partial => 'general_fields' %> | ||
5 | <%= render :partial => 'translatable' %> | 6 | <%= render :partial => 'translatable' %> |
6 | <%= render :partial => 'shared/lead_and_body' %> | 7 | <%= render :partial => 'shared/lead_and_body' %> |
app/views/cms/_rss_feed.rhtml
@@ -2,6 +2,8 @@ | @@ -2,6 +2,8 @@ | ||
2 | 2 | ||
3 | <%= required f.text_field(:name) %> | 3 | <%= required f.text_field(:name) %> |
4 | 4 | ||
5 | +<%= render :partial => 'general_fields' %> | ||
6 | + | ||
5 | <%= required labelled_form_field(_('Limit of articles'), text_field(:article, :limit)) %> | 7 | <%= required labelled_form_field(_('Limit of articles'), text_field(:article, :limit)) %> |
6 | 8 | ||
7 | <%= labelled_form_field(_('Include in RSS Feed only posts from language:'), f.select(:language, [[_('All'), nil ]] + Noosfero.locales.map { |k,v| [v, k]})) %> | 9 | <%= labelled_form_field(_('Include in RSS Feed only posts from language:'), f.select(:language, [[_('All'), nil ]] + Noosfero.locales.map { |k,v| [v, k]})) %> |
app/views/cms/_textile_article.rhtml
@@ -4,5 +4,6 @@ | @@ -4,5 +4,6 @@ | ||
4 | 4 | ||
5 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '72')) %> | 5 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '72')) %> |
6 | 6 | ||
7 | +<%= render :partial => 'general_fields' %> | ||
7 | <%= render :partial => 'translatable' %> | 8 | <%= render :partial => 'translatable' %> |
8 | <%= render :partial => 'shared/lead_and_body' %> | 9 | <%= render :partial => 'shared/lead_and_body' %> |
app/views/cms/_tiny_mce_article.rhtml
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | <div> | 5 | <div> |
6 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64')) %> | 6 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64')) %> |
7 | 7 | ||
8 | + <%= render :partial => 'general_fields' %> | ||
8 | <%= render :partial => 'translatable' %> | 9 | <%= render :partial => 'translatable' %> |
9 | <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true} %> | 10 | <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true} %> |
10 | </div> | 11 | </div> |
app/views/content_viewer/view_page.rhtml
@@ -12,6 +12,22 @@ | @@ -12,6 +12,22 @@ | ||
12 | <%= remote_function :update => "article-toolbar", :url => @page.url.merge({ :toolbar => true, :only_path => true }), :complete => "$$('#article-toolbar .remote-lbOn').each(function(link) { new lightbox(link); }); jQuery('#article-toolbar .simplemenu-trigger').click(function(e) { e.stopPropagation(); })" %> | 12 | <%= remote_function :update => "article-toolbar", :url => @page.url.merge({ :toolbar => true, :only_path => true }), :complete => "$$('#article-toolbar .remote-lbOn').each(function(link) { new lightbox(link); }); jQuery('#article-toolbar .simplemenu-trigger').click(function(e) { e.stopPropagation(); })" %> |
13 | </script> | 13 | </script> |
14 | 14 | ||
15 | +<% if @page.display_hits? || @page.license.present? %> | ||
16 | + <div id='article-sub-header'> | ||
17 | + <% if @page.display_hits? %> | ||
18 | + <div id="article-hits"> | ||
19 | + <%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %> | ||
20 | + </div> | ||
21 | + <% end %> | ||
22 | + | ||
23 | + <% if @page.license.present? %> | ||
24 | + <div id="article-license"> | ||
25 | + <%= _('Licensed under %s') % (@page.license.url.present? ? link_to(@page.license.name, @page.license.url, :target => '_blank') : @page.license.name) %> | ||
26 | + </div> | ||
27 | + <% end %> | ||
28 | + </div> | ||
29 | +<% end %> | ||
30 | + | ||
15 | <% if !@page.tags.empty? %> | 31 | <% if !@page.tags.empty? %> |
16 | <div id="article-tags"> | 32 | <div id="article-tags"> |
17 | <%= _("This article's tags:") %> | 33 | <%= _("This article's tags:") %> |
@@ -19,12 +35,6 @@ | @@ -19,12 +35,6 @@ | ||
19 | </div> | 35 | </div> |
20 | <% end %> | 36 | <% end %> |
21 | 37 | ||
22 | -<% if @page.display_hits? %> | ||
23 | - <div id="article-hits"> | ||
24 | - <%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %> | ||
25 | - </div> | ||
26 | -<% end %> | ||
27 | - | ||
28 | <% if @page.parent && !@page.parent.path.blank? %> | 38 | <% if @page.parent && !@page.parent.path.blank? %> |
29 | <div id="article-parent"> | 39 | <div id="article-parent"> |
30 | <%= button(:back, _('Go back to %s') % @page.parent.short_title, @page.parent.url) %> | 40 | <%= button(:back, _('Go back to %s') % @page.parent.short_title, @page.parent.url) %> |
public/stylesheets/application.css
@@ -1019,14 +1019,26 @@ code input { | @@ -1019,14 +1019,26 @@ code input { | ||
1019 | #article-tags { | 1019 | #article-tags { |
1020 | font-size: 10px; | 1020 | font-size: 10px; |
1021 | text-align: right; | 1021 | text-align: right; |
1022 | + margin-bottom: -10px; | ||
1022 | } | 1023 | } |
1023 | #article-tags a { | 1024 | #article-tags a { |
1024 | text-decoration: none; | 1025 | text-decoration: none; |
1025 | } | 1026 | } |
1026 | 1027 | ||
1028 | +#article-sub-header { | ||
1029 | + height: 15px; | ||
1030 | +} | ||
1031 | + | ||
1027 | #article-hits { | 1032 | #article-hits { |
1028 | font-size: 10px; | 1033 | font-size: 10px; |
1034 | + float: left; | ||
1035 | +} | ||
1036 | + | ||
1037 | +#article-license { | ||
1038 | + font-size: 10px; | ||
1039 | + float: right; | ||
1029 | text-align: right; | 1040 | text-align: right; |
1041 | + color: #AAA; | ||
1030 | } | 1042 | } |
1031 | 1043 | ||
1032 | #article-cat { | 1044 | #article-cat { |