diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9418f4749..228f57ab6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -28,7 +28,6 @@ module ApplicationHelper include AvatarHelper ## added by william include PraiseTreadHelper - # add by nyan include CoursesHelper extend Forwardable @@ -1330,7 +1329,7 @@ module ApplicationHelper def hubspot_head tags = javascript_include_tag('hubspot/messenger.min', 'hubspot/messenger-theme-future') - tags << stylesheet_link_tag('hubspot/messenger', 'hubspot/messenger-theme-future') + tags << stylesheet_link_tag('hubspot/messenger', 'hubspot/messenger-theme-future', 'hubspot/messenger-theme-flat') unless User.current.pref.warn_on_leaving_unsaved == '0' tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });") end diff --git a/app/models/project.rb b/app/models/project.rb index 1c672c5fc..20c5de89b 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -122,7 +122,8 @@ class Project < ActiveRecord::Base after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?} after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?} - after_save :create_board_sync #nyan + # 创建project之后默认创建一个board,之后的board去掉了board的概念 + after_save :create_board_sync before_destroy :delete_all_members def remove_references_before_destroy return if self.id.nil? diff --git a/app/views/applied_project/_set_applied.js.erb b/app/views/applied_project/_set_applied.js.erb index e77592060..7403b963b 100644 --- a/app/views/applied_project/_set_applied.js.erb +++ b/app/views/applied_project/_set_applied.js.erb @@ -1,4 +1,13 @@ <% selector = ".#{applied_css(@project)}" %> $("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript applied_link(@project, User.current) %>")}); - - +if (window.Messenger) { + Messenger.options = { + extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right', + theme: 'flat' + } + Messenger().post({ + id: "label_apply_project_waiting", + message: "<%= l(:label_apply_project_waiting) %>", + showCloseButton: true, + }); +}; diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 35c414699..1381df74a 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -3,7 +3,12 @@
- +
<%= l(:label_task_plural)%>(<%= @homework_list.count%>)<%= l(:label_task_plural)%>(<%= @homework_list.count%>) + <%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if( + User.current.admin? || + !(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) || + (Rails.env.development?) %> + <% end %> <% display_id = im_watching_student_id? @bid%> -<%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;display: inline-block;" if( - User.current.admin? || - !(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) || - (Rails.env.development?) %> <% @homework_list.each do |homework|%> <% if homework.attachments.any?%> diff --git a/app/views/bids/show_project.html.erb b/app/views/bids/show_project.html.erb index d5676c3c8..c14d2e14c 100644 --- a/app/views/bids/show_project.html.erb +++ b/app/views/bids/show_project.html.erb @@ -32,18 +32,16 @@
-
+
- <% if @bid.reward_type == 3 %> + <% if @bid.reward_type == Bid::Homework %> diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 6aef01e1d..f4857bd22 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -2,7 +2,7 @@
<%= select_tag 'bid', options_for_select(select_option_helper(@option)), :name => 'bid', :class => 'grayline' %> -

<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
-

<%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason_homework), :style => "resize: none;", :class => 'noline' %>