This commit is contained in:
alan 2014-11-25 16:09:38 +08:00
commit 3eddca8c6e
22 changed files with 94 additions and 81 deletions

View File

@ -64,7 +64,7 @@ class AttachmentsController < ApplicationController
# modify by nwb
# 下载添加权限设置
candown = false
if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project
if @attachment.container.class.to_s != "HomeworkAttach" && (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project
project = @attachment.container.project
candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
elsif @attachment.container.is_a?(Project)

View File

@ -376,12 +376,13 @@ class UsersController < ApplicationController
"show_changesets" => true
}
scope = User.logged.status(@status)
scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
@search_by = params[:search_by] ? params[:search_by][:id] : 0
scope = scope.like(params[:name],@search_by) if params[:name].present?
@user_count = scope.count
@user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'users_base'
@offset ||= @user_pages.reverse_offset
unless @offset == 0
unless @offset == 0
@users = scope.offset(@offset).limit(@limit).all.reverse
else
limit = @user_count % @limit

View File

@ -47,6 +47,7 @@ class WordsController < ApplicationController
# 删除留言功能要调用destroy也记得在destroy.js中修改
# deny api. api useless
@show_real_name = params[:show_real_name] || false
parent_id = params[:reference_id]
author_id = User.current.id
reply_user_id = params[:reference_user_id]

View File

@ -60,7 +60,7 @@ module HomeworkAttachHelper
memberships = User.current.memberships.all(:conditions => cond)
projects = memberships.map(&:project)
not_have_project = []
not_have_project << "NO PROJECT"
not_have_project << Setting.please_chose
not_have_project << 0
type = []
type << not_have_project

View File

@ -58,16 +58,10 @@
<span style="float: right">
<% if User.current.logged? && is_cur_course_student(@course) %>
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
<% if cur_user_homework!= nil && cur_user_homework.empty? %>
<% if bid.comment_status == 0 || bid.comment_status == 2%>
<span class="span_wping">
<%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
</span>
<% else %>
<span title="匿评阶段不可提交作业!" class="span_wping">
<a style="width:80px; margin:20px 0 0 350px;background:#8e8e8e;">提交作业</a>
</span>
<% end %>
<% if cur_user_homework && cur_user_homework.empty? %>
<span class="span_wping">
<%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
</span>
<% else %>
<span style="color: green; float: right">
<%= l(:lable_has_commit_homework)%>

View File

@ -18,8 +18,9 @@
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
<p>
<input type="button" onclick="submitProjectBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %></p>
<a herf="#" onclick="submitProjectBoard();" class="ButtonColor m3p10"><%= l(:button_submit)%></a>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'ButtonColor m3p10' %>
</p>
<% end %>
<div id="preview" class="wiki"></div>
<% end %>

View File

@ -9,7 +9,9 @@
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where(id: [3, 4, 7, 9] )).size >0))%>
<%= link_to(l(:label_course_homework_new), {:controller => 'courses', :action => 'new_homework'}, :class => 'icon icon-add') %>
<% else %>
<span class="font_lighter"><%= l(:label_coursejoin_tip) %></span>
<span class="font_lighter">
<%= l(:label_coursejoin_tip) %>
</span>
<% end %>
</div>
<div id="bid-show">

View File

@ -49,8 +49,8 @@
<% else %>
<!-- 是学生 -->
<% if is_my_homework %>
<!-- 我的作品,显示为编辑和删除 -->
<% if @bid.comment_status == 0 %>
<!-- 我的作品,在未开启匿评和未使用匿评,显示为编辑和删除 -->
<% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0 %>
<li class="wmine" style="padding-top: 4px;">
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
<% if homework.user == User.current || User.current.admin? %>
@ -68,10 +68,14 @@
<a style="color:#8e8e8e;"><%= l(:button_edit) %></a>
<% if homework.user == User.current || User.current.admin? %>
<!-- 作业创建者显示删除作业 -->
<a style="color:#8e8e8e;"><%=l(:label_bid_respond_delete)%></a>
<a style="color:#8e8e8e;">
<%=l(:label_bid_respond_delete)%>
</a>
<% else %>
<!-- 作业参与者显示退出作业 -->
<a style="color:#8e8e8e;"><%=l(:label_logout) %></a>
<a style="color:#8e8e8e;">
<%=l(:label_logout) %>
</a>
<% end %>
</li>
<% end %>
@ -88,7 +92,9 @@
<% elsif @bid.comment_status == 2%>
<!-- 处于匿评已关闭阶段,不容许评分 -->
<li class="wping" title="关闭匿评后不可继续评分">
<a style="background:#8e8e8e;"><%= l(:label_anonymous_comments) %></a>
<a style="background:#8e8e8e;">
<%= l(:label_anonymous_comments) %>
</a>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>

View File

@ -35,16 +35,9 @@
</span>
</li>
<li class="c_red" style="margin:25px 0 0 20px;"> 您还没交作业,请创建作业!</li>
<% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0%>
<!-- 老师布置的作业在创建和开启匿评这段时间才允许创建作品 -->
<li class="wping">
<%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
</li>
<% else %>
<li class="wping" title="匿评阶段不可提交作业!">
<a style="width:80px; margin:20px 0 0 350px;background:#8e8e8e;">提交作业</a>
</li>
<% end %>
</ul>
<div class="cl"></div>
<% end %>

View File

@ -1,3 +1,4 @@
<% show_real_name ||= false %>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
@ -12,8 +13,13 @@
<% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to reply.user.name, user_path(reply.user) %>
回复
<% if show_name %>
<%= link_to reply.at_user.name,user_path(reply.at_user) %>
<% parent_jour = JournalsForMessage.find reply.m_reply_id %>
<% if show_name && parent_jour %>
<% if show_real_name%>
<%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %>
<% else %>
<%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
<% end %>
<% else %>
<%= l(:label_anonymous) %>
<% end %>

View File

@ -1,7 +1,7 @@
<% if @save_succ %>
var pre_append = $('<%= j(
render :partial => "journal_reply_items",
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm}
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm, :show_real_name => true}
) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600);

View File

@ -27,23 +27,26 @@
<p id="attachments_form"><label><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @issue} %></p>
<% if @issue.safe_attribute? 'watcher_user_ids' -%>
<p id="watchers_form"><label><%= l(:label_issue_watchers) %></label>
<span id="watchers_inputs">
<%= watchers_checkboxes(@issue, @available_watchers) %>
</span>
<span class="search_for_watchers">
<%= link_to l(:label_search_for_watchers),
{:controller => 'watchers', :action => 'new', :project_id => @issue.project},
:remote => true,
:method => 'get' %>
</span>
<p id="watchers_form">
<label>
<%= l(:label_issue_watchers) %>
</label>
<span id="watchers_inputs">
<%= watchers_checkboxes(@issue, @available_watchers) %>
</span>
<span class="search_for_watchers">
<%= link_to l(:label_search_for_watchers),
{:controller => 'watchers', :action => 'new', :project_id => @issue.project},
:remote => true,
:method => 'get' %>
</span>
</p>
<% end %>
</div>
<%= submit_tag l(:button_create), :class => "ButtonAddTags"%>
<%= submit_tag l(:button_create_and_continue), :class => 'ButtonAddTags' %>
<%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form','preview',{:class => "ButtonColor"}%>
<a href="#" class="ButtonColor m3p10" onclick="$('#issue-form').submit();">
<%= l(:button_create)%>
</a>
<%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form','preview',{:class => "ButtonColor m3p10"}%>
<%= javascript_tag "$('#issue_subject').focus();" %>
<% end %>

View File

@ -15,7 +15,9 @@
} do |f| %>
<%= render :partial => 'form',
:locals => {:f => f, :replying => !@message.parent.nil?} %>
<%= submit_tag l(:button_save) %>
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board, :id => @message}, 'message-form') %>
<a href="#" onclick="$('#message-form').submit();" class="ButtonColor m3p10">
<%= l(:button_save) %>
</a>
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -76,9 +76,11 @@
<%= f.text_field :name ,:id => "tags_name",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit l(:button_project_tags_add),:class => "ButtonAddTags" %>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").hide();',:class=>'ButtonColor'%>
<!--<%#= f.submit l(:button_project_tags_add),:class => "ButtonColor m3p10" %>-->
<a href="#" onclick='$("#tags_name").parent().submit();' class="ButtonColor m3p10" >
<%= l(:button_project_tags_add)%>
</a>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").hide();',:class=>'ButtonColor m3p10'%>
<% end %>
</div>
<% end %>

View File

@ -20,8 +20,8 @@
</td>
<td rowspan="2" >
<div class="project-search" style="float: right">
<label for="user_browse_label"><%= l(:label_user_search_type) %></label>
<%= select "search_by", "id",
<!--label for="user_browse_label"><%#= l(:label_user_search_type) %></label-->
<%#= select "search_by", "id",
{ l(:label_search_by_login) => "0", l(:label_search_by_name) => "1", l(:label_search_by_email) => "2" },
:size => 20 %>
<%= text_field_tag 'name', params[:name], :size => 30 %>

View File

@ -20,7 +20,7 @@
<% parent_jour = JournalsForMessage.find reply.m_reply_id %>
<% if show_name && parent_jour %>
<% if show_real_name%>
<%= link_to parent_jour.user.lastname+reply.user.firstname, user_path(parent_jour.user) %>
<%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %>
<% else %>
<%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
<% end %>
@ -51,7 +51,7 @@
</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} %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name, :show_real_name => show_real_name} %>
<% end %>
</div>
<div style="clear: both;"></div>

View File

@ -1,5 +1,5 @@
<%= form_tag(words_create_reply_path, :remote => true) do %>
<% show_real_name ||= false%>
<%= form_tag(words_create_reply_path(:show_real_name=>show_real_name), :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content),

View File

@ -1,7 +1,7 @@
<% if @save_succ %>
var pre_append = $('<%= j(
render :partial => "words/journal_reply_items",
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name}
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name, :show_real_name=>@show_real_name}
) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600);

View File

@ -256,6 +256,8 @@ course_domain:
default: course.trustie.net
repository_domain:
default: repository.trustie.net
please_chose:
default: 请选择
plugin_redmine_ckeditor:
serialized: true
default: --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess

View File

@ -2895,3 +2895,25 @@ div.repos_explain{
{
width: 190px;
}
input[class~='ButtonClolr'],.ButtonColor{
color: #fffbff !important;
padding: 5px;
width: auto;
height: 24px ;
font-family: '微软雅黑',Arial,Helvetica,sans-serif;
font-size: 15px;
text-align: center;
background: #15bccf !important;
border: 0px solid #15bccf ;
display:inline-block
}
input[class~='m3p10'], .m3p10 {
margin: 0;
padding: 3px 10px !important;
height: 20px;
display: inline-block;
color: #ffffff;
}

View File

@ -55,7 +55,7 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px;line-hei
.c_grey{ color:#999; font-weight:normal;}
.dis ul li.wname02 a{ width:200px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.dis ul li.wmine{ margin:12px 0 0 10px;}
.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;}
.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;line-height: 1.9;}
.wzan{ margin:15px 0 0 25px; width:32px; height:44px;}
.wzan a{ display: block;text-align: center;}
a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;}

View File

@ -474,20 +474,6 @@ body {
position: relative;
top: 1px;
}
input[class~='ButtonClolr'],.ButtonColor{
color: #fffbff !important;
padding: 5px;
width: auto;
height: 24px ;
font-family: '微软雅黑',Arial,Helvetica,sans-serif;
font-size: 15px;
text-align: center;
background: #15bccf !important;
border: 0px solid #15bccf ;
display:inline-block
}
input[class~='whiteButton'], .whiteButton {
-moz-box-shadow: inset 0px 1px 0px 0px #ffffff;
@ -537,14 +523,6 @@ input[class~='whiteButton']:active, .whiteButton:active {
color: #ffffff;
}
input[class~='m3p10'], .m3p10 {
margin: 0;
padding: 3px 10px !important;
height: 20px;
display: inline-block;
color: #ffffff;
}
input[class~='h30'], .h30 {
height: 30px;
}