- <%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>
-
-
<%=h @news.title %>
- <%#= watcher_link(@news, User.current) %>
- <%= link_to(l(:button_edit),
- edit_news_path(@news),
- :class => 'talk_edit fr',
- :accesskey => accesskey(:edit),
- :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
- <%= delete_link news_path(@news),:class => 'talk_edit fr' if User.current.allowed_to?(:manage_news, @project) %>
-
-
<%= textAreailizable(@news, :description) %>
- <%= link_to_attachments_course @news %>
- <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
-
+
+ <% if @news.try(:author).try(:realname) == ' ' %>
+ <%= link_to @news.try(:author), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
+ <% else %>
+ <%= link_to @news.try(:author).try(:realname), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
+ <% end %>
+
+
<%= format_time( @news.created_on)%>
+
+
+ <%= @news.description.html_safe%>
+
+ <%= link_to_attachments_course @news, :author => false %>
+
-
-<% if @news.commentable? %>
-
- <%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %>
-
- <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
-
- <%= text_area 'comment', 'comments', :rows => 5, :style => "width:98%" %>
+
+
+
+
+ <% unless @comments.empty? %>
+
+
回复(<%=@comments.count %>)
+
+
+
+ <% @comments.each_with_index do |reply,i| %>
+
+
+
+ <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
+
+
+
+ <% if reply.try(:author).try(:realname) == ' ' %>
+ <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
+ <% end %>
+
+
+ <%= reply.comments.html_safe%>
+
+
+ <%= format_time(reply.created_on) %>
+
+
+
+
+
+
+ <% end %>
+
-
-
<%= l(:label_comment_add) %>
- <% end %>
<% end %>
-
-<% comments = @comments.reverse %>
-<% comments.each do |comment| %>
- <% next if comment.new_record? %>
-
-
<%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author), :class => "ping_dispic" %>
-
-
- <%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %>
<%= format_time(comment.created_on) %>
+
+ <% if @news.commentable? %>
+
-
-
- <% end if @comments.any? %>
+ <% end %>
+
-<% content_for :header_tags do %>
- <%= stylesheet_link_tag 'scm' %>
-<% end %>
-<% html_title @news.title -%>
diff --git a/app/views/news/edit.html.erb b/app/views/news/edit.html.erb
index 24d7f2040..76259f5d7 100644
--- a/app/views/news/edit.html.erb
+++ b/app/views/news/edit.html.erb
@@ -18,8 +18,10 @@
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<% if @org_subfield %>
<%= render :partial => 'edit_for_org_subfield', :locals => {:f => f, :news => @news} %>
- <% else %>
+ <% elsif @course %>
<%= render :partial => 'course_news_new', :locals => {:f => f, :news => @news, :edit_mode => true, :course => @course} %>
+ <% elsif @project %>
+ <%= render :partial => 'project_news_new', :locals => {:f => f, :news => @news, :edit_mode => true} %>
<% end %>
<% end %>
diff --git a/app/views/users/_project_news.html.erb b/app/views/users/_project_news.html.erb
index 3ea1479c5..57597d6e4 100644
--- a/app/views/users/_project_news.html.erb
+++ b/app/views/users/_project_news.html.erb
@@ -1,29 +1,134 @@
-