Merge branch 'szzh' into guange_dev

This commit is contained in:
sw 2015-05-14 17:46:08 +08:00
commit a77a572a4d
34 changed files with 331 additions and 207 deletions

View File

@ -80,7 +80,7 @@ class BoardsController < ApplicationController
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("last_replies_messages.created_on desc").
preload(:author, {:last_reply => :author}). preload(:author, {:last_reply => :author}).
all all
elsif @course elsif @course
@ -88,7 +88,7 @@ class BoardsController < ApplicationController
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("last_replies_messages.created_on desc").
preload(:author, {:last_reply => :author}). preload(:author, {:last_reply => :author}).
all : [] all : []
@topics = paginateHelper board_topics,10 @topics = paginateHelper board_topics,10

View File

@ -593,6 +593,17 @@ module ApplicationHelper
Project.project_tree(projects, &block) Project.project_tree(projects, &block)
end end
# 判断当前用户是否为项目管理员
def is_project_manager?(user_id,project_id)
@result = false
mem = Member.where("user_id = ? and project_id = ?",user_id, project_id)
unless mem.blank?
mem.first.roles.to_s.include?("Manager")
@result = false
end
return @result
end
def principals_check_box_tags(name, principals) def principals_check_box_tags(name, principals)
s = '' s = ''
principals.each do |principal| principals.each do |principal|

View File

@ -17,6 +17,7 @@
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span> </span>
<div class="cl"></div>
<% end %> <% end %>
<% container.saved_attachments.each_with_index do |attachment, i| %> <% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment"> <span id="attachments_p<%= i %>" class="attachment">
@ -34,10 +35,12 @@
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span> </span>
<div class="cl"></div>
<% end %> <% end %>
<% end %> <% end %>
</span> </span>
<% project = project %> <% project = project %>
<div class="cl"></div>
<span class="add_attachment" style="font-weight:normal;"> <span class="add_attachment" style="font-weight:normal;">
<%#= 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()"%-->

View File

@ -1,4 +1,72 @@
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html"> <% if defined?(container) %>
<span id="attachments_fields<%= container.id %>" class="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="sub_btn">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% else %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
<% end %>
</span>
<script type='text/javascript'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<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#{container.id}.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => "_file#{container.id}",
:class => 'file_selector',
:multiple => true,
:onchange => "addInputFiles_board(this, '#{container.id}');",
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count<%=container.id %>" :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>
<% else %>
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %> <% if defined?(container) && container && container.saved_attachments %>
<% if isReply %> <% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %> <% container.saved_attachments.each_with_index do |attachment, i| %>
@ -27,39 +95,40 @@
<% end %> <% end %>
<% end %> <% end %>
</span> </span>
<script type='text/javascript'> <script type='text/javascript'>
// function CompatibleSend() // function CompatibleSend()
// { // {
// var obj=document.getElementById("_file"); // var obj=document.getElementById("_file");
// var file= $(obj).clone(); // var file= $(obj).clone();
// file.click(); // file.click();
// } // }
</script> </script>
<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()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %> <%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]', <%= file_field_tag 'attachments[dummy][file]',
:id => '_file', :id => '_file',
:class => 'file_selector', :class => 'file_selector',
:multiple => true, :multiple => true,
:onchange => 'addInputFiles(this);', :onchange => 'addInputFiles(this);',
:style => 'display:none', :style => 'display:none',
:data => { :data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'), :upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description), :description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public), :field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure), :are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count), :file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all) :delete_all_files => l(:text_are_you_sure_all)
} %> } %>
<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>
(<%= 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>
<% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %> <%= javascript_include_tag 'attachments' %>
<% end %> <% end %>

View File

@ -13,6 +13,6 @@
:target => "_blank"%> :target => "_blank"%>
</div> </div>
<% end %> <% end %>
<br> <div class="cl"></div>
<% end %> <% end %>
</div> </div>

View File

@ -3,14 +3,15 @@ var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
fileSpan.hide(); fileSpan.hide();
alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>"); alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>");
<% else %> <% else %>
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
fileSpan.find('a.remove-upload') fileSpan.find('a.remove-upload')
.attr({ .attr({
"data-remote": true, "data-remote": true,
"data-method": 'delete', "data-method": 'delete',
"href": '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>' "href": '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>'
}) })
.off('click'); .off('click');
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
//var divattach = fileSpan.find('div.div_attachments'); //var divattach = fileSpan.find('div.div_attachments');
//divattach.html('<%= j(render :partial => 'tags/tagEx', :locals => {:obj => @attachment, :object_flag => "6"})%>'); //divattach.html('<%= j(render :partial => 'tags/tagEx', :locals => {:obj => @attachment, :object_flag => "6"})%>');
<% end %> <% end %>

View File

@ -3,7 +3,7 @@
<%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %> <%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
<li> <li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="#" onclick="$('#message-form').submit();" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="#" onclick="submitProjectsBoard('<%= @message.id %>')" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>

View File

@ -32,7 +32,7 @@
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p> <p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;"> <div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;" id="topic<%= topic.id %>">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %> <% author = topic.author.to_s + "" %>
@ -40,12 +40,10 @@
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p> <p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.course_editable_by?(User.current) %> <% if topic.course_editable_by?(User.current) %>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: left; <a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
margin-left: 20px;"><%= l(:button_edit) %></a> margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %> <% end %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'},
@ -55,7 +53,9 @@
:style => ' margin-right: 10px;' :style => ' margin-right: 10px;'
) if topic.destroyable_by?(User.current) %> ) if topic.destroyable_by?(User.current) %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %>
<div class="cl"></div> <div class="cl"></div>
<script> <script>
@ -63,7 +63,7 @@
</script> </script>
<div class="project_board_content break_word" id="content_<%=topic.id%>"> <div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img"> <div id="contentmessage<%=topic.id %>" class="upload_img">
<%= topic.content %> <%= topic.content.html_safe %>
</div> </div>
</div> </div>
@ -100,7 +100,8 @@
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %> <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="talk_btn fr c_white" style=""><%= l(:label_memo_create)%></a> <%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -12,7 +12,7 @@
} do |f| %> } do |f| %>
<%= render :partial => 'form_project', <%= render :partial => 'form_project',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="#" onclick="$('#message-form<%= topic.id%>').submit();" class="blue_btn fl c_white" ><%= l(:button_submit)%></a> <a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');" class="blue_btn fl c_white" ><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a>
<%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %> <%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %>
</ul> </ul>
@ -31,10 +31,10 @@
} do |f| %> } do |f| %>
<%= render :partial => 'form_course', <%= render :partial => 'form_course',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="javascript:void(0)" onclick="$('#message-form<%= topic.id%>').submit();"class="blue_btn fl c_white"><%= l(:button_submit)%></a> <a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<%= link_to l(:button_cancel), board_message_url(topic.board,topic.root, :r => (topic.parent_id &&topic.id)), :class => "blue_btn grey_btn fl c_white" %> <a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>

View File

@ -8,16 +8,16 @@
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span" class="ml55"></p> <p id="subject_span<%= topic.id%>" class="ml55"></p>
</li> </li>
<% else %> <% else %>
<li> <li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<% end %> <% end %>
<li class="ml60 mb5"> <li class="ml60 mb5">
@ -40,12 +40,12 @@
<% end %> <% end %>
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none' %>
<% if replying%> <% if replying%>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
<% else %> <% else %>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span" class="ml55"></p> <p id="message_content_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li> <li>

View File

@ -5,19 +5,19 @@
<li style="display: none"> <li style="display: none">
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<% else %> <% else %>
<li> <li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<% end %> <% end %>
<li class="ml60 mb5"> <li class="ml60 mb5">
@ -36,16 +36,16 @@
<li> <li>
<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>
<% unless replying %> <% unless replying %>
<label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label> <label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %> <% end %>
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none' %>
<% if replying%> <% if replying%>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
<% else %> <% else %>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span" class="ml55"></p> <p id="message_content_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li> <li>

View File

@ -4,7 +4,7 @@
<li> <li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="#" onclick="$('#message-form').submit();" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="#" onclick="submitProjectsBoard('<%= @message.id %>')" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>

View File

@ -33,7 +33,7 @@
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;"> <div class="talkmain_box" id="topic<%= topic.id %>" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %> <% author = topic.author.to_s + "" %>
@ -215,20 +215,5 @@
$("#message_form").submit(); $("#message_form").submit();
} }
} }
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');
flag = false;
}
else
{
$("#message_content_span").text("<%= l(:label_field_correct) %>");
$("#message_content_span").css('color','#008000');
flag = true;
}
}
</script> </script>

View File

@ -25,14 +25,29 @@
<script type="text/javascript">//侧导航 <script type="text/javascript">//侧导航
window.onload = function () { window.onload = function () {
$("p[aa='bb']").each(function() { var topic_id = getParam('topic_id');
alert((this.offsetHeight == '55')); document.getElementById(topic_id).focus();
if(this.offsetHeight == '55') {
this.next.style.dispaly="block";
}
})
} }
var getParam = function(name){
var search = document.location.search;
var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
var matcher = pattern.exec(search);
var items = null;
if(null != matcher){
try{
items = decodeURIComponent(decodeURIComponent(matcher[1]));
}catch(e){
try{
items = decodeURIComponent(matcher[1]);
}catch(e){
items = matcher[1];
}
}
}
return items;
};
function show_newtalk() function show_newtalk()
{ {
$("#about_newtalk").toggle(); $("#about_newtalk").toggle();
@ -42,6 +57,9 @@ function show_newtalk1(id)
{ {
$(id).toggle(); $(id).toggle();
} }
</script> </script>
<% if @project %> <% if @project %>
<%= render :partial => 'project_show', locals: {project: @project} %> <%= render :partial => 'project_show', locals: {project: @project} %>

View File

@ -15,7 +15,7 @@
<span class="fl"> &nbsp;</span> <span class="fl"> &nbsp;</span>
<span class="fl"> <%= l(:label_new_activity) %></span> <span class="fl"> <%= l(:label_new_activity) %></span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @course)} "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : <%= link_to "#{eventToLanguageCourse(e.event_type, @course)} "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) :
(e.event_type.eql?("bid") ? homework_course_path(@course) : e.event_url),:class => "problem_tit c_dblue fl fb"%> (e.event_type.eql?("bid") ? homework_course_path(@course) : (e.event_type.eql?("message") || e.event_type.eql?("reply") ? course_boards_path(@course,:topic_id => e.id) : e.event_url)),:class => "problem_tit c_dblue fl fb"%>
<br /> <br />
<p class="mt5 break_word"><%= e.event_description.html_safe %> <p class="mt5 break_word"><%= e.event_description.html_safe %>
<br /> <br />

View File

@ -20,16 +20,14 @@
<div class=""> <div class="">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %> <% if User.current.logged? %>
<!--私有项目资源部能引用,不能设置公开私有--> <%#--私有项目资源不能引用,不能设置公开私有--%>
<!--公开项目资源可以应用,管理员和资源上传者拥有设置公开私有权限--> <%#--公开项目资源可以应用,管理员和资源上传者拥有设置公开私有权限--%>
<%# if project.is_public? %>
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> <%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
<% if (Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") || file.author_id == User.current.id) && project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project" %> <% if (is_project_manager?(User.current.id, @project.id) || file.author_id == User.current.id) && project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project" %>
<span id="is_public_<%= file.id %>"> <span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
</span> </span>
<% end %> <% end %>
<%# end %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -48,8 +48,8 @@
</table> </table>
</div> </div>
</div> </div>
<% end %> <% end %>
<div class="pagination"> <div class="pagination" style="margin-top: 10px;">
<%= pagination_links_full @forums_pages, @forums_count %> <%= pagination_links_full @forums_pages, @forums_count %>
</div> </div>
<% else %> <% else %>

View File

@ -59,7 +59,7 @@
<strong style="float: left;"> <strong style="float: left;">
文件: 文件:
</strong> </strong>
<div id="homework_attach_jour_attachment"> <div id="homework_attach_jour_attachment" style="padding-left: 40px;">
<%= render :partial => 'attachments/form' %> <%= render :partial => 'attachments/form' %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -12,13 +12,13 @@
$("#stars_value").val(num); $("#stars_value").val(num);
} }
function ChoseZero() // function ChoseZero()
{ // {
if(confirm('是否确定评分为0分?')) // if(confirm('是否确定评分为0分?'))
{ // {
ChoseStars(0); // ChoseStars(0);
} // }
} // }
</script> </script>
<div id="popbox"> <div id="popbox">
<div class="ping_con"> <div class="ping_con">

View File

@ -1,4 +1,4 @@
<a style="float: right;padding-left: 10px;font-weight: normal;cursor: pointer;color: red;" onclick="ChoseZero();">零分</a> <a style="float: right;padding-left: 10px;font-weight: normal;cursor: pointer;color: red;" onclick="ChoseStars(0);">零分</a>
<span><a href="javascript:" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span> <span><a href="javascript:" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="javascript:" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span> <span><a href="javascript:" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="javascript:" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span> <span><a href="javascript:" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>

View File

@ -75,16 +75,32 @@
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620", <%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
:maxlength => 3000, :placeholder => "最多3000个汉字" %> :maxlength => 3000, :placeholder => "最多3000个汉字" %>
</p> </p>
<p> <!--<div class="cl"></div>-->
<label style="float: left;"> <!--<p>-->
<!--<label style="float: left;">-->
<!--&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;-->
<!--</label>-->
<!--<div style="float: left;padding-bottom: 15px;">-->
<!--<%#= render :partial => 'attachments/form', :locals => {:container => @homework}%>-->
<!--</div>-->
<!--</p>-->
<!--<div class="cl"></div>-->
<div class="cl"></div>
<label style="float: left;padding-left: 15px;">
&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;
</label> </label>
<div style="float: left;padding-bottom: 15px;"> <!--<div style="float: left;margin-left: 5px;">-->
<%= render :partial => 'attachments/form', :locals => {:container => @homework}%> <!--<%#= render :partial => 'attachments/form',locals: {:container => @homework}%>-->
<!--</div>-->
<div style="float: left;">
<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
</div> </div>
</p>
<div class="cl"></div> <div class="cl"></div>
<p>
<p style="padding-top: 10px;">
<label>&nbsp;&nbsp;&nbsp;开发项目 <label>&nbsp;&nbsp;&nbsp;开发项目
<img src="/images/bid/pic_question.png" width="16" height="16" <img src="/images/bid/pic_question.png" width="16" height="16"
title="项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。 title="项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。
@ -101,7 +117,7 @@
<span style="float: left;"> <span style="float: left;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span> </span>
<a href="javascript:" class="tijiao" onclick="submit_homework_form();"> <a href="javascript:void(0)" class="tijiao" onclick="submit_homework_form();">
<%= l(:label_button_ok) %> <%= l(:label_button_ok) %>
</a> </a>
<a href="javascript:history.back()" class="tijiao">取&nbsp;&nbsp;消</a> <a href="javascript:history.back()" class="tijiao">取&nbsp;&nbsp;消</a>

View File

@ -168,16 +168,16 @@ function cookieget(n)
<div class="side_title"><a title="<%= l(:label_feedback) %>" class="close_btn"><span><%= l(:label_feedback) %></span></a></div> <div class="side_title"><a title="<%= l(:label_feedback) %>" class="close_btn"><span><%= l(:label_feedback) %></span></a></div>
<div class="side_center"> <div class="side_center">
<div class="custom_service"> <div class="custom_service">
<% if @public_forum %> <%# if @public_forum %>
<% get_memo %> <% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %> <%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label> <label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a> <a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a>
<% end %> <% end %>
<% end %> <%# end %>
</div> </div>
<div class="msgserver"> <div class="msgserver">
<a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白&nbsp;&nbsp;&nbsp;羽</a> <a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白&nbsp;&nbsp;&nbsp;羽</a>

View File

@ -2,15 +2,15 @@
<div class="actions" style="max-width:680px;"> <div class="actions" style="max-width:680px;">
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<p><%= f.text_field :subject, :required => true, :size => 95 %></p> <p><%= f.text_field :subject, :required => true, :size => 95, :style => 'width:98%' %></p>
<p style="max-width:680px"><%= f.kindeditor :content,:width=>'99%', :required => true %></p> <p style="max-width:680px"><%= f.kindeditor :content,:width=>'99%', :required => true %></p>
<!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> --> <!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> -->
<br/> <div class="cl"></div>
<p style="margin-right: 10px;" class="fl"> <label class="fl" style="margin-left: -80px;margin-top: 10px;"><%= l(:label_attachment_plural) %></label>
<%= l(:label_attachment_plural) %><br /> <div style="margin-left: 110px;margin-top: 10px;margin-bottom: 10px;" class="fl">
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %> <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p> </div>
<%= f.submit :value => l(:label_memo_create), :style => "margin-left: 100px;"%> <%= link_to l(:button_back), forum_path(@forum) %> <%= f.submit :value => l(:label_memo_create), :style => "margin-left: 100px;"%> <%= link_to l(:button_back), forum_path(@forum) %>
</div> </div>
<% end %> <% end %>

View File

@ -5,22 +5,22 @@
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<!-- <h1>New memo</h1> --> <!-- <h1>New memo</h1> -->
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> <%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<div class="top-content"> <div class="top-content">
<table> <table>
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td> <td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td> <td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="top-content-search"> <div class="top-content-search">
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/forums", forums_path %></td> <td style="padding-left: 8px"><%= link_to request.host()+"/forums", forums_path %></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %></p></td> <td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %></p></td>
</tr> </tr>
</table> </table>
</div> </div>
<h3><%=l(:label_memo_new)%></h3> <h3><%=l(:label_memo_new)%></h3>
<div class="box tabular"> <div class="box tabular">
<div style="width:780px"> <div style="width:780px">

View File

@ -29,7 +29,7 @@
<%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_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' %>
<% else %> <% else %>
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> <%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %> <%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</li> </li>

View File

@ -66,9 +66,7 @@
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> </span> <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages', project_boards_path(@project,:topic_id => act.id),
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}),
:class => "problem_tit fl fb " %> :class => "problem_tit fl fb " %>
<br /> <br />
<p class="mt5 break_word"><%= textAreailizable act,:content %><br /> <p class="mt5 break_word"><%= textAreailizable act,:content %><br />

View File

@ -323,10 +323,9 @@
</span> </span>
&nbsp; &nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages', act.board.project ? project_boards_path(act.board.project,:topic_id => act.id) : course_boards_path(act.board.course,:topic_id => act.id),
:action => 'show', :class => "problem_tit fl fb " %>
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> </td>
</td>
<% else %> <% else %>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong> <strong>

View File

@ -28,7 +28,13 @@
<td colspan="2" valign="top" width="50" ><img src="/images/new/news.png" width="40" height="40"/></td> <td colspan="2" valign="top" width="50" ><img src="/images/new/news.png" width="40" height="40"/></td>
<td><table width="580" border="0"> <td><table width="580" border="0">
<tr> <tr>
<td colspan="2" valign="top"><strong> <%= content_tag('span', h(e.project), :class => 'project') %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title(e.event_title), e.event_url %></td> <td colspan="2" valign="top"><strong> <%= content_tag('span', h(e.project), :class => 'project') %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span>
<% if e.event_type.eql?("message") || e.event_type.eql?("reply") %>
<%= link_to format_activity_title(e.event_title), e.board.project ? project_boards_path(e.board.project,:topic_id => e.id):course_boards_path(e.board.course,:topic_id => e.id) %>
<%else %>
<%= link_to format_activity_title(e.event_title), e.event_url %>
<%end%>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580" ><p class="font_description"><%= format_activity_description(e.event_description) %></p></td> <td colspan="2" width="580" ><p class="font_description"><%= format_activity_description(e.event_description) %></p></td>

View File

@ -151,45 +151,48 @@ function submit_edit_course(id)
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////课程讨论区 //////////////////////////////////////////////////////////////课程讨论区
function regexSubject() function regexSubject(id) {
{ var subjectid = "#message_subject" + id ;
var content = $.trim($("#message_subject").val()); var content = $.trim($(subjectid).val());
if(content.length ==0) var message = "#subject_span" + id;
{ if (content.length == 0) {
$("#subject_span").text("主题不能为空"); $(message).text("主题不能为空");
$("#subject_span").css('color','#ff0000'); $(message).css('color', '#ff0000');
return false; return false;
} }
else else {
{ $(message).text("填写正确");
$("#subject_span").text("填写正确"); $(message).css('color', '#008000');
$("#subject_span").css('color','#008000');
return true; return true;
} }
return false; return false;
} }
function regexContent() function regexContent(id) {
{ var contentid = "#message_content" + id;
var content = message_content_editor.html(); var message = "#message_content_span"+ id;
if(content.length ==0) var content = $.trim($(contentid).val());
{ if (content.length == 0) {
$("#message_content_span").text("描述不能为空"); $(message).text("描述不能为空");
$("#message_content_span").css('color','#ff0000'); $(message).css('color', '#ff0000');
return false; return false;
} }
else else {
{ $(message).text("填写正确");
$("#message_content_span").text("填写正确"); $(message).css('color', '#008000');
$("#message_content_span").css('color','#008000');
return true; return true;
} }
return false; return false;
} }
function submitCoursesBoard()
{ // 项目讨论区编辑和提交
message_content_editor.sync(); function submitProjectsBoard(id) {
if(regexSubject()&&regexContent()){$("#message-form").submit();} var formid = "#message-form" + id;
if (regexSubject(id) && regexContent(id)) {
$(formid).submit();
}
} }
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////// 课程通知 /////////////////////////////////////////////////////////////// 课程通知
function regexTitle() function regexTitle()

View File

@ -144,42 +144,51 @@ $(function(){
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////项目讨论区 //////////////////////////////////////////////////////////////项目讨论区
function regexSubject() { function regexSubject(id) {
var content = $.trim($("#message_subject").val());
var subjectid = "#message_subject" + id ;
var content = $.trim($(subjectid).val());
var message = "#subject_span" + id;
if (content.length == 0) { if (content.length == 0) {
$("#subject_span").text("主题不能为空"); $(message).text("主题不能为空");
$("#subject_span").css('color', '#ff0000'); $(message).css('color', '#ff0000');
return false; return false;
} }
else { else {
$("#subject_span").text("填写正确"); $(message).text("填写正确");
$("#subject_span").css('color', '#008000'); $(message).css('color', '#008000');
return true; return true;
} }
return false; return false;
} }
function regexContent() { function regexContent(id) {
var content = $.trim($("#message_content").val());
var contentid = "#message_content" + id;
var message = "#message_content_span"+ id;
var content = $.trim($(contentid).val());
if (content.length == 0) { if (content.length == 0) {
$("#message_content_span").text("描述不能为空");
$("#message_content_span").css('color', '#ff0000'); $(message).text("描述不能为空");
$(message).css('color', '#ff0000');
return false; return false;
} }
else { else {
$("#message_content_span").text("填写正确");
$("#message_content_span").css('color', '#008000'); $(message).text("填写正确");
$(message).css('color', '#008000');
return true; return true;
} }
return false; return false;
} }
// 项目讨论区编辑和提交 // 项目讨论区编辑和提交
function submitProjectsBoard() { function submitProjectsBoard(id) {
if (regexSubject() && regexContent()) { var formid = "#message-form" + id;
$("#message-form").submit();
if (regexSubject(id) && regexContent(id)) {
$(formid).submit();
} }
} }
// 提交新闻 // 提交新闻
function regexTitle() { function regexTitle() {
var name = $("#news_title").val(); var name = $("#news_title").val();

View File

@ -361,7 +361,7 @@ span.forums-avatar-right{
} }
.content-text-list{ .content-text-list{
margin-bottom: 10px; margin-bottom: 10px;
border-bottom: 1px dashed rgb(204, 204, 204); /*border-bottom: 1px dashed rgb(204, 204, 204);*/
width: 580px; width: 580px;
} }
@ -2004,9 +2004,15 @@ color:#505050;
} }
img.ui-datepicker-trigger { img.ui-datepicker-trigger {
cursor: pointer; display: block;
vertical-align: middle; background: url(../images/public_icon.png) -31px 0 no-repeat;
margin-left: 4px; cursor: pointer;
vertical-align: middle;
margin-left: 5px;
margin-top: 5px;
width: 16px;
height: 15px;
float: left;
} }
/***** Progress bar *****/ /***** Progress bar *****/
@ -2511,7 +2517,7 @@ a.close-icon:hover {background-image:url('../images/close_hl.png');}
.icon-user { background-image: url(../images/user.png); } .icon-user { background-image: url(../images/user.png); }
.icon-projects { background-image: url(../images/projects.png); } .icon-projects { background-image: url(../images/projects.png); }
.icon-help { background-image: url(../images/help.png); } .icon-help { background-image: url(../images/help.png); }
.icon-attachment { background-image: url(../images/attachment.png); } .icon-attachment { background-image: url(../images/attachment.png);padding-left: 20px !important; }
.icon-history { background-image: url(../images/history.png); } .icon-history { background-image: url(../images/history.png); }
.icon-time { background-image: url(../images/time.png); } .icon-time { background-image: url(../images/time.png); }
.icon-time-add { background-image: url(../images/time_add.png); } .icon-time-add { background-image: url(../images/time_add.png); }

View File

@ -86,7 +86,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
.ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; } .ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; }
.ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;} .ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
.ping_con p span a{ color:#777777;} .ping_con p span a{ color:#777777;}
.ping_star{ width:185px; color:#333; font-weight:bold; margin-bottom:5px;} .ping_star{ width:195px; color:#333; font-weight:bold; margin-bottom:5px;}
.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;} .ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;}
.ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;} a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;}

View File

@ -1190,7 +1190,8 @@ div.pagination {
text-align: left; text-align: left;
font-size: 13px; font-size: 13px;
} }
.pagination li a{margin-top: 10px;}
.pagination li span{margin-top: 10px;}
.m5p5 { .m5p5 {
display: inline-block; display: inline-block;
height: auto; height: auto;

View File

@ -738,6 +738,6 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
.Replybox{ float:left; width:495px; margin-left:5px;} .Replybox{ float:left; width:495px; margin-left:5px;}
.talk_nextpage{ border:none; width:410px; margin:0 auto;} .talk_nextpage{ border:none; width:410px; margin:0 auto;}
.newtalk { margin-top:8px; margin-right:8px;} .newtalk { margin-top:8px; margin-right:8px;}
.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}
#about_newtalk{ display:none;} #about_newtalk{ display:none;}