From 34dbde442d099734a99434d85bc48bcc0770b10b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 8 May 2015 14:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E8=AF=BE=E7=A8=8B=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 210 +++++++------------------ 1 file changed, 53 insertions(+), 157 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index c55bb8336..e4db6bef1 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -1,26 +1,28 @@ - +
-

- <% if User.current.language == "zh"%> - <%= h @board.name %> - <% else %> - <%= l(:project_module_boards) %> - <% end %> - -

- <%= l(:label_message_new) %> -
+

<%= l(:label_board_plural) %>

- -
-
-
- -
+ <% if !User.current.logged?%>
@@ -29,150 +31,44 @@
<% end %> -

讨论区共有<%= @topic_count %>个帖子

- <% if @topics.any? %> - <% @topics.each do |topic| %> -
- <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> -
- <% author = topic.author.to_s + ":" %> - <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %> - -

  <%= h(topic.subject) %>

- <% if topic.editable_by?(User.current) %> - <%= l(:button_edit) %> - <% end %> - <% if topic.sticky? %> - <%= l(:label_board_sticky)%> - <% end %> - <%= link_to( - l(:button_delete), - {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :class => 'talk_edit fr', - :style => ' margin-right: 10px;' - ) if topic.destroyable_by?(User.current) %> - - -
-

-

- <%= topic.content %> -
- - - - -

- <%= l(:label_activity_time)%>:  <%= format_time topic.created_on %> -
- <%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %> - -
-
-
- -
-
- <% reply = Message.new(:subject => "RE: #{@message.subject}")%> - <% if !topic.locked? && authorize_for('messages', 'reply') %> - -
- - <% end %> - <% replies_all = topic.children. - includes(:author, :attachments, {:board => :project}). - reorder("#{Message.table_name}.created_on DESC").offset(2). - all %> - <% replies_show = topic.children. - includes(:author, :attachments, {:board => :project}). - reorder("#{Message.table_name}.created_on DESC").limit(2). - all %> - <% unless replies_show.empty? %> - <% reply_count = 0 %> -
-
    - <% replies_show.each do |message| %> - -
  • - <%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %> -
    - <%= link_to_user_header message.author,false,:class => 'fl c_orange ' %> -
    -

    <%= textAreailizable message,:content,:attachments => message.attachments %>

    - -
    - <%= format_time(message.created_on) %> - <%= link_to( - - l(:button_delete), - {:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:button_delete), - :class => ' c_dblue fr' - ) if message.course_destroyable_by?(User.current) %> -
    -
    - -
  • - <% end %> -
-
- - <%if replies_all.first %> - - <% end %> +
+

+ <%= l(:label_totle) %> + <%= @topic_count %> + <%= l(:label_course_momes_count) %> +

+ <%= link_to l(:label_message_new), + new_board_message_path(@board), + :class => 'problem_new_btn fl c_dorange' if User.current.logged? %> +
+
+<% if @topics.any? %> + <% @topics.each do |topic| %> +
+ <%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %> +
+ <%= link_to h(topic.subject), board_message_path(@board, topic),title: topic.subject.to_s,:class => "problem_tit fl fb c_dblue" %> + <% if topic.sticky? %> + 置顶 <% end %> +
+

由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %>

- <% end %> - <% else %> -

<%= l(:label_no_data) %>

- <% end %> + <%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %> + +
+
+ <% end %> +<% else %> +

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

+<% end %> <%# other_formats_links do |f| %> - <%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> +<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <%# end %> <% html_title @board.name %>