讨论区样式调整

This commit is contained in:
z9hang 2015-03-24 17:12:51 +08:00
parent e39007d96e
commit 19eaa012b7
18 changed files with 230 additions and 224 deletions

View File

@ -66,15 +66,17 @@ class BoardsController < ApplicationController
'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)"
@topic_count = @board.topics.count @topic_count = @board.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page'] #@topic_pages = paginateHelper @board.topics,10
@topics = @board.topics. #@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
board_topics = @board.topics.
reorder("#{Message.table_name}.sticky DESC"). reorder("#{Message.table_name}.sticky DESC").
includes(:last_reply). includes(:last_reply).
limit(@topic_pages.per_page). # limit(@topic_pages.per_page).
offset(@topic_pages.offset). # offset(@topic_pages.offset).
order(sort_clause). order(sort_clause).
preload(:author, {:last_reply => :author}). preload(:author, {:last_reply => :author}).
all all
@topics = paginateHelper board_topics,10
@message = Message.new(:board => @board) @message = Message.new(:board => @board)
#modify by nwb #modify by nwb
if @project if @project

View File

@ -76,6 +76,13 @@ class MessagesController < ApplicationController
layout_file = @project ? 'base_projects' : 'base_courses' layout_file = @project ? 'base_projects' : 'base_courses'
render :action => 'new', :layout => layout_file render :action => 'new', :layout => layout_file
end end
else
respond_to do |format|
format.html {
layout_file = @project ? 'base_projects' : 'base_courses'
render :layout => layout_file
}
end
end end
end end

View File

@ -68,15 +68,15 @@ class NewsController < ApplicationController
elsif @course elsif @course
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@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 = @course ? @course.news.course_visible : News.course_visible
scope_page = paginateHelper scope,10
@news_count = scope.count @news_count = scope.count
#@news_pages = Paginator.new @news_count, @limit, params['page'] #@news_pages = Paginator.new @news_count, @limit, params['page']
#@offset ||= scope_page.offset #@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") :order => "#{News.table_name}.created_on DESC")
# :offset => @offset, # :offset => @offset,
# :limit => @limit) # :limit => @limit)
@newss = paginateHelper scope_order,10
respond_to do |format| respond_to do |format|
format.html { format.html {
@news = News.new @news = News.new

View File

@ -38,7 +38,7 @@
<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 "浏览", :type=>"button", :onclick=>"_file.click()" %> <%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn" %>
<%= file_field_tag 'attachments[dummy][file]', <%= file_field_tag 'attachments[dummy][file]',
:id => '_file', :id => '_file',
:class => 'file_selector', :class => 'file_selector',
@ -52,7 +52,7 @@
:upload_path => uploads_path(:format => 'js'), :upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description) :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) %>) (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span> </span>

View File

@ -26,10 +26,11 @@
</div> </div>
<!--display the board--> <!--display the board-->
<div class="borad-title"> <div class="project_r_h">
<%=h @board.name %> <h2 class="project_h2"><%= l(:label_board_plural) %></h2>
</div> </div>
<% if !User.current.logged?%> <% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;"> <div style="font-size: 14px;margin:20px;">
<%= l(:label_user_login_course_board) %> <%= l(:label_user_login_course_board) %>
@ -37,71 +38,35 @@
<hr/> <hr/>
</div> </div>
<% end %> <% end %>
<div class="talk_top ml15">
<div class="borad-setitle"> <p class="fl"><%= l(:label_totle) %><span><%= @topic_count %></span><%= l(:label_course_momes_count) %></p>
<span class="borad-topic-count">
共有
<%=link_to @topic_count,:controller => 'boards',:action => 'index' %>
个贴子
</span>
<span>
<%= link_to l(:label_message_new), <%= link_to l(:label_message_new),
new_board_message_path(@board), new_board_message_path(@board),
:class => 'icon icon-add', :class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
:onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> <div class="cl"></div>
</span>
</div> </div>
<div style="padding-top: 10px">
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<table class="content-text-list"> <div class="problem_main">
<tr> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %></td> <div class="talk_txt fl">
<td> <%= 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" %>
<table width="640px" border="0"> <a href="#" class="talk_up fl c_red">置顶</a>
<tr> <p>由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %></p>
<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>
<% end %>
<div class="pagination">
<%= pagination_links_full @topic_pages, @topic_count %>
</div> </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 %>
<% else %> <% else %>
<p class="nodata"> <p class="nodata">
<%= l(:label_no_data) %> <%= l(:label_no_data) %>
</p> </p>
<% end %> <% 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| %> <% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<% end %> <% end %>

View File

@ -22,7 +22,7 @@
</span> </span>
</div> </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]', <%= file_field_tag 'attachments[dummy][file]',
:id => '_file', :id => '_file',
:class => 'file_selector', :class => 'file_selector',
@ -37,10 +37,9 @@
:description_placeholder => l(:label_optional_description) :description_placeholder => l(:label_optional_description)
} %> } %>
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">--> <!--<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"> <span id="upload_file_count">
<%= l(:label_no_file_uploaded)%> <%= l(:label_no_file_uploaded)%>
</span> </span>
(<%= l(:label_max_size) %>: (<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</label>

View File

@ -48,7 +48,7 @@
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<% end %> <% end %>
<% if is_course_teacher(User.current,@course) %> <% 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 %> <% end %>
</div><!---re_top end--> </div><!---re_top end-->
<div class="cl"></div> <div class="cl"></div>
@ -56,8 +56,11 @@
<div class="re_con" id="course_list"> <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} %> <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %>
</div><!---re_con end--> </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>
</div> </div>
<% html_title(l(:label_attachment_plural)) -%> <% html_title(l(:label_attachment_plural)) -%>

View File

@ -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"> <div class="upload_con">
<h2><%= l(:label_upload_files)%></h2> <h2><%= l(:label_upload_files)%></h2>
<div class="upload_box"> <div class="upload_box">
@ -8,8 +11,8 @@
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> --> <!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
<%= render :partial => 'attachement_list',:locals => {:course => course} %> <%= render :partial => 'attachement_list',:locals => {:course => course} %>
<div class="cl"></div> <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=" fr grey_btn mr40" onclick="close_window('light','fade');"><%= l(:button_cancel)%></a>
<a href="javascript:void(0);" class="upload_btn upload_btn_grey" onclick="closeModal();"><%= l(:button_cancel)%></a> <a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
<% end %> <% end %>
</div> </div>

View File

@ -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>

View File

@ -33,27 +33,25 @@
} }
return false; return false;
} }
function submitCoursesBoard()
{
if(regexSubject()&&regexContent()){$("#message-form").submit();}
}
</script> </script>
<%= error_messages_for 'message' %> <%= error_messages_for 'message' %>
<% replying ||= false %> <% replying ||= false %>
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
<div class="box ph10_5"> <li>
<!--[form:message]--> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
<p>
<label for="message_subject">
<%= l(:field_subject) %>
<span class="required"> *&nbsp;&nbsp;</span>
</label>
<br/>
<% if replying %> <% if replying %>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
<% else %> <% else %>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject", onkeyup: "regexSubject();" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
<% end %> <% end %>
<span id="subject_span"></span> <span id="subject_span"></span>
</p> </li>
<p> <li class="ml60 mb5">
<% unless replying %> <% unless replying %>
<% if @message.safe_attribute? 'sticky' %> <% if @message.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %> <%= f.check_box :sticky %>
@ -64,23 +62,22 @@
<%= label_tag 'message_locked', l(:label_board_locked) %> <%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %> <% end %>
<% end %> <% end %>
</p> <div class="cl"></div>
<p> </li>
<label for="message_subject"> <li>
<%= l(:field_description) %> <label class="fl" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label>
<span class="required"> *&nbsp;&nbsp;</span>
</label>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div> <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' %> <%= text_area :quote,:quote,:style => 'display:none' %>
</p> <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
<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> <span id="message_content_span"></span>
</p> </li>
<p> <div class="cl"></div>
<%= l(:label_attachment_plural) %> <li>
<br /> <label>&nbsp;&nbsp;<%= l(:label_attachment_plural) %>&nbsp;&nbsp;</label>
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %> <%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
</p> </li>
</div> <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>

View File

@ -4,18 +4,15 @@
&#187; &#187;
<%= l(:label_message_new) %> <%= l(:label_message_new) %>
</h3> </h3>
<% elsif @course %> <%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<h3>
<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %>
&#187;
<%= l(:label_message_new) %>
</h3>
<% end %>
<%= 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} %>
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> <%= 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'} )%> <%= 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 %>
<%= render :partial => 'course_new' %>
<% end %> <% end %>
<div id="preview" class="wiki"></div>

View File

@ -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>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label>
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内"> <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>
<li class="ml45"> <li class="ml45">
<label class="fl" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label> <label class="fl" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label>
<textarea id="news_description" name="news[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl" onkeyup="regexDescription();" ></textarea> <textarea id="news_description" name="news[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl" onkeyup="regexDescription();" ></textarea>
<span id="description_notice_span"></span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<p id="attachments_form" style="margin-left:-10px;"> <li class="ml45">
<label style="padding-right: 15px;"> <label>&nbsp;&nbsp;<%= l(:label_attachment_plural) %>&nbsp;&nbsp;</label>
<%= l(:label_attachment_plural) %>
</label>
<%= render :partial => 'attachments/form', :locals => {:container => @news} %> <%= render :partial => 'attachments/form', :locals => {:container => @news} %>
</p> </li>
<li class=" ml90" >
<!-- <#%= wikitoolbar_for 'news_description'%>--> <%= 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'%>-->

View File

@ -3,63 +3,7 @@
label_tips = l(:label_course_news) 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"> <div class="project_r_h">
<h2 class="project_h2"><%= label_tips %></h2> <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> <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) %> <% if @course && User.current.allowed_to?(:manage_news, @course) %>
<%= link_to(btn_tips,new_course_news_path(@course), <%= link_to(btn_tips,new_course_news_path(@course),
:class => 'problem_new_btn fl c_dorange', :class => 'problem_new_btn fl c_dorange')%>
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
<div class="cl"></div> <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 %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -1,4 +1,8 @@
<!-- <h3><%#=l(:label_news_new)%></h3> --> <!-- <h3><%#=l(:label_news_new)%></h3> -->
<%
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
%>
<% if @project %> <% if @project %>
<%= labelled_form_for @news, :url => project_news_index_path(@project), <%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => {:id => 'news-form', :multipart => true} do |f| %> :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'} %> <%#= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
<% end %> <% end %>
<% elsif @course %> <% elsif @course %>
<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), <%= labelled_form_for @news, :url => course_news_index_path(@course),
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/form', :locals => {:f => f} %> <%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
<%= 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 if @course %>
<% end %> </ul>
<div id="preview" class="wiki"></div>
</div>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>

View File

@ -82,3 +82,7 @@ zh:
label_release_news: "发布通知" label_release_news: "发布通知"
label_create_time: "创建时间" label_create_time: "创建时间"
#news end #news end
#boards
label_course_momes_count: "个帖子"
#boards count

View File

@ -2079,6 +2079,7 @@ zh:
label_end_time: 截止时间 label_end_time: 截止时间
label_send_email: 确定发送 label_send_email: 确定发送
label_input_email: 请输入邮箱地址 label_input_email: 请输入邮箱地址
#api end
project_module_files: 资源库 project_module_files: 资源库
label_totle: 共有 label_totle: 共有

View File

@ -127,3 +127,15 @@ function submit_new_bid(id)
$("#"+id).submit(); $("#"+id).submit();
} }
} }
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');
}

View File

@ -69,7 +69,7 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
.talk_top span{ color:#ff7143;} .talk_top span{ color:#ff7143;}
.talk_txt{ width:460px; margin-left:10px; color:#676868;} .talk_txt{ width:460px; margin-left:10px; color:#676868;}
.talk_up{ color:#f63c00;} .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.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;} a:hover.talk_btn{ background:#2a9dc1;}
/****讨论区内页***/ /****讨论区内页***/