课程讨论区的列表显示
This commit is contained in:
parent
c5133997fa
commit
0f6ea47792
|
@ -37,6 +37,7 @@ class MessagesController < ApplicationController
|
|||
|
||||
# Show a topic and its replies
|
||||
def show
|
||||
=begin
|
||||
if @course
|
||||
topic_id = params[:r]?params[:r]:params[:id]
|
||||
parent_id = params[:id]
|
||||
|
@ -44,6 +45,7 @@ class MessagesController < ApplicationController
|
|||
redirect_to url
|
||||
return;
|
||||
end
|
||||
=end
|
||||
|
||||
@isReply = true
|
||||
page = params[:page]
|
||||
|
|
|
@ -1,313 +1,91 @@
|
|||
<div nhname="container_board">
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2 fl">
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
||||
span.ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
|
||||
span.ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
|
||||
div.ke-toolbar .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
|
||||
span.ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
|
||||
span.ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
|
||||
div.ke-toolbar .ke-outline {border: none;}
|
||||
.ke-inline-block {display: none;}
|
||||
div.ke-container {float: left;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#Container").css("width","1000px");
|
||||
});
|
||||
</script>
|
||||
<div class="homepageRight mt0 ml10">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">
|
||||
<% if User.current.language == "zh"%>
|
||||
<%= h @board.name %>
|
||||
<% else %>
|
||||
<%= l(:project_module_boards) %>
|
||||
<% end %>
|
||||
|
||||
</h2>
|
||||
<% if User.current.logged? %>
|
||||
<a href="javascript:void(0)" class="green_btn fr newtalk " id="new_topic_btn" nhname="showbtn"><%= l(:label_message_new) %></a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class=" talklist_box" >
|
||||
<div class="talk_new ml15 mb10" nhname="about_talk" id="about_newtalk" style="display:none;" >
|
||||
<ul>
|
||||
<%= render :partial => 'course_new' %>
|
||||
</ul>
|
||||
</div><!--talknew end-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 发布新帖部分 -->
|
||||
<div class=" talklist_box" >
|
||||
|
||||
<% if !User.current.logged?%>
|
||||
<div style="font-size: 14px;margin:20px;">
|
||||
<%= l(:label_user_login_course_board) %>
|
||||
<%= link_to l(:label_user_login_new), signin_path %>
|
||||
<hr/>
|
||||
</div>
|
||||
<% end %>
|
||||
<p class="c_dark mb5 f14">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
|
||||
<% if @topics.any? %>
|
||||
<% @topics.each do |topic| %>
|
||||
<div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;" id="topic<%= topic.id %>" nhname="container_board" mhname="container_board_reply">
|
||||
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
|
||||
<div class="talkmain_txt fl mt5 f12">
|
||||
<% author = topic.author.to_s %>
|
||||
<div style="max-width:120px;white-space:nowrap;overflow:hidden;float:left;text-overflow:ellipsis;">
|
||||
<%= link_to User.current.member_of_course?(@board.course) ? "#{topic.author.show_name}(#{topic.author.login})" : "#{topic.author}" , user_path(topic.author),
|
||||
:class =>"talkmain_name fl f14",:title=>author,
|
||||
:style=>'max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;' %>
|
||||
</div>
|
||||
<p style="float:left;color:#ff5722;"> :</p>
|
||||
</div>
|
||||
|
||||
<p class="talkmain_tit fl fb break_word f14" title="<%= h(topic.subject) %>" style="width:auto;float:left;max-width:360px;white-space:nowrap;overflow:hidden;float:left;text-overflow:ellipsis;"> <%= h(topic.subject) %></p>
|
||||
<% if topic.course_editable_by?(User.current) %>
|
||||
<a href="javascript:void(0)" nhname="showbtn" class="linkBlue" style="float: right;
|
||||
margin-right: 10px;"><%= l(:button_edit) %></a>
|
||||
<% 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) %>
|
||||
|
||||
<% if topic.sticky? %>
|
||||
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<script>
|
||||
//$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}});
|
||||
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
|
||||
$(function(){
|
||||
function nh_show_btn(){
|
||||
if($("#project_show_<%= topic.id%>").is(':hidden')){
|
||||
if($("#contentmessage<%=topic.id %>").height()>182){
|
||||
$("#project_show_<%= topic.id%>").show();
|
||||
}
|
||||
<% @topics.each do |topic| if @topics %>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复(' + btn.data('count') + ')');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多(' + btn.data('count') + ')');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
}
|
||||
}
|
||||
var div = $("#contentmessage<%=topic.id %>");
|
||||
var imgs = $('img',div);
|
||||
var lens = imgs.length;
|
||||
function nh_load_img_end(){
|
||||
nh_show_btn();
|
||||
// lens--;
|
||||
// if(lens <= 0){
|
||||
// nh_show_btn();
|
||||
// }
|
||||
}
|
||||
if(lens > 0){
|
||||
$('img',div).load(function(){
|
||||
nh_load_img_end();
|
||||
});
|
||||
}
|
||||
nh_show_btn();
|
||||
// if(lens <= 0){
|
||||
// nh_show_btn();
|
||||
// }else{
|
||||
// $('img',div).load(function(){
|
||||
// nh_load_img_end();
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
|
||||
var description_images=$("div#activity_description_<%= topic.id %>").find("img");
|
||||
if (description_images.length>0) {
|
||||
for (var i=0; i<description_images.length; i++){
|
||||
var image=$(description_images[i]);
|
||||
var element=$("<a></a>").attr("href",image.attr('src'));
|
||||
image.wrap(element);
|
||||
}
|
||||
}
|
||||
$('#activity_description_<%= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
|
||||
|
||||
var reply_images=$("div#reply_content_<%= topic.id %>").find("img");
|
||||
if (reply_images.length>0) {
|
||||
for (var i=0; i<reply_images.length; i++){
|
||||
var image=$(reply_images[i]);
|
||||
var element=$("<a></a>").attr("href",image.attr('src'));
|
||||
image.wrap(element);
|
||||
}
|
||||
}
|
||||
$('#reply_content_<%= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
|
||||
});
|
||||
</script>
|
||||
<div class="project_board_content break_word f14 list_style" id="content_<%=topic.id%>">
|
||||
<div id="contentmessage<%=topic.id %>" class="upload_img">
|
||||
<%= topic.content.html_safe %>
|
||||
<!-- -->
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<% if topic %>
|
||||
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<!-- <%# if course_activities.count == 10 %>
|
||||
<div id="show_more_course_activities" class="loadMore mt10 f_grey">展开更多<%#= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %></div>
|
||||
<%# end %>
|
||||
|
||||
|
||||
<p style="display: none" id="project_show_<%= topic.id%>">
|
||||
<a id="expend_more_information<%= topic.id%>" href="javascript:void(0)" style="color: #0781b4;" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</a>
|
||||
<span class="g-arr-down">
|
||||
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
|
||||
</span>
|
||||
|
||||
</p>
|
||||
<%= link_to_attachments_course topic, :author => false %>
|
||||
|
||||
<%= l(:label_activity_time)%>: <%= format_time topic.created_on %>
|
||||
|
||||
</div>
|
||||
<a href="javascript:void(0)" nhname="showbtn_reply" class="linkBlue fr f12" style="margin-right:10px;"><%= l(:button_reply) %></a>
|
||||
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" style="display: none;border-top: 1px dashed #d9d9d9;padding-top:5px;margin-left:0px;padding-left:15px;">
|
||||
<ul>
|
||||
<%= render :partial => 'edit',locals: {:topic => topic} %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="talkWrapBox">
|
||||
<% reply = Message.new(:subject => "RE: #{topic.subject}")%>
|
||||
<% if !topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply" style="display: none;">
|
||||
<em class="talkWrapArrow"></em>
|
||||
<div class="cl"></div>
|
||||
<div class="talkConIpt ml15 mb10" style="margin-left:30px;" id="reply<%= topic.id %>">
|
||||
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'},
|
||||
:html => {:nhname=>"form",:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %>
|
||||
|
||||
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
|
||||
<input name="parent_topic" type="hidden" value=""/>
|
||||
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
|
||||
<div style="padding-top:5px;" class="fr">
|
||||
<a href="javascript:void(0)" nhname="cancelbtn" class="grey_btn fr ml10" style=""><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0)" nhname="submitbtn" class="blue_btn fr " style=""><%= l(:button_submit)%></a>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% replies_all = topic.children.includes(:author, :attachments, {:board => :project}).
|
||||
reorder("#{Message.table_name}.created_on DESC").all %>
|
||||
<% unless replies_all.empty? %>
|
||||
<% replies_all_i = 0 %>
|
||||
<div class="talkWrapMsg" nhname="nh_reply_div" id="nh_reply_div_<%= topic.id %>">
|
||||
<ul>
|
||||
<% replies_all.each do |message| %>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li nhname="reply_rec" style="display:<%= replies_all_i>2?'none':'' %>" id="topic<%=message.id%>">
|
||||
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class => 'Msg_pic' %>
|
||||
<div class="Msg_txt">
|
||||
<%= link_to User.current.member_of_course?(@board.course) ? "#{message.author.show_name}(#{message.author.login})" : "#{message.author}", user_path(message.author),:class => 'fl c_orange f14 ' %>
|
||||
<br/>
|
||||
<div class="fl break_word f14 list_style">
|
||||
<%= textAreailizable message,:content,:attachments => message.attachments %>
|
||||
<!-- -->
|
||||
</div>
|
||||
<input nhname="nh_content_val" value="<%= message.content %>" type="hidden"/>
|
||||
<br/><div class="cl"></div>
|
||||
<span class=" c_grey fl f12"><%= format_time(message.created_on) %></span>
|
||||
<%= 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 => ' linkBlue fr f12'
|
||||
) if message.course_destroyable_by?(User.current) %>
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
'javascript:;',
|
||||
:nhname =>'showbtn_child_reply',
|
||||
:class => ' linkBlue fr f12',
|
||||
:style => 'margin-right: 10px;',
|
||||
'data-topic-id' =>message.id,
|
||||
:title => l(:button_reply)) if !topic.locked? && authorize_for('messages', 'reply') %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
</li><!---留言内容-->
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<%if topic.replies_count>2 %>
|
||||
<div class="talkWrapMsg"><a nhname="reply_ex_btn" data-count="<%= topic.replies_count %>" data-init="0" class=" ml258" href="javascript:void(0)" id="showgithelp<%= topic.id%>" value="show_help" class="c_dblue lh23" style="color: #0781b4;" >展开回复(<%= topic.replies_count.to_s%>)</a></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--讨论主类容 end-->
|
||||
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
<ul class="wlist">
|
||||
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %>
|
||||
</ul>
|
||||
<%# other_formats_links do |f| %>
|
||||
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
||||
<%# end %>
|
||||
|
||||
<% html_title @board.name %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@course}: #{@board}") %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(".talkmain_box").each(function(){
|
||||
var target = $("li[nhname='reply_rec']",$(this));
|
||||
var btn = $("a[nhname='reply_ex_btn']",$(this));
|
||||
var jumpobj = $("div[nhname='nh_reply_div']",$(this));
|
||||
btn.click(function(){
|
||||
if($(this).data('init')=='0'){
|
||||
$(this).data('init',1);
|
||||
$(this).html('收起回复('+$(this).data('count')+')');
|
||||
target.show();
|
||||
}else{
|
||||
$(this).data('init',0);
|
||||
$(this).html('展开回复('+$(this).data('count')+')');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
$("#nhjump").attr('href','#'+jumpobj.attr('id'));
|
||||
$("#nhjump")[0].click();
|
||||
}
|
||||
});
|
||||
});
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='container_board']").each(function(){
|
||||
var container = $(this);
|
||||
var about_talk = $("div[nhname='about_talk']",container);
|
||||
var params = ({
|
||||
kindutil:K,
|
||||
showbtn:$("a[nhname='showbtn']",container),
|
||||
about_talk:about_talk,
|
||||
inputsubject:$("input[nhname='inputsubject']",about_talk),
|
||||
subjectmsg:$("p[nhname='subjectmsg']",about_talk),
|
||||
textarea:$("textarea[nhname='textarea']",about_talk),
|
||||
contentmsg:$("p[nhname='contentmsg']",about_talk),
|
||||
submitbtn:$("a[nhname='submitbtn']",about_talk),
|
||||
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
|
||||
form:$("form[nhname='form']",about_talk),
|
||||
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
|
||||
init_content_val:$("input[nhname='init_content_val']",about_talk)
|
||||
});
|
||||
nh_init_board(params);
|
||||
});
|
||||
$("div[mhname='container_board_reply']").each(function(){
|
||||
var container = $(this);
|
||||
var about_talk = $("div[nhname='about_talk_reply']",container);
|
||||
var params = {
|
||||
type:'reply',
|
||||
kindutil:K,
|
||||
showbtn:$("a[nhname='showbtn_reply']",container),
|
||||
showbtn_child:$("a[nhname='showbtn_child_reply']",container),
|
||||
about_talk:about_talk,
|
||||
inputsubject:$("input[nhname='inputsubject']",about_talk),
|
||||
subjectmsg:$("p[nhname='subjectmsg']",about_talk),
|
||||
textarea:$("textarea[nhname='textarea']",about_talk),
|
||||
contentmsg:$("p[nhname='contentmsg']",about_talk),
|
||||
submitbtn:$("a[nhname='submitbtn']",about_talk),
|
||||
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
|
||||
form:$("form[nhname='form']",about_talk),
|
||||
quote_show:$("div[nhname='quote_show']",about_talk),
|
||||
quote_input:$("textarea[nhname='quote_input']",about_talk),
|
||||
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
|
||||
jumphref:$("#nhjump")
|
||||
};
|
||||
params.get_ref_str_call=function(btn){
|
||||
var div = btn.parent('div');
|
||||
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'<div class="cl"></div></blockquote>';
|
||||
return str;
|
||||
}
|
||||
nh_init_board(params);
|
||||
});
|
||||
|
||||
<% if( @params[:topic_id]!=nil && @params[:topic_id]!='' && @params[:page]==nil ) %>
|
||||
var nh_dw_html = $("#topic<%=@params[:topic_id]%>");
|
||||
if(nh_dw_html!=undefined && nh_dw_html.length!=0){
|
||||
if(nh_dw_html.is(':hidden')){
|
||||
$("a[nhname='reply_ex_btn']",nh_dw_html.parent('ul').parent('div').parent('div')).click();
|
||||
}
|
||||
$("#nhjump").attr('href','#'+nh_dw_html.attr('id'));
|
||||
$("#nhjump")[0].click();
|
||||
|
||||
}
|
||||
<% end %>
|
||||
<% if(!@flag.nil? && @flag=='true') %>
|
||||
if($("#new_topic_btn")!=undefined)$("#new_topic_btn").click();
|
||||
<% end %>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$("#show_more_course_activities").mouseover(function () {
|
||||
$("#more_course_activities_link").click();
|
||||
});
|
||||
</script>-->
|
||||
</div>
|
|
@ -1,117 +1,146 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2">
|
||||
<%= l(:label_board) %>
|
||||
</h2>
|
||||
</div>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor","forum" %>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||
div.ke-toolbar .ke-outline{border:none;}
|
||||
.ke-inline-block{display: none;}
|
||||
div.ke-container{float:left;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#Container").css("width","1000px");
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function expand_reply(container,btnid){
|
||||
var target = $(container).children();
|
||||
var btn = $(btnid);
|
||||
if(btn.data('init')=='0'){
|
||||
btn.data('init',1);
|
||||
btn.html('收起回复('+btn.data('count')+')');
|
||||
target.show();
|
||||
}else{
|
||||
btn.data('init',0);
|
||||
btn.html('展开更多('+btn.data('count')+')');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= @topic.id%>,null,"87%");
|
||||
});
|
||||
|
||||
<div class="topbar_info02 fl">
|
||||
<p class="hiddent">
|
||||
<%= l(:label_user_location) %> :
|
||||
<%= link_to l(:label_borad_course), course_boards_path(@course) %>
|
||||
>
|
||||
<%= link_to @topic.subject, course_board_path(@course, @board) %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
function del_confirm(){
|
||||
if(confirm('确认删除么?')){
|
||||
$("#del_memo_link").click();
|
||||
}else{
|
||||
|
||||
<div class="problem_main">
|
||||
<div class="ping_dispic">
|
||||
<%= link_to image_tag(url_to_avatar(@topic.author),:width => '46',:height => '46'), user_path(@topic.author) %>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="postRightContainer ml10">
|
||||
<div class="postThemeContainer">
|
||||
<div class="postDetailPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
|
||||
</div>
|
||||
<div class="postThemeWrap">
|
||||
<% if @topic.author.id == User.current.id%>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => @topic},
|
||||
:class => 'postOptionLink'
|
||||
) if @message.course_editable_by?(User.current) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => @topic},
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if @message.course_destroyable_by?(User.current) %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%end%>
|
||||
<div class="postDetailTitle fl">
|
||||
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="postDetailCreater">
|
||||
<%= link_to @topic.author.name, user_path(@topic.author), :class => "linkBlue2", :target=> "_blank"%></div>
|
||||
<div class="postDetailDate mb5"><%= format_date( @topic.created_on)%></div>
|
||||
<div class="cl"></div>
|
||||
<div class="memo-content upload_img break_word" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
|
||||
<%= @topic.content.html_safe%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class=" fl" style="width: 600px">
|
||||
<%= link_to_attachments_course @topic, :author => false %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="talk_txt fl">
|
||||
<p class="problem_tit fl fb c_dblue break_word" >
|
||||
<%= @topic.subject %>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
由<%= link_to_user_header @topic.author,false,:class=> 'problem_name' %>
|
||||
添加于<%= format_time(@topic.created_on) %>
|
||||
</p>
|
||||
</div>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => @topic},
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'talk_edit fr'
|
||||
) if @message.course_destroyable_by?(User.current) %>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => @topic},
|
||||
:class => 'talk_edit fr'
|
||||
) if @message.course_editable_by?(User.current) %>
|
||||
<div class="cl"></div>
|
||||
<div class="talk_info mb10 upload_img break_word"><%= @topic.content.html_safe %></div>
|
||||
<div class="talk_info mb10"><%= link_to_attachments_course @topic, :author => false %></div>
|
||||
<!-- <a href="#" class=" link_file ml60">附件:爱覅俄方if.zip(27.5kB)</a>-->
|
||||
<div class="cl"></div>
|
||||
<% if User.current.logged? %>
|
||||
<%= toggle_link l(:button_reply), "reply", :focus => 'message_subject',:class => 'talk_edit fr' %>
|
||||
<% else %>
|
||||
<%= link_to l(:button_reply), signin_path,:class => 'talk_edit fr' %>
|
||||
<% end %>
|
||||
<%= link_to(
|
||||
l(:button_quote),
|
||||
{:action => 'quote', :id => @topic},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'talk_edit fr',
|
||||
:remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<div class="cl"></div>
|
||||
</div><!--讨论主类容 end-->
|
||||
<% unless @replies.empty? %>
|
||||
<% reply_count = 0 %>
|
||||
<% @replies.each do |message| %>
|
||||
<div class="ping_C mb10 ml50" id="<%= "message-#{message.id}" %>">
|
||||
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div>
|
||||
<div class="ping_discon">
|
||||
<div class="ping_distop upload_img break_word">
|
||||
<%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %>
|
||||
<span class="c_grey fr"><%= format_time(message.created_on) %></span>
|
||||
<div class="cl"></div>
|
||||
<p><%= textAreailizable message,:content,:attachments => message.attachments %></p>
|
||||
<%= link_to_attachments_course message, :author => false %>
|
||||
<div class="homepagePostReply">
|
||||
<% unless @replies.empty? %>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<% if @reply_count > 2%>
|
||||
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%= @topic.id%>" onclick="expand_reply('#reply_div_<%= @topic.id %>','#reply_btn_<%= @topic.id%>')" data-count="<%= @reply_count %>" data-init="0" >点击展开更多回复</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="" id="reply_div_<%= @topic.id %>">
|
||||
<% @replies.each_with_index do |reply,i| %>
|
||||
<div class="homepagePostReplyContainer" style="display: <%= i >= 2 ? 'none':''%>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
<div class="ping_disfoot">
|
||||
<%= link_to(
|
||||
l(:button_quote),
|
||||
{:action => 'quote', :id => message},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_quote)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<%= link_to(
|
||||
#image_tag('edit.png'),
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => message},
|
||||
:title => l(:button_edit)
|
||||
) if message.course_editable_by?(User.current) %>
|
||||
<%= link_to(
|
||||
#image_tag('delete.png'),
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => message},
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if message.course_destroyable_by?(User.current) %>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_on) %></div>
|
||||
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!---留言内容-->
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
||||
<div id="reply" style="display:none;">
|
||||
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
||||
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
|
||||
<%= link_to l(:button_submit),"javascript:void(0)",:onclick => 'course_board_submit_message_replay();' ,:class => "blue_btn fl c_white" ,:style=>"margin-left: 50px;"%>
|
||||
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fl c_white" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<% html_title @topic.subject %>
|
||||
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @topic.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= @topic.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => @topic.id, :is_board => 'false'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @topic.id%>' name="reply[content]"></textarea>
|
||||
<div nhname='toolbar_container_<%= @topic.id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
|
||||
<a id="new_message_submit_btn_<%= @topic.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= @topic.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -15,9 +15,9 @@
|
|||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.id, :topic_id => activity.id,:host=> Setting.host_course), :class=> "postGrey" %>
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.parent_id, :topic_id => activity.id,:host=> Setting.host_course), :class=> "postGrey"%>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
|
|
|
@ -1040,3 +1040,35 @@ a:hover.c_grey{ color:#333;}
|
|||
a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;}
|
||||
a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;}
|
||||
|
||||
/*讨论区内部样式*/
|
||||
.postDetailContainer {padding:15px; border:1px solid #dddddd; background-color:#ffffff;}
|
||||
.postlabel {background-color:#edf1f2; color:#888888; padding:2px 5px; float:left; margin-bottom:5px;}
|
||||
.postRightContainer {width:718px; border:1px solid #dddddd; padding:15px; background-color:#ffffff; float:left; margin-bottom:10px;}
|
||||
.postDetailBanner {height:30px; width:720px; border-bottom:1px solid #efefef;}
|
||||
.postDetailRow {width:720px; border-bottom:1px solid #efefef; padding:15px 0;}
|
||||
.postDetailPortrait {width:50px; height:50px; float:left; margin-right:15px;}
|
||||
.postDetailWrap {width:580px; float:left;}
|
||||
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
|
||||
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
|
||||
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
|
||||
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
|
||||
.postDetailDate {color:#888888; font-size:12px; float:left;}
|
||||
.postDetailReply { margin-top:28px; color:#888888; float:right;}
|
||||
a.postReplyIcon {background:url(images/post_image_list.png) -40px 2px no-repeat; width:18px; height:18px; float:left;}
|
||||
a.postReplyIcon:hover {background:url(images/post_image_list.png) -40px -29px no-repeat;}
|
||||
.postDetailInput {width:713px; height:28px; border:1px solid #d9d9d9; outline:none !important;}
|
||||
.postAttIcon {background:url(images/post_image_list.png) 0px -91px no-repeat; width:16px; height:16px; padding-left:20px;}
|
||||
.postAttIcon:hover {background:url(images/post_image_list.png) 0px -113px no-repeat;}
|
||||
.postThemeContainer {width:720px;}
|
||||
.postThemeWrap {width:655px; float:left;position: relative}
|
||||
.postLikeIcon {background:url(images/post_image_list.png) 0px -42px no-repeat ;float:right; padding-left:18px; margin-top:3px;}
|
||||
.postLikeIcon:hover {background:url(images/post_image_list.png) 0px -64px no-repeat ;}
|
||||
a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
|
||||
a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repeat !important; color:#3598db;}
|
||||
.postEdit {background:url(images/post_image_list.png) 0px -94px no-repeat; width:18px; height:18px; display:block; float:left;}
|
||||
.postDelete {background:url(images/post_image_list.png) -42px -93px no-repeat; width:18px; height:18px; display:block; float:right;}
|
||||
.pageBanner {width:968px; margin:0px auto; border:1px solid #dddddd; background-color: #FFF; padding: 10px 15px; float:left;}
|
||||
.homepagePostReplyInput {width:543px; height:33px; max-width:543px; max-height:33px; border:1px solid #d9d9d9; outline:none;}
|
||||
.postRouteContainer {padding:10px 15px; background-color:#ffffff; border:1px solid #dddddd; margin-top:10px; font-size:14px;}
|
||||
a.postRouteLink {font-weight:bold; color:#484848;}
|
||||
a.postRouteLink:hover {text-decoration:underline;}
|
||||
|
|
Loading…
Reference in New Issue