Merge branch 'sw_new_course' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course
This commit is contained in:
commit
0d04eb745f
|
@ -66,17 +66,28 @@ class BoardsController < ApplicationController
|
|||
'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
|
||||
|
||||
@topic_count = @board.topics.count
|
||||
#@topic_pages = paginateHelper @board.topics,10
|
||||
#@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||
board_topics = @board.topics.
|
||||
reorder("#{Message.table_name}.sticky DESC").
|
||||
includes(:last_reply).
|
||||
# limit(@topic_pages.per_page).
|
||||
# offset(@topic_pages.offset).
|
||||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
@topics = paginateHelper board_topics,10
|
||||
if @project
|
||||
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||
@topics = @board.topics.
|
||||
reorder("#{Message.table_name}.sticky DESC").
|
||||
includes(:last_reply).
|
||||
limit(@topic_pages.per_page).
|
||||
offset(@topic_pages.offset).
|
||||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
elsif @course
|
||||
board_topics = @board.topics.
|
||||
reorder("#{Message.table_name}.sticky DESC").
|
||||
includes(:last_reply).
|
||||
# limit(@topic_pages.per_page).
|
||||
# offset(@topic_pages.offset).
|
||||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
@topics = paginateHelper board_topics,10
|
||||
end
|
||||
|
||||
@message = Message.new(:board => @board)
|
||||
#modify by nwb
|
||||
if @project
|
||||
|
|
|
@ -44,18 +44,35 @@ class MessagesController < ApplicationController
|
|||
end
|
||||
|
||||
@reply_count = @topic.children.count
|
||||
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
||||
@replies = @topic.children.
|
||||
includes(:author, :attachments, {:board => :project}).
|
||||
reorder("#{Message.table_name}.created_on DESC").
|
||||
limit(@reply_pages.per_page).
|
||||
offset(@reply_pages.offset).
|
||||
all
|
||||
# @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
||||
# @replies = @topic.children.
|
||||
# includes(:author, :attachments, {:board => :project}).
|
||||
# reorder("#{Message.table_name}.created_on DESC").
|
||||
# limit(@reply_pages.per_page).
|
||||
# offset(@reply_pages.offset).
|
||||
# all
|
||||
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
if @course
|
||||
messages_replies = @topic.children.
|
||||
includes(:author, :attachments, {:board => :project}).
|
||||
reorder("#{Message.table_name}.created_on DESC").
|
||||
#limit(@reply_pages.per_page).
|
||||
#offset(@reply_pages.offset).
|
||||
all
|
||||
@replies = paginateHelper messages_replies,10
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
render :action => "show", :layout => "base_courses"#by young
|
||||
else
|
||||
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
||||
@replies = @topic.children.
|
||||
includes(:author, :attachments, {:board => :project}).
|
||||
reorder("#{Message.table_name}.created_on DESC").
|
||||
limit(@reply_pages.per_page).
|
||||
offset(@reply_pages.offset).
|
||||
all
|
||||
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
render :action => "show", :layout => "base_projects"#by young
|
||||
end
|
||||
end
|
||||
|
|
|
@ -270,7 +270,7 @@ module ApplicationHelper
|
|||
onclick = "$('##{id}').slideToggle(); "
|
||||
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
|
||||
onclick << "return false;"
|
||||
link_to(name, "#", :onclick => onclick)
|
||||
link_to(name, "#", :onclick => onclick,:class => options[:class])
|
||||
end
|
||||
|
||||
def image_to_function(name, function, html_options = {})
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<%= l(:label_message_new) %>
|
||||
</div>
|
||||
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'messages/form', :locals => {:f => f} %>
|
||||
<%= render :partial => 'messages/form_course', :locals => {:f => f} %>
|
||||
<p>
|
||||
<!--<input type="button" onclick="submitCoursesBoard();" class = "ButtonColor m3p10 h30" value="<%#= l(:button_submit)%>">-->
|
||||
<a href="#" onclick="submitCoursesBoard();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
<p class="talk_top"><%= l(:label_message_new) %></p>
|
||||
<ul>
|
||||
<%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
|
||||
<%= render :partial => 'form_course', :locals => {:f => f,:is_new => true} %>
|
||||
<a href="#" onclick="submitCoursesBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
|
||||
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form' ,target='preview',{:class => 'blue_btn grey_btn fl c_white'} )%>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -53,144 +53,104 @@
|
|||
/*border-radius: 10px;*/
|
||||
}
|
||||
</style>
|
||||
<div class="lz">
|
||||
<!-- 在这里添加赞和踩-->
|
||||
<span id="praise_tread" style="float: right">
|
||||
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @topic,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
|
||||
</span>
|
||||
<div class="contextual">
|
||||
<%= watcher_link(@topic, User.current) %>
|
||||
<%= link_to(
|
||||
l(:button_quote),
|
||||
{:action => 'quote', :id => @topic},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'icon icon-comment',
|
||||
:remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => @topic},
|
||||
:class => 'icon icon-edit'
|
||||
) if @message.course_editable_by?(User.current) %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => @topic},
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'icon icon-del'
|
||||
) if @message.course_destroyable_by?(User.current) %>
|
||||
</div>
|
||||
|
||||
<div class="lz-left">
|
||||
<div class="">
|
||||
<%= link_to image_tag(url_to_avatar(@topic.author), :class => "avatar"), user_path(@topic.author) %>
|
||||
</div>
|
||||
<p class="">
|
||||
<%= link_to @topic.author, user_path(@topic.author) %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="memo-section">
|
||||
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
|
||||
<% if @project %>
|
||||
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project),title: @topic.subject.to_s %>
|
||||
<% elsif @course %>
|
||||
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="memo-content">
|
||||
<%= textilizable(@topic, :content) %>
|
||||
<%= link_to_attachments @topic, :author => false %>
|
||||
</div>
|
||||
<div class="memo-timestamp">
|
||||
<div style="float: left">
|
||||
<%= authoring @topic.created_on, @topic.author %>
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<% if User.current.logged? %>
|
||||
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
|
||||
<% else %>
|
||||
<%= link_to l(:button_reply), signin_path %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_board) %></h2>
|
||||
</div>
|
||||
<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) %></div>
|
||||
<div class="talk_txt fl">
|
||||
<p class="problem_tit fl fb" ><%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %></p>
|
||||
<br/>
|
||||
<p>由<%= link_to_user_header @topic.author,false,:class=> 'problem_name' %> 添加于<%= format_time(@topic.created_on) %></p>
|
||||
</div>
|
||||
<!-- <a class="talk_edit fr">删除</a><a class="talk_edit fr">编辑</a><a class="talk_edit fr">置顶</a> -->
|
||||
<%= watcher_link(@topic, User.current) %>
|
||||
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => @topic},
|
||||
:class => 'talk_edit fr'
|
||||
) if @message.course_editable_by?(User.current) %>
|
||||
<%= 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) %>
|
||||
<div class="cl"></div>
|
||||
<div class="talk_info mb10"><%= textilizable(@topic, :content) %></div>
|
||||
<div class="talk_info mb10"><%= link_to_attachments @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_content',: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? %>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<h3 class="comments">
|
||||
<%= l(:label_reply_plural) %>
|
||||
(<%= @reply_count %>)
|
||||
</h3>
|
||||
<% reply_count = 0 %>
|
||||
<% @replies.each do |message| %>
|
||||
<div class="message reply" id="<%= "message-#{message.id}" %>">
|
||||
|
||||
<table class="borad-text-list">
|
||||
<tr>
|
||||
<td rowspan="3" valign="top" width="60px">
|
||||
<%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
|
||||
</td>
|
||||
<td>
|
||||
<div class="contextual-borad">
|
||||
<%= 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></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td class="comments">
|
||||
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
|
||||
<%= textilizable message,:content,:attachments => message.attachments %>
|
||||
</div>
|
||||
<%= link_to_attachments message, :author => false %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="font_lighter" style="float: left">
|
||||
<%= authoring message.created_on, message.author %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="ping_C mb10" 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">
|
||||
<%= 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>
|
||||
<%= textilizable message,:content,:attachments => message.attachments %>
|
||||
<%= link_to_attachments message, :author => false %>
|
||||
</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>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!---留言内容-->
|
||||
<% end %>
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
|
||||
</div>
|
||||
<% 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', :locals => {:f => f, :replying => true} %>
|
||||
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onclick="submit_message_replay();" >
|
||||
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
|
||||
<a href="#" onclick="submit_message_replay();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<% html_title @topic.subject %>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -33,51 +33,54 @@
|
|||
}
|
||||
return false;
|
||||
}
|
||||
function submitCoursesBoard()
|
||||
{
|
||||
if(regexSubject()&®exContent()){$("#message-form").submit();}
|
||||
}
|
||||
</script>
|
||||
<%= error_messages_for 'message' %>
|
||||
<% replying ||= false %>
|
||||
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
||||
|
||||
<li>
|
||||
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
||||
<% if replying %>
|
||||
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||
<% else %>
|
||||
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||
<% end %>
|
||||
<span id="subject_span"></span>
|
||||
</li>
|
||||
<li class="ml60 mb5">
|
||||
<% unless replying %>
|
||||
<% if @message.safe_attribute? 'sticky' %>
|
||||
<%= f.check_box :sticky %>
|
||||
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||
<% end %>
|
||||
<% if @message.safe_attribute? 'locked' %>
|
||||
<%= f.check_box :locked %>
|
||||
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||
<div class="box ph10_5">
|
||||
<!--[form:message]-->
|
||||
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
||||
<p>
|
||||
<label for="message_subject">
|
||||
<%= l(:field_subject) %>
|
||||
<span class="required"> * </span>
|
||||
</label>
|
||||
<br/>
|
||||
<% if replying %>
|
||||
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %>
|
||||
<% else %>
|
||||
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject", onkeyup: "regexSubject();" }.merge(extra_option) %>
|
||||
<% end %>
|
||||
<span id="subject_span"></span>
|
||||
</p>
|
||||
<p>
|
||||
<% unless replying %>
|
||||
<% if @message.safe_attribute? 'sticky' %>
|
||||
<%= f.check_box :sticky %>
|
||||
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||
<% end %>
|
||||
<% if @message.safe_attribute? 'locked' %>
|
||||
<%= f.check_box :locked %>
|
||||
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
<p>
|
||||
<label for="message_subject">
|
||||
<%= l(:field_description) %>
|
||||
<span class="required"> * </span>
|
||||
</label>
|
||||
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
|
||||
<span id="message_content_span"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<label> <%= l(:label_attachment_plural) %> :</label>
|
||||
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
|
||||
</li>
|
||||
<li >
|
||||
<a href="#" onclick="submitCoursesBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
|
||||
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form' ,target='preview',{:class => 'blue_btn grey_btn fl c_white'} )%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</p>
|
||||
<p>
|
||||
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
|
||||
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000 %>
|
||||
<span id="message_content_span"></span>
|
||||
</p>
|
||||
<p>
|
||||
<%= l(:label_attachment_plural) %>
|
||||
<br />
|
||||
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
|
||||
</p>
|
||||
</div>
|
|
@ -0,0 +1,82 @@
|
|||
<script type="text/javascript">
|
||||
function regexSubject()
|
||||
{
|
||||
var content = $.trim($("#message_subject").val());
|
||||
if(content.length ==0)
|
||||
{
|
||||
$("#subject_span").text("<%= l(:label_subject_empty) %>");
|
||||
$("#subject_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#subject_span").text("<%= l(:label_field_correct) %>");
|
||||
$("#subject_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function regexContent()
|
||||
{
|
||||
var content = $.trim($("#message_content").val());
|
||||
if(content.length ==0)
|
||||
{
|
||||
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
|
||||
$("#message_content_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#message_content_span").text("<%= l(:label_field_correct) %>");
|
||||
$("#message_content_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function submitCoursesBoard()
|
||||
{
|
||||
if(regexSubject()&®exContent()){$("#message-form").submit();}
|
||||
}
|
||||
</script>
|
||||
<%= error_messages_for 'message' %>
|
||||
<% replying ||= false %>
|
||||
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
||||
|
||||
<li>
|
||||
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
||||
<% if replying %>
|
||||
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||
<% else %>
|
||||
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||
<% end %>
|
||||
<span id="subject_span"></span>
|
||||
</li>
|
||||
<li class="ml60 mb5">
|
||||
<% unless replying %>
|
||||
<% if @message.safe_attribute? 'sticky' %>
|
||||
<%= f.check_box :sticky %>
|
||||
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||
<% end %>
|
||||
<% if @message.safe_attribute? 'locked' %>
|
||||
<%= f.check_box :locked %>
|
||||
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
|
||||
<div class="cl"></div>
|
||||
<span id="message_content_span"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<label> <%= l(:label_attachment_plural) %> :</label>
|
||||
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
|
||||
</li>
|
||||
<li >
|
||||
<div class="cl"></div>
|
||||
</li>
|
|
@ -1,23 +1,45 @@
|
|||
<% if @message.project %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_course_board) %></h2>
|
||||
</div>
|
||||
|
||||
<% if @message.project %>
|
||||
<%= 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>
|
||||
|
||||
<%= form_for @message, {
|
||||
:as => :message,
|
||||
:url => {:action => 'edit'},
|
||||
:html => {:multipart => true,
|
||||
:id => 'message-form',
|
||||
:method => :post}
|
||||
} do |f| %>
|
||||
<%= render :partial => 'form',
|
||||
:locals => {:f => f, :replying => !@message.parent.nil?} %>
|
||||
<a href="#" onclick="$('#message-form').submit();" class="ButtonColor m3p10">
|
||||
<%= l(:button_save) %>
|
||||
</a>
|
||||
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %>
|
||||
<% end %>
|
||||
<% elsif @message.course %>
|
||||
<%= course_board_breadcrumb(@message) %>
|
||||
<div class="talk_new ml15">
|
||||
<ul>
|
||||
<%= form_for @message, {
|
||||
:as => :message,
|
||||
:url => {:action => 'edit'},
|
||||
:html => {:multipart => true,
|
||||
:id => 'message-form',
|
||||
:method => :post}
|
||||
} do |f| %>
|
||||
<%= render :partial => 'form_course',
|
||||
:locals => {:f => f, :replying => !@message.parent.nil?} %>
|
||||
<a href="#" 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 %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3><%= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%=h @topic.subject %></span></h3>
|
||||
|
||||
<%= form_for @message, {
|
||||
:as => :message,
|
||||
:url => {:action => 'edit'},
|
||||
:html => {:multipart => true,
|
||||
:id => 'message-form',
|
||||
:method => :post}
|
||||
} do |f| %>
|
||||
<%= render :partial => 'form',
|
||||
:locals => {:f => f, :replying => !@message.parent.nil?} %>
|
||||
<a href="#" onclick="if(regexSubject()&®exContent()){$('#message-form').submit();}" class="ButtonColor m3p10">
|
||||
<%= l(:button_save) %>
|
||||
</a>
|
||||
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= l(:label_message_new) %>
|
||||
</h3>
|
||||
<%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<%= render :partial => 'form', :locals => {:f => f,:is_new => true} %>
|
||||
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
|
||||
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form' ,target='preview',{:class => 'whiteButton m3p10'} )%>
|
||||
<% end %>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
</script>
|
||||
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">课程通知</h2>
|
||||
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
||||
</div>
|
||||
<% if authorize_for_course('news', 'edit') %>
|
||||
<div id="edit-news" style="display:none;">
|
||||
|
|
|
@ -219,7 +219,7 @@ a:hover.ping_sub{ background:#14a8b9;}
|
|||
/*.ping_distop span{ float:left;}*/
|
||||
.ping_distop p{ color:#5f5f5f;}
|
||||
.ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;}
|
||||
.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}
|
||||
/*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/
|
||||
|
||||
/* 创建作品 work */
|
||||
.Newwork{ width:668px; height:418px;}
|
||||
|
@ -340,6 +340,7 @@ a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-lef
|
|||
a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
|
||||
.r_txt_tit{width:500px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;}
|
||||
|
||||
blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue