diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 5c3503718..31463d691 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -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)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 0db7facbc..4049c2ae8 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -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
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 89fa0e1dc..4e7768785 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -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]
diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb
index 6965eca07..63332e564 100644
--- a/app/helpers/homework_attach_helper.rb
+++ b/app/helpers/homework_attach_helper.rb
@@ -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
diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb
index 870bd692b..630d7552c 100644
--- a/app/views/bids/_bid_homework_show.html.erb
+++ b/app/views/bids/_bid_homework_show.html.erb
@@ -58,16 +58,10 @@
<% 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%>
-
- <%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
-
- <% else %>
-
- 提交作业
-
- <% end %>
+ <% if cur_user_homework && cur_user_homework.empty? %>
+
+ <%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
+
<% else %>
<%= l(:lable_has_commit_homework)%>
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index 8128797c0..1a5cbd2fa 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -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} %>
-
- <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %>
+ <%= l(:button_submit)%>
+ <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'ButtonColor m3p10' %>
+
<% end %>
<% end %>
diff --git a/app/views/courses/homework.html.erb b/app/views/courses/homework.html.erb
index 68ec0dc2e..81201bef5 100644
--- a/app/views/courses/homework.html.erb
+++ b/app/views/courses/homework.html.erb
@@ -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 %>
- <%= l(:label_coursejoin_tip) %>
+
+ <%= l(:label_coursejoin_tip) %>
+
<% end %>
diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb
index b821e2495..d11ea3333 100644
--- a/app/views/homework_attach/_homework.html.erb
+++ b/app/views/homework_attach/_homework.html.erb
@@ -49,8 +49,8 @@
<% else %>
<% if is_my_homework %>
-
- <% if @bid.comment_status == 0 %>
+
+ <% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0 %>
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
<% if homework.user == User.current || User.current.admin? %>
@@ -68,10 +68,14 @@
<%= l(:button_edit) %>
<% if homework.user == User.current || User.current.admin? %>
- <%=l(:label_bid_respond_delete)%>
+
+ <%=l(:label_bid_respond_delete)%>
+
<% else %>
- <%=l(:label_logout) %>
+
+ <%=l(:label_logout) %>
+
<% end %>
<% end %>
@@ -88,7 +92,9 @@
<% elsif @bid.comment_status == 2%>
- <%= l(:label_anonymous_comments) %>
+
+ <%= l(:label_anonymous_comments) %>
+
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
迟交!
<% end %>
diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb
index a8736592c..8ef696e0c 100644
--- a/app/views/homework_attach/_homeworks_list.html.erb
+++ b/app/views/homework_attach/_homeworks_list.html.erb
@@ -35,16 +35,9 @@
您还没交作业,请创建作业!
- <% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0%>
-
<%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
- <% else %>
-
- 提交作业
-
- <% end %>
<% end %>
diff --git a/app/views/homework_attach/_journal_reply_items.html.erb b/app/views/homework_attach/_journal_reply_items.html.erb
index 726efb0c1..dd09bd84f 100644
--- a/app/views/homework_attach/_journal_reply_items.html.erb
+++ b/app/views/homework_attach/_journal_reply_items.html.erb
@@ -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 %>
@@ -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 %>
diff --git a/app/views/homework_attach/add_jour_reply.js.erb b/app/views/homework_attach/add_jour_reply.js.erb
index 564229d81..34cec1cca 100644
--- a/app/views/homework_attach/add_jour_reply.js.erb
+++ b/app/views/homework_attach/add_jour_reply.js.erb
@@ -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);
diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb
index efa3adc2e..05ec50c11 100644
--- a/app/views/issues/new.html.erb
+++ b/app/views/issues/new.html.erb
@@ -27,23 +27,26 @@
<%= render :partial => 'attachments/form', :locals => {:container => @issue} %>
<% if @issue.safe_attribute? 'watcher_user_ids' -%>
-
-
- <%= watchers_checkboxes(@issue, @available_watchers) %>
-
-
- <%= link_to l(:label_search_for_watchers),
- {:controller => 'watchers', :action => 'new', :project_id => @issue.project},
- :remote => true,
- :method => 'get' %>
-
+
+
+
+ <%= watchers_checkboxes(@issue, @available_watchers) %>
+
+
+ <%= link_to l(:label_search_for_watchers),
+ {:controller => 'watchers', :action => 'new', :project_id => @issue.project},
+ :remote => true,
+ :method => 'get' %>
+
<% end %>
-
- <%= 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"}%>
+
+ <%= l(:button_create)%>
+
+ <%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form','preview',{:class => "ButtonColor m3p10"}%>
<%= javascript_tag "$('#issue_subject').focus();" %>
<% end %>
diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb
index 3d4b6a4d2..c50bd5dff 100644
--- a/app/views/messages/edit.html.erb
+++ b/app/views/messages/edit.html.erb
@@ -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') %>
+
+ <%= l(:button_save) %>
+
+ <%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %>
<% end %>
diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb
index 63592d91a..3efd0cfab 100644
--- a/app/views/tags/_tag.html.erb
+++ b/app/views/tags/_tag.html.erb
@@ -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'%>
-
+
+
+ <%= l(:button_project_tags_add)%>
+
+ <%= link_to_function l(:button_cancel), '$("#put-tag-form").hide();',:class=>'ButtonColor m3p10'%>
<% end %>
<% end %>
diff --git a/app/views/users/search.html.erb b/app/views/users/search.html.erb
index f5bbc3b8d..f8d5a7cf3 100644
--- a/app/views/users/search.html.erb
+++ b/app/views/users/search.html.erb
@@ -20,8 +20,8 @@
-
- <%= select "search_by", "id",
+
+ <%#= 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 %>
diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb
index ebca999a6..76359794c 100644
--- a/app/views/words/_journal_reply_items.html.erb
+++ b/app/views/words/_journal_reply_items.html.erb
@@ -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 @@
<% 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 %>
diff --git a/app/views/words/_new_respond.html.erb b/app/views/words/_new_respond.html.erb
index 5d615578d..a4cad1a38 100644
--- a/app/views/words/_new_respond.html.erb
+++ b/app/views/words/_new_respond.html.erb
@@ -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),
diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb
index eeb4e3ef6..04cbee26e 100644
--- a/app/views/words/create_reply.js.erb
+++ b/app/views/words/create_reply.js.erb
@@ -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);
diff --git a/config/settings.yml b/config/settings.yml
index ccc1cac9d..381e8a302 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -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
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 5a6e973d6..5c21b200e 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -2894,4 +2894,26 @@ div.repos_explain{
#membership_project_id option
{
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;
}
\ No newline at end of file
diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css
index b3acd8f83..b382b6d46 100644
--- a/public/stylesheets/css.css
+++ b/public/stylesheets/css.css
@@ -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;}
diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css
index bdec84b4c..7cee0aa9b 100644
--- a/public/stylesheets/nyan.css
+++ b/public/stylesheets/nyan.css
@@ -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;
}
|