diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 823db4729..ebd7ab064 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1724,6 +1724,10 @@ module ApplicationHelper candown end + def project_type_link text + link_to "#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type" + end + private def wiki_helper diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 4a790790e..fc2afe0f7 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -386,4 +386,5 @@ module ProjectsHelper end type end + end diff --git a/app/views/files/_project_file_new.html.erb b/app/views/files/_project_file_new.html.erb index 89088a295..0ec274ee8 100644 --- a/app/views/files/_project_file_new.html.erb +++ b/app/views/files/_project_file_new.html.erb @@ -46,7 +46,7 @@
<%= form_tag( search_project_project_files_path(@project), method: 'get',:class => "re_search f_l",:remote=>true) do %> <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> - <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %> + <%= submit_tag "站内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %> <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% end %> <% manage_allowed = User.current.allowed_to?(:manage_files, @project) %> diff --git a/app/views/layouts/_base_development_group.html.erb b/app/views/layouts/_base_development_group.html.erb new file mode 100644 index 000000000..f8e27a570 --- /dev/null +++ b/app/views/layouts/_base_development_group.html.erb @@ -0,0 +1,54 @@ +<% 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%> + <% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %> + + <% 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 new file mode 100644 index 000000000..c367882e5 --- /dev/null +++ b/app/views/layouts/_base_friend_group.html.erb @@ -0,0 +1,31 @@ +<% 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 new file mode 100644 index 000000000..811a58961 --- /dev/null +++ b/app/views/layouts/_base_research_team.html.erb @@ -0,0 +1,42 @@ +<% 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 a5269d422..5d7c9210e 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -8,9 +8,8 @@ <%= join_in_project_link(@project, User.current) %> <% end %> - <% if ((User.current.member_of? @project) && - User.current.login? && - Member.where(:user_id => User.current.id, :project_id=>@project.id).first.roles.first.to_s != "Manager") %> - <%= exit_project_link(@project) %> + <% if ((User.current.member_of? @project) && User.current.login? && User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) %> + <%= link_to "#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %> + <%= link_to "#{l(:label_friend_organization)}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%> <% end %>
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 79847fab9..467be2758 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -17,6 +17,26 @@ <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> + + + @@ -90,6 +110,7 @@ }, :class => "c_orange f14" ) %> <% end %> +
<%= l(:label_member) %>(<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'info_foot_num c_blue' %>) @@ -102,6 +123,7 @@
+
+
@@ -179,6 +153,7 @@
+

<%= l(:label_tag)%>:

@@ -203,6 +178,22 @@ <%= render :partial => 'layouts/new_footer'%>
+
+ + +
+
+

请选择项目类型:

+ + 确定 + +
+
+
123
diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb index f62b0822a..570ba3426 100644 --- a/app/views/projects/_tools_expand.html.erb +++ b/app/views/projects/_tools_expand.html.erb @@ -1,8 +1,3 @@ -
  • - <% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %> - <%= link_to l(:label_settings), settings_project_path(@project) %> - <% end %> -
  • <% unless @project.enabled_modules.where("name = 'news'").empty? %> <%= link_to l(:project_module_news), project_news_index_path(@project) %> @@ -18,16 +13,16 @@ <%= link_to l(:project_module_code_review), {controller: 'code_review', action: 'index', id: @project.id} %> <% end %>
  • -
  • - <% unless @project.enabled_modules.where("name = 'calendar'").empty? %> - <%= link_to l(:project_module_calendar),project_calendar_path(@project) %> - <% end %> -
  • -
  • - <% unless @project.enabled_modules.where("name = 'gantt'").empty? %> - <%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %> - <% end %> -
  • + + + + + + + + + +
  • <% unless @project.enabled_modules.where("name = 'documents'").empty? %> <%= link_to l(:project_module_documents), project_documents_path(@project) %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index b3ddf6a26..d32d7baa6 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -48,10 +48,7 @@
    <%= h(e.project) if @project.nil? || @project.id != e.project_id %> - <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> - <%= l(:label_new_activity) %> : - - <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id), :class => "problem_tit fl fb") %> + <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"}, :class => "problem_tit fl fb" %>
    diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index ecc9fe7c3..99f8bafca 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -53,7 +53,10 @@ zh: label_exit_project: 退出项目 label_apply_project_waiting: 已处理申请,请等待管理员审核 label_unapply_project: 取消申请 - lable_sure_exit_project: 是否确认退出该项目 + lable_sure_exit_project: 是否确认退出该项目 + label_friend_organization: 朋友圈 + label_research_group: 科研组 + label_development_team: 开发组 label_member: 成员 project_module_attachments: 资源 diff --git a/db/migrate/20150409092151_add_project_new_type_to_project.rb b/db/migrate/20150409092151_add_project_new_type_to_project.rb new file mode 100644 index 000000000..68f22b5ad --- /dev/null +++ b/db/migrate/20150409092151_add_project_new_type_to_project.rb @@ -0,0 +1,5 @@ +class AddProjectNewTypeToProject < ActiveRecord::Migration + def change + add_column :projects, :project_new_type, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index b149a870b..f9ade5aa4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150309090143) do +ActiveRecord::Schema.define(:version => 20150409092151) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -422,6 +422,22 @@ ActiveRecord::Schema.define(:version => 20150309090143) do add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + create_table "delayed_jobs", :force => true do |t| + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -638,16 +654,6 @@ ActiveRecord::Schema.define(:version => 20150309090143) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_details_copy", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" @@ -963,25 +969,26 @@ ActiveRecord::Schema.define(:version => 20150309090143) do end create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false + t.string "name", :default => "", :null => false t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false t.integer "parent_id" t.datetime "created_on" t.datetime "updated_on" t.string "identifier" - t.integer "status", :default => 1, :null => false + t.integer "status", :default => 1, :null => false t.integer "lft" t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false + t.boolean "inherit_members", :default => false, :null => false t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 t.integer "user_id" - t.integer "dts_test", :default => 0 + t.integer "dts_test", :default => 0 t.string "enterprise_name" t.integer "organization_id" + t.integer "project_new_type" end add_index "projects", ["lft"], :name => "index_projects_on_lft" @@ -1069,12 +1076,12 @@ ActiveRecord::Schema.define(:version => 20150309090143) do end create_table "roles", :force => true do |t| - t.string "name", :limit => 90 - t.integer "position" - t.boolean "assignable" - t.integer "builtin" + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "assignable", :default => true + t.integer "builtin", :default => 0, :null => false t.text "permissions" - t.string "issues_visibility", :limit => 90 + t.string "issues_visibility", :limit => 30, :default => "default", :null => false end create_table "schools", :force => true do |t| @@ -1445,4 +1452,16 @@ ActiveRecord::Schema.define(:version => 20150309090143) do t.datetime "updated_at", :null => false end + create_table "zip_packs", :force => true do |t| + t.integer "user_id" + t.integer "homework_id" + t.string "file_digest" + t.string "file_path" + t.integer "pack_times", :default => 1 + t.integer "pack_size", :default => 0 + t.string "file_digests" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + end diff --git a/public/images/leftside.png b/public/images/leftside.png index c927f9eb5..0b144f330 100644 Binary files a/public/images/leftside.png and b/public/images/leftside.png differ diff --git a/public/images/public_icon.png b/public/images/public_icon.png index 7134ded42..a815691f8 100644 Binary files a/public/images/public_icon.png and b/public/images/public_icon.png differ diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 2628ce1b5..91b4f41da 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -401,11 +401,6 @@ $(function(){ } }); -//将右侧的最小高度设置成左侧高度,美化界面 -$(document).ready(function () { - $("#RSide").css("min-height",$("#LSide").height()-30); -}); - // 日历选择日期后关闭 function regexDeadLine() { diff --git a/public/javascripts/header.js b/public/javascripts/header.js index e5363f8d5..e27f758d3 100644 --- a/public/javascripts/header.js +++ b/public/javascripts/header.js @@ -38,4 +38,9 @@ $(document).ready(function () { addSlipMenu(); addProjectSlipMenu (); addCourseSlipMenu(); +}); + +//将右侧的最小高度设置成左侧高度,美化界面 +$(document).ready(function () { + $("#RSide").css("min-height",$("#LSide").height()-30); }); \ No newline at end of file diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 6dc772f1e..52d96f2d7 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -130,6 +130,7 @@ function submitFocus(obj) //当项目描述长度小于112px时,不显示更多按钮 $(function(){ +// alert($("#course_description_content").height()); if($("#course_description_content").height()>112) { $("#lg-foot").show(); @@ -144,4 +145,18 @@ function course_setting(id) $('#tbc_0'+id).removeClass().addClass("dis"); $('#tb_'+(3-id)).removeClass().addClass("hwork_normaltab"); $('#tbc_0'+(3-id)).removeClass().addClass("undis"); -} \ No newline at end of file +} + +//项目类型 +function show_window () { + $('#light').css('display','block'); + $('#fade').css('display','block'); +} + +function close_window(type){ + $('#light').css('display','none'); + $('#fade').css('display','none'); + + $("#" + type).attr("checked","checked"); +} +//弹框l \ No newline at end of file diff --git a/public/stylesheets/pleft.css b/public/stylesheets/pleft.css index f20a123c9..7a87c3c77 100644 --- a/public/stylesheets/pleft.css +++ b/public/stylesheets/pleft.css @@ -16,6 +16,9 @@ a:hover.pr_join_a{ background:#41a8c8;} .pr_close{ display:block; background:url(../images/leftside.png) -1px -49px no-repeat; width:11px; height:11px; margin-top:3px; float:left; } .pr_add{display:block; background:url(../images/leftside.png) 0px -71px no-repeat; width:11px; height:11px; margin-top:3px; float:left; } .pr_arrow{display:block; background:url(../images/leftside.png) 0px -90px no-repeat; width:11px; height:11px; margin-top:3px; float:left; } +.pr_friend{display:block; background:url(../images/leftside.png) 0px -112px no-repeat; width:12px; height:11px; margin-top:4px; float:left; } +.pr_keyan{display:block; background:url(../images/leftside.png) 0px -135px no-repeat; width:12px; height:11px; margin-top:4px; float:left; } +.pr_kafa{display:block; background:url(../images/leftside.png) 0px -156px no-repeat; width:12px; height:11px; margin-top:4px; float:left; } .pr_info_name{ color:#3e4040; font-size:14px; line-height:1.5;} .pr_info_name:hover{ color:#3ca5c6;} .pr_info_score{ font-size:14px; color:#3e4040; } @@ -47,7 +50,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;} .course_description_none{max-height: none;} -.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;} +.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;} /****标签(和资源库的tag样式一致)***/ .project_Label{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 77d4db195..b01c2a7e0 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -126,6 +126,8 @@ a:hover.grey_btn{ background:#717171; color:#fff;} .blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 10px; text-align:center;} a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;} a:hover.blue_btn{ background:#329cbd;} +a.orange_btn{ background:#ff5722;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center; } +a:hover.orange_btn{ background:#d63502;} .nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;} .more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;} .upbtn{ margin:42px 0 0 10px; border:none;} @@ -362,3 +364,4 @@ div.flash.warning, .conflict { .floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;} a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;} a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} +.white_content02{display:none;position:fixed;top:15%;left:30%;width:200px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}