2014-06-11 16:46:13 +08:00
|
|
|
|
<%
|
|
|
|
|
btn_tips = l(:label_news_notice)
|
|
|
|
|
label_tips = l(:label_course_news)
|
|
|
|
|
%>
|
|
|
|
|
|
2014-08-21 15:40:21 +08:00
|
|
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
<% if @course && User.current.allowed_to?(:manage_news, @course) %>
|
|
|
|
|
<%= link_to(btn_tips,new_course_news_path(@course),
|
2015-03-24 17:12:51 +08:00
|
|
|
|
: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>
|
|
|
|
|
|
2014-06-11 16:46:13 +08:00
|
|
|
|
|
2015-03-26 19:04:47 +08:00
|
|
|
|
<!-- <%# if @course && User.current.allowed_to?(:manage_news, @course) %>
|
|
|
|
|
<%#= link_to(btn_tips, new_course_news_path(@course),
|
2014-10-08 10:27:19 +08:00
|
|
|
|
:class => 'icon icon-add',
|
|
|
|
|
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
|
|
|
|
|
|
2014-06-11 16:46:13 +08:00
|
|
|
|
<div id="add-news" class="add_frame" style="display:none;">
|
2015-03-26 19:04:47 +08:00
|
|
|
|
<%#= labelled_form_for @news, :url => course_news_index_path(@course),
|
2014-06-11 16:46:13 +08:00
|
|
|
|
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
2015-03-26 19:04:47 +08:00
|
|
|
|
<%#= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
|
|
|
|
|
<%#= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'ButtonColor m3p10' %>
|
2014-10-13 09:40:49 +08:00
|
|
|
|
<%#= preview_link preview_news_path, 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
|
|
|
|
|
2015-03-26 19:04:47 +08:00
|
|
|
|
<%#= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'ButtonColor m3p10' %>
|
|
|
|
|
<%# end if @course %>
|
2014-06-11 16:46:13 +08:00
|
|
|
|
<div id="preview" class="wiki"></div>
|
|
|
|
|
</div>
|
2015-03-26 19:04:47 +08:00
|
|
|
|
<%# end %>-->
|
2015-03-23 16:53:04 +08:00
|
|
|
|
|
2014-06-11 16:46:13 +08:00
|
|
|
|
<div>
|
|
|
|
|
<% if @newss.empty? %>
|
|
|
|
|
<p class="nodata">
|
|
|
|
|
<%= l(:label_no_data) %>
|
|
|
|
|
</p>
|
|
|
|
|
<% else %>
|
|
|
|
|
<% @newss.each do |news| %>
|
2015-03-23 16:53:04 +08:00
|
|
|
|
<div class="problem_main">
|
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 />
|
|
|
|
|
<div class="cl mb5"></div>
|
2015-04-03 11:19:15 +08:00
|
|
|
|
<p id="news_description_<%= news.id %>" class="news_description mt5"><%= textAreailizable news.description %><br /> <%= l(:label_create_time) %> :<%= format_time(news.created_on) %></p>
|
2015-03-26 19:02:40 +08:00
|
|
|
|
<div class="news_foot" style="display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>"><%= l(:label_expend_information) %> <span class="g-arr-down"><img src="/images/jiantou.jpg" width="12" height="6" /></span></div>
|
2015-03-23 16:53:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div><!--problem_main end-->
|
|
|
|
|
|
2014-06-11 16:46:13 +08:00
|
|
|
|
<% 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%>
|
2014-06-11 16:46:13 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
2015-03-27 16:59:52 +08:00
|
|
|
|
<%# other_formats_links do |f| %>
|
|
|
|
|
<%#= f.link_to 'Atom', :url => {:course_id => @course, :key => User.current.rss_key} %>
|
|
|
|
|
<%# end %>
|
2014-06-11 16:46:13 +08:00
|
|
|
|
|
|
|
|
|
<% 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 %>
|
|
|
|
|
|
2014-06-26 11:15:06 +08:00
|
|
|
|
<% html_title(l(:label_course_news)) -%>
|
2014-06-11 16:46:13 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script type='text/javascript'>
|
|
|
|
|
$(document).ready(function ($) {
|
|
|
|
|
$('.content-text-list').each(function () {
|
|
|
|
|
$(this).find('.delete_icon').hide();
|
|
|
|
|
$(this).mouseenter(function (event) {
|
|
|
|
|
$(this).find('.delete_icon').show();
|
|
|
|
|
});
|
|
|
|
|
$(this).mouseleave(function (event) {
|
|
|
|
|
$(this).find('.delete_icon').hide();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
2015-03-26 19:02:40 +08:00
|
|
|
|
$(function(){
|
|
|
|
|
$('.news_description').each(function () {
|
2015-03-27 09:05:43 +08:00
|
|
|
|
if($(this).height() >= 38)
|
2015-03-26 19:02:40 +08:00
|
|
|
|
{
|
|
|
|
|
$('#news_foot_'+$(this).attr('id').replace('news_description_','')).css("display","block");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
});
|
2014-06-11 16:46:13 +08:00
|
|
|
|
</script>
|