view_page.html.erb
3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<%
if @page.parent && @page.parent.has_posts? && @page.parent.feed
add_rss_feed_to_head(@page.parent.name, @page.parent.feed.url)
end
%>
<div id="article" class="<%= @page.css_class_name %>">
<%= render :partial => 'confirm_unfollow' %>
<script type="text/javascript">
window.ONE_COMMENT = "<%= _('One comment') %>";
window.COMMENT_PLURAL = "<%= _('comments') %>";
window.NO_COMMENT_YET = "<%= _('No comments yet') %>";
</script>
<% if @page.parent && !@page.parent.path.blank? %>
<div id="article-parent">
<%= button(:back, _('Go back to %s') % @page.parent.short_title, @page.parent.url) %>
</div>
<% end %>
<div id="article-toolbar">
<%= render :partial => 'article_toolbar' %>
</div>
<% if NOOSFERO_CONF['addthis_enabled'] and @page.public? %>
<%= render :partial => 'addthis' %>
<% end %>
<% cache(@page.cache_key(params, user, language)) do %>
<div class="<%="article-body article-body-" + @page.css_class_name %>">
<% options = @page.image? ? {:gallery_view => true} : {} %>
<% if @page.image.present? && !@page.event? && !@page.blog? %>
<div class="article-body-img">
<%= image_tag(@page.image.public_filename) %>
<p><%= @page.image.label%></p>
</div>
<% end %>
<%= article_to_html(@page, options) %>
<br style="clear:both" />
</div> <!-- end class="article-body" -->
<% end %>
<% if ! @page.categories.empty? %>
<div id="article-cat">
<h4><%= _('Categories') %></h4>
<%= safe_join(@page.categories.map {|item| link_to_category(item, false) }, ", ") %>
</div>
<% end %>
<% if !@page.tags.empty? %>
<div id="article-tags">
<%= _("This article's tags:").html_safe %>
<%= safe_join(@page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tags', :id => t.name ) }, "\n") %>
</div>
<% end %>
<%= display_source_info(@page) %>
<%= safe_join(@plugins.dispatch(:article_extra_contents, @page).collect { |content| instance_exec(&content) }, "") %>
<% if @page.accept_comments? || @comments_count > 0 %>
<div class="comments" id="comments_list">
<h3 <%= 'class="no-comments-yet"'.html_safe if @comments_count == 0 %>>
<%= display_number_of_comments(@comments_count) %>
</h3>
<% if @comments.present? && @comments.count > 1 %>
<%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") if @page.accept_comments? %>
<%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %>
<%= javascript_include_tag "comment_order.js" %>
<div class="comment-order">
<%= form_tag({:controller=>'content_viewer' , :action=>'view_page'}, {:method=>'get', :id=>"form_order"}) do %>
<%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %>
<% end %>
</div>
<% end %>
<ul class="article-comments-list">
<% if @comments.present? %>
<%= render :partial => 'comment/comment', :collection => @comments %>
<%= pagination_links @comments, :param_name => 'comment_page', :params => { :comment_order => @comment_order } %>
<% end %>
</ul>
<% if !@page.archived? && @page.accept_comments? %>
<div id='page-comment-form' class='page-comment-form'><%= render :partial => 'comment/comment_form', :locals =>{:url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%></div>
<% end %>
</div><!-- end class="comments" -->
<% end %>
</div><!-- end id="article" -->
<%= add_zoom_to_article_images %>