socialforge/app/views/news/_course_news.html.erb

70 lines
2.7 KiB
Plaintext
Raw Normal View History

<%
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
%>
2015-03-23 16:53:04 +08:00
<div class="project_r_h">
<h2 class="project_h2"><%= label_tips %></h2>
</div>
<div class="talk_top">
<p class="fl">
<%= l(:label_total_news) %>
<span><%= @news_count %></span>
<%= l(:label_course_news_count) %>
</p>
2015-03-23 16:53:04 +08:00
<% 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')%>
2015-03-23 17:36:50 +08:00
<div class="cl"></div>
2015-03-23 16:53:04 +08:00
<% end %>
<div class="cl"></div>
</div>
<div>
<% if @newss.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<% @newss.each do |news| %>
<div class="problem_main upload_img">
2015-03-24 08:43:40 +08:00
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
2015-03-23 16:53:04 +08:00
<div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
<span class="fl">
<%= l(:label_release_news) %>
</span>
<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
<br />
2015-03-23 16:53:04 +08:00
<div class="cl mb5"></div>
2015-06-02 17:50:57 +08:00
<script>
$(function(){if($("#news_description_<%= news.id%>_content").height()>360){$("#news_foot_<%= news.id%>").show();}});
</script>
<div id="news_description_<%= news.id%>" class="news_description mt5">
<div id="news_description_<%= news.id%>_content" class="upload_img">
<%= news.description.html_safe %>
</div>
2015-05-21 15:57:58 +08:00
</div>
<div class="news_foot c_red" style="cursor:pointer;display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>">
<%= l(:button_more)%>...
<span class="g-arr-down"></span>
</div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
<%= link_to_attachments_course news %>
2015-03-23 16:53:04 +08:00
</div>
<div class="cl"></div>
</div><!--problem_main end-->
<% end %>
<% end %>
</div>
<!--end-->
2015-03-23 16:53:04 +08:00
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<% 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_course_news)) -%>