课程讨论区发布帖子、编辑帖子的实现
This commit is contained in:
parent
5d8ebad25c
commit
8ea5d98b6c
|
@ -96,6 +96,7 @@ class BoardsController < ApplicationController
|
||||||
'replies' => "#{Message.table_name}.replies_count",
|
'replies' => "#{Message.table_name}.replies_count",
|
||||||
'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
|
'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
|
||||||
|
|
||||||
|
@is_new = params[:is_new]
|
||||||
@topic_count = @board ? @board.topics.count : 0
|
@topic_count = @board ? @board.topics.count : 0
|
||||||
if @project
|
if @project
|
||||||
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||||
|
|
|
@ -42,7 +42,9 @@
|
||||||
<span class="add_attachment">
|
<span class="add_attachment">
|
||||||
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
||||||
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
||||||
<%= button_tag "#{l(:button_browse)}", :type=>"button", :onclick=>"file#{container.id}.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
|
<%#= button_tag "#{l(:button_browse)}", :type=>"button", :onclick=>"file#{container.id}.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
|
||||||
|
<% id ="file#{container.id}"%>
|
||||||
|
<a href="javascript:void(0);" class="AnnexBtn fl" style= "<%= ie8? ? 'display:none' : ''%>" onclick="$('#'+'<%= id %>').click();">上传附件</a>
|
||||||
<%= file_field_tag 'attachments[dummy][file]',
|
<%= file_field_tag 'attachments[dummy][file]',
|
||||||
:id => "file#{container.id}",
|
:id => "file#{container.id}",
|
||||||
:class => 'file_selector',
|
:class => 'file_selector',
|
||||||
|
@ -63,7 +65,7 @@
|
||||||
<% if container.nil? %>
|
<% if container.nil? %>
|
||||||
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
|
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
<!--(<%#= l(:label_max_size) %>: <%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)-->
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
$("#RSide").removeAttr("id");
|
||||||
|
$("#Container").css("width","1000px");
|
||||||
|
$("#message_subject").focus();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="homepageRight mt0 ml10">
|
||||||
|
<div class="homepageRightBanner">
|
||||||
|
<div class="NewsBannerName">
|
||||||
|
编辑帖子
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%= render :partial => 'boards/course_new',
|
||||||
|
:locals => {:f => f, :edit_mode => edit_mode, :topic => topic} %>
|
||||||
|
</div>
|
|
@ -1,12 +1,66 @@
|
||||||
<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||||
|
<%= error_messages_for 'message' %>
|
||||||
|
<div class="resources mt10">
|
||||||
|
<div id="new_course_topic">
|
||||||
|
<div class="homepagePostBrief c_grey">
|
||||||
|
<div>
|
||||||
|
<input type="text" name="message[subject]" id="message_subject" class="InputBox w704" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布帖子,请先输入帖子标题" value="<%= topic.subject%>" >
|
||||||
|
<p id="subjectmsg"></p>
|
||||||
|
</div>
|
||||||
|
<div id="topic_editor" style="display: none;">
|
||||||
|
<div class="mt10">
|
||||||
|
<%= f.check_box :sticky, :value => topic.sticky%>
|
||||||
|
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||||
|
<%= f.check_box :locked, :value => topic.locked%>
|
||||||
|
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="mt10">
|
||||||
|
<div id="message_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
|
||||||
|
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||||
|
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||||
|
|
||||||
<%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
|
<%= f.kindeditor :content, :editor_id => 'message_content_editor',
|
||||||
<li>
|
:owner_id => topic.nil? ? 0: topic.id,
|
||||||
|
:owner_type => OwnerTypeHelper::MESSAGE,
|
||||||
|
:width => '100%',
|
||||||
|
:height => 300,
|
||||||
|
:minHeight=>300,
|
||||||
|
:class => 'talk_text fl',
|
||||||
|
:input_html => { :id => 'message_content',
|
||||||
|
:class => 'talk_text fl',
|
||||||
|
:maxlength => 5000 }%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="message_content_span"></p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="mt10">
|
||||||
|
<div class="fl" id="topic_attachments">
|
||||||
|
<%= render :partial => 'attachments/form_course', :locals => {:container => topic, :isReply => @isReply} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mt5">
|
||||||
|
<%if !edit_mode %>
|
||||||
|
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_topic();">确定</a>
|
||||||
|
<span class="fr mr10 mt3">或</span>
|
||||||
|
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="reset_topic();">取消</a>
|
||||||
|
<% else %>
|
||||||
|
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_topic();">确定</a>
|
||||||
|
<span class="fr mr10 mt3">或</span>
|
||||||
|
<%= link_to "取消",board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "fr mr10 mt3"%>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%#= render :partial => 'course_new_topic', :locals => {:f => f, :topic => @message} %>
|
||||||
|
<!--<li>
|
||||||
<div class="ml55 fl" nhname="toolbar_container"></div>
|
<div class="ml55 fl" nhname="toolbar_container"></div>
|
||||||
<a href="javascript:void(0);" nhname="cancelbtn" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
|
<a href="javascript:void(0);" nhname="cancelbtn" class="grey_btn fr ml10"><%#= l(:button_cancel) %></a>
|
||||||
<a href="javascript:void(0);" nhname="submitbtn" class="blue_btn fr " style="margin-left: 55px">
|
<a href="javascript:void(0);" nhname="submitbtn" class="blue_btn fr " style="margin-left: 55px">
|
||||||
<%= l(:button_submit)%>
|
<%#= l(:button_submit)%>
|
||||||
</a>
|
</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>-->
|
||||||
<% end %>
|
</div>
|
||||||
|
</div>
|
|
@ -1,79 +1,107 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/*回复框*/
|
/*回复框*/
|
||||||
div.ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
.homepagePostReplyInputContainer .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;}
|
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
|
||||||
span.ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
|
.homepagePostReplyInputContainer .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;}
|
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
|
||||||
span.ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
|
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
|
||||||
span.ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
|
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
|
||||||
div.ke-toolbar .ke-outline {border: none;}
|
.homepagePostReplyInputContainer .ke-outline {border: none;}
|
||||||
.ke-inline-block {display: none;}
|
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
|
||||||
div.ke-container {float: left;}
|
.homepagePostReplyInputContainer .ke-container {float: left;}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
$("#RSide").removeAttr("id");
|
$("#RSide").removeAttr("id");
|
||||||
$("#Container").css("width","1000px");
|
$("#Container").css("width","1000px");
|
||||||
});
|
});
|
||||||
|
function reset_topic(){
|
||||||
|
$("#message_subject").val("");
|
||||||
|
$("#subjectmsg").text("");
|
||||||
|
document.getElementById("message_sticky").checked=false;
|
||||||
|
document.getElementById("message_locked").checked=false;
|
||||||
|
$("#topic_attachments").html("<%= escape_javascript(render :partial => 'attachments/form_course', :locals => {:container => Message.new, :isReply => @isReply})%>");
|
||||||
|
message_content_editor.html("");
|
||||||
|
$("#topic_editor").toggle();
|
||||||
|
}
|
||||||
|
<% if @is_new%>
|
||||||
|
$(function(){
|
||||||
|
$("#message_subject").focus();
|
||||||
|
});
|
||||||
|
<%end%>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="homepageRight mt0 ml10">
|
||||||
|
<div class="homepageRightBanner">
|
||||||
|
<div class="NewsBannerName">
|
||||||
|
课程讨论区
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},
|
||||||
|
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||||
|
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if topics%>
|
<% if topics%>
|
||||||
<% topics.each do |topic| %>
|
<% topics.each do |topic| %>
|
||||||
<script>
|
<script>
|
||||||
function expand_reply(container, btnid) {
|
function expand_reply(container, btnid) {
|
||||||
var target = $(container);
|
var target = $(container);
|
||||||
var btn = $(btnid);
|
var btn = $(btnid);
|
||||||
if (btn.data('init') == '0') {
|
if (btn.data('init') == '0') {
|
||||||
btn.data('init', 1);
|
btn.data('init', 1);
|
||||||
btn.html('收起回复');
|
btn.html('收起回复');
|
||||||
target.show();
|
target.show();
|
||||||
} else {
|
} else {
|
||||||
btn.data('init', 0);
|
btn.data('init', 0);
|
||||||
btn.html('展开更多');
|
btn.html('展开更多');
|
||||||
target.hide();
|
target.hide();
|
||||||
target.eq(0).show();
|
target.eq(0).show();
|
||||||
target.eq(1).show();
|
target.eq(1).show();
|
||||||
target.eq(2).show();
|
target.eq(2).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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});
|
||||||
|
|
||||||
function expand_reply_input(id) {
|
var reply_images=$("div#reply_content_<%= topic.id %>").find("img");
|
||||||
$(id).toggle();
|
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});
|
||||||
$(function () {
|
});
|
||||||
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
|
</script>
|
||||||
var description_images=$("div#activity_description_<%= topic.id %>").find("img");
|
<% if topic %>
|
||||||
if (description_images.length>0) {
|
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %>
|
||||||
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>
|
|
||||||
<% if topic %>
|
|
||||||
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if topics.count == 10 %>
|
<% if topics.count == 10 %>
|
||||||
<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>
|
<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#show_more_course_topic").mouseover(function () {
|
$("#show_more_course_topic").mouseover(function () {
|
||||||
|
|
|
@ -35,14 +35,7 @@
|
||||||
<% if @project %>
|
<% if @project %>
|
||||||
<%= render :partial => 'project_show', locals: {project: @project} %>
|
<%= render :partial => 'project_show', locals: {project: @project} %>
|
||||||
<% elsif @course %>
|
<% elsif @course %>
|
||||||
<div class="homepageRight mt0 ml10">
|
<%= render :partial => 'course_show', :locals => {:topics => @topics, :page => 0, :course => @course} %>
|
||||||
<div class="homepageRightBanner">
|
|
||||||
<div class="NewsBannerName">
|
|
||||||
课程讨论区
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%= render :partial => 'course_show', :locals => {:topics => @topics, :page => 0} %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function reset_homework(){
|
function reset_homework(){
|
||||||
$("#homework_name").val("");
|
$("#homework_name").val("");
|
||||||
$("#homework_end_time").val("");
|
$("#homework_end_time").val("");
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
|
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
|
||||||
<%= link_to "(#{@course.boards.first ? @course.boards.first.topics.count : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
|
<%= link_to "(#{@course.boards.first ? @course.boards.first.topics.count : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
|
||||||
<%= link_to( "+#{l(:label_message_new)}",course_boards_path(@course, :flag => true),:class => 'subnav_green ml95 c_white') if User.current.member_of_course?(@course) && @course.boards.first %>
|
<%= link_to( "+#{l(:label_message_new)}",course_boards_path(@course, :flag => true, :is_new => 1),:class => 'subnav_green ml95 c_white') if User.current.member_of_course?(@course) && @course.boards.first %>
|
||||||
</div>
|
</div>
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02" %>
|
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02" %>
|
||||||
|
|
|
@ -27,14 +27,14 @@
|
||||||
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%");
|
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="postRightContainer ml10">
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
||||||
<div class="postThemeContainer">
|
<div class="postThemeContainer">
|
||||||
<div class="postDetailPortrait">
|
<div class="postDetailPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
|
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="postThemeWrap">
|
<div class="postThemeWrap">
|
||||||
<% if @topic.author.id == User.current.id%>
|
<% if @topic.author.id == User.current.id%>
|
||||||
<div class="homepagePostSetting">
|
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
<ul class="homepagePostSettiongText">
|
<ul class="homepagePostSettiongText">
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="" id="reply_div_<%= @topic.id %>">
|
<div class="" id="reply_div_<%= @topic.id %>">
|
||||||
<% @replies.each_with_index do |reply,i| %>
|
<% @replies.each_with_index do |reply,i| %>
|
||||||
<div class="homepagePostReplyContainer">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
<div class="homepagePostReplyPortrait">
|
<div class="homepagePostReplyPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -111,22 +111,24 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div>
|
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div>
|
||||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||||
<%= format_date(reply.created_on) %>
|
<%= format_date(reply.created_on) %>
|
||||||
<%= link_to(
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||||
l(:button_reply),
|
<%= link_to(
|
||||||
{:action => 'quote', :id => reply},
|
l(:button_reply),
|
||||||
:remote => true,
|
{:action => 'quote', :id => reply},
|
||||||
:method => 'get',
|
:remote => true,
|
||||||
:class => 'fr newsBlue',
|
:method => 'get',
|
||||||
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
:class => 'fr newsBlue',
|
||||||
<%= link_to(
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||||
l(:button_delete),
|
<%= link_to(
|
||||||
{:action => 'destroy', :id => reply},
|
l(:button_delete),
|
||||||
:method => :post,
|
{:action => 'destroy', :id => reply},
|
||||||
:class => 'fr newsGrey mr10',
|
:method => :post,
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:class => 'fr newsGrey mr10',
|
||||||
:title => l(:button_delete)
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
) if reply.course_destroyable_by?(User.current) %>
|
:title => l(:button_delete)
|
||||||
|
) if reply.course_destroyable_by?(User.current) %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p id="reply_message_<%= reply.id%>"></p>
|
<p id="reply_message_<%= reply.id%>"></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,45 +1,38 @@
|
||||||
<div class="project_r_h">
|
<% if @message.project %>
|
||||||
<h2 class="project_h2"><%= l(:label_course_board) %></h2>
|
<div class="project_r_h">
|
||||||
</div>
|
<h2 class="project_h2"><%= l(:label_course_board) %></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<% if @message.project %>
|
|
||||||
<%#= board_breadcrumb(@message) %>
|
<%#= board_breadcrumb(@message) %>
|
||||||
<!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>-->
|
<!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>-->
|
||||||
<div class="ml15">
|
<div class="ml15">
|
||||||
<ul>
|
<ul>
|
||||||
<%= form_for @message, { :as => :message,
|
<%= form_for @message, {:as => :message,
|
||||||
:url => {:action => 'edit'},
|
:url => {:action => 'edit'},
|
||||||
:html => {:multipart => true,
|
:html => {:multipart => true,
|
||||||
:id => 'message-form',
|
:id => 'message-form',
|
||||||
:method => :post}
|
:method => :post}
|
||||||
} do |f| %>
|
} do |f| %>
|
||||||
<%= render :partial => 'form_project',
|
<%= render :partial => 'form_project',
|
||||||
:locals => {:f => f, :replying => !@message.parent.nil?} %>
|
:locals => {:f => f, :replying => !@message.parent.nil?} %>
|
||||||
<a href="#" onclick="submitProjectsBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
|
<a href="#" onclick="submitProjectsBoard();" class="blue_btn fl c_white"><%= l(:button_submit) %></a>
|
||||||
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %>
|
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% elsif @message.course %>
|
<% elsif @message.course %>
|
||||||
<%#= course_board_breadcrumb(@message) %>
|
<%= form_for @message, {
|
||||||
<div class="talk_new ml15">
|
:as => :message,
|
||||||
<ul>0
|
:url => {:action => 'edit'},
|
||||||
<%= form_for @message, {
|
:html => {:multipart => true,
|
||||||
:as => :message,
|
:id => 'message-form',
|
||||||
:url => {:action => 'edit'},
|
:method => :post}
|
||||||
:html => {:multipart => true,
|
} do |f| %>
|
||||||
:id => 'message-form',
|
<%= render :partial => 'boards/course_message_edit',
|
||||||
:method => :post}
|
:locals => {:f => f, :edit_mode => true, :topic => @message} %>
|
||||||
} do |f| %>
|
|
||||||
<%= render :partial => 'form_course',
|
|
||||||
:locals => {:f => f, :replying => !@message.parent.nil?} %>
|
|
||||||
<a href="javascript:void(0)" onclick="submitCoursesBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
|
|
||||||
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %>
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<div id="preview" class="wiki"></div>
|
<div id="preview" class="wiki"></div>
|
||||||
|
|
|
@ -148,6 +148,65 @@ function submit_edit_course(id)
|
||||||
$("#edit_course_"+id).submit();
|
$("#edit_course_"+id).submit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//课程讨论区
|
||||||
|
function regexTopicSubject() {
|
||||||
|
var name = $("#message_subject").val();
|
||||||
|
if(name.length ==0)
|
||||||
|
{
|
||||||
|
$("#subjectmsg").text("标题不能为空");
|
||||||
|
$("#subjectmsg").css('color','#ff0000');
|
||||||
|
$("#message_subject").focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if(name.length <= 255)
|
||||||
|
{
|
||||||
|
$("#subjectmsg").text("填写正确");
|
||||||
|
$("#subjectmsg").css('color','#008000');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#subjectmsg").text("标题超过255个字符");
|
||||||
|
$("#subjectmsg").css('color','#ff0000');
|
||||||
|
$("#message_subject").focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function regexTopicDescription()
|
||||||
|
{
|
||||||
|
var name = message_content_editor.html();
|
||||||
|
if(name.length ==0)
|
||||||
|
{
|
||||||
|
$("#message_content_span").text("描述不能为空");
|
||||||
|
$("#message_content_span").css('color','#ff0000');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if(name.length >=6000){
|
||||||
|
$("#message_content_span").text("描述最多3000个汉字(或6000个英文字符)");
|
||||||
|
$("#message_content_span").css('color','#ff0000');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#message_content_span").text("填写正确");
|
||||||
|
$("#message_content_span").css('color','#008000');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function submit_topic()
|
||||||
|
{
|
||||||
|
if(regexTopicSubject() && regexTopicDescription())
|
||||||
|
{
|
||||||
|
message_content_editor.sync();
|
||||||
|
$("#message-form").submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset_topic(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////////////////////////////////////课程讨论区
|
//////////////////////////////////////////////////////////////课程讨论区
|
||||||
|
|
|
@ -904,6 +904,7 @@ a:hover.BlueCirBtn{ background:#269ac9; color:#fff;}
|
||||||
.w720{width:721px;}
|
.w720{width:721px;}
|
||||||
.w709{width: 709px;}
|
.w709{width: 709px;}
|
||||||
.w701{width: 701px;}
|
.w701{width: 701px;}
|
||||||
|
.w704{width: 704px;}
|
||||||
a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888;}
|
a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; 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;}
|
a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repeat !important; color:#3598db;}
|
||||||
a.FilesBtn{ background: url(../images/homepage_icon2.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
|
a.FilesBtn{ background: url(../images/homepage_icon2.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
|
||||||
|
|
Loading…
Reference in New Issue