##// END OF EJS Templates
Display watch link only when inside project with logged-in user (#2549)....
Jean-Philippe Lang -
r12593:79d01c7fe57d
parent child
Show More
@@ -1,47 +1,47
1 1 <div class="contextual">
2 2 <%= link_to(l(:label_news_new),
3 3 new_project_news_path(@project),
4 4 :class => 'icon icon-add',
5 5 :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
6 <%= watcher_link(@project.enabled_module('news'), User.current) %>
6 <%= watcher_link(@project.enabled_module('news'), User.current) if @project && User.current.logged? %>
7 7 </div>
8 8
9 9 <div id="add-news" style="display:none;">
10 10 <h2><%=l(:label_news_new)%></h2>
11 11 <%= labelled_form_for @news, :url => project_news_index_path(@project),
12 12 :html => { :id => 'news-form', :multipart => true } do |f| %>
13 13 <%= render :partial => 'news/form', :locals => { :f => f } %>
14 14 <%= submit_tag l(:button_create) %>
15 15 <%= preview_link preview_news_path(:project_id => @project), 'news-form' %> |
16 16 <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %>
17 17 <% end if @project %>
18 18 <div id="preview" class="wiki"></div>
19 19 </div>
20 20
21 21 <h2><%=l(:label_news_plural)%></h2>
22 22
23 23 <% if @newss.empty? %>
24 24 <p class="nodata"><%= l(:label_no_data) %></p>
25 25 <% else %>
26 26 <% @newss.each do |news| %>
27 27 <h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
28 28 <%= link_to h(news.title), news_path(news) %>
29 29 <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3>
30 30 <p class="author"><%= authoring news.created_on, news.author %></p>
31 31 <div class="wiki">
32 32 <%= textilizable(news, :description) %>
33 33 </div>
34 34 <% end %>
35 35 <% end %>
36 36 <p class="pagination"><%= pagination_links_full @news_pages %></p>
37 37
38 38 <% other_formats_links do |f| %>
39 39 <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
40 40 <% end %>
41 41
42 42 <% content_for :header_tags do %>
43 43 <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
44 44 <%= stylesheet_link_tag 'scm' %>
45 45 <% end %>
46 46
47 47 <% html_title(l(:label_news_plural)) -%>
General Comments 0
You need to be logged in to leave comments. Login now