From 4b58699ee9f2c361f2c28e30c6907ba198291414 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Mon, 18 May 2015 16:41:04 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug#2270=20:forge/cours?= =?UTF-8?q?e=E4=B8=BB=E9=A1=B5--=E6=90=9C=E7=B4=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=A0=E4=BB=BB=E4=BD=95=E4=BD=9C=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 ++ app/services/users_service.rb | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2a10af260..ace4ae903 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -383,6 +383,8 @@ class UsersController < ApplicationController # scope = User.logged.status(@status) # @search_by = params[:search_by] ? params[:search_by][:id] : 0 # scope = scope.like(params[:name],@search_by) if params[:name].present? + @search_by = params[:search_by] ? params[:search_by] : 0 + us = UsersService.new scope = us.search_user params @user_count = scope.count diff --git a/app/services/users_service.rb b/app/services/users_service.rb index 071820ba3..afefc6ff1 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -206,10 +206,18 @@ class UsersService } scope = User.logged.status(status) if params[:is_search_assitant].nil? - watcher = User.watched_by(params[:user_id]) - watcher.push(params[:user_id]) + #modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件(bug:#2270) start + #say by yutao: params[:user_id]这个是指谁发起的搜索么? 如果是 这个值貌似应该从session获取 怪怪的赶脚-_-! search_by = params[:search_by] ? params[:search_by] : "0" - scope = scope.where("id not in (?)",watcher).like(params[:name],search_by) if params[:name].present? + if params[:name].present? + if !params[:user_id].nil? + watcher = User.watched_by(params[:user_id]) + watcher.push(params[:user_id]) + scope = scope.where("id not in (?)",watcher) + end + scope = scope.like(params[:name],search_by) + end + #modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件 end else teachers = searchTeacherAndAssistant(Course.find(params[:course_id])) scope = scope.where("id not in (?)",teachers.map{|t| t.user_id}).like(params[:name],search_by) if params[:name].present? From df48d8988116fdce3e15d1822a547c68165c8276 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 18 May 2015 17:02:02 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=B0=81=E8=A3=85=20=E6=B7=BB=E5=8A=A0admin=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=AE=A1=E7=90=86=E8=B5=84=E6=BA=90=E7=9A=84=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E7=A7=81=E6=9C=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 25 +++++++++++++++---- .../layouts/_base_development_group.html.erb | 19 ++++---------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 506adceec..0836bf307 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -593,22 +593,37 @@ module ApplicationHelper Project.project_tree(projects, &block) end + # 项目版本库可见权限判断 + # 条件:1、modules中设置不可见或项目没有版本库;2、如果项目是私有或者项目版本库隐藏则必须是项目成员才可见 + def visible_repository?(project) + @result = false + unless project.enabled_modules.where("name = 'repository'").empty? || project.repositories.count == 0 + if (project.hidden_repo || !project.is_public?) + if User.current.member_of?(project) + @result = true + end + else + @result = true + end + end + return @result + 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 = true + @result = mem.first.roles.to_s.include?("Manager") ? true : false end return @result end - # 私有项目资源不能引用,不能设置公开私有 - # 公开项目资源可以应用,管理员和资源上传者拥有设置公开私有权限 + # 公开项目资源可以引用,admin和管理员和资源上传者拥有设置公开私有权限 def authority_pubilic_for_files(project, file) @result = false - 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" + if (is_project_manager?(User.current.id, @project.id) || file.author_id == User.current.id || User.current.admin) && + project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project" @result = true end return @result diff --git a/app/views/layouts/_base_development_group.html.erb b/app/views/layouts/_base_development_group.html.erb index 4b0692f9e..218fc186d 100644 --- a/app/views/layouts/_base_development_group.html.erb +++ b/app/views/layouts/_base_development_group.html.erb @@ -39,20 +39,11 @@ <% end %> <%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %> - <% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %> - <% if @project.hidden_repo || !@project.is_public? %> - <% if User.current.member_of?(@project) %> - - <% end %> - <% else %> - - <% end %> + <% if visible_repository?(@project) %> + <% end %> From 9690dc41f657007415e71500d73e77e5f1bdb7e6 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Mon, 18 May 2015 17:03:26 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug#2606=20:IE=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8=EF=BC=9A=E6=B5=8B=E8=AF=95=E7=89=88=E2=80=94?= =?UTF-8?q?=E4=B8=AD=E5=9B=BD=E9=AB=98=E6=A0=A1=EF=BC=9A=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E6=97=B6ajax=E9=93=BE=E6=8E=A5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/school/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/school/index.html.erb b/app/views/school/index.html.erb index 00f419aab..cdd87e723 100644 --- a/app/views/school/index.html.erb +++ b/app/views/school/index.html.erb @@ -53,7 +53,7 @@ } $.ajax({ type :"POST", - url :prefix + '/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+province, + url :prefix + '/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+encodeURIComponent(province), data :'text', success: function(data){ $("#schoollist").html(data); From ff6173c5f544e243f18016b2290afc9f48699961 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Tue, 19 May 2015 09:04:42 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug#2623:=E7=95=99?= =?UTF-8?q?=E8=A8=80=E2=80=94=E5=88=A0=E9=99=A4=E7=95=99=E8=A8=80=EF=BC=9A?= =?UTF-8?q?=E5=BD=93=E7=95=99=E8=A8=80=E6=88=90=E5=8A=9F=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E7=95=99=E8=A8=80=E7=9A=84=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=89=8B=E5=8A=A8=E5=88=B7=E6=96=B0=E6=89=8D?= =?UTF-8?q?=E4=BC=9A=E6=94=B9=E5=8F=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 3 +++ app/views/words/destroy.js.erb | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 3d6772ea8..cc6c4f47e 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -85,6 +85,9 @@ class WordsController < ApplicationController elsif @journal_destroyed.jour_type == "Course" @course = Course.find @journal_destroyed.jour_id @jours_count = @course.journals_for_messages.where('m_parent_id IS NULL').count + elsif @journal_destroyed.jour_type == "Principal" + @user = User.find(@journal_destroyed.jour_id) + @jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count end respond_to do |format| format.js diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index 43da9a7d8..dabd3a8c7 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -5,6 +5,8 @@ $('#jours_count').html("<%= @jours_count %>"); <% elsif @course && @jours_count%> $('#course_jour_count').html("(<%= @jours_count %>)"); + <% elsif @user && @jours_count%> + $('#jour_count').html("<%= @jours_count %>"); <% end %> var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') destroyedItem.fadeOut(600,function(){ From d42fd98dffe9249cb54c8366c6e2581e29413bba Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 19 May 2015 10:10:52 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layouts/_base_development_group.html.erb | 52 -- app/views/layouts/_base_friend_group.html.erb | 29 -- .../layouts/_base_research_team.html.erb | 40 -- app/views/layouts/_join_exit_project.html.erb | 1 - app/views/layouts/base_projects.html.erb | 458 +++++++++--------- .../projects/_development_group.html.erb | 52 ++ app/views/projects/_friend_group.html.erb | 29 ++ app/views/projects/_research_team.html.erb | 40 ++ 8 files changed, 349 insertions(+), 352 deletions(-) delete mode 100644 app/views/layouts/_base_development_group.html.erb delete mode 100644 app/views/layouts/_base_friend_group.html.erb delete mode 100644 app/views/layouts/_base_research_team.html.erb create mode 100644 app/views/projects/_development_group.html.erb create mode 100644 app/views/projects/_friend_group.html.erb create mode 100644 app/views/projects/_research_team.html.erb diff --git a/app/views/layouts/_base_development_group.html.erb b/app/views/layouts/_base_development_group.html.erb deleted file mode 100644 index 218fc186d..000000000 --- a/app/views/layouts/_base_development_group.html.erb +++ /dev/null @@ -1,52 +0,0 @@ -<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> - - <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> - - <% end %> - <% unless @project.enabled_modules.where("name = 'boards'").empty? %> - - <% end%> - <% unless @project.enabled_modules.where("name = 'files'").empty? %> - - <% end %> - <%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %> - <% if visible_repository?(@project) %> - - <% end %> - - - \ No newline at end of file diff --git a/app/views/layouts/_base_friend_group.html.erb b/app/views/layouts/_base_friend_group.html.erb deleted file mode 100644 index d1d7c530a..000000000 --- a/app/views/layouts/_base_friend_group.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> - - <% unless @project.enabled_modules.where("name = 'boards'").empty? %> - - <% end%> - <% unless @project.enabled_modules.where("name = 'files'").empty? %> - - <% end %> \ No newline at end of file diff --git a/app/views/layouts/_base_research_team.html.erb b/app/views/layouts/_base_research_team.html.erb deleted file mode 100644 index 83f6a78bb..000000000 --- a/app/views/layouts/_base_research_team.html.erb +++ /dev/null @@ -1,40 +0,0 @@ -<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> - - <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> - - <% end %> - <% unless @project.enabled_modules.where("name = 'boards'").empty? %> - - <% end%> - <% unless @project.enabled_modules.where("name = 'files'").empty? %> - - <% end%> \ No newline at end of file diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb index 83352de9d..35d8f87ef 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -20,5 +20,4 @@ !Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %> <%= exit_project_link(@project) %> <% end %> - diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 71975c5c3..beade0a7a 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -1,247 +1,245 @@ <% @nav_dispaly_project_label = 1 -@nav_dispaly_forum_label = 1 %> + @nav_dispaly_forum_label = 1 %> <%#@nav_dispaly_project_label = 1 %> - - - <%= h html_title %> - - - <%= csrf_meta_tag %> - <%= favicon %> - <%= javascript_heads %> - <%= heads_for_theme %> - <%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %> - <%= javascript_include_tag 'cookie','project', 'header','select_list_move' %> - <%= call_hook :view_layouts_base_html_head %> - - <%= yield :header_tags -%> + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= javascript_heads %> + <%= heads_for_theme %> + <%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %> + <%= javascript_include_tag 'cookie','project', 'header','select_list_move' %> + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> - - - - - -
- <%= render :partial => 'layouts/new_header'%> + else if($("#friend_organization").attr("checked") == "checked"){ + project_type = 3; + } + $.get( + url, + { project_type: project_type}, + function (data) { + if(data == 1) + { + $("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team), 1))%>"); + $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/development_group')) %>'); + $("#close_light").attr("onClick","close_window('development_group');"); + } + else if(data == 2) + { + $("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group), 2))%>"); + $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/research_team')) %>'); + $("#close_light").attr("onClick","close_window('research_group');"); + } + else if(data == 3) + { + $("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization), 3))%>"); + $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/friend_group')) %>'); + $("#close_light").attr("onClick","close_window('friend_organization');"); + } + else + { + alert("服务器异常,请与管理员联系"); + } + } + ); + } + + + + +
+ <%= render :partial => 'layouts/new_header'%> +
+ + +
+
+

+ + <%= l(:label_projects_community) %> + +

+ +
+ +
+
+
+
+ +
+ <%= l(:label_project_id)%><%= @project.id %> +
+ +
+ <% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%> + <% typeclass = @project.project_new_type == 1 ? "pr_kafa" : (@project.project_new_type == 2 ? "pr_keyan" : "pr_friend")%> + <%= render 'layouts/join_exit_project',{:text => text, :typeclass => typeclass} %> +
+ +
+
+ <%= link_to l(:label_project_name)+"#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %> + <% if @project.is_public? %> + <%= l(:label_public)%> + <% else %> + <%= l(:label_private)%> + <% end %> +
+
+ <% if @project.project_type == 0 %> + <%= l(:label_project_score)%> : + <%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects', + :action => 'show_projects_score', + :remote => true, + :id => @project.id}, :class => "c_orange f14" ) %> + <% end %> +
- -
-
-

- - <%= l(:label_projects_community) %> - -

- -
- - <%= form_tag(projects_search_path, :method => :get, :id => "project_search_form", :class => "search_form") do %> - <%= text_field_tag 'name', params[:name], :placeholder => "项目名称", :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %> - - <%= l(:label_search)%> - -
- + + -
-
-
-
- -
- <%= l(:label_project_id)%><%= @project.id %> -
- -
- <% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%> - <% typeclass = @project.project_new_type == 1 ? "pr_kafa" : (@project.project_new_type == 2 ? "pr_keyan" : "pr_friend")%> - <%= render 'layouts/join_exit_project',{:text => text, :typeclass => typeclass} %> -
- -
-
- <%= link_to l(:label_project_name)+"#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %> - <% if @project.is_public? %> - <%= l(:label_public)%> - <% else %> - <%= l(:label_private)%> - <% end %> -
-
-
- <% if @project.project_type == 0 %> - <%= l(:label_project_score)%> : - <%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects', - :action => 'show_projects_score', - :remote => true, - :id => @project.id - }, :class => "c_orange f14" ) %> - <% end %> -
- - -
- <%= l(:label_member) %>(<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'info_foot_num c_blue' %>) - - <%= l(:label_user_watcher) %>(<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'info_foot_num c_blue' %>) - - <%= l(:project_module_attachments) %>( - <% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> - <%= link_to "#{attaments_num}", project_files_path(@project), :class => 'info_foot_num c_blue' %>) -
-
-
- - - -
- - -
-
-

<%= l(:label_project_overview)%>:

-
- <%= textilizable(@project.description) if @project.description && !@project.description.blank? %> -
-
-
- - - - -
-
+ + <% end %> + + +
+ <% if @project.project_new_type == 1 || @project.project_new_type.nil? %> + <%= render :partial => 'projects/development_group', :locals => {:project => @project}%> + <% elsif @project.project_new_type == 2 %> + <%= render :partial => 'projects/research_team', :locals => {:project => @project}%> + <% else %> + <%= render :partial => 'projects/friend_group', :locals => {:project => @project}%> + <% end %> +
+ +
+
- -
-

<%= l(:label_tag)%>:

-
-
- <%= render :partial => 'tags/project_tag', :locals => {:obj => @project,:object_flag => "2"}%> -
-
-
-
-
-
+ +
+
+

<%= l(:label_project_overview)%>:

+
+ <%= textilizable(@project.description) if @project.description && !@project.description.blank? %> +
+
+
+ + + + +
+
-
- <%= render_flash_messages %> - <%= yield %> - <%= call_hook :view_layouts_base_content %> -
-
-
-
- <%= render :partial => 'layouts/new_footer'%> + +
+

<%= l(:label_tag)%>:

+
+
+ <%= render :partial => 'tags/project_tag', :locals => {:obj => @project,:object_flag => "2"}%> +
+
-
-
- - <% text = @project.project_new_type == 1 ? "development_group" : (@project.project_new_type == 2 ? "research_group" : "friend_organization")%> -
-
-

请选择项目类型:

-
    -
  • id="development_group"/>
  • -
  • id="research_group"/>
  • -
  • id="friend_organization"/>
  • -
- 确定 - -
+
-
123
- <%= render :partial => 'layouts/new_feedback' %> - - - <%= call_hook :view_layouts_base_body_bottom %> - +
+ +
+ <%= render_flash_messages %> + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+
+
+
+ <%= render :partial => 'layouts/new_footer'%> +
+
+
+ + <% text = @project.project_new_type == 1 ? "development_group" : (@project.project_new_type == 2 ? "research_group" : "friend_organization")%> +
+
+

请选择项目类型:

+
    +
  • id="development_group"/>
  • +
  • id="research_group"/>
  • +
  • id="friend_organization"/>
  • +
+ 确定 + +
+
+
123
+<%= render :partial => 'layouts/new_feedback' %> + + +<%= call_hook :view_layouts_base_body_bottom %> + diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb new file mode 100644 index 000000000..7f79fc5f1 --- /dev/null +++ b/app/views/projects/_development_group.html.erb @@ -0,0 +1,52 @@ +<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> + +<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + +<% end %> +<% unless @project.enabled_modules.where("name = 'boards'").empty? %> + +<% end%> +<% unless @project.enabled_modules.where("name = 'files'").empty? %> + +<% end %> +<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %> +<% if visible_repository?(@project) %> + +<% end %> + + + \ No newline at end of file diff --git a/app/views/projects/_friend_group.html.erb b/app/views/projects/_friend_group.html.erb new file mode 100644 index 000000000..dca5473f7 --- /dev/null +++ b/app/views/projects/_friend_group.html.erb @@ -0,0 +1,29 @@ +<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> + +<% unless @project.enabled_modules.where("name = 'boards'").empty? %> + +<% end%> +<% unless @project.enabled_modules.where("name = 'files'").empty? %> + +<% end %> \ No newline at end of file diff --git a/app/views/projects/_research_team.html.erb b/app/views/projects/_research_team.html.erb new file mode 100644 index 000000000..2a0ad1ef3 --- /dev/null +++ b/app/views/projects/_research_team.html.erb @@ -0,0 +1,40 @@ +<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> + +<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + +<% end %> +<% unless @project.enabled_modules.where("name = 'boards'").empty? %> + +<% end%> +<% unless @project.enabled_modules.where("name = 'files'").empty? %> + +<% end%> \ No newline at end of file From 6c6ae38f7a18b149746dfc0ed05dc99267edc7ca Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 19 May 2015 10:19:49 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=A7=81=E6=9C=89=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/application.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index edde12527..85ef3240a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1904,6 +1904,18 @@ input.autocomplete.ajax-loading { background-image: url(../images/loading.gif); } +.private_project { + position: relative; + bottom: 2px; + text-transform: uppercase; + background: #d22; + color: #fff; + font-weight: bold; + padding: 0px 2px 0px 2px; + font-size: 60%; + margin-right: 2px; + border-radius: 2px; +} /***** Flash & error messages ****/ #errorExplanation, div.flash, .nodata, .warning, .conflict { padding: 4px 4px 4px 30px; From 5cb9cc0903b737ad2cee8a34573f18e746d0c368 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Tue, 19 May 2015 10:35:17 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug#2211:course?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5--=E8=BF=98=E6=9C=89=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=AF=BE=E7=A8=8B=E8=80=81=E5=B8=88=E7=9A=84?= =?UTF-8?q?=E5=A7=93=E5=90=8D=E5=B0=B1=E4=B8=8D=E8=A6=81=E4=BB=A5=E7=9C=81?= =?UTF-8?q?=E7=95=A5=E5=8F=B7=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/_course_list.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb index 0d979c769..111c0abb1 100644 --- a/app/views/welcome/_course_list.html.erb +++ b/app/views/welcome/_course_list.html.erb @@ -5,13 +5,13 @@
- +
<% unless course.is_public == 1 %> <%= l(:label_private) %> <% end %> - <%= link_to(course.name.truncate(25, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> + <%= link_to(course.name+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> - +
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> <%#=course.try(:teacher).try(:name)%> From 895058f38ecb81c2a0eca44b12fba663516264a0 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Tue, 19 May 2015 11:30:31 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug#2154:=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E4=B8=8A=E4=BC=A0=E8=AF=BE=E4=BB=B6=EF=BC=8C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E8=B5=84=E6=BA=90=E6=95=B0=E7=BB=9F=E8=AE=A1=E6=9C=AA?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/create.js.erb | 2 ++ app/views/layouts/base_courses.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb index b00ae3612..87bf5b864 100644 --- a/app/views/files/create.js.erb +++ b/app/views/files/create.js.erb @@ -27,6 +27,8 @@ $('#upload_file_div').slideToggle('slow'); <%elsif @course%> closeModal(); $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>'); + $("#courses_files_count_info").html("<%= @all_attachments.count%>"); + $("#courses_files_count_nav").html("(<%= @all_attachments.count%>)") <% end %> <% end %> $(document).ready(img_thumbnails); diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 6820ccaf3..070a99d08 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -95,7 +95,7 @@ <%= l(:label_account_identity_student)%>(<%= course_student_link student_num %>) - <%= l(:project_module_attachments)%>(<%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue' %>)
+ <%= l(:project_module_attachments)%>(<%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue',:id=>'courses_files_count_info' %>)
@@ -127,7 +127,7 @@