From 87564eceee8e98c0974c04a984a4e73a598e65ae Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 11 May 2015 15:25:16 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A--->?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/edit.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index 63c3051aa..e31c5008f 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -42,7 +42,7 @@
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
+ +
diff --git a/public/stylesheets/pleft.css b/public/stylesheets/pleft.css index 4d495e999..6554db7ec 100644 --- a/public/stylesheets/pleft.css +++ b/public/stylesheets/pleft.css @@ -49,7 +49,7 @@ a:hover.subnav_green{ background:#14ad5a;} /*简介*/ .project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;} .course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;} -.project_board_content{overflow: hidden;max-height: 50px;word-break: break-all;word-wrap: break-word;} +.project_board_content{overflow: hidden;max-height: 55px;word-break: break-all;word-wrap: break-word;} .course_description_none{max-height: none;} .lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;} .lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;} From 79c0c6f551aa67bfed5ed42efbd8af7084c93da5 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 11 May 2015 16:45:03 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 4 ++-- app/views/boards/_project_show.html.erb | 2 +- app/views/layouts/_base_development_group.html.erb | 2 +- app/views/layouts/_base_friend_group.html.erb | 2 +- app/views/layouts/_base_research_team.html.erb | 2 +- app/views/layouts/base_courses.html.erb | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 34ce6e55f..3962a5b12 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -39,7 +39,7 @@ <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>

  <%= h(topic.subject) %>

- <% if topic.editable_by?(User.current) %> + <% if topic.course_editable_by?(User.current) %> <%= l(:button_edit) %> <% end %> @@ -75,7 +75,7 @@
-
+ -
+ <% end%> diff --git a/app/views/layouts/_base_friend_group.html.erb b/app/views/layouts/_base_friend_group.html.erb index 16ccc09e5..71d375501 100644 --- a/app/views/layouts/_base_friend_group.html.erb +++ b/app/views/layouts/_base_friend_group.html.erb @@ -12,7 +12,7 @@ (<%= @project.boards.first.topics.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %> + <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %> <% end %>
<% end%> diff --git a/app/views/layouts/_base_research_team.html.erb b/app/views/layouts/_base_research_team.html.erb index a214e8c20..f228f0439 100644 --- a/app/views/layouts/_base_research_team.html.erb +++ b/app/views/layouts/_base_research_team.html.erb @@ -23,7 +23,7 @@ (<%= @project.boards.first.topics.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %> + <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %> <% end %>
<% end%> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 2a26ff59f..6923b17c2 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -133,7 +133,7 @@ <%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
+ + <% end%> \ No newline at end of file diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 1b17347c3..180b0322a 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -124,6 +124,7 @@ zh: # lable_file_sharingarea: 资源共享区 + label_upload_source: 上传资源 label_upload_files: 上传文件 label_slected_to_other_project: 选入我的其他项目 label_slected_to_project: 选入我的项目 From a62001c89250fd84c4cb407e7e976979566e2b3a Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 13 May 2015 10:27:27 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93--=20=E5=A6=82=E6=9E=9C=E4=B8=BB=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E5=B7=B2=E5=AD=98=E5=9C=A8=EF=BC=8C=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D=E5=85=81=E8=AE=B8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BB=E7=89=88=E6=9C=AC=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/repositories_helper.rb | 12 ++++++++++++ .../projects/settings/_new_repositories.html.erb | 10 ++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 773560932..9ee11e392 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -232,6 +232,18 @@ module RepositoriesHelper :label => l(:label_git_report_last_commit) )) end + + # 判断项目是否有主版本库 + def judge_main_repository(pro) + if pro.repositories.blank? + return false + else + pro.repositories.sort.each do |rep| + rep.is_default? + return true + end + end + end # def cvs_field_tags(form, repository) # content_tag('p', form.text_field( # :root_url, diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb index e6a0ac296..ef70f1e60 100644 --- a/app/views/projects/settings/_new_repositories.html.erb +++ b/app/views/projects/settings/_new_repositories.html.erb @@ -72,10 +72,12 @@ <%= l(:text_scm_command_not_available) %> <% end %> -
  • - - <%= f.check_box :is_default, :label => "" %>

    -
  • + <% unless judge_main_repository(@project) %> +
  • + + <%= f.check_box :is_default, :label => "" %>

    +
  • + <% end %>
  • <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>""%> From 90559556c66f175d2383a757d7c4cf3269a219c3 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 13 May 2015 10:37:01 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=EF=BC=8C=E8=BE=93=E5=85=A5=E6=A1=86=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/settings/_new_repositories.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb index ef70f1e60..c2606f791 100644 --- a/app/views/projects/settings/_new_repositories.html.erb +++ b/app/views/projects/settings/_new_repositories.html.erb @@ -80,14 +80,14 @@ <% end %>
  • - <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>""%> + <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %> <% unless @repository.identifier_frozen? %> - <%=l(:text_length_between,:min=>1,:max=>254)< + <%=l(:text_length_between,:min=>1,:max=>254)< <% end %>
  • - <%= f.password_field :upassword, :label=> "" %> + <%= f.password_field :upassword, :label=> "", :no_label => true %> <%= l(:label_upassword_info)%>
  • From 68050b7d22bec71ec7e31d01fbc6e4291aba660b Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 13 May 2015 10:42:52 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=84=9A=E6=9C=AC=E8=BF=87=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/show.html.erb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index ceb675dcb..247e65554 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -152,9 +152,6 @@
    - - - <% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %> <% end %> From 406d608edc387f5e5ad749758c8822f43d8ffe5b Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 13 May 2015 11:46:19 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E7=A7=81?= =?UTF-8?q?=E6=9C=89=E6=9D=83=E9=99=90=E8=AE=BE=E7=BD=AE=20--=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=88=90=E5=91=98=E5=8F=AF=E4=BB=A5=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=20--=E5=B7=A6=E4=BE=A7=E5=85=A5=E5=8F=A3=E9=9A=90=E8=97=8F=20-?= =?UTF-8?q?-=E7=A6=81=E6=AD=A2=E9=80=9A=E8=BF=87url=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 12 ++++++------ app/views/layouts/_base_development_group.html.erb | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 5fe953563..d0af82c8c 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -244,12 +244,12 @@ update def show ## TODO: the below will move to filter, done. - # if !User.current.member_of?(@project) - # if @project.hidden_repo - # render_403 - # return -1 - # end - # end + if !User.current.member_of?(@project) + if @project.hidden_repo + render_403 + return -1 + end + end #if( !User.current.member_of?(@project) || @project.hidden_repo) @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? diff --git a/app/views/layouts/_base_development_group.html.erb b/app/views/layouts/_base_development_group.html.erb index 058095a20..49719fbd5 100644 --- a/app/views/layouts/_base_development_group.html.erb +++ b/app/views/layouts/_base_development_group.html.erb @@ -37,13 +37,14 @@ <%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> <% end %> - <% end%> - <% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %> + <% end %> + <%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %> + <% unless @project.hidden_repo || @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %> - <% end %> + <% end %> From fe2f6a0d9d61df25ea798739a10ea0a58484e25d Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 13 May 2015 14:31:54 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=B7=BB=E5=8A=A0=E5=9B=9E=E5=A4=8D=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=8A=9F=E8=83=BD=20Signed-off-by:=20alan=20<54753343?= =?UTF-8?q?4@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 18 +++++++++++++----- app/views/attachments/_form_course.html.erb | 2 +- app/views/attachments/_form_project.html.erb | 2 +- app/views/boards/_project_show.html.erb | 17 ++++++++++------- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 6e2da4bb0..619f91245 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -194,11 +194,19 @@ class MessagesController < ApplicationController redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) end elsif request.get? - respond_to do |format| - format.html { - layout_file = @project ? 'base_projects' : 'base_courses' - render :layout => layout_file - } + if params[:is_board] + if @project + redirect_to project_boards_path(@project) + elsif @course + redirect_to course_boards_path(@course) + end + else + respond_to do |format| + format.html { + layout_file = @project ? 'base_projects' : 'base_courses' + render :layout => layout_file + } + end end end end diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index 7b07426aa..4a297fb7b 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -56,7 +56,7 @@ :file_count => l(:label_file_count), :delete_all_files => l(:text_are_you_sure_all) } %> -<%= l(:label_no_file_uploaded)%> +<%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb index 66d9a0e80..a3d30bd45 100644 --- a/app/views/attachments/_form_project.html.erb +++ b/app/views/attachments/_form_project.html.erb @@ -56,7 +56,7 @@ :file_count => l(:label_file_count), :delete_all_files => l(:text_are_you_sure_all) } %> - <%= l(:label_no_file_uploaded)%> + <%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 150acbabd..a20bed3fd 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -40,12 +40,10 @@

      <%= h(topic.subject) %>

    <% if topic.editable_by?(User.current) %> - <%= l(:button_edit) %> - <% end %> - <% if topic.sticky? %> - <%= l(:label_board_sticky)%> + <%= l(:button_edit) %> <% end %> + <%= link_to( l(:button_delete), {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, @@ -55,7 +53,9 @@ :style => ' margin-right: 10px;' ) if topic.destroyable_by?(User.current) %> - + <% if topic.sticky? %> + <%= l(:label_board_sticky)%> + <% end %>

    @@ -96,7 +96,10 @@ <%= 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} %> - <%= l(:label_memo_create)%> + <%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %> + <%= l(:label_memo_create)%> + + <% end %>