diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index c89f0af26..f801aff87 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -2,70 +2,39 @@ btn_tips = l(:label_news_notice) label_tips = l(:label_course_news) %> +

<%= label_tips %>

-

- <%= l(:label_total_news) %> - <%= @news_count %> - <%= l(:label_course_news_count) %> -

- <% if @course && User.current.allowed_to?(:manage_news, @course) %> - <%= link_to(btn_tips,new_course_news_path(@course),:class => 'problem_new_btn fl c_dorange')%> -
+
+

+ <%= l(:label_total_news) %> + <%= @news_count %> + <%= l(:label_course_news_count) %> +

+ <% if @course && User.current.allowed_to?(:manage_news, @course) %> + <%= link_to(btn_tips,new_course_news_path(@course),:class => 'problem_new_btn fl c_dorange')%> +
- <% end %> + <% end %> +
+
+
+ <%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %>
- <% if @newss.empty? %> -

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

- <% else %> - <% @newss.each do |news| %> -
- <%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %> -
- <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> - - <%= l(:label_release_news) %>: - - <%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %> - <%=link_to "#{news.comments.all.count}".html_safe, news_path(news.id), :class => "pro_mes_w" %> -
-
- -
-
- <%= news.description.html_safe %> -
-
-
- -
- <%= l(:label_create_time)%>:<%= format_time(news.created_on)%> - <%= link_to_attachments_course news %> -
- <%#= render :partial => 'student_work/work_attachments', :locals => {:attachments => news.attachments} %> -
-
-
- - <% end %> - <% 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' %> diff --git a/app/views/news/_course_news_list.html.erb b/app/views/news/_course_news_list.html.erb new file mode 100644 index 000000000..da963b3cd --- /dev/null +++ b/app/views/news/_course_news_list.html.erb @@ -0,0 +1,47 @@ +
+<% if newss.empty? %> +

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

+<% else %> + <% newss.each do |news| %> +
+ <%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %> +
+ <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> + + <%= l(:label_release_news) %>: + + <%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %> + <%=link_to "#{news.comments.all.count}".html_safe, news_path(news.id), :class => "pro_mes_w" %> +
+
+ +
+
+ <%= news.description.html_safe %> +
+
+
+ +
+ <%= l(:label_create_time)%>:<%= format_time(news.created_on)%> + <%= link_to_attachments_course news %> +
+ <%#= render :partial => 'student_work/work_attachments', :locals => {:attachments => news.attachments} %> +
+
+
+ + <% end %> +<% end %> +
+ + + \ No newline at end of file diff --git a/app/views/news/index.js.erb b/app/views/news/index.js.erb new file mode 100644 index 000000000..04671917b --- /dev/null +++ b/app/views/news/index.js.erb @@ -0,0 +1 @@ +$("#news_list").html("<%= escape_javascript(render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count})%>"); \ No newline at end of file