Merge branch 'sw_new_course' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course
Conflicts: app/views/courses/_courses_jours.html.erb
This commit is contained in:
commit
61d7d65b55
|
@ -66,15 +66,17 @@ class BoardsController < ApplicationController
|
|||
'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
|
||||
|
||||
@topic_count = @board.topics.count
|
||||
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||
@topics = @board.topics.
|
||||
#@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).
|
||||
# limit(@topic_pages.per_page).
|
||||
# offset(@topic_pages.offset).
|
||||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
@topics = paginateHelper board_topics,10
|
||||
@message = Message.new(:board => @board)
|
||||
#modify by nwb
|
||||
if @project
|
||||
|
|
|
@ -76,6 +76,13 @@ class MessagesController < ApplicationController
|
|||
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||
render :action => 'new', :layout => layout_file
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||
render :layout => layout_file
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -68,15 +68,15 @@ class NewsController < ApplicationController
|
|||
elsif @course
|
||||
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
||||
scope = @course ? @course.news.course_visible : News.course_visible
|
||||
scope_page = paginateHelper scope,10
|
||||
|
||||
@news_count = scope.count
|
||||
#@news_pages = Paginator.new @news_count, @limit, params['page']
|
||||
#@offset ||= scope_page.offset
|
||||
@newss = scope_page.all(:include => [:author, :course],
|
||||
scope_order = scope.all(:include => [:author, :course],
|
||||
:order => "#{News.table_name}.created_on DESC")
|
||||
# :offset => @offset,
|
||||
# :limit => @limit)
|
||||
|
||||
@newss = paginateHelper scope_order,10
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@news = News.new
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<span class="add_attachment">
|
||||
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
||||
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
||||
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()" %>
|
||||
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn" %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => 'file_selector',
|
||||
|
@ -52,7 +52,7 @@
|
|||
:upload_path => uploads_path(:format => 'js'),
|
||||
:description_placeholder => l(:label_optional_description)
|
||||
} %>
|
||||
<span id="upload_file_count"><%= l(:label_no_file_uploaded)%></span>
|
||||
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
|
||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
|
||||
|
|
|
@ -26,10 +26,11 @@
|
|||
</div>
|
||||
|
||||
<!--display the board-->
|
||||
<div class="borad-title">
|
||||
<%=h @board.name %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_board_plural) %></h2>
|
||||
</div>
|
||||
|
||||
|
||||
<% if !User.current.logged?%>
|
||||
<div style="font-size: 14px;margin:20px;">
|
||||
<%= l(:label_user_login_course_board) %>
|
||||
|
@ -37,71 +38,35 @@
|
|||
<hr/>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="borad-setitle">
|
||||
<span class="borad-topic-count">
|
||||
共有
|
||||
<%=link_to @topic_count,:controller => 'boards',:action => 'index' %>
|
||||
个贴子
|
||||
</span>
|
||||
<span>
|
||||
<%= link_to l(:label_message_new),
|
||||
new_board_message_path(@board),
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %>
|
||||
</span>
|
||||
<div class="talk_top ml15">
|
||||
<p class="fl"><%= l(:label_totle) %><span><%= @topic_count %></span><%= l(:label_course_momes_count) %></p>
|
||||
<%= link_to l(:label_message_new),
|
||||
new_board_message_path(@board),
|
||||
:class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div style="padding-top: 10px">
|
||||
<% if @topics.any? %>
|
||||
<% @topics.each do |topic| %>
|
||||
<table class="content-text-list">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %></td>
|
||||
<td>
|
||||
<table width="640px" border="0">
|
||||
<tr>
|
||||
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
|
||||
<%= topic.locked? ? 'locked' : '' %>">
|
||||
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %>
|
||||
</td>
|
||||
<td align="right" rowspan="3">
|
||||
<table class="borad-count">
|
||||
<tr>
|
||||
<td align="center" class="borad-count-digit">
|
||||
<%=link_to (topic.replies_count), board_message_path(@board, topic) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
回答
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2" >
|
||||
<span class="font_lighter">
|
||||
<%= authoring topic.created_on, topic.author %>
|
||||
<br />
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="problem_main">
|
||||
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
|
||||
<div class="talk_txt fl">
|
||||
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s,:class => "problem_tit fl fb c_dblue" %>
|
||||
<a href="#" class="talk_up fl c_red">置顶</a>
|
||||
<p>由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %></p>
|
||||
</div>
|
||||
<%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div><!--讨论主类容 end-->
|
||||
<% end %>
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @topic_pages, @topic_count %>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_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 %>
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
<div class="dis">
|
||||
|
||||
<div class="msg_box" id='leave-message'>
|
||||
<%# reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
<h3>
|
||||
<%= l(:label_user_response) %>
|
||||
</h3>
|
||||
<h4><%= l(:label_leave_message) %></h4>
|
||||
|
||||
<% if !User.current.logged?%>
|
||||
<div style="font-size: 14px;margin:20px;">
|
||||
|
@ -13,20 +10,14 @@
|
|||
<hr/>
|
||||
</div>
|
||||
<% else %>
|
||||
<div style="width: 80%; margin-left:10%;">
|
||||
<%= form_for('new_form', :method => :post,
|
||||
:url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%>
|
||||
<%= f.text_area 'course_message',:id => "leave_meassge", :rows => 3, :cols => 65,
|
||||
:placeholder => "#{l(:label_welcome_my_respond)}",
|
||||
:style => "resize: none; width: 98%",
|
||||
:class => 'noline',:maxlength => 250%>
|
||||
<!--<%#= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>-->
|
||||
<a href="javascript:" onclick='$("#leave_meassge").parent().submit();' class="ButtonColor m3p10" style ="display: block; float: right; margin-right: 1%; margin-top: 1px;"> <%= l(:button_leave_meassge)%>
|
||||
</a>
|
||||
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250%>
|
||||
<a href="#">取 消</a>
|
||||
<a href="#" onclick='$("#leave_meassge").parent().submit();'> <%= l(:button_leave_meassge)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div id="history">
|
||||
|
@ -34,5 +25,4 @@
|
|||
</div>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
|
@ -1,16 +1,13 @@
|
|||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
<div class="ping_ctt">
|
||||
<div id="tbc_01" class="ping_dis">
|
||||
<% if journals.size > 0 %>
|
||||
<% for journal in journals %>
|
||||
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
|
||||
<div class="ping_dispic">
|
||||
<a target="_blank" href="#">
|
||||
<%= image_tag(url_to_avatar(journal.user)) %>
|
||||
<%= image_tag(url_to_avatar(journal.user),:width => '46',:height => '46') %>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ping_discon" style="width: 85%;">
|
||||
<div class="ping_discon" style="width: 610px;">
|
||||
<div class="ping_distop">
|
||||
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
|
||||
<span>
|
||||
|
@ -26,7 +23,7 @@
|
|||
</div>
|
||||
<div class="ping_disfoot">
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<span style="float: right">
|
||||
|
||||
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||
|
@ -38,31 +35,28 @@
|
|||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="font_lighter" style="float: right">
|
||||
<%= l(:label_bids_published) %>
|
||||
<%= time_tag(journal.created_on).html_safe %>
|
||||
<%= l(:label_bids_published_ago) %>
|
||||
</span>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<div class="cl"></div>
|
||||
<!--<span class="font_lighter" style="float: right">
|
||||
<#%= l(:label_bids_published) %>
|
||||
<#%= time_tag(journal.created_on).html_safe %>
|
||||
<#%= l(:label_bids_published_ago) %>
|
||||
</span>-->
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<% if reply_allow %>
|
||||
<div id='<%= ids %>' class="respond-form">
|
||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
|
||||
<%= render :partial => 'words/new_respond_course', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="clear: both;"></div>
|
||||
<div>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
|
||||
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
<%= stylesheet_link_tag 'css', :media => 'all' %>
|
||||
<!-- <#%= stylesheet_link_tag 'css', :media => 'all' %> -->
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">用户留言</h2>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'courses_jours',
|
||||
:locals => { :contest => @contest, :journals => @jour, :state => false}
|
||||
|
@ -21,7 +24,7 @@ function setMaxLength() {
|
|||
}
|
||||
function setMaxLengthItem(textarea){
|
||||
if (textarea.getAttribute('maxlength')) {
|
||||
var counter = document.createElement('div');
|
||||
var counter = document.createElement('span');
|
||||
counter.className = 'counter';
|
||||
var counterClone = counter.cloneNode(true);
|
||||
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</span>
|
||||
</div>
|
||||
|
||||
<button name="button" class="f_l ml10" onclick="_file.click()" onmouseover="this.focus()" type="button" style="width:20%; height:26%;"><%= l(:label_browse)%></button>
|
||||
<button name="button" class="sub_btn" onclick="_file.click()" onmouseover="this.focus()" type="button"><%= l(:label_browse)%></button>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => 'file_selector',
|
||||
|
@ -37,10 +37,9 @@
|
|||
:description_placeholder => l(:label_optional_description)
|
||||
} %>
|
||||
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
|
||||
<label class="f_l ml10 c_grey" style=" margin-top: 3px;">
|
||||
|
||||
<span id="upload_file_count">
|
||||
<%= l(:label_no_file_uploaded)%>
|
||||
</span>
|
||||
(<%= l(:label_max_size) %>:
|
||||
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</label>
|
|
@ -48,7 +48,7 @@
|
|||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||
<% end %>
|
||||
<% if is_course_teacher(User.current,@course) %>
|
||||
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a>
|
||||
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_window('light','fade','20%','35%');">上传资源</a>
|
||||
<% end %>
|
||||
</div><!---re_top end-->
|
||||
<div class="cl"></div>
|
||||
|
@ -56,8 +56,11 @@
|
|||
<div class="re_con" id="course_list">
|
||||
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %>
|
||||
</div><!---re_con end-->
|
||||
<div id="light" class="white_content">
|
||||
<%= render :partial => 'upload_show',:locals => {:course => @course}%>
|
||||
</div>
|
||||
<div id="fade" class="black_overlay">123</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% html_title(l(:label_attachment_plural)) -%>
|
|
@ -1,4 +1,7 @@
|
|||
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
|
||||
|
||||
<div ><a href="#" onClick="close_window('light','fade');" class="box_close"></a></div>
|
||||
<div class="cl"></div>
|
||||
<div id="popbox_upload" class="box_h3 mb10">
|
||||
<div class="upload_con">
|
||||
<h2><%= l(:label_upload_files)%></h2>
|
||||
<div class="upload_box">
|
||||
|
@ -8,8 +11,8 @@
|
|||
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
|
||||
<%= render :partial => 'attachement_list',:locals => {:course => course} %>
|
||||
<div class="cl"></div>
|
||||
<a id="submit_resource" href="javascript:void(0);" class="upload_btn" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
<a href="javascript:void(0);" class="upload_btn upload_btn_grey" onclick="closeModal();"><%= l(:button_cancel)%></a>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="close_window('light','fade');"><%= l(:button_cancel)%></a>
|
||||
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@
|
|||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
|
||||
<%= link_to "(#{@course.boards.count})", course_boards_path(@course), :class => "subnav_num c_orange" %>
|
||||
<%= link_to "(#{@course.boards[0].topics.count})", course_boards_path(@course), :class => "subnav_num c_orange" %>
|
||||
<%= link_to( "+#{l(:label_message_new)}", course_boards_path(@course), :class => 'subnav_green ml95 c_white') if is_teacher %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_board_plural) %></h2>
|
||||
</div>
|
||||
<div class="talk_new ml15">
|
||||
<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} %>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="preview" class="wiki"></div>
|
|
@ -33,54 +33,51 @@
|
|||
}
|
||||
return false;
|
||||
}
|
||||
function submitCoursesBoard()
|
||||
{
|
||||
if(regexSubject()&®exContent()){$("#message-form").submit();}
|
||||
}
|
||||
</script>
|
||||
<%= error_messages_for 'message' %>
|
||||
<% replying ||= false %>
|
||||
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
||||
|
||||
<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' %>
|
||||
</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>
|
||||
<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 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>
|
||||
|
|
|
@ -4,18 +4,15 @@
|
|||
»
|
||||
<%= 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} %>
|
||||
<%= 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 %>
|
||||
|
||||
<div id="preview" class="wiki"></div>
|
||||
<% elsif @course %>
|
||||
<h3>
|
||||
<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %>
|
||||
»
|
||||
<%= l(:label_message_new) %>
|
||||
</h3>
|
||||
<%= render :partial => 'course_new' %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<%= 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 %>
|
||||
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
|
|
@ -1,17 +1,78 @@
|
|||
<li class="ml45">
|
||||
<script type="text/javascript">
|
||||
function regexTitle()
|
||||
{
|
||||
var name = $("#news_title").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#title_notice_span").text("标题不能为空");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else if(name.length <= 60)
|
||||
{
|
||||
$("#title_notice_span").text("填写正确");
|
||||
$("#title_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#title_notice_span").text("标题超过60个字符");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function regexDescription()
|
||||
{
|
||||
var name = $("#news_description").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#description_notice_span").text("描述不能为空");
|
||||
$("#description_notice_span").css('color','#ff0000');
|
||||
$("#description_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#description_notice_span").text("填写正确");
|
||||
$("#description_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submitNews()
|
||||
{
|
||||
if(regexTitle() && regexDescription())
|
||||
{
|
||||
$("#news-form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function submitFocus(obj)
|
||||
{
|
||||
$(obj).focus();
|
||||
}
|
||||
</script>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:field_title) %> :</label>
|
||||
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内">
|
||||
<span id="title_notice_span"></span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||
<textarea id="news_description" name="news[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl" onkeyup="regexDescription();" ></textarea>
|
||||
<span id="description_notice_span"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<p id="attachments_form" style="margin-left:-10px;">
|
||||
<label style="padding-right: 15px;">
|
||||
<%= l(:label_attachment_plural) %>
|
||||
</label>
|
||||
<li class="ml45">
|
||||
<label> <%= l(:label_attachment_plural) %> :</label>
|
||||
<%= render :partial => 'attachments/form', :locals => {:container => @news} %>
|
||||
</p>
|
||||
|
||||
<!-- <#%= wikitoolbar_for 'news_description'%>-->
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
|
||||
<%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<!-- <#%= wikitoolbar_for 'news_description'%>-->
|
|
@ -3,63 +3,7 @@
|
|||
label_tips = l(:label_course_news)
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
function regexTitle()
|
||||
{
|
||||
var name = $("#news_title").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#title_notice_span").text("标题不能为空");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else if(name.length <= 60)
|
||||
{
|
||||
$("#title_notice_span").text("填写正确");
|
||||
$("#title_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#title_notice_span").text("标题超过60个字符");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function regexDescription()
|
||||
{
|
||||
var name = $("#news_description").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#description_notice_span").text("描述不能为空");
|
||||
$("#description_notice_span").css('color','#ff0000');
|
||||
$("#description_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#description_notice_span").text("填写正确");
|
||||
$("#description_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submitNews()
|
||||
{
|
||||
if(regexTitle() && regexDescription())
|
||||
{
|
||||
$("#news-form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function submitFocus(obj)
|
||||
{
|
||||
$(obj).focus();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= label_tips %></h2>
|
||||
|
@ -68,26 +12,9 @@
|
|||
<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),
|
||||
:class => 'problem_new_btn fl c_dorange',
|
||||
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
|
||||
:class => 'problem_new_btn fl c_dorange')%>
|
||||
<div class="cl"></div>
|
||||
<div id="add-news" class="hwork_new" style="display:none;">
|
||||
<%= error_messages_for @news %>
|
||||
<p class="talk_top pl15" >
|
||||
<%= l(:bale_news_notice)%>
|
||||
</p>
|
||||
<ul>
|
||||
<%= labelled_form_for @news, :url => course_news_index_path(@course),
|
||||
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
||||
<%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
|
||||
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'ButtonColor m3p10' %>
|
||||
<%#= preview_link preview_news_path, 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
||||
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'ButtonColor m3p10' %>
|
||||
<% end if @course %>
|
||||
</ul>
|
||||
<div id="preview" class="wiki"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<!-- <h3><%#=l(:label_news_new)%></h3> -->
|
||||
<%
|
||||
btn_tips = l(:label_news_notice)
|
||||
label_tips = l(:label_course_news)
|
||||
%>
|
||||
<% if @project %>
|
||||
<%= labelled_form_for @news, :url => project_news_index_path(@project),
|
||||
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
||||
|
@ -7,11 +11,22 @@
|
|||
<%#= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
||||
<% end %>
|
||||
<% elsif @course %>
|
||||
<%= labelled_form_for @news, :url => course_news_index_path(@course),
|
||||
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
||||
<%= render :partial => 'news/form', :locals => {:f => f} %>
|
||||
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
|
||||
<%#= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
||||
<% end %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= label_tips %></h2>
|
||||
</div>
|
||||
<div class="hwork_new">
|
||||
<%= error_messages_for @news %>
|
||||
<p class="talk_top pl15" >
|
||||
<%= l(:bale_news_notice)%>
|
||||
</p>
|
||||
<ul>
|
||||
<%= labelled_form_for @news, :url => course_news_index_path(@course),
|
||||
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
||||
<%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
|
||||
|
||||
<% end if @course %>
|
||||
</ul>
|
||||
<div id="preview" class="wiki"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
<% id = "journal_reply_ul_" + journal.id.to_s%>
|
||||
<% allow_delete ||= false%>
|
||||
<div id = '<%= id %>' >
|
||||
<div id = '<%= id %>'>
|
||||
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
|
||||
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :allow_delete => allow_delete} %>
|
||||
<% end %>
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
|
||||
<div class="recall_head">
|
||||
<% if show_name %>
|
||||
<%= image_tag url_to_avatar(reply.user) %>
|
||||
<%= image_tag url_to_avatar(reply.user),:width => '30',:height => '30' %>
|
||||
<% else %>
|
||||
<%= image_tag url_to_avatar(nil) %>
|
||||
<%= image_tag url_to_avatar(nil),:width => '30',:height => '30' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="recall_con">
|
||||
|
@ -44,7 +44,11 @@
|
|||
</div>
|
||||
<div id='<%=id%>' class="respond-form">
|
||||
<% if reply_allow %>
|
||||
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %>
|
||||
<% if journal.jour_type == "Course" %>
|
||||
<%= render :partial => "words/new_respond_course", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %>
|
||||
<% else %>
|
||||
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<%= form_tag(words_create_reply_path, :remote => true) do %>
|
||||
<%= text_area_tag 'user_notes', "", :class => 're_respond-form',
|
||||
:style => "resize: none;", :rows => 4,
|
||||
:placeholder => l(:label_feedback_respond_content),
|
||||
:width => '100%',
|
||||
:maxlength => 250 %>
|
||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
|
||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
|
||||
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
|
||||
<%= submit_tag l(:button_feedback_respond), :name => nil ,
|
||||
:class => "sub_btn",
|
||||
:style => "float: right; margin-top: 1px; margin-right: 4px;"%>
|
||||
|
||||
<% end %>
|
|
@ -81,4 +81,8 @@ zh:
|
|||
label_course_news_count: "个课程通知"
|
||||
label_release_news: "发布通知"
|
||||
label_create_time: "创建时间"
|
||||
#news end
|
||||
#news end
|
||||
|
||||
#boards
|
||||
label_course_momes_count: "个帖子"
|
||||
#boards count
|
|
@ -2079,6 +2079,7 @@ zh:
|
|||
label_end_time: 截止时间
|
||||
label_send_email: 确定发送
|
||||
label_input_email: 请输入邮箱地址
|
||||
#api end
|
||||
project_module_files: 资源库
|
||||
|
||||
label_totle: 共有
|
||||
|
|
|
@ -134,6 +134,18 @@ function submit_new_bid(id)
|
|||
}
|
||||
}
|
||||
|
||||
function show_window (id1,id2,top,left) {
|
||||
$('#'+ id1).css('top',top);
|
||||
$('#'+ id1).css('left',left);
|
||||
$('#'+ id1).css('display','block');
|
||||
$('#' + id2).css('display','block');
|
||||
}
|
||||
|
||||
function close_window(id1,id2){
|
||||
$('#' + id1).css('display','none');
|
||||
$('#' + id2).css('display','none');
|
||||
}
|
||||
|
||||
//隐藏提示狂
|
||||
function hidden_atert_form(cur_page,cur_type)
|
||||
{
|
||||
|
|
|
@ -69,7 +69,7 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
|
|||
.talk_top span{ color:#ff7143;}
|
||||
.talk_txt{ width:460px; margin-left:10px; color:#676868;}
|
||||
.talk_up{ color:#f63c00;}
|
||||
.talk_pic{width:32px; height:32px; padding:2px;}
|
||||
a.talk_pic{width:32px; height:32px; padding:2px;}
|
||||
a.talk_btn{ background:#64bdd9; width:50px; height:20px; color:#fff; text-align:center; margin-top:12px; padding-top:3px;}
|
||||
a:hover.talk_btn{ background:#2a9dc1;}
|
||||
/****讨论区内页***/
|
||||
|
@ -329,6 +329,18 @@ a:hover.st_add{ color:#ff8e15;}
|
|||
.w_p{ float:left; color:#15bccf; font-size:16px; font-weight:bold; margin-top:70px; }
|
||||
/* 新建项目弹框*/
|
||||
.table_left{ width:90px; text-align:right; color:#4c4c4c; font-weight:bold;}
|
||||
/*留言回复框样式*/
|
||||
.respond-form{
|
||||
display: none;
|
||||
width: 87%;
|
||||
margin: auto;
|
||||
clear: both;
|
||||
}
|
||||
.re_respond-form
|
||||
{
|
||||
width: -moz-available;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue