view_page.rhtml
2.07 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
<div class="article">
<%
# AddThis Button
if block_given? and File.exists?( RAILS_ROOT + '/config/web2.0.yml')
opts = YAML.load_file( RAILS_ROOT + '/config/web2.0.yml' )
if opts['addthis']
opts = opts['addthis']
%>
<script type="text/javascript">
addthis_brand = '<%= escape_javascript( @environment.name ) %>';
<%=
str = ''
opts.each { |k, v|
str += ' addthis_'+ k +' = "'+ escape_javascript( v ) +"\";\n"
}
str
%></script>
<a href="http://www.addthis.com/bookmark.php" class="bt_addthis" target="_blank" onmouseover="return addthis_open(this, '', '[URL]', '<%= escape_javascript( @environment.name()+' :: '+@page.title ) %>')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="/images/bt-bookmark.gif" width="53" height="16" border="0" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<% end; end %>
<h2><%= @page.title %></h2>
<% if logged_in? && current_user.person.has_permission?('post_content', profile) %>
<div class="article-actions">
<%= link_to content_tag( 'span', _('Edit') ),
{ :controller => 'cms', :action => 'edit', :id => @page },
:class => 'button with-text icon-edit' %>
</div>
<% end %>
<div class="article-tags">
<%= @page.tags.map { |t| link_to(t, tag_url(:tag => t.name)) }.join("\n") %>
</div>
<% if @page.parent && !@page.parent.path.blank? %>
<div class="article-parent">
<%= link_to_document(@page.parent, _('Up')) %>
</div>
<% end %>
<%= @page.to_html %>
<!--
<% unless @page.children.empty? %>
<hr/>
<ul>
<% @page.children.each do |item| %>
<li><%= link_to_document(item) %></li>
<% end %>
<% end %>
-->
<div class="article-cat">
<h3><%= _('Categories') %></h3>
<%= @page.categories.map {|item| link_to_category(item) }.join(', ') %>
</div>
<h3><%= @comments.size == 0 ? _('No comments yet') : (n_('One comment', '%{comments} comments', @comments.size)) % { :comments => @comments.size} %></h3>
<%= render :partial => 'comment', :collection => @comments %>
<%= render :partial => 'comment_form' %>
</div><!-- end class="article" -->