diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 9d51e5839..0199e4d90 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -756,7 +756,7 @@ class AdminController < ApplicationController # 单位审核:批准 # 消息发送,发送对象为申请人 - # status: 0表示未批准; status:1表示已批准; status: 2表示已更改; status: 3表示已拒绝; + # status: 0表示未批准; status:1表示已批准; status: 2表示已更改; status: 3表示已拒绝; status: 4表示已更改后废除的高校 def approve_applied_schools applied_school = ApplyAddSchools.find params[:id] applied_message_id = applied_school.school_id @@ -783,8 +783,8 @@ class AdminController < ApplicationController begin #更新消息表的status applied_message_id = aas.school_id - #applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools") - #applied_message.update_all(:status => 2) + applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools") + applied_message.update_all(:status => 4) aas.update_attribute(:status, 2) AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name ) users = UserExtensions.where("school_id = #{aas.school_id}") diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb index 9fb6e44d7..90b6068f3 100644 --- a/app/views/files/_project_file.html.erb +++ b/app/views/files/_project_file.html.erb @@ -79,7 +79,7 @@ <%#= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% if User.current.member_of?(@project) %> - + 上传资源 <%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :project_id => @project.id), :class => "blue-btn fr mr5", :remote => true) %> <% end %> diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index a230c21df..c2dfdaa0c 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -259,9 +259,11 @@ <% update_visiti_count @user %>
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 560c10d8f..9e9a6e641 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -6,8 +6,8 @@ <% message.update_attribute(:viewed, true)%>
<% end %> -
-
  提示:  您尚未完善您的基本资料,完善后可使用更多功能
+
+
  提示:  您尚未完善您的基本资料,完善后可使用更多功能
<% end %>
diff --git a/app/views/users/_my_manage_issue_list.html.erb b/app/views/users/_my_manage_issue_list.html.erb index 39947a00b..37396f721 100644 --- a/app/views/users/_my_manage_issue_list.html.erb +++ b/app/views/users/_my_manage_issue_list.html.erb @@ -1,85 +1,59 @@ <% unless activity.author.nil? %> -
-
- <% if activity.status_id.to_i == 5 %> - - <% else %> - - <% end %> -
-
- -
-

<%= format_time(activity.created_on) %> 发布

-

<%= format_time(activity.updated_on) %> 更新

-
-
-
    -
  • - <%= Project.find(activity.project_id).name %> -
  • -
  • - <% case activity.tracker_id %> - <% when 1 %> - 缺陷 - <% when 2 %> - 功能 - <% when 3 %> - 支持 - <% when 4 %> - 任务 - <% when 5 %> - 周报 - <% end %> -
  • -
  • - <% if !activity.assigned_to_id.nil? && activity.assigned_to_id != 0 %> - <% if activity.try(:assigned_to).try(:realname).blank? %> - <%= link_to activity.assigned_to, user_path(activity.assigned_to_id)%> - <% else %> - <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id)%> - <% end %> - <% end %>
  • -
  • - <%= activity.priority.name %> -
  • - -
  • <%= activity.fixed_version %>
  • -
  • <%= activity.status.name %>
  • -
  • <%= activity.done_ratio %>%
  • -
  • - <% if activity.journals.count > 0 %> - - <%= activity.journals.count %> - <% end %> -
  • -
+ + +
+ <% if activity.status_id.to_i == 5 %> + + <% else %> + + <% end %>
+
+ +
+

<%= format_time(activity.created_on) %>发布

+

<%= format_time(activity.updated_on) %>更新

+
+
+ + <%= Project.find(activity.project_id).name %> + + <% case activity.tracker_id %> + <% when 1 %> + 缺陷 + <% when 2 %> + 功能 + <% when 3 %> + 支持 + <% when 4 %> + 任务 + <% when 5 %> + 周报 + <% end %> + + + <% if !activity.assigned_to_id.nil? && activity.assigned_to_id != 0 %> + <% if activity.try(:assigned_to).try(:realname).blank? %> + <%= link_to activity.assigned_to, user_path(activity.assigned_to_id)%> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id)%> + <% end %> + <% end %> + + <%= activity.priority.name %> + <%= activity.fixed_version %> + <%= activity.status.name %> + <%= activity.done_ratio %>% + + <% if activity.journals.count > 0 %> + + <%= activity.journals.count %> + <% end %> + + <% end %> - - - diff --git a/app/views/users/_user_manage_issue_list.html.erb b/app/views/users/_user_manage_issue_list.html.erb index 78fbef88a..0b67cd1e3 100644 --- a/app/views/users/_user_manage_issue_list.html.erb +++ b/app/views/users/_user_manage_issue_list.html.erb @@ -1,24 +1,3 @@ <% issue_list(issues) do |issue| -%> - <%= render :partial => 'users/my_manage_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %> -<% end %> - -
-
-
    - <%= link_to "导出EXCEL", user_manage_issues_user_path(:format => 'xls'), :class => "hw_btn_blue ml10 mt10 mb10", :id => "sendexcel", - :onclick => "remote_function_export('#{User.current}')"%> -
- -
-
-
    - <%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> -
-
-
-
+<% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb index babf72099..72799e63e 100644 --- a/app/views/users/_user_message_applied.html.erb +++ b/app/views/users/_user_message_applied.html.erb @@ -1,5 +1,5 @@ -<% if ma.applied_type == "ApplyAddSchools" %> +<% if ma.applied_type == "ApplyAddSchools" && ma.status != 4 %>
  • diff --git a/app/views/users/_user_message_applied_school_action.html.erb b/app/views/users/_user_message_applied_school_action.html.erb index d08601d64..c0658ced5 100644 --- a/app/views/users/_user_message_applied_school_action.html.erb +++ b/app/views/users/_user_message_applied_school_action.html.erb @@ -10,6 +10,6 @@ <%= link_to "“"+ma.name+"”" + "的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%> <% elsif ma.status == 0 %> - <%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %> + <%= link_to "“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %> <% end %> \ No newline at end of file diff --git a/app/views/users/all_journals.js.erb b/app/views/users/all_journals.js.erb index 05467dd7f..5cd133e81 100644 --- a/app/views/users/all_journals.js.erb +++ b/app/views/users/all_journals.js.erb @@ -45,7 +45,6 @@ $('#reply_div_<%= params[:div_id].to_i %>').html('<%= escape_javascript(render : :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :activity => @activity}) %>'); -sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity"); <% elsif params[:type] == 'is_project_message' %> $('#reply_div_<%= params[:div_id].to_i %>').html('<%= escape_javascript(render :partial => 'projects/project_message_replies', :locals => {:comments => @journals, @@ -53,3 +52,5 @@ sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity :type => @type, :activity_id => params[:id].to_i}) %>'); <% end %> +// 创建回复框 +sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity"); \ No newline at end of file diff --git a/app/views/users/user_manage_issues.html.erb b/app/views/users/user_manage_issues.html.erb index c66b18948..1675dc174 100644 --- a/app/views/users/user_manage_issues.html.erb +++ b/app/views/users/user_manage_issues.html.erb @@ -214,10 +214,10 @@ }); }); $(document).ready(function(){ - if($.browser.webkit){ + if($.browser.webkit){ $("#issues_filter_por").css("padding-left","5px"); $("#issue_filter_status").css("padding-left","15px"); - } + } }); @@ -254,52 +254,47 @@
- -
-
    -
  • - 搜索结果 - <%= render :partial => "users/my_issue_filter_all" %> -
  • -
    -
-
-
+ + + + + + + + + + + + + + + + <% if @issues.empty? %> +

<%= l(:label_no_data) %>

+ <% else %> + <%= render :partial => 'users/user_manage_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages, :issue_count => @issue_count, :subject => @subject } %> + <% end %> + +

搜索结果<%= @issue_count %>

<%= select( :project, :project_id, options_for_issue_project_list(@issues_filter), - { :include_blank => false,:selected => @project_id ? @project_id : 0 }, - { :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style => "margin: 0 15px;text-align: left;"} - )%> - - - <%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["指派给",0]), - { :include_blank => false, :selected => @assigned_to ? @assigned_to : 0}, - {:onchange=>"remote_function();add_style();",:id => "assigned_to_id",:name => "assigned_to_id", :class => "fl", :style => "visibility:hidden; width:0px;margin:0px;padding:0px;"} ) - %> - - - - - + { :include_blank => false, :selected => @project_id ? @project_id : 0 }, + { :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id" } + )%> + 类型指派给优先度里程碑状态完成度 
+
+
+
    + <%= link_to "导出EXCEL", user_manage_issues_user_path(:format => 'xls'), :class => "hw_btn_blue mb10", :id => "sendexcel", + :onclick => "remote_function_export('#{User.current}')"%> +
+ +
+
+
    + <%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> +
- <% end %> - <% if @issues.empty? %> -

<%= l(:label_no_data) %>

- <% else %> -
- <%= render :partial => 'users/user_manage_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages, :issue_count => @issue_count, :subject => @subject } %>
<% end %>
diff --git a/app/views/users/user_manage_issues.js.erb b/app/views/users/user_manage_issues.js.erb index 7a24c05f4..12de45705 100644 --- a/app/views/users/user_manage_issues.js.erb +++ b/app/views/users/user_manage_issues.js.erb @@ -1,3 +1,6 @@ -$("#issue_filter_all").html("<%= escape_javascript(render :partial => 'users/my_issue_filter_all') %>"); -$("#issue_list").html("<%= escape_javascript(render :partial => 'users/user_manage_issue_list',:locals => {:issues => @issues, :issue_pages=> @issue_pages, :issue_count => @issue_count })%>"); +$("#issue_filter_all").html("<%= @issue_count %>"); +$("#issue_list").html("<%= escape_javascript(render :partial => 'users/user_manage_issue_list', + :locals => {:issues => @issues, + :issue_pages=> @issue_pages, + :issue_count => @issue_count })%>"); $("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>'); \ No newline at end of file diff --git a/db/migrate/20170303030731_update_status_for_applied_messages.rb b/db/migrate/20170303030731_update_status_for_applied_messages.rb new file mode 100644 index 000000000..89ed96ec4 --- /dev/null +++ b/db/migrate/20170303030731_update_status_for_applied_messages.rb @@ -0,0 +1,8 @@ +class UpdateStatusForAppliedMessages < ActiveRecord::Migration + def up + AppliedMessage.where(:applied_type => "ApplyAddSchools", :status => 0).update_all(:status => 4) + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index f8771be44..e806883e3 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 => 20170219070127) do +ActiveRecord::Schema.define(:version => 20170303030731) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1064,12 +1064,39 @@ ActiveRecord::Schema.define(:version => 20170219070127) do add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" + create_table "homework_bank_tests", :force => true do |t| + t.text "input" + t.text "output" + t.boolean "test_type" + t.integer "homework_bank_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "homework_banks", :force => true do |t| + t.integer "user_id" + t.string "name" + t.text "description" + t.integer "homework_type" + t.integer "quotes", :default => 0 + t.boolean "is_public" + t.string "language" + t.text "standard_code", :limit => 2147483647 + t.integer "min_num" + t.integer "max_num" + t.boolean "base_on_project" + t.string "applicable_syllabus" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "homework_commons", :force => true do |t| t.string "name" t.integer "user_id" t.text "description" - t.date "publish_time" - t.date "end_time" + t.datetime "publish_time" + t.datetime "end_time" t.integer "homework_type", :default => 1 t.string "late_penalty" t.integer "course_id" @@ -1137,6 +1164,16 @@ ActiveRecord::Schema.define(:version => 20170219070127) do add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + create_table "homework_samples", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_samples", ["homework_common_id"], :name => "index_homework_samples_on_homework_common_id" + create_table "homework_tests", :force => true do |t| t.text "input" t.text "output" @@ -1154,6 +1191,19 @@ ActiveRecord::Schema.define(:version => 20170219070127) do t.datetime "updated_at", :null => false end + create_table "ii", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + create_table "innodb_monitor", :id => false, :force => true do |t| t.integer "a" end @@ -2264,7 +2314,8 @@ ActiveRecord::Schema.define(:version => 20170219070127) do t.datetime "updated_at", :null => false t.integer "author_id" t.integer "status", :limit => 1, :default => 0 - t.integer "position", :limit => 1, :default => 0 + t.integer "position", :limit => 1 + t.integer "result", :default => 0 end create_table "user_actions", :force => true do |t| diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 0b554ed6d..da479de6d 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -661,12 +661,14 @@ a:hover.pro-fenzhi-a{color:#3b94d6;} .pro-task-new-con input{ border:1px solid #c8c8c8; height: 28px; width: 200px; color: #888;} .pro-task-new-con textarea{ width: 881px;border:1px solid #c8c8c8;} .pro-task-new-con input.input-big{ width: 881px;} -.issues-table{ width: 100%;} -.issues-table select{ border: none; width: 100px; color:#888; font-weight: bold;appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;} +.issues-table{ width: 100%; border:1px solid #c8c8c8; border-bottom: none;} +.issues-table select{ border: none; color:#888; font-weight: bold; text-align: center; width:50px; padding-left:0; -webkit-appearance: none;appearance: none; + -moz-appearance: none; background: url("/images/new_project/arrow.png") no-repeat scroll right center transparent;} .issues-table tr th{ height: 40px; border-bottom:1px solid #e5e5e5; color: #888;} .issues-table p.text-left{ text-align: left; color: #333; border-bottom: 3px solid #3498db; display: block; width: 100px; height:40px; line-height: 40px; padding-left:15px;} -.issues-table tr td{ padding:10px 0; border-bottom: 1px dashed #c8c8c8; text-align: center; color:#888;} -.issues-table tr td.w50{ width: 60px;} +.issues-table tr td{ padding:10px 0; border-bottom: 1px solid #e5e5e5; text-align: center; color:#888;} +.issues-table tr td.w50{ width: 50px;} +.issues-table tr td.w100{ width: 100px;} .issues-table tbody tr:hover{ background:#f2f2f2;} .issues-table tr td span.w100{ display: inline-block; width: 100px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis; } span.task-linebtn-green{color:#59af48; border: 1px solid #59af48;font-size: 12px; padding: 0 5px; border-radius: 3px;line-height: 14px;} @@ -676,3 +678,5 @@ span.task-step{ color:#ee4a20;font-style: italic; font-weight:bold; font-size:14 .task-bgrey{background:#ccc;} .task-title{ width: 830px;} a.task-list-title{ max-width: 700px;} + +