Commit 49ee3a7a2eb25dc5144e154b4dfebfcc2477021c
1 parent
68a4fe77
Exists in
master
and in
29 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 | |
7 | 7 | <%= required f.text_field(:name, :size => '64', :onchange => "updateUrlField(this, 'article_slug')") %> |
8 | 8 | |
9 | +<%= render :partial => 'general_fields' %> | |
10 | + | |
9 | 11 | <script type="text/javascript"> |
10 | 12 | function submit_button(index) { |
11 | 13 | return $("article_slug").form.select("input.submit")[index]; | ... | ... |
app/views/cms/_event.rhtml
app/views/cms/_folder.rhtml
app/views/cms/_forum.rhtml
... | ... | @@ -6,6 +6,8 @@ |
6 | 6 | |
7 | 7 | <%= required f.text_field(:name, :size => '64', :onchange => "updateUrlField(this, 'article_slug')") %> |
8 | 8 | |
9 | +<%= render :partial => 'general_fields' %> | |
10 | + | |
9 | 11 | <%= labelled_form_field(_('Description:'), text_area(:article, :body, :cols => 64, :rows => 10)) %> |
10 | 12 | |
11 | 13 | <%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, [5, 10, 20, 50, 100])) %> | ... | ... |
app/views/cms/_gallery.rhtml
... | ... | @@ -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
app/views/cms/_raw_html_article.rhtml
app/views/cms/_rss_feed.rhtml
... | ... | @@ -2,6 +2,8 @@ |
2 | 2 | |
3 | 3 | <%= required f.text_field(:name) %> |
4 | 4 | |
5 | +<%= render :partial => 'general_fields' %> | |
6 | + | |
5 | 7 | <%= required labelled_form_field(_('Limit of articles'), text_field(:article, :limit)) %> |
6 | 8 | |
7 | 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
app/views/cms/_tiny_mce_article.rhtml
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | <div> |
6 | 6 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64')) %> |
7 | 7 | |
8 | + <%= render :partial => 'general_fields' %> | |
8 | 9 | <%= render :partial => 'translatable' %> |
9 | 10 | <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true} %> |
10 | 11 | </div> | ... | ... |
app/views/content_viewer/view_page.rhtml
... | ... | @@ -12,6 +12,22 @@ |
12 | 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 | 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 | 31 | <% if !@page.tags.empty? %> |
16 | 32 | <div id="article-tags"> |
17 | 33 | <%= _("This article's tags:") %> |
... | ... | @@ -19,12 +35,6 @@ |
19 | 35 | </div> |
20 | 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 | 38 | <% if @page.parent && !@page.parent.path.blank? %> |
29 | 39 | <div id="article-parent"> |
30 | 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 | 1019 | #article-tags { |
1020 | 1020 | font-size: 10px; |
1021 | 1021 | text-align: right; |
1022 | + margin-bottom: -10px; | |
1022 | 1023 | } |
1023 | 1024 | #article-tags a { |
1024 | 1025 | text-decoration: none; |
1025 | 1026 | } |
1026 | 1027 | |
1028 | +#article-sub-header { | |
1029 | + height: 15px; | |
1030 | +} | |
1031 | + | |
1027 | 1032 | #article-hits { |
1028 | 1033 | font-size: 10px; |
1034 | + float: left; | |
1035 | +} | |
1036 | + | |
1037 | +#article-license { | |
1038 | + font-size: 10px; | |
1039 | + float: right; | |
1029 | 1040 | text-align: right; |
1041 | + color: #AAA; | |
1030 | 1042 | } |
1031 | 1043 | |
1032 | 1044 | #article-cat { | ... | ... |