From 775ebc3607512ed8089a4a0113678f0b3e06a877 Mon Sep 17 00:00:00 2001 From: huangjingquan Date: Fri, 1 Nov 2013 10:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E9=97=BB=E7=95=8C=E9=9D=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/index.html.erb | 156 ++++++++++++++++++---------------- app/views/news/show.html.erb | 2 +- 2 files changed, 83 insertions(+), 75 deletions(-) diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index cded25576..9718a30df 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -1,32 +1,33 @@ +
<% if @project.project_type == 1%> -<%= link_to(l(:label_news_notice), - new_project_news_path(@project), - :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> - <% else %> - <%= link_to(l(:label_news_new), - new_project_news_path(@project), - :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> - - <% end %> + <%= link_to(l(:label_news_notice), + new_project_news_path(@project), + :class => 'icon icon-add', + :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> + <% else %> + <%= link_to(l(:label_news_new), + new_project_news_path(@project), + :class => 'icon icon-add', + :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> + + <% end %>
-<% if @newss.empty? %> -

<%= l(:label_no_data) %>

-<% else %> -<% @newss.each do |news| %> - - - - - -
<%=link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> - <% if @project.project_type == 1 %> - - - - <% else %> - - - - <% end %> - - - - - - - -
<%=link_to_user(news.author)if news.respond_to?(:author) %> <%= l(:label_project_notice)%> <%= link_to h(news.title), news_path(news) %>
<%=link_to_user(news.author)if news.respond_to?(:author) %> <%= l(:label_project_newshare)%> <%= link_to h(news.title), news_path(news) %>
<%= textilizable(news, :description) %>
<%= format_time(news.created_on) %><%= link_to l(:label_project_newother),news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %>
-<% end %> -<% end %>
+ <% if @newss.empty? %> +

+ <%= l(:label_no_data) %> +

+ <% else %> + <% @newss.each do |news| %> + + + + + +
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + + <% if @project.project_type == 1 %> + + + + <% else %> + + + + <% end %> + + + + + + + +
<%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_notice)%><%= link_to h(news.title), news_path(news) %> + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
<%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_newshare)%> <%= link_to h(news.title), news_path(news) %> + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
<%= textilizable(news, :description) %>
<%= format_time(news.created_on) %><%= link_to l(:label_project_newother),news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %>
+ <% end %> + <% end %> +
+ + <% other_formats_links do |f| %> + <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %> + <% end %> + + <% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> + <%= stylesheet_link_tag 'scm' %> + <% end %> + + <% html_title(l(:label_news_plural)) -%>
- -<% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %> -<% end %> - -<% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> - <%= stylesheet_link_tag 'scm' %> -<% end %> - -<% html_title(l(:label_news_plural)) -%> diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index b8296716d..3c7d0adad 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -8,7 +8,7 @@ <%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %> -

<%= h @news.title %>

+

<%=h @news.title %>

<% if authorize_for('news', 'edit') %>