From e4ff85894d349ddb5ad786bfa5b3dfe74ed266cc Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 17 Oct 2014 15:02:09 +0800 Subject: [PATCH 01/44] =?UTF-8?q?1=E3=80=81=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BC=98=E5=8C=96=E3=80=822=E3=80=81=E6=9C=AA?= =?UTF-8?q?=E5=8F=82=E5=8A=A0=E8=AF=BE=E7=A8=8B=E6=88=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84tab=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReadMe.txt | 9 +++++++++ app/controllers/admin_controller.rb | 8 ++++---- app/controllers/application_controller.rb | 2 +- app/controllers/users_controller.rb | 20 +++++++++++++++++--- app/models/contesting_project.rb | 7 ++++--- app/views/layouts/_base_footer.html.erb | 6 ++---- app/views/layouts/base_users.html.erb | 2 +- config/routes.rb | 9 +++++---- lib/redmine.rb | 20 ++++++++++++++++++-- lib/redmine/menu_manager.rb | 2 +- 10 files changed, 62 insertions(+), 23 deletions(-) diff --git a/ReadMe.txt b/ReadMe.txt index 538457d3d..895e7ffb8 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -88,3 +88,12 @@ bundle exec rake db:migrate:down VERSION=20140811022947 bundle exec rake db:migrate:up VERSION=20140811022947 bundle exec rake db:migrate bundle exec rake project_score:calculate +=================================[2014-10-17]==================================== +kw:数据迁移,web_footer_oranizers表已存在 +bundle exec rake db:migrate:down VERSION=20141013014908 +bundle exec rake db:migrate:up VERSION=20141013014908 +bundle exec rake db:migrate +kw:数据迁移,web_footer_companies表已存在 +bundle exec rake db:migrate:down VERSION=20141013023400 +bundle exec rake db:migrate:up VERSION=20141013023400 +bundle exec rake db:migrate diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 7b4e326ad..f3b8b421a 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -159,7 +159,7 @@ class AdminController < ApplicationController respond_to do |format| flash[:notice] = l(:notice_successful_update) format.html { - redirect_to admin_first_page_made_url + redirect_to first_page_made_url } format.api { render_api_ok } #format.json { render json: @first_page, status: :created, location: @first_page } @@ -194,7 +194,7 @@ class AdminController < ApplicationController respond_to do |format| format.html { flash[:notice] = l(:notice_successful_update) - redirect_to admin_course_page_made_url + redirect_to course_page_made_url } format.api { render_api_ok } end @@ -235,7 +235,7 @@ class AdminController < ApplicationController respond_to do |format| format.html { flash[:notice] = l(:notice_successful_update) - redirect_to admin_contest_page_made_url + redirect_to contest_page_made_url } format.api { render_api_ok } end @@ -270,7 +270,7 @@ class AdminController < ApplicationController respond_to do |format| format.html { flash[:notice] = l(:notice_successful_update) - redirect_to admin_web_footer_made_url + redirect_to web_footer_made_url } format.api { render_api_ok } end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7f3dc0203..1d94d9a7c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -766,7 +766,7 @@ class ApplicationController < ActionController::Base end def find_web_footer - @organize = WebFooterOranizer.first + @organizer = WebFooterOranizer.first @companies = WebFooterCompany.all end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9d1bb1472..21adfa19e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -39,9 +39,10 @@ class UsersController < ApplicationController :user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, - :activity_new_score_index, :influence_new_score_index, :score_new_index] + :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index] before_filter :auth_user_extension, only: :show before_filter :rest_user_score, only: :show + #before_filter :select_entry, only: :user_projects accept_api_auth :index, :show, :create, :update, :destroy,:tag_save , :tag_saveEx #william @@ -80,6 +81,21 @@ class UsersController < ApplicationController end end + def user_projects_index + if User.current.admin? + memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}").first + else + cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" + memberships = @user.memberships.all(:conditions => cond).first + end + watch_projects = Project.joins(:watchers).where("project_type <>? and watchable_type = ? and `watchers`.user_id = ?", '1','Project', @user.id).first + if memberships.nil? && watch_projects + redirect_to(:watch_projects_user) and return + else + redirect_to(:user_projects_user) and return + end + end + #added by young def user_projects @@ -92,8 +108,6 @@ class UsersController < ApplicationController #events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20) #@events_by_day = events.group_by(&:event_date) @state = 0 - - #add by huang unless User.current.admin? if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?) diff --git a/app/models/contesting_project.rb b/app/models/contesting_project.rb index 3db6d6f86..9828bb598 100644 --- a/app/models/contesting_project.rb +++ b/app/models/contesting_project.rb @@ -7,9 +7,10 @@ class ContestingProject < ActiveRecord::Base DESCRIPTION_LENGTH_LIMIT = 500 validates :description, length: {maximum:DESCRIPTION_LENGTH_LIMIT } - validates :user_id, presence: true - validates :contest_id, presence: true, uniqueness: {:scope => :project_id} - validates :project_id, presence: true + validates :user_id, presence: true + validates :contest_id, presence: true, uniqueness: {scope: :project_id} + validates :project_id, presence: true + validate :validate_user validate :validate_contest validate :validate_project diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index 31175ea6d..012729aea 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -7,14 +7,12 @@

- <%= @organize.description.html_safe unless @organize.nil?%> + <%= @organizer.description.html_safe unless @organizer.nil?%>

diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 1410e2277..c1c0eaf7b 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -274,7 +274,7 @@ <% if @user.user_extensions.identity == 2 %> <%= render_menu :user_enterprise_menu %> <% else %> - <%= render_menu :user_menu %> + <%= render_menu :user_menu,@user %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index 3f3ef1b59..91f96bfb2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -241,6 +241,7 @@ RedmineApp::Application.routes.draw do match "tag_saveEx" , :via => [:get, :post] end member do + match 'user_projects_index', :to => 'users#user_projects_index', :via => :get match 'user_projects', :to => 'users#user_projects', :via => :get match 'user_activities', :to => 'users#user_activities', :via => :get, :as => "user_activities" match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback" @@ -592,10 +593,10 @@ RedmineApp::Application.routes.draw do match 'admin', :to => 'admin#index', :via => :get match 'admin/projects', :via => :get match 'admin/users', :via => :get - match 'admin/first_page_made', :via => [:get,:post] - match 'admin/course_page_made', :via => [:get,:post] - match 'admin/contest_page_made', :via => [:get,:post] - match 'admin/web_footer_made', :via => [:get,:post] + match 'admin/first_page_made', as: :first_page_made + match 'admin/course_page_made', as: :course_page_made + match 'admin/contest_page_made', as: :contest_page_made + match 'admin/web_footer_made', as: :web_footer_made match 'admin/search', :via => [:get, :post] match 'admin/plugins', :via => :get match 'admin/info', :via => :get diff --git a/lib/redmine.rb b/lib/redmine.rb index db91d7a54..3ec7b114c 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -415,9 +415,25 @@ Redmine::MenuManager.map :course_menu do |menu| end Redmine::MenuManager.map :user_menu do |menu| menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain } - menu.push :user_course, {:controller => 'users', :action => 'user_courses'},:if => Proc.new {|c| FirstPage.find_by_page_type('project').show_course != 2} + menu.push :user_course, {:controller => 'users', :action => 'user_courses'}, + :if => Proc.new {|u| if User.current == u || User.current.admin? + membership = u.coursememberships.all + else + membership = u.coursememberships.all(:conditions => Course.visible_condition(User.current)) + end + FirstPage.find_by_page_type('project').show_course != 2 && membership && membership.count > 0 + } #menu.push :user_homework, {:controller => 'users', :action => 'user_homeworks'} by huang - menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain} + menu.push :user_project, {:controller => 'users', :action => 'user_projects_index', :host => Setting.project_domain}, + :if => Proc.new {|u| if User.current.admin? + memberships = u.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}").first + else + cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" + memberships = u.memberships.all(:conditions => cond).first + end + watch_projects = Project.joins(:watchers).where("project_type <>? and watchable_type = ? and `watchers`.user_id = ?", '1','Project', u.id).first + memberships || watch_projects + } # menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} by huang menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain} diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index 75e79d06c..4417c2e0c 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -216,7 +216,7 @@ module Redmine # * Checking the url target (project only) # * Checking the conditions of the item def allowed_node?(node, user, project) - if project && user && !user.allowed_to?(node.url, project) + if project && project.is_a?(Project) && user && !user.allowed_to?(node.url, project) return false end if node.condition && !node.condition.call(project) From ef48fec26b68149aea37eb106e71d4a44d8925d2 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 17 Oct 2014 17:00:20 +0800 Subject: [PATCH 02/44] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=BC=B9=E5=87=BA=E6=A1=86=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/_join_private_course.html.erb | 125 ++++++++++-------- app/views/courses/join_private_courses.js.erb | 5 +- public/stylesheets/welcome.css | 6 + 3 files changed, 79 insertions(+), 57 deletions(-) diff --git a/app/views/courses/_join_private_course.html.erb b/app/views/courses/_join_private_course.html.erb index 60223922f..2d36e2ece 100644 --- a/app/views/courses/_join_private_course.html.erb +++ b/app/views/courses/_join_private_course.html.erb @@ -1,60 +1,75 @@ - - + + + + + 蹇熻繘鍏ヨ绋嬮氶亾 + + + + + +
+
+
+

蹇熻繘鍏ヨ绋嬮氶亾

+

鍙鎸佹湁璇剧▼ID鍜屽瘑鐮侊紝灏辫蹇熷姞鍏ユ墍鍦ㄨ绋嬨傝绋嬮〉闈㈡悳绱笉鍒扮殑绉佹湁璇剧▼鍙兘浠庢閫氶亾杩涘叆鍝︼紒

-
- 瀵嗙爜   锛 - <%= text_field_tag 'course_password', nil, :style=>'width:80%'%> +
+ <%= form_tag({:controller => 'courses', + :action => 'join'}, + :remote => true, + :method => :post, + :id => 'new-watcher-form') do %> + + <% end%>
+
+
+ + -

- <%= submit_tag l(:label_new_join), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %> - <%= submit_tag l(:button_cancel), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);", :type => 'button' %> -

-<% end %> diff --git a/app/views/courses/join_private_courses.js.erb b/app/views/courses/join_private_courses.js.erb index 71c7e62b7..14a161907 100644 --- a/app/views/courses/join_private_courses.js.erb +++ b/app/views/courses/join_private_courses.js.erb @@ -1,3 +1,4 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>'); -showModal('ajax-modal', '400px'); -$('#ajax-modal').addClass('new-watcher'); \ No newline at end of file +showModal('ajax-modal', '510px'); +$('#ajax-modal').addClass('new-watcher'); +$('#ajax-modal').css('height','330px'); \ No newline at end of file diff --git a/public/stylesheets/welcome.css b/public/stylesheets/welcome.css index 3e333d231..227cc6870 100644 --- a/public/stylesheets/welcome.css +++ b/public/stylesheets/welcome.css @@ -467,6 +467,12 @@ a.attachments_list_color { font-size: 10pt; } +.new-watcher{ + -webkit-border-radius: 5px; + border-radius: 5px; + box-shadow: 0px 0px 8px #194a81; +} + /************************** 璐村惂鍔ㄦ 缁撴潫 ****************************/ /************************** 瀛︽牎璇剧▼ 寮濮 ****************************/ .course{ From 59333c29f3b06017af2a56d24fbadf68c599f90e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 20 Oct 2014 10:06:27 +0800 Subject: [PATCH 03/44] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=81=AB=E7=8B=90?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E4=B8=AD403=20404=E5=90=8E=E9=80=80?= =?UTF-8?q?=E4=B8=80=E6=AD=A5=E8=BF=94=E5=9B=9E=E7=A9=BA=E7=99=BD=E9=A1=B5?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/common/403.html | 4 ++-- app/views/common/404.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/common/403.html b/app/views/common/403.html index 39df9d70e..826d43067 100644 --- a/app/views/common/403.html +++ b/app/views/common/403.html @@ -31,8 +31,8 @@ a:hover{ } 娌℃湁璁块棶鏉冮檺锛佸缓璁偍

diff --git a/app/views/common/404.html b/app/views/common/404.html index f4ec0e8f0..ce92d7e4c 100644 --- a/app/views/common/404.html +++ b/app/views/common/404.html @@ -31,8 +31,8 @@ a:hover{ } 椤甸潰涓嶈浜嗭紒寤鸿鎮

From f5a7aec3c014175da69fdd68ddbb6b4857fb7342 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 20 Oct 2014 11:57:16 +0800 Subject: [PATCH 04/44] =?UTF-8?q?#1342=E9=A1=B9=E7=9B=AE--=E9=85=8D?= =?UTF-8?q?=E7=BD=AE--=E7=89=88=E6=9C=AC=E5=BA=93--=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=88=B0=E5=B7=B2=E6=9C=89=E7=9A=84SVN=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=EF=BC=9A=E8=BF=94=E5=9B=9E500=E9=94=99=E8=AF=AF=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9A=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E9=94=99=E8=AF=AF=EF=BC=8C=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index c9550add3..0c1f65317 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -113,7 +113,7 @@ class RepositoriesController < ApplicationController @root_path=RepositoriesHelper::ROOT_PATH @repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git" @project_path=@root_path+"htdocs/"+@repository_name - @repository_tag=params[:repository][:upassword] + @repository_tag=params[:repository][:upassword] || params[:repository][:password] @repo_name=User.current.login.to_s+"_"+params[:repository][:identifier] logger.info "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+": "+@repository_tag logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name From 65b80959a6c275c004cb7b39b9016d72b9adfea7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 20 Oct 2014 14:23:10 +0800 Subject: [PATCH 05/44] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_form.html.erb | 7 +++++-- app/views/repositories/_form.html.erb | 29 ++++++++++++++++++--------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb index 4679420f4..0db5a0f70 100644 --- a/app/views/forums/_form.html.erb +++ b/app/views/forums/_form.html.erb @@ -19,8 +19,11 @@
- <%= f.text_area :description, :required => true, :id => 'editor01' %> - +

+ <%= f.text_area :description, :required => true, :id => 'editor01' %> +

+ +

(<%= l(:label_forums_max_length) %>)

diff --git a/app/views/repositories/_form.html.erb b/app/views/repositories/_form.html.erb index 1fabf47c8..cc200ac5c 100644 --- a/app/views/repositories/_form.html.erb +++ b/app/views/repositories/_form.html.erb @@ -11,20 +11,31 @@

<%= f.check_box :is_default, :label => :field_repository_is_default %>

-

<%= f.text_field :identifier, :required => true, :disabled => @repository.identifier_frozen?, - value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}"%> +

+ <%= f.text_field :identifier, :required => true, :disabled => @repository.identifier_frozen?, + value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}"%> <% unless @repository.identifier_frozen? %> - <%= l(:text_length_between, :min => 1, :max => Repository::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_repository_identifier_info).html_safe %> + + <%= l(:text_length_between, :min => 1, :max => Repository::IDENTIFIER_MAX_LENGTH) %> + <%= l(:text_repository_identifier_info).html_safe %> <% end %>

-

<%= f.text_field :url, :size => 60, :required => true, :disabled => !@repository.safe_attribute?('url'), :id => "url_text_field" %> - <%= "#{l(:label_exist_repository_path)}" %> +

+ <%= f.text_field :url, :size => 60, :required => true, :disabled => !@repository.safe_attribute?('url'), :id => "url_text_field" %> + + <%= "#{l(:label_exist_repository_path)}" %> + +

+

+ <%= f.text_field :login, :size => 30 %> +

+

+ <%= f.password_field :password, :size => 30, :name => 'ignore', + :value => ((@repository.new_record? || @repository.password.blank?) ? '' : ('x'*15)), + :onfocus => "this.value=''; this.name='repository[password]';", + :onchange => "this.name='repository[password]';" %>

-

<%= f.text_field :login, :size => 30 %>

-

<%= f.password_field :password, :size => 30, :name => 'ignore', :value => ((@repository.new_record? || @repository.password.blank?) ? '' : ('x'*15)), - :onfocus => "this.value=''; this.name='repository[password]';", - :onchange => "this.name='repository[password]';" %>

From 4ceb0e8789edeb4db7d0565f2573e4239307bacc Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 20 Oct 2014 14:39:39 +0800 Subject: [PATCH 06/44] =?UTF-8?q?#1289=E4=BF=AE=E5=A4=8D=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=86=85=E5=AE=B9=E5=B9=B6=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E2=80=9C=E5=A2=9E=E5=8A=A0=E2=80=9D=E5=90=8E=EF=BC=8C=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=9A=84=E5=86=85=E5=AE=B9=E8=BF=98=E5=9C=A8=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=A1=86=E4=B8=AD=E7=9A=84BUG=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=96=B9=E6=A1=88=EF=BC=9A=E6=96=B0=E5=A2=9E=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=90=8E=E5=A2=9E=E5=8A=A0js=E4=BB=A3=E7=A0=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=BE=93=E5=85=A5=E6=A1=86=E5=86=85=E5=80=BC=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_tag.html.erb | 35 ++++++++++++++++++++++----------- app/views/users/tag_save.js.erb | 16 +++++++-------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index b20b383ef..405f8f2e3 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -12,10 +12,16 @@ #end%> <% if object_flag == '3' %> - <%= image_tag("/images/sidebar/tags.png") %> - <%= l(:label_tag) %>: + + <%= image_tag("/images/sidebar/tags.png") %> + + + <%= l(:label_tag) %>: + <% if User.current.logged? %> - <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %> + + <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %> + <% end %>

@@ -36,7 +42,9 @@ <% elsif object_flag == '6' %> <%#= image_tag("/images/sidebar/tags.png") %> - <%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', :class => "tags_icona", :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %> + <%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', + :class => "tags_icona", + :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %> <%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %>    @@ -47,21 +55,24 @@ <%= render :partial => "courses/course_resources_html", :locals => {:obj => obj ,:object_flag => object_flag } %>
<% else %> - - <%= image_tag("/images/sidebar/tags.png") %> - <%= l(:label_tag) %>: - + + <%= image_tag("/images/sidebar/tags.png") %> + + + <%= l(:label_tag) %>: + <% if User.current.logged? %> - <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'tags_name'} %> + + <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'tags_name'} %> + <% end %> -
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
@@ -180,11 +228,9 @@
<%= l(:label_new_course_description) %>
-
<% if @course.description && !@course.description.blank? %>
- <%= textilizable @course.description %>
<% else %> @@ -193,7 +239,10 @@
<% end %>
- <%= l(:label_create_time) %>锛<%= format_time(@course.created_at) %> + + <%= l(:label_create_time) %>锛 + + <%= format_time(@course.created_at) %>
@@ -233,10 +282,6 @@
  • <%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => link_class(:feedback) %>
  • - - <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0)) %> - - <% end %> <%= render_flash_messages %> @@ -250,7 +295,9 @@ <%= render :partial => 'layouts/base_footer' %> diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 7808f268e..92d2cc84e 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -8,7 +8,9 @@ - <%=h html_title %> + + <%=h html_title %> + <%= csrf_meta_tag %> <%= favicon %> @@ -124,7 +126,9 @@ - <%= l(:lable_course_teacher) %> : + + <%= l(:lable_course_teacher) %> : + <%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %> @@ -141,8 +145,13 @@ - <%= l(:label_main_term) %> : - <%= course.time.to_s %> <%= course.term %> + + <%= l(:label_main_term) %> : + + + <%= course.time.to_s %> + <%= course.term %> + From 216537a8440e9a9f85b74625abb14c5a2ec5c76d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 14:21:33 +0800 Subject: [PATCH 21/44] =?UTF-8?q?#1278=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=B8=BA=E5=BC=80=E8=AE=BE=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=8D=95?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course.html.erb | 14 +++++--------- app/views/courses/index.html.erb | 6 ------ config/locales/zh.yml | 1 + 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index 239f2da26..5d5064be0 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -11,7 +11,9 @@

    <%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%> <% unless @course.is_public == 1 %> - <%= l(:label_private) %> + + <%= l(:label_private) %> + <% end %> <%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%>

    @@ -19,9 +21,8 @@ <%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%> <% @admin = @course.course_infos%> <%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%> - <% unless @course.teacher.user_extensions.school.nil? %> - <%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %> + <%= link_to(@course.school.try(:name), school_course_list_path(@course.school)) if @course.school %> <% end %> <% end %>

    @@ -52,7 +53,6 @@

    - <%= content_tag('span', link_to("#{@course_activity_count[@course.id]}", course_path(@course)), :class => "info") %> <%= content_tag('span', l(:label_x_activity, :count => @course_activity_count[@course.id])) %>

    @@ -62,7 +62,7 @@ <% if(course_endTime_timeout? @course) %> - 璇剧▼瀛︽湡宸茬粨鏉 + <%= l(:lable_course_end) %> <% else %> <%= join_in_course_for_list(@course, User.current,['regular'])%> @@ -80,10 +80,6 @@
    <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> - <%# desc = course.short_description.nil? ? "" : course.short_description%> - <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
    diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index 907be64a4..f781ab5c4 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -39,8 +39,6 @@
    <%if @courses%> <%= render_course_hierarchy(@courses)%> - <%#= render :partial => 'course', :locals => {:course => @courses.first}%> - <%#= "hello".html_safe %> <%end%>
    @@ -56,10 +54,6 @@

    <% end %> -<%# other_formats_links do |f| %> - <%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> -<%# end %> - <% content_for :sidebar do %> <%= form_tag({}, :method => :get) do %>

    <%= l(:label_project_plural) %>

    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 21b7514be..43bb6812a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2162,3 +2162,4 @@ zh: lable_teacher_evaluation_no: 鑰佸笀杩樻湭杩涜璇勪环 lable_teacher_evaluation: 浣滀笟缁艰瘎 lable_course_teacher: 涓昏鑰佸笀 + lable_course_end: 璇剧▼瀛︽湡宸茬粨鏉 From 38345c0c689dfeadd279fe77d7f28ffbb7d4ea96 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 21 Oct 2014 14:27:58 +0800 Subject: [PATCH 22/44] =?UTF-8?q?=E9=87=8D=E6=96=B0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=A7=92=E8=89=B2=E6=9C=89label=E5=AD=97?= =?UTF-8?q?=E6=9C=AA=E6=98=BE=E7=A4=BA=E5=85=A8=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E5=89=8D=E6=AC=A1=E4=BF=AE=E6=94=B9=E5=BD=B1=E5=93=8D=E4=BA=86?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=9C=B0=E6=96=B9=EF=BC=89=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E5=90=88=E4=BD=9C=E5=8D=95=E4=BD=8D=EF=BC=8C=E5=A1=AB?= =?UTF-8?q?=E5=86=99=E5=AD=97=E6=AE=B5=E4=B8=8D=E6=AD=A3=E7=A1=AE=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E6=B8=85=E7=A9=BA=E7=94=A8=E6=88=B7=E5=A1=AB=E5=86=99?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/web_footer_companies_controller.rb | 8 ++++++-- app/views/roles/_form.html.erb | 2 +- public/stylesheets/application.css | 13 ++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/controllers/web_footer_companies_controller.rb b/app/controllers/web_footer_companies_controller.rb index b61a58189..0fa076c2f 100644 --- a/app/controllers/web_footer_companies_controller.rb +++ b/app/controllers/web_footer_companies_controller.rb @@ -10,7 +10,7 @@ class WebFooterCompaniesController < ApplicationController end def new - @company = WebFooterCompany.new + @company ||= WebFooterCompany.new end def create @@ -20,7 +20,11 @@ class WebFooterCompaniesController < ApplicationController redirect_to web_footer_companies_url else flash[:error] = "#{l :web_footer_company_create_fail}: #{@company.errors.full_messages[0]}" - render :action => 'new' + respond_to do |format| + format.html { render :action => 'new'} + format.api { render_validation_errors(@company) } + end + end end diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index 9ed134f1e..36d3ed8e3 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -1,7 +1,7 @@ <%= error_messages_for 'role' %> <% unless @role.anonymous? %> -
    +
    <% unless @role.builtin? %>

    <%= f.text_field :name, :required => true %>

    <%= f.check_box :assignable %>

    diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 33b4035d6..1f53d9903 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1814,12 +1814,23 @@ html>body .tabular p {overflow:hidden;} float: left; text-align: right; /* width of left column */ - margin-left: -150px; + margin-left: -180px; /* width of labels. Should be smaller than left column to create some right margin */ width: 175px; font-size: 12px; } +.role label{ + font-weight: bold; + float: left; + text-align: right; + /* width of left column */ + margin-left: -60px; + /* width of labels. Should be smaller than left column to create some right margin */ + width: 175px; + font-size: 12px; +} + .tabular label.floating{ font-weight: normal; margin-left: 0px; From 87788ab34caffb3e84dde726be67cdf64274e8ec Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 15:33:48 +0800 Subject: [PATCH 23/44] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 25 +--------- app/helpers/courses_helper.rb | 1 - app/views/courses/_course.html.erb | 1 - app/views/courses/show.html.erb | 68 +++++++++++++++++---------- 4 files changed, 46 insertions(+), 49 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index f91ccf550..93626b86b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -427,9 +427,7 @@ class CoursesController < ApplicationController @course_type = params[:course_type] @school_id = params[:school_id] per_page_option = 10 - - - if @school_id == "0" or @school_id.nil? + if @school_id == "0" || @school_id.nil? @courses_all = Course.active.visible. joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id") else @@ -437,49 +435,37 @@ class CoursesController < ApplicationController joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id"). where("#{Course.table_name}.school_id = ?", @school_id) end - @course_count = @courses_all.count @course_pages = Paginator.new @course_count, per_page_option, params['page'] - @course_activity_count=Hash.new @courses_all.each do |course| @course_activity_count[course.id]=0 end - - case params[:course_sort_type] when '0' @courses = @courses_all.order("created_at desc") @s_type = 0 @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page) - - @course_activity_count=get_course_activity @courses, @course_activity_count + @course_activity_count=get_course_activity @courses, @course_activity_count when '1' @courses = @courses_all.order("course_ac_para desc") @s_type = 1 @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page) - @course_activity_count=get_course_activity @courses, @course_activity_count when '2' @courses = @courses_all.order("watchers_count desc") @s_type = 2 @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page) - @course_activity_count=get_course_activity @courses, @course_activity_count - when '3' - @course_activity_count=get_course_activity @courses_all, @course_activity_count - @courses=handle_course @courses_all, @course_activity_count - @s_type = 3 @courses = @courses[@course_pages.offset, @course_pages.per_page] else @s_type = 0 @courses = @courses_all.order("created_at desc") @courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page) - @course_activity_count=get_course_activity @courses, @course_activity_count end @@ -521,18 +507,14 @@ class CoursesController < ApplicationController # 鏂板缓浣滀笟 def new_homework @homework = Bid.new - @homework.proportion @homework.safe_attributes = params[:bid] if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] )) render :layout => 'base_courses' else render_403 end - end - - def toggleCourse @course_prefs = Course.find_by_extra(@course.extra) unless (@course_prefs.teacher == User.current || User.current.admin?) @@ -722,7 +704,4 @@ class CoursesController < ApplicationController render_404 end end - - - end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 3a8b1b09a..3555a0b0c 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -479,7 +479,6 @@ module CoursesHelper type << option2 type end - #鑾峰彇璇剧▼鍔ㄦ def get_course_activity courses, activities @course_ids=activities.keys() diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index 5d5064be0..9298c253c 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -47,7 +47,6 @@

    <%= content_tag('span', "#{garble @course.members.count}", :class => "info") %> - <%#= content_tag('span', l(:label_x_member, :count => @course.members.count)) %> <%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>

    diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 6ea67c7cd..ee7d995e7 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -9,17 +9,20 @@
    - + <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure",:class => "tableth") %> - <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype",:class => "tableth") %> <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> - - <%# @containers.each do |container| %> - <%# next if container.attachments.empty? -%> - <%# if container.is_a?(Version) -%> - - <%# end -%> <% if @curse_attachments != nil %> <% @curse_attachments.each do |file| %> <%if file.is_public == 0 && !User.current.member_of?(@project)%> <%next%> <%end%> "> - - - + + - + + - - <% end -%> - <%# reset_cycle %> <% end -%> - - -
    <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %> + <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %> + +

    + - <% if e.event_type == "issue" %> <% end %> @@ -51,30 +65,33 @@ <% end %> - <% end -%> <% if (@events_pages.page == @events_pages.last_page) %>
    - <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %> + + <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %> + <% if @canShowRealName %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> - (<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %> - ) + (<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>) <% else %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> <% end %> @@ -32,15 +35,26 @@

    <%= h(truncate(strip_tags(e.event_description).gsub(/ /, ' '), length: 30, omission: '...')) %> -

    <%= l :label_activity_time %> - 锛  <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %> + + + <%= l :label_activity_time %> + 锛  + <%= format_activity_day(day) %> + <%= format_time(e.event_datetime, false) %> + - <%= link_to l(:label_find_all_comments), issue_path(e.id) %> <%= l(:label_comments_count, :count => e.journals.count) %> + + <%= link_to l(:label_find_all_comments), issue_path(e.id) %> + + + <%= l(:label_comments_count, :count => e.journals.count) %> +
    - + @@ -88,24 +105,27 @@
    <%= image_tag(url_to_avatar(@user), :class => "avatar") %> + <%= image_tag(url_to_avatar(@user), :class => "avatar") %> + + <%= l(:label_user_create_project) %> + <%= link_to @course.name %> + ! + -
    <% if @canShowRealName %> - (<%= link_to_user(@user, @canShowRealName) %> - ) + (<%= link_to_user(@user, @canShowRealName) %>) <% else %> <%= link_to_user(@user)%> <% end %> - <%= l(:label_user_create_project) %> <%= link_to @course.name %> - !
    <%= l :label_create_time %> - : <%= format_time(@course.created_at) %> + + <%= l :label_create_time %>: + <%= format_time(@course.created_at) %>
    - + From b84e19846bb20f1a095dfef4d72c28a46be3f14a Mon Sep 17 00:00:00 2001 From: gonglexin <18008490802@163.com> Date: Tue, 21 Oct 2014 15:38:25 +0800 Subject: [PATCH 24/44] =?UTF-8?q?#1360=20=E5=88=A0=E9=99=A4=E6=88=90?= =?UTF-8?q?=E5=91=98=E6=97=B6=E7=BB=99=E5=87=BA=E7=A1=AE=E8=AE=A4=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=88=A0=E9=99=A4=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings/_members.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index f685e4543..5432db8e6 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -51,7 +51,7 @@ :class => 'icon icon-edit' %> <%= delete_link membership_path(member), :remote => true, - :data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %> + :data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %> <% end %> From 164297e30fa91e0c3bba5264cec940448aff335e Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 21 Oct 2014 16:34:46 +0800 Subject: [PATCH 25/44] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E8=A6=81=E7=82=B9=E4=B8=A4=E6=AC=A1=E6=8F=90=E4=BA=A4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/_course_show.html.erb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 51764341d..6977385d8 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -178,7 +178,7 @@ <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= render :partial => 'form', :locals => {:f => f, :replying => true} %> <%#= submit_tag l(:button_submit) %> - + <%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %> <% end %>
    @@ -188,12 +188,13 @@ <% html_title @topic.subject %> \ No newline at end of file From c76439c5152b3c8443f9fdeb38cb8468117b0740 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 16:38:16 +0800 Subject: [PATCH 26/44] =?UTF-8?q?=20#1381=E4=BF=AE=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=9B=B8=E5=85=B3=E5=86=85=E5=AE=B9=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E3=80=81=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=88=97=E8=A1=A8=E8=A1=A8=E5=A4=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8=E7=9A=84BUG=20=202.=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=20=203.?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90=E5=88=97=E8=A1=A8=E4=B9=9F?= =?UTF-8?q?=E6=9C=89=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98=EF=BC=8C=E4=B8=80?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_file.html.erb | 8 +-- .../_course_show_all_attachment.html.erb | 59 +++++++---------- .../_course_sort_by_attachtypel.html.erb | 60 +++++++++-------- app/views/files/_show_all_attachment.html.erb | 53 +++++++-------- app/views/files/_sort_by_attachtypel.html.erb | 66 ++++++++++--------- app/views/files/getattachtype.js.erb | 20 +++--- app/views/files/index.html.erb | 19 +++--- app/views/memos/_form.html.erb | 9 --- config/locales/zh.yml | 1 + 9 files changed, 141 insertions(+), 154 deletions(-) diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index cb0084b25..d00a51bc1 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -2,11 +2,11 @@ <% attachmenttypes = @course.attachmenttypes %> <% sufixtypes = @course.contenttypes %> -<%= t(:label_user_course) %>璧勬簮鍏变韩鍖 + + <%= l(:label_coursefile_sharingarea) %> +
    - - <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @course) %>
    <%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %> @@ -55,7 +55,7 @@ <% if sufixtypes.any? %>   - <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes), + <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') + options_for_select(sufixtypes), :onchange => "course_attachment_contenttypes_searchex(this.value)" %> <% end %>
    diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb index 3ce583cb8..b70e6e3b6 100644 --- a/app/views/files/_course_show_all_attachment.html.erb +++ b/app/views/files/_course_show_all_attachment.html.erb @@ -9,57 +9,55 @@
    - <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %> - <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> <%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%> <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> - - <%# @containers.each do |container| %> - <%# next if container.attachments.empty? -%> - <%# if container.is_a?(Version) -%> - - <%# end -%> <% if @curse_attachments != nil %> <% @curse_attachments.each do |file| %> <%if file.is_public == 0 && !User.current.member_of_course?(@course)%> <%next%> <%end%> "> - - - + + + - + - - <% end -%> <% end %> - <%# reset_cycle %> - <%# end -%> - - - - -
    <%= image_tag(url_to_avatar(@user), :class => "avatar") %> + <%= image_tag(url_to_avatar(@user), :class => "avatar") %> + + <%= l(:label_user_create_project) %> + <%= link_to @course.name %> + ! + -
    <% if @canShowRealName %> - (<%= link_to_user(@user, @canShowRealName) %> - ) + (<%= link_to_user(@user, @canShowRealName) %>) <% else %> <%= link_to_user(@user)%> <% end %> - - <%= l(:label_user_create_project) %> <%= link_to @course.name %> - !
    <%= l :label_create_time %> - : <%= format_time(@course.created_at) %> + + <%= l :label_create_time %>: + <%= format_time(@course.created_at) %>
    <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= number_to_human_size(file.filesize) %> + <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + + <%= number_to_human_size(file.filesize) %> + - <%= file.attachmentstype.typeName unless file.attachmentstype.nil? %> - - <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> - + + <%= file.attachmentstype.typeName unless file.attachmentstype.nil? %> + + + <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> + + + <%= file.show_suffix_type %> <%= file.show_suffix_type %> - <%= file.file_dense_str %> + + <%= file.file_dense_str %> +   - - <%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, - :attachment => file} %> - + + <%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, + :attachment => file} %> + + + <%= file.downloads %> <%= file.downloads %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -77,13 +75,6 @@
    diff --git a/app/views/files/_course_sort_by_attachtypel.html.erb b/app/views/files/_course_sort_by_attachtypel.html.erb index 5a0cdba02..feb8d736d 100644 --- a/app/views/files/_course_sort_by_attachtypel.html.erb +++ b/app/views/files/_course_sort_by_attachtypel.html.erb @@ -3,25 +3,22 @@ <% attachmenttypes = @course.attachmenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @course) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @course) %> - +
    - - <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %> - <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> - <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %> - <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %> - <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %> - <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %> - <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %> - <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> - + <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %> + <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> + <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> + <%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%> + <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> + <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> + <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> @@ -33,28 +30,36 @@ <% end %> <% if isTypeOk(file, selAttachType, selContentType) %> "> - - + + - + - -
    <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> + + <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> +   - - <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, - :attachment => file, :contentype => selContentType} %> - + + <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, + :attachment => file, :contentype => selContentType} %> + + + <%= file.show_suffix_type %> <%= file.show_suffix_type %> - <%= file.file_dense_str %> + + <%= file.file_dense_str %> +   - - <%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, - :attachment => file} %> - + + <%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, + :attachment => file} %> + + + <%= file.downloads %> <%= file.downloads %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -75,9 +80,6 @@ <% end -%> <% reset_cycle %> <% end -%> - - -
    diff --git a/app/views/files/_show_all_attachment.html.erb b/app/views/files/_show_all_attachment.html.erb index c1df86b32..3520d5576 100644 --- a/app/views/files/_show_all_attachment.html.erb +++ b/app/views/files/_show_all_attachment.html.erb @@ -15,52 +15,51 @@
    <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= number_to_human_size(file.filesize) %> + <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + + <%= number_to_human_size(file.filesize) %> + - <%= file.attachmentstype.typeName %> + + <%= file.attachmentstype.typeName %> + <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> <%= file.show_suffix_type %> + <%= file.show_suffix_type %> + - <%= file.file_dense_str %> + + <%= file.file_dense_str %> +   - - <%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, - :attachment => file} %> - + + <%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, + :attachment => file} %> + + + <%= file.downloads %> <%= file.downloads %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -73,15 +72,13 @@ <%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
    - +
    diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb index 6c6e11791..5faa73b0f 100644 --- a/app/views/files/_sort_by_attachtypel.html.erb +++ b/app/views/files/_sort_by_attachtypel.html.erb @@ -3,7 +3,7 @@ <% attachmenttypes = @project.attachmenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> - +
    @@ -13,15 +13,13 @@ - <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %> - <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> - <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %> - <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %> - <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %> - <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %> - <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %> - <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> - + <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %> + <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> + <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> + <%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%> + <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> + <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> + <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> @@ -33,28 +31,38 @@ <% end %> <% if isTypeOk(file, selAttachType, selContentType) %> "> - - - + + + - + - - @@ -75,9 +84,6 @@ <% end -%> <% reset_cycle %> <% end -%> - - -
    <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= number_to_human_size(file.filesize) %> + <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> + + <%= number_to_human_size(file.filesize) %> + - <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> + + <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> +   - - <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, - :attachment => file, :contentype => selContentType} %> - + + <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, + :attachment => file, :contentype => selContentType} %> + + + <%= file.show_suffix_type %> <%= file.show_suffix_type %> - <%= file.file_dense_str %> + + <%= file.file_dense_str %> +   - - <%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, - :attachment => file} %> - + + <%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list, + :attachment => file} %> + + + <%= file.downloads %> <%= file.downloads %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -67,7 +75,8 @@ <%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
    -
    diff --git a/app/views/files/getattachtype.js.erb b/app/views/files/getattachtype.js.erb index 88722073f..7acf849ce 100644 --- a/app/views/files/getattachtype.js.erb +++ b/app/views/files/getattachtype.js.erb @@ -1,13 +1,13 @@ <% if @attachtype==0 && @contenttype=='0' %> -<% if @project%> -$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>'); -<% elsif @course%> -$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>'); -<%end%> + <% if @project%> + $("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>'); + <% elsif @course%> + $("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>'); + <%end%> <%else%> -<% if @project%> -$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>') -<% elsif @course%> -$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>') -<%end%>; + <% if @project%> + $("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>') + <% elsif @course%> + $("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>') + <%end%>; <%end%> diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 69b41fc28..e3f022e37 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -120,16 +120,15 @@ function course_attachment_contenttypes_searchex(value) { <% if @course%> - $.ajax({ - - url: '<%=getattachtype_course_files_path(course_id: @course)%>', - type: "POST", - data: { - type: $('#attachment_browse').val(), - contentType: encodeURIComponent(value) - } - - }).complete(eval_ajax); + $.ajax({ + url: '<%=getattachtype_course_files_path(course_id: @course)%>', + type: "POST", + data: { + type: $('#attachment_browse').val(), + contentType: encodeURIComponent(value) + } + + }).complete(eval_ajax); <%end%> } function course_attachtype_edit(value) { diff --git a/app/views/memos/_form.html.erb b/app/views/memos/_form.html.erb index b22983d2a..41ea73fcd 100644 --- a/app/views/memos/_form.html.erb +++ b/app/views/memos/_form.html.erb @@ -1,12 +1,3 @@ <%= error_messages_for 'bid' %> - -

    <%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %>

    <%= hidden_field_tag 'subject', ||=@memo.subject %> \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 43bb6812a..f453b21c3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2163,3 +2163,4 @@ zh: lable_teacher_evaluation: 浣滀笟缁艰瘎 lable_course_teacher: 涓昏鑰佸笀 lable_course_end: 璇剧▼瀛︽湡宸茬粨鏉 + lable_file_sharingarea: 璧勬簮鍏变韩鍖 From 0ba1477f1bd86aa3269f6b96ca393bcd58d80994 Mon Sep 17 00:00:00 2001 From: gonglexin <18008490802@163.com> Date: Tue, 21 Oct 2014 16:51:30 +0800 Subject: [PATCH 27/44] =?UTF-8?q?#1360=20=E7=BF=BB=E9=A1=B5=E6=88=96?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=B9=8B=E5=89=8D=E8=8B=A5=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BA=86=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=99=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings/_members.html.erb | 6 +++++- app/views/members/autocomplete.js.erb | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index 5432db8e6..ab0f20257 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -82,7 +82,11 @@

    <%= l(:label_role_plural) %>: <% roles.each do |role| %> - + <% if role.id == 10 %> + + <% else %> + + <% end %> <% end %>

    <%= submit_tag l(:button_add), :id => 'member-add-submit' %>

    diff --git a/app/views/members/autocomplete.js.erb b/app/views/members/autocomplete.js.erb index 5ef01c04d..d1e7a884b 100644 --- a/app/views/members/autocomplete.js.erb +++ b/app/views/members/autocomplete.js.erb @@ -1,6 +1,11 @@ <% if @project%> $('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>'); <% elsif @course%> + var checked = $("#principals input:checked").size(); + if(checked > 0) + { + alert('缈婚〉鎴栨悳绱㈠悗灏嗕涪澶卞綋鍓嶉夋嫨鐨勭敤鎴锋暟鎹!'); + } $('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_course_members(@course)) %>'); <%end%> var collection=$("#principals_for_new_member").children("#principals").children("label"); From 859a1122b7c217d425263df90a5173151a9e9fa2 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Tue, 21 Oct 2014 23:23:07 +0800 Subject: [PATCH 28/44] =?UTF-8?q?=E4=BF=AE=E6=94=B9contest=E4=B8=ADcontest?= =?UTF-8?q?notification=E5=88=97=E8=A1=A8=E5=92=8C=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E7=9A=84=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: alan <547533434@qq.com> --- Gemfile.lock | 1 - app/views/contest_notification/show.html.erb | 28 -- app/views/contestnotifications/index.html.erb | 43 ++- app/views/contests/show_contest.html.erb | 32 -- app/views/layouts/base_contest.html.erb | 2 +- app/views/layouts/base_newcontest.html.erb | 22 -- app/views/softapplications/_list.html.erb | 29 +- .../stylesheets/window_js/mac_os_x_dialog.css | 320 ++++++++--------- .../stylesheets/window_js/nuncio.css | 328 +++++++++--------- .../stylesheets/window_js/spread.css | 216 ++++++------ 10 files changed, 488 insertions(+), 533 deletions(-) delete mode 100644 app/views/contest_notification/show.html.erb diff --git a/Gemfile.lock b/Gemfile.lock index 34314d845..0ecb19aff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -125,7 +125,6 @@ GEM mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.10.1) - mysql2 (0.3.11) mysql2 (0.3.11-x86-mingw32) net-ldap (0.3.1) nokogiri (1.6.3) diff --git a/app/views/contest_notification/show.html.erb b/app/views/contest_notification/show.html.erb deleted file mode 100644 index c4dfc737b..000000000 --- a/app/views/contest_notification/show.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -
    - - - - - - - - - - - -
    <%= l(:label_contest_innovate ) %><%= l(:label_user_location) %> : - -
    - contest.trustie.net - - <%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), welcome_contest_path %> > l(:label_details)
    -
    - - -
    -

    <%= @notification.title %>

    -
    -

    <%= @notification.content.html_safe %>

    -
    -
    diff --git a/app/views/contestnotifications/index.html.erb b/app/views/contestnotifications/index.html.erb index 870c4cd4c..8a4278551 100644 --- a/app/views/contestnotifications/index.html.erb +++ b/app/views/contestnotifications/index.html.erb @@ -21,11 +21,42 @@
    <% end %>
    - <% if @contestnotificationss.empty? %> -

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

    - <% else %> + +
    + + <%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%> + + +

    + <%= link_to(@contest.author.lastname+@contest.author.firstname, + user_path(@contest.author)) + %> + 锛<%= @contest.name %>

    +

    + + <%= l(:label_bids_reward_method) %> + + <%= @contest.budget%> + + +

    +
    + <%= @contest.description %> +
    + + <%= render :partial => "/praise_tread/praise_tread", + :locals => {:obj => @contest, + :show_flag => true, + :user_id =>User.current.id, + :horizontal => false} + %> + +
    +
    + +
    + +

    <% @contestnotificationss.each do |contestnotifications| %> @@ -57,7 +88,7 @@
    <% end %> - <% end %> +
    diff --git a/app/views/contests/show_contest.html.erb b/app/views/contests/show_contest.html.erb index 3654fa6a1..c9ba360cc 100644 --- a/app/views/contests/show_contest.html.erb +++ b/app/views/contests/show_contest.html.erb @@ -1,37 +1,5 @@ <% reply_allow = JournalsForMessage.create_by_user? User.current %> -
    - - <%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%> - - -

    - <%= link_to(@contest.author.lastname+@contest.author.firstname, - user_path(@contest.author)) - %> - 锛<%= @contest.name %>

    -

    - - <%= l(:label_bids_reward_method) %> - - <%= @contest.budget%> - - -

    -
    - <%= @contest.description %> -
    - - <%= render :partial => "/praise_tread/praise_tread", - :locals => {:obj => @contest, - :show_flag => true, - :user_id =>User.current.id, - :horizontal => false} - %> - -
    -
    -
    <%= render :partial => 'history', diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb index ae44933ab..cf8b7d475 100644 --- a/app/views/layouts/base_contest.html.erb +++ b/app/views/layouts/base_contest.html.erb @@ -112,7 +112,7 @@ <%= l(:lable_contest_user) %><%= link_to(@user.name, user_path(@user))%> - + <%= l(:label_bids_reward_method) %><%= @bid.budget%> diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index d8945a5dc..a81170db3 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -136,28 +136,6 @@
    -
    - - - - - - - - - - -
    - <%= l(:lable_contest_user) %>:  - <%= link_to(@user.name, user_path(@user))%> -
    - <%= l(:label_bids_reward_method) %> - <%= @contest.budget%> -
    - <%= l(:label_limit_time) %> : - <%= @contest.deadline%> -
    -
    diff --git a/app/views/softapplications/_list.html.erb b/app/views/softapplications/_list.html.erb index 91c49cda3..860b157c3 100644 --- a/app/views/softapplications/_list.html.erb +++ b/app/views/softapplications/_list.html.erb @@ -1,28 +1,35 @@ <% @softapplications.each do |softapplication| %> -
    +
    <%= link_to softapplication.name, softapplication, :target => "_blank" %> <%= rating_for softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
    <%= image_tag('/images/app1.png')%>
    -
    <%= softapplication.description.truncate(95, omission: '...') %>
    -
    +
    +
    <%contest = softapplication.contests.first%> + <%=l(:label_attendingcontestwork_belongs_contest)%>锛<%= contest ? link_to(contest.name.truncate(14, omission: '...'), show_attendingcontest_contest_path(contest), title: contest.name.to_s ) : '灏氭湭鍔犲叆绔炶禌'%> +

    + <%= l(:label_profile) %>锛<%= softapplication.description.truncate(95, omission: '...') %> -

    <%=l(:label_attendingcontestwork_belongs_contest)%>锛<%= contest ? link_to(contest.name.truncate(14, omission: '...'), show_attendingcontest_contest_path(contest), title: contest.name.to_s ) : '灏氭湭鍔犲叆绔炶禌'%>

    +
    - -

    <%=l(:label_attendingcontestwork_belongs_type)%>锛<%= softapplication.app_type_name ? softapplication.app_type_name.truncate(14, omission: '...') : "" %>

    +
    <% strTitle = softapplication.android_min_version_available %>

    <%=l(:label_attendingcontestwork_adaptive_system)%>锛<%= strTitle ? strTitle.truncate(10,omisiion:'...') : "" %>

    -
    -
    + + + +

    <%=l(:label_attendingcontestwork_belongs_type)%>锛<%= softapplication.app_type_name ? softapplication.app_type_name.truncate(14, omission: '...') : "" %>

    +
    +
    + <%=l(:label_attendingcontestwork_developers)%>锛<%= softapplication.application_developers %> - <%=l(:label_attendingcontestwork_release_time)%>锛<%=format_time softapplication.created_at %> + <%=l(:label_attendingcontestwork_release_time)%>锛<%=format_time softapplication.created_at %>
    -
    -
    +
    +
    <% end %> \ No newline at end of file diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css index e663e3c5e..4c89f602d 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css @@ -1,160 +1,160 @@ -.overlay_mac_os_x_dialog { - background-color: #FF7224; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; -} - -.mac_os_x_dialog_nw { - background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; - width:16px; - height:16px; -} - -.mac_os_x_dialog_n { - background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; - height:18px; -} - -.mac_os_x_dialog_ne { - background: transparent url(mac_os_x_dialog/R.png) repeat-y top left; - width:16px; - height:16px; -} - -.mac_os_x_dialog_w { - background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; - width:16px; -} - -.mac_os_x_dialog_e { - background: transparent url(mac_os_x_dialog/R.png) repeat-y top right; - width:16px; -} - -.mac_os_x_dialog_sw { - background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0; - width:31px; - height:40px; -} - -.mac_os_x_dialog_s { - background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0; - height:40px; -} - -.mac_os_x_dialog_se, .mac_os_x_dialog_sizer { - background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0; - width:31px; - height:40px; -} - -.mac_os_x_dialog_sizer { - cursor:se-resize; -} - -.mac_os_x_dialog_close { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:25px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_minimize { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:45px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_maximize { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:65px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_title { - float:left; - height:14px; - font-family: Tahoma, Arial, sans-serif; - font-size:12px; - text-align:center; - margin-top:6px; - width:100%; - color:#000; -} - -.mac_os_x_dialog_content { - overflow:auto; - color: #222; - font-family: Tahoma, Arial, sans-serif; - font-size: 10px; - background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; -} - -.mac_os_x_dialog_buttons { - text-align: center; -} -/* FOR IE */ -* html .mac_os_x_dialog_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - - -* html .mac_os_x_dialog_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - +.overlay_mac_os_x_dialog { + background-color: #FF7224; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.mac_os_x_dialog_nw { + background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; + width:16px; + height:16px; +} + +.mac_os_x_dialog_n { + background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; + height:18px; +} + +.mac_os_x_dialog_ne { + background: transparent url(mac_os_x_dialog/R.png) repeat-y top left; + width:16px; + height:16px; +} + +.mac_os_x_dialog_w { + background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; + width:16px; +} + +.mac_os_x_dialog_e { + background: transparent url(mac_os_x_dialog/R.png) repeat-y top right; + width:16px; +} + +.mac_os_x_dialog_sw { + background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_dialog_s { + background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0; + height:40px; +} + +.mac_os_x_dialog_se, .mac_os_x_dialog_sizer { + background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_dialog_sizer { + cursor:se-resize; +} + +.mac_os_x_dialog_close { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:25px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_minimize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:45px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_maximize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:65px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_title { + float:left; + height:14px; + font-family: Tahoma, Arial, sans-serif; + font-size:12px; + text-align:center; + margin-top:6px; + width:100%; + color:#000; +} + +.mac_os_x_dialog_content { + overflow:auto; + color: #222; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; +} + +.mac_os_x_dialog_buttons { + text-align: center; +} +/* FOR IE */ +* html .mac_os_x_dialog_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); +} + + +* html .mac_os_x_dialog_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); +} + +* html .mac_os_x_dialog_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_se { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); +} + +* html .mac_os_x_dialog_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); +} + diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/nuncio.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/nuncio.css index 2c439bd00..e2700e5b7 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/nuncio.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/nuncio.css @@ -1,164 +1,164 @@ -.overlay_nuncio img { border: none; } - -.overlay_nuncio { - background-color: #666666; -} - -.nuncio_nw { - width: 12px; - height: 28px; - background: url(nuncio/top_left.png) no-repeat; -} - -.nuncio_n { - background: url(nuncio/top_mid.png) repeat-x; - height: 28px; -} - -.nuncio_ne { - width: 21px; - height: 28px; - background: url(nuncio/top_right.png) no-repeat; -} - -.nuncio_e { - width: 21px; - background: url(nuncio/center_right.png) repeat-y top right; -} - -.nuncio_w { - width: 12px; - background: url(nuncio/center_left.png) repeat-y top left; -} - -.nuncio_sw { - width: 12px; - height: 18px; - background: url(nuncio/bottom_left.png) no-repeat; -} - -.nuncio_s { - background: url(nuncio/bottom_mid.png) repeat-x 0 0; - height: 18px; -} - -.nuncio_se, .nuncio_sizer { - width: 21px; - height: 18px; - background: url(nuncio/bottom_right.png) no-repeat; -} - -.nuncio_close { - width: 14px; - height: 14px; - background: url(nuncio/close.png) no-repeat; - position:absolute; - top:10px; - right:22px; - cursor:pointer; - z-index:2000; -} - -.nuncio_minimize { - width: 14px; - height: 15px; - background: url(nuncio/minimize.png) no-repeat; - position:absolute; - top:10px; - right:40px; - cursor:pointer; - z-index:2000; -} - -.nuncio_title { - float:left; - font-size:11px; - font-weight: bold; - font-style: italic; - color: #fff; - width: 100% -} - -.nuncio_content { - background: url(nuncio/overlay.png) repeat; - overflow:auto; - color: #ddd; - font-family: Tahoma, Arial, "sans-serif"; - font-size: 10px; -} - -.nuncio_sizer { - cursor:se-resize; -} - - -.top_draggable, .bottom_draggable { - cursor:move -} -/* FOR IE */ -* html .nuncio_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_left.png", sizingMethod="crop"); -} - -* html .nuncio_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_mid.png", sizingMethod="scale"); -} - -* html .nuncio_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_right.png", sizingMethod="crop"); -} - -* html .nuncio_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_left.png", sizingMethod="scale"); -} - -* html .nuncio_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_right.png", sizingMethod="scale"); -} - -* html .nuncio_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_left.png", sizingMethod="crop"); -} - -* html .nuncio_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_mid.png", sizingMethod="scale"); -} - -* html .nuncio_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); -} - -* html .nuncio_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); -} - -* html .nuncio_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/close.png", sizingMethod="crop"); -} - -* html .nuncio_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/minimize.png", sizingMethod="crop"); -} - +.overlay_nuncio img { border: none; } + +.overlay_nuncio { + background-color: #666666; +} + +.nuncio_nw { + width: 12px; + height: 28px; + background: url(nuncio/top_left.png) no-repeat; +} + +.nuncio_n { + background: url(nuncio/top_mid.png) repeat-x; + height: 28px; +} + +.nuncio_ne { + width: 21px; + height: 28px; + background: url(nuncio/top_right.png) no-repeat; +} + +.nuncio_e { + width: 21px; + background: url(nuncio/center_right.png) repeat-y top right; +} + +.nuncio_w { + width: 12px; + background: url(nuncio/center_left.png) repeat-y top left; +} + +.nuncio_sw { + width: 12px; + height: 18px; + background: url(nuncio/bottom_left.png) no-repeat; +} + +.nuncio_s { + background: url(nuncio/bottom_mid.png) repeat-x 0 0; + height: 18px; +} + +.nuncio_se, .nuncio_sizer { + width: 21px; + height: 18px; + background: url(nuncio/bottom_right.png) no-repeat; +} + +.nuncio_close { + width: 14px; + height: 14px; + background: url(nuncio/close.png) no-repeat; + position:absolute; + top:10px; + right:22px; + cursor:pointer; + z-index:2000; +} + +.nuncio_minimize { + width: 14px; + height: 15px; + background: url(nuncio/minimize.png) no-repeat; + position:absolute; + top:10px; + right:40px; + cursor:pointer; + z-index:2000; +} + +.nuncio_title { + float:left; + font-size:11px; + font-weight: bold; + font-style: italic; + color: #fff; + width: 100% +} + +.nuncio_content { + background: url(nuncio/overlay.png) repeat; + overflow:auto; + color: #ddd; + font-family: Tahoma, Arial, "sans-serif"; + font-size: 10px; +} + +.nuncio_sizer { + cursor:se-resize; +} + + +.top_draggable, .bottom_draggable { + cursor:move +} +/* FOR IE */ +* html .nuncio_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_left.png", sizingMethod="crop"); +} + +* html .nuncio_n { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_mid.png", sizingMethod="scale"); +} + +* html .nuncio_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_right.png", sizingMethod="crop"); +} + +* html .nuncio_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_left.png", sizingMethod="scale"); +} + +* html .nuncio_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_right.png", sizingMethod="scale"); +} + +* html .nuncio_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_left.png", sizingMethod="crop"); +} + +* html .nuncio_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_mid.png", sizingMethod="scale"); +} + +* html .nuncio_se { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); +} + +* html .nuncio_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); +} + +* html .nuncio_close { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/close.png", sizingMethod="crop"); +} + +* html .nuncio_minimize { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/minimize.png", sizingMethod="crop"); +} + diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/spread.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/spread.css index 9bda2a68d..d7d722e8a 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/spread.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/spread.css @@ -1,108 +1,108 @@ -.overlay_spread { - background-color: #85BBEF; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; -} - -.spread_nw { - background: transparent url(spread/left-top.gif) no-repeat 0 0; - width:10px; - height:25px; -} - -.spread_n { - background: transparent url(spread/top-middle.gif) repeat-x 0 0; - height:25px; -} - -.spread_ne { - background: transparent url(spread/right-top.gif) no-repeat 0 0; - width:10px; - height:25px; -} - -.spread_w { - background: transparent url(spread/frame-left.gif) repeat-y top left; - width:7px; -} - -.spread_e { - background: transparent url(spread/frame-right.gif) repeat-y top right; - width:7px; -} - -.spread_sw { - background: transparent url(spread/bottom-left-c.gif) no-repeat 0 0; - width:7px; - height:7px; -} - -.spread_s { - background: transparent url(spread/bottom-middle.gif) repeat-x 0 0; - height:7px; -} - -.spread_se, .spread_sizer { - background: transparent url(spread/bottom-right-c.gif) no-repeat 0 0; - width:7px; - height:7px; -} - -.spread_sizer { - cursor:se-resize; -} - -.spread_close { - width: 23px; - height: 23px; - background: transparent url(spread/button-close-focus.gif) no-repeat 0 0; - position:absolute; - top:0px; - right:11px; - cursor:pointer; - z-index:1000; -} - -.spread_minimize { - width: 23px; - height: 23px; - background: transparent url(spread/button-min-focus.gif) no-repeat 0 0; - position:absolute; - top:0px; - right:55px; - cursor:pointer; - z-index:1000; -} - -.spread_maximize { - width: 23px; - height: 23px; - background: transparent url(spread/button-max-focus.gif) no-repeat 0 0; - position:absolute; - top:0px; - right:33px; - cursor:pointer; - z-index:1000; -} - -.spread_title { - float:left; - height:14px; - font-family: Tahoma, Arial, sans-serif; - font-size:14px; - font-weight:bold; - text-align:left; - margin-top:2px; - width:100%; - color:#E47211; -} - -.spread_content { - overflow:auto; - color: #222; - font-family: Tahoma, Arial, sans-serif; - font-size: 10px; - background:#A9EA00; -} - +.overlay_spread { + background-color: #85BBEF; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.spread_nw { + background: transparent url(spread/left-top.gif) no-repeat 0 0; + width:10px; + height:25px; +} + +.spread_n { + background: transparent url(spread/top-middle.gif) repeat-x 0 0; + height:25px; +} + +.spread_ne { + background: transparent url(spread/right-top.gif) no-repeat 0 0; + width:10px; + height:25px; +} + +.spread_w { + background: transparent url(spread/frame-left.gif) repeat-y top left; + width:7px; +} + +.spread_e { + background: transparent url(spread/frame-right.gif) repeat-y top right; + width:7px; +} + +.spread_sw { + background: transparent url(spread/bottom-left-c.gif) no-repeat 0 0; + width:7px; + height:7px; +} + +.spread_s { + background: transparent url(spread/bottom-middle.gif) repeat-x 0 0; + height:7px; +} + +.spread_se, .spread_sizer { + background: transparent url(spread/bottom-right-c.gif) no-repeat 0 0; + width:7px; + height:7px; +} + +.spread_sizer { + cursor:se-resize; +} + +.spread_close { + width: 23px; + height: 23px; + background: transparent url(spread/button-close-focus.gif) no-repeat 0 0; + position:absolute; + top:0px; + right:11px; + cursor:pointer; + z-index:1000; +} + +.spread_minimize { + width: 23px; + height: 23px; + background: transparent url(spread/button-min-focus.gif) no-repeat 0 0; + position:absolute; + top:0px; + right:55px; + cursor:pointer; + z-index:1000; +} + +.spread_maximize { + width: 23px; + height: 23px; + background: transparent url(spread/button-max-focus.gif) no-repeat 0 0; + position:absolute; + top:0px; + right:33px; + cursor:pointer; + z-index:1000; +} + +.spread_title { + float:left; + height:14px; + font-family: Tahoma, Arial, sans-serif; + font-size:14px; + font-weight:bold; + text-align:left; + margin-top:2px; + width:100%; + color:#E47211; +} + +.spread_content { + overflow:auto; + color: #222; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background:#A9EA00; +} + From aba9e517b3e1638bf1a633f7df34094786a3230e Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 22 Oct 2014 10:03:22 +0800 Subject: [PATCH 29/44] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_links.html.erb | 1 - app/views/memos/show.html.erb | 2 -- 2 files changed, 3 deletions(-) diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 698198120..f6b7ee7dd 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -33,7 +33,6 @@ <% end %> <% end %> <% if options[:author] %> - <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>, <%= format_time(attachment.created_on) %> diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 2736ca81b..e121098f4 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -61,7 +61,6 @@

    -
    <%= authoring @memo.created_at, @memo.author %>
    @@ -128,7 +127,6 @@ - <%= authoring reply.created_at, reply.author %> From 56ac9222eff587ddaf4546b1b4f4637355d2e101 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 22 Oct 2014 10:16:08 +0800 Subject: [PATCH 30/44] =?UTF-8?q?#1384=E4=BF=AE=E5=A4=8Dwiki=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/wiki/edit.html.erb | 73 +++++++++++++------------ app/views/wiki/history.html.erb | 74 +++++++++++++++---------- app/views/wiki/show.html.erb | 97 ++++++++++++++++----------------- 3 files changed, 132 insertions(+), 112 deletions(-) diff --git a/app/views/wiki/edit.html.erb b/app/views/wiki/edit.html.erb index 30e8b73ae..89dcfdb7a 100644 --- a/app/views/wiki/edit.html.erb +++ b/app/views/wiki/edit.html.erb @@ -1,57 +1,62 @@ <%= wiki_page_breadcrumb(@page) %> -

    <%= h @page.pretty_title %>

    +

    + <%= h @page.pretty_title %> +

    <%= form_for @content, :as => :content, :url => {:action => 'update', :id => @page.title}, :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| %> -<%= f.hidden_field :version %> -<% if @section %> -<%= hidden_field_tag 'section', @section %> -<%= hidden_field_tag 'section_hash', @section_hash %> -<% end %> -<%= error_messages_for 'content' %> + <%= f.hidden_field :version %> + <% if @section %> + <%= hidden_field_tag 'section', @section %> + <%= hidden_field_tag 'section_hash', @section_hash %> + <% end %> + <%= error_messages_for 'content' %>
    -

    <%=text_area_tag 'content[text]', @text, :required => true, :id => 'editor02', :cols => 100, :rows => 25 %>

    +

    + <%=text_area_tag 'content[text]', @text, :required => true, :id => 'editor02', :cols => 100, :rows => 25 %> +

    -
    -<%#= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25, - :class => 'wiki-edit', :accesskey => accesskey(:edit) %> - - +
    + <% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %> + <%= fields_for @page do |fp| %> +

    + + <%= fp.select :parent_id,content_tag('option', '', :value => '') + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %> +

    + <% end %> + <% end %> + +

    + + <%= f.text_field :comments, :style => "width:75%;" %> +

    +

    + + <%= render :partial => 'attachments/form' %> +

    +
    -<% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %> - <%= fields_for @page do |fp| %>

    - - <%= fp.select :parent_id, - content_tag('option', '', :value => '') + - wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - - @page.self_and_descendants, @page.parent) %> + <%= submit_tag l(:button_save) %>

    - <% end %> + <%= wikitoolbar_for 'content_text' %> <% end %> - -

    <%= f.text_field :comments, :style => "width:75%;" %>

    -

    <%= render :partial => 'attachments/form' %>

    -
    - -

    <%= submit_tag l(:button_save) %> - <%#= preview_link({:controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, 'wiki_form') %>

    -<%= wikitoolbar_for 'content_text' %> -<% end %> -
    - <% content_for :header_tags do %> <%= robot_exclusion_tag %> <% end %> - <% html_title @page.pretty_title %> diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erb index 17cb19118..19a577d69 100644 --- a/app/views/wiki/history.html.erb +++ b/app/views/wiki/history.html.erb @@ -8,35 +8,51 @@ :project_id => @page.project, :id => @page.title}, :method => :get) do %> - - - - - - - - - - -<% show_diff = @versions.size > 1 %> -<% line_num = 1 %> -<% @versions.each do |ver| %> -"> - - - - - - - - -<% line_num += 1 %> -<% end %> - + + + + + + + + + + + + + <% show_diff = @versions.size > 1 %> + <% line_num = 1 %> + <% @versions.each do |ver| %> + "> + + + + + + + + + <% line_num += 1 %> + <% end %> +
    #<%= l(:field_updated_on) %><%= l(:field_author) %><%= l(:field_comments) %>
    <%= link_to h(ver.version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked', true);") if show_diff && (line_num < @versions.size) %><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %><%= format_time(ver.updated_on) %><%= link_to_user ver.author %><%=h ver.comments %> - <%= link_to l(:button_annotate), :action => 'annotate', :id => @page.title, :version => ver.version %> - <%= delete_link wiki_page_path(@page, :version => ver.version) if User.current.allowed_to?(:delete_wiki_pages, @page.project) && @version_count > 1 %> -
    #<%= l(:field_updated_on) %><%= l(:field_author) %><%= l(:field_comments) %>
    + <%= link_to h(ver.version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %> + + <%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked', true);") if show_diff && (line_num < @versions.size) %> + + <%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %> + + <%= format_time(ver.updated_on) %> + + <%= link_to_user ver.author %> + + <%=h ver.comments.truncate(25,ommision:'...') %> + + <%= link_to l(:button_annotate), :action => 'annotate', :id => @page.title, :version => ver.version %> + <%= delete_link wiki_page_path(@page, :version => ver.version) if User.current.allowed_to?(:delete_wiki_pages, @page.project) && @version_count > 1 %> +
    <%= submit_tag l(:label_view_diff), :class => 'small' if show_diff %> -<%= pagination_links_full @version_pages, @version_count %> + + <%= pagination_links_full @version_pages, @version_count %> + <% end %> diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb index b4386b754..eff1e9d77 100644 --- a/app/views/wiki/show.html.erb +++ b/app/views/wiki/show.html.erb @@ -1,61 +1,62 @@
    -<% if @editable %> -<% if @content.current_version? %> - <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %> - <%= watcher_link(@page, User.current) %> - <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> - <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> - <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %> - <%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %> -<% else %> - <%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %> -<% end %> -<% end %> -<%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> + <% if @editable %> + <% if @content.current_version? %> + <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %> + <%= watcher_link(@page, User.current) %> + <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> + <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> + <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %> + <%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %> + <% else %> + <%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %> + <% end %> + <% end %> + <%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
    - <%= wiki_page_breadcrumb(@page) %> - <% unless @content.current_version? %>

    - <%= link_to(("\xc2\xab " + l(:label_previous)), - :action => 'show', :id => @page.title, :project_id => @page.project, - :version => @content.previous.version) + " - " if @content.previous %> - <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %> - <%= '('.html_safe + link_to(l(:label_diff), :controller => 'wiki', :action => 'diff', - :id => @page.title, :project_id => @page.project, - :version => @content.version) + ')'.html_safe if @content.previous %> - - <%= link_to((l(:label_next) + " \xc2\xbb"), :action => 'show', - :id => @page.title, :project_id => @page.project, - :version => @content.next.version) + " - " if @content.next %> - <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => nil) %> -
    - <%= @content.author ? link_to_user(@content.author) : l(:label_user_anonymous) - %>, <%= format_time(@content.updated_on) %>
    - <%=h @content.comments %> + <%= link_to(("\xc2\xab " + l(:label_previous)), + :action => 'show', :id => @page.title, :project_id => @page.project, + :version => @content.previous.version) + " - " if @content.previous %> + <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %> + <%= '('.html_safe + link_to(l(:label_diff), :controller => 'wiki', :action => 'diff', + :id => @page.title, :project_id => @page.project, + :version => @content.version) + ')'.html_safe if @content.previous %> - + <%= link_to((l(:label_next) + " \xc2\xbb"), :action => 'show', + :id => @page.title, :project_id => @page.project, + :version => @content.next.version) + " - " if @content.next %> + <%= link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => nil) %> +
    + + <%= @content.author ? link_to_user(@content.author) : l(:label_user_anonymous)%>, + <%= format_time(@content.updated_on) %> + +
    + <%=h @content.comments %>


    <% end %> - <%= render(:partial => "wiki/content", :locals => {:content => @content}) %> - <%= link_to_attachments @page %> - <% if @editable && authorize_for('wiki', 'add_attachment') %> -
    -

    <%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;", - :id => 'attach_files_link' %>

    -<%= form_tag({:controller => 'wiki', :action => 'add_attachment', - :project_id => @project, :id => @page.title}, - :multipart => true, :id => "add_attachment_form", - :style => "display:none;") do %> -
    -

    <%= render :partial => 'attachments/form' %>

    -
    -<%= submit_tag l(:button_add) %> -<%= link_to l(:button_cancel), {}, :onclick => "$('#add_attachment_form').hide(); return false;" %> -<% end %> -
    +
    +

    + <%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;", + :id => 'attach_files_link' %>

    + <%= form_tag({:controller => 'wiki', :action => 'add_attachment', + :project_id => @project, :id => @page.title}, + :multipart => true, :id => "add_attachment_form", + :style => "display:none;") do %> +
    +

    + <%= render :partial => 'attachments/form' %> +

    +
    + <%= submit_tag l(:button_add) %> + <%= link_to l(:button_cancel), {}, :onclick => "$('#add_attachment_form').hide(); return false;" %> + <% end %> +
    <% end %> <% other_formats_links do |f| %> @@ -63,9 +64,7 @@ <%= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %> <%= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %> <% end if User.current.allowed_to?(:export_wiki_pages, @project) %> - <% content_for :sidebar do %> <%= render :partial => 'sidebar' %> <% end %> - <% html_title @page.pretty_title %> From 3a48034fcaa6f1c69fe3bf9427c3ac50cf4d5801 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 22 Oct 2014 10:50:41 +0800 Subject: [PATCH 31/44] =?UTF-8?q?#1387=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?--=E8=B5=84=E6=BA=90=E5=BA=93-=E5=85=B3=E8=81=94=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=9F=A5=E8=AF=A2=E5=87=BA=E6=9D=A5=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=98=AF=E6=95=B4=E4=B8=AA=E9=A1=B9=E7=9B=AE=E4=B8=AD?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=9A=84=E9=9B=86=E5=90=88=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/attachments_helper.rb | 15 +++++++++------ app/views/files/_course_new.html.erb | 7 ++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb index e6f20ea60..060ced940 100644 --- a/app/helpers/attachments_helper.rb +++ b/app/helpers/attachments_helper.rb @@ -143,16 +143,19 @@ module AttachmentsHelper params[:q] ||= "" filename_condition = params[:q].strip - attachAll = Attachment.scoped - - # 闄ゅ幓褰撳墠璇剧▼鐨勬墍鏈夎祫婧 - nobelong_attach = Attachment.where("!(container_type = '#{course.class}' and container_id = #{course.id})") unless course.blank? + #attachAll = Attachment.where("author_id = #{User.current.id}") + # + ## 闄ゅ幓褰撳墠璇剧▼鐨勬墍鏈夎祫婧 + #nobelong_attach = # 鎼滅储鍩熺‘瀹 - domain = course.nil? ? attachAll : nobelong_attach + course.nil? ? + domain=Attachment.where("author_id = #{User.current.id}") + : + domain=Attachment.where("author_id = #{User.current.id} and container_type = 'Course' and container_id <> #{course.id}") unless course.blank? # 鎼滅储鍒扮殑璧勬簮 - searched_attach = domain.where("is_public=1 and filename LIKE :like ", like:"%#{filename_condition}%").limit(limit).order('created_on desc') + searched_attach = domain.where("filename LIKE :like ", like:"%#{filename_condition}%").limit(limit).order('created_on desc') #searched_attach = private_filter searched_attach searched_attach = paginateHelper(searched_attach, 10) diff --git a/app/views/files/_course_new.html.erb b/app/views/files/_course_new.html.erb index 88c33d865..2eaa70cb6 100644 --- a/app/views/files/_course_new.html.erb +++ b/app/views/files/_course_new.html.erb @@ -1,4 +1,6 @@ -

    <%=l(:label_attachment_new)%>

    +

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

    <% attachmenttypes = course.attachmenttypes %> <%= error_messages_for 'attachment' %> @@ -8,8 +10,7 @@ <% if attachmenttypes.any? %> <%= l(:attachment_type) %> <%= select_tag "attachment_type", - options_from_collection_for_select(attachmenttypes, "id", - "typeName", 2), {style: 'width:100px'} %> + options_from_collection_for_select(attachmenttypes, "id","typeName", 2), {style: 'width:100px'} %> <% end %>

    From bf49f46b2217e6c7e21ba090ab13ca972c31f806 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 22 Oct 2014 12:02:05 +0800 Subject: [PATCH 32/44] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8A=A5=E9=94=99=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- app/views/users/show.html.erb | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 93626b86b..089960e76 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -26,7 +26,7 @@ class CoursesController < ApplicationController def join if User.current.logged? course = Course.find_by_id params[:object_id] - if course + unless course @state = 4 else unless (allow_join(course) && User.current.member_of_course?(course)) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 3d2b7b0f0..fd0195833 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,11 +1,19 @@ <% if User.current.id == @user.id %> From 91d08d5b9ac027ed26ce2b1b02f9e3ba4cab5f9a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 23 Oct 2014 09:44:06 +0800 Subject: [PATCH 41/44] =?UTF-8?q?#1233=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5--=E5=8A=A8=E6=80=81=EF=BC=9A=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E9=A1=B9=E7=9B=AE=E9=93=BE=E6=8E=A5=E6=8A=A5500?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84BUG=20=E4=BC=98=E5=8C=96=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 825 ++++++++++++++++++++-------------- 1 file changed, 484 insertions(+), 341 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index fd0195833..7d13e404e 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -48,353 +48,485 @@ <% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%> - + @@ -451,12 +583,19 @@ - + + + <%= format_time e.created_on %> + +
    <%= image_tag(url_to_avatar(e.user), :class => "avatar") %> + <%= image_tag(url_to_avatar(e.user), :class => "avatar") %> + <% case e.act_type %> - <% when 'JournalsForMessage' %> - - - - - - - - - - <% when 'Bid' %> - - <% if act.reward_type == 3 && @show_course == 1%> - <% if e.user == User.current %> + <% when 'JournalsForMessage' %> + - <% else %> - + + - <% end %> - <% else %> - <% if e.user == User.current %> - + + - <% else %> - + <% when 'Bid' %> + + <% if act.reward_type == 3 && @show_course == 1%> + <% if e.user == User.current %> + + <% else %> + + <% end %> + <% else %> + <% if e.user == User.current %> + + <% else %> + + <% end %> + <% end %> + + + + + + + + <% when 'Journal' %> + + <% if e.user == User.current %> + + <% else %> + + <% end %> + + + <% if act.notes.nil? %> + <% desStr = '' %> + <% else %> + <% desStr= textAreailizable(act, :notes) %> + <% end %> + + + + + + <% when 'Changeset' %> + + <% if e.user == User.current %> + + <% else %> + + <% end %> + + + + + + + + <% when 'Message' %> + + <% if e.user == User.current %> + + <% else %> + + <% end %> + + + - <% end %> - <% end %> - - - - - - - - <% when 'Journal' %> - - <% if e.user == User.current %> - - <% else %> - - <% end %> - - - <% if act.notes.nil? %> - <% desStr = '' %> - <% else %> - <% desStr= textAreailizable(act, :notes) %> - <% end %> - - - - - - <% when 'Changeset' %> - - <% if e.user == User.current %> - - <% else %> - - <% end %> - - - - - - - - <% when 'Message' %> - - <% if e.user == User.current %> - - <% else %> - - <% end %> - - - - - - - - <% when 'Principal' %> - - <% if e.user == User.current %> - - <% else %> - - <% end %> - - - - - - - - <% when 'News' %> - - <% if e.user == User.current %> - - <% else %> - - <% end %> - - - - - - - - <% when 'Issue' %> - - <% if e.user == User.current %> - - <% else %> - - <% end %> - - - - - - - - <% when 'Contest' %> - - <% if e.user == User.current && @show_contest == 1%> - - <% else %> - - <% end %> - - - - - - - <% else %> - <% end %> + + + + + <% when 'Principal' %> + + <% if e.user == User.current %> + + <% else %> + + <% end %> + + + + + + + + <% when 'News' %> + + <% if e.user == User.current %> + + <% else %> + + <% end %> + + + + + + + + <% when 'Issue' %> + + <% if e.user == User.current %> + + <% else %> + + <% end %> + + + + + + + + <% when 'Contest' %> + + <% if e.user == User.current && @show_contest == 1%> + + <% else %> + + <% end %> + + + + + + + <% else %> + <% end %>
    - <% if User.current.login == e.user.try(:login) %> - - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> - -   - <% else %> - <%= link_to("#{e.user.name}", user_path(e.user_id)) %> - <% end %> - - <%= l(:label_have_feedback) %> - <%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> - -
    -

    <%= textAreailizable act.notes %>

    -
    - - <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %> - -
    -
    -
    - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -
    -
    -
    - - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> - + <% if User.current.login == e.user.try(:login) %> + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + +   + <% else %> + + <%= link_to("#{e.user.name}", user_path(e.user_id)) %> + + <% end %> - <%= l(:label_i_new_activity) %> + <%= l(:label_have_feedback) %> + <%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %> + <%= l(:label_of_feedback) + l(:label_layouts_feedback) %> - <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> - - <%= link_to(h(e.user), user_path(e.user_id)) %> -   - - <%= l(:label_new_activity) %> -   - <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> +
    +

    + <%= textAreailizable act.notes %> +

    +
    + + <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %> + +
    - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> - <%= l(:label_i_new_activity) %> - <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> +
    +
    + + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> + +
    +
    - <%= link_to(h(e.user), user_path(e.user_id)) %>  - <%= l(:label_new_activity) %>  - <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> +
    + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + + + <%= l(:label_i_new_activity) %> + + <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + + + <%= link_to(h(e.user), user_path(e.user_id)) %> +   + + <%= l(:label_new_activity) %> +   + <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + + + <%= l(:label_i_new_activity) %> + + <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + + + <%= link_to(h(e.user), user_path(e.user_id)) %> +   + + <%= l(:label_new_activity) %> +   + <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> +
    +

    + <%=textAreailizable act, :description %> +

    +
    + + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> + +
    +
    + + <%= link_to l(:label_find_all_comments), respond_path(e.act_id) %> + + + <%= l(:label_comments_count, :count => e.act.commit) %> + +
    +
    + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + +   + + <%= l(:label_i_new_activity) %> + +   + <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> + <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), + {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> + + + <%= link_to(h(e.user), user_path(e.user_id)) %> + +   + + <%= l(:label_new_activity) %> + +   + <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> + <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), + {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> +
    +

    + <%= desStr %> +

    +
    +
    + + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> + +
    +
    +
    + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + +   + + <%= l(:label_i_new_activity) %> + +   + <%= link_to format_activity_title(act.title), + {:controller => 'repositories', + :action => 'revision', + :id => act.repository.project, + :repository_id => act.repository.identifier_param, + :rev => act.identifier} %> + + + <%= link_to(h(e.user), user_path(e.user_id)) %> + +   + + <%= l(:label_new_activity) %> + +   + <%= link_to format_activity_title(act.title), + {:controller => 'repositories', + :action => 'revision', + :id => act.repository.project, + :repository_id => act.repository.identifier_param, + :rev => act.identifier} %> +
    +

    + <%= textAreailizable act,:long_comments %> +

    +
    +
    + + <%= format_time(e.act.committed_on) %> + +
    +
    + <%= link_to l(:label_find_all_comments), + {:controller => 'repositories', + :action => 'revision', + :id => act.repository.project, + :repository_id => act.repository.identifier_param, + :rev => act.identifier} %> + + + <%= l(:label_comments_count, :count => e.act.count) %> + +
    +
    + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + +   + + <%= l(:label_i_new_activity) %> + +   + <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), + {:controller => 'messages', + :action => 'show', + :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> + + + <%= link_to(h(e.user), user_path(e.user_id)) %> + +   + + <%= l(:label_new_activity) %> + +   + <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), + {:controller => 'messages', + :action => 'show', + :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> +
    +

    + <%= textAreailizable(act,:content) %> +

    -

    <%=textAreailizable act, :description %>

    -
    - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -
    -
    - <%= link_to l(:label_find_all_comments), respond_path(e.act_id) %> - <%= l(:label_comments_count, :count => e.act.commit) %> -
    -
    - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>  - <%= l(:label_i_new_activity) %>  - <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> - <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), - {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> - - <%= link_to(h(e.user), user_path(e.user_id)) %>  - <%= l(:label_new_activity) %>  - <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> - <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), - {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> -

    <%= desStr %>

    -
    -
    - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -
    -
    -
    - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>  - <%= l(:label_i_new_activity) %>  - <%= link_to format_activity_title(act.title), - {:controller => 'repositories', - :action => 'revision', - :id => act.repository.project, - :repository_id => act.repository.identifier_param, - :rev => act.identifier} %> - - <%= link_to(h(e.user), user_path(e.user_id)) %>  - <%= l(:label_new_activity) %>  - <%= link_to format_activity_title(act.title), - {:controller => 'repositories', - :action => 'revision', - :id => act.repository.project, - :repository_id => act.repository.identifier_param, - :rev => act.identifier} %> -
    -

    <%= textAreailizable act,:long_comments %>

    -
    - <%= format_time(e.act.committed_on) %> -
    -
    - <%= link_to l(:label_find_all_comments), - {:controller => 'repositories', - :action => 'revision', - :id => act.repository.project, - :repository_id => act.repository.identifier_param, - :rev => act.identifier} %> - - <%= l(:label_comments_count, :count => e.act.count) %> -
    -
    - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>  - <%= l(:label_i_new_activity) %>  - <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), - {:controller => 'messages', - :action => 'show', - :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> - - <%= link_to(h(e.user), user_path(e.user_id)) %>  - <%= l(:label_new_activity) %>  - <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), - {:controller => 'messages', - :action => 'show', - :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> -
    -

    <%= textAreailizable(act,:content) %>

    -
    -
    - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -
    -
    -
    - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>  - <%= l(:label_new_user) %> - - <%= link_to(h(e.user), user_path(e.user_id)) %>  - <%= l(:label_new_user) %> -

    -
    - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -
    -
    -
    - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>  - <%= l(:label_i_new_activity) %>  - <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> - - <%= link_to(h(e.user), user_path(e.user_id)) %>  - <%= l(:label_new_activity) %>  - <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> -
    -

    <%= textAreailizable act,:description %>

    -
    - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -
    -
    - - <%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %> - - - <%= l(:label_comments_count, :count => e.act.comments_count) %> - -
    -
    - - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> -   - - <%= l(:label_i_new_activity) %> -   - <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), - {:controller => 'issues', - :action => 'show', - :id => act.id} %> - - - <%= link_to(h(e.user), user_path(e.user_id)) %> -   - - <%= l(:label_new_activity) %> -   - <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), - {:controller => 'issues', - :action => 'show', - :id => act.id} %> -
    - <%= textAreailizable act, :description %> -
    -
    - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -
    -
    - <%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %> - <%= l(:label_comments_count, :count => e.act.journals.count) %> -
    -
    - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>  - <%= l(:label_i_new_activity) %>  - <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> - - <%= link_to(h(e.user), user_path(e.user_id)) %>  - <%= l(:label_new_activity) %>  - <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> -

    <%= textAreailizable act, :description %>

    -
    -
    - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -
    -
    +
    + + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> + +
    +
    +
    + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + +   + + <%= l(:label_new_user) %> + + + + <%= link_to(h(e.user), user_path(e.user_id)) %> + +   + + <%= l(:label_new_user) %> + +
    +

    +
    +
    + + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> + +
    +
    +
    + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + +   + + <%= l(:label_i_new_activity) %> + +   + <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> + + + <%= link_to(h(e.user), user_path(e.user_id)) %> + +   + + <%= l(:label_new_activity) %> + +   + <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> +
    +

    + <%= textAreailizable act,:description %> +

    +
    +
    + + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> + +
    +
    + + <%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %> + + + <%= l(:label_comments_count, :count => e.act.comments_count) %> + +
    +
    + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + +   + + <%= l(:label_i_new_activity) %> +   + <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), + {:controller => 'issues', + :action => 'show', + :id => act.id} %> + + + <%= link_to(h(e.user), user_path(e.user_id)) %> +   + + <%= l(:label_new_activity) %> +   + <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), + {:controller => 'issues', + :action => 'show', + :id => act.id} %> +
    + <%= textAreailizable act, :description %> +
    +
    + + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> + +
    +
    + + <%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %> + + + <%= l(:label_comments_count, :count => e.act.journals.count) %> + +
    +
    + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + +   + + <%= l(:label_i_new_activity) %> + +   + <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> + + + <%= link_to(h(e.user), user_path(e.user_id)) %> + +   + + <%= l(:label_new_activity) %> + +   + <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> +
    +

    + <%= textAreailizable act, :description %> +

    +
    +
    + + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> + +
    +

    <%= textAreailizable e.notes %>

    +

    + <%= textAreailizable e.notes %> +

    +
    - <%= format_time e.created_on %>
    @@ -466,11 +605,15 @@
    <% else %> -

    <%= l(:label_no_user_respond_you) %>

    +

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

    <% end %> From 923a33add544ba0c018e5ccb2ee08f44de0ab391 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 23 Oct 2014 10:44:06 +0800 Subject: [PATCH 42/44] =?UTF-8?q?#1397=E3=80=81#1396=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E9=80=9A=E7=9F=A5=E5=A2=9E=E5=8A=A0js?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contestnotifications/_form.html.erb | 39 +++++------ app/views/contestnotifications/index.html.erb | 64 ++++++++++++++++++- config/locales/zh.yml | 4 ++ 3 files changed, 86 insertions(+), 21 deletions(-) diff --git a/app/views/contestnotifications/_form.html.erb b/app/views/contestnotifications/_form.html.erb index 36bcd78c6..908d1138d 100644 --- a/app/views/contestnotifications/_form.html.erb +++ b/app/views/contestnotifications/_form.html.erb @@ -3,24 +3,27 @@ <%= l(:bale_news_notice) %>
    -

    - <%= f.text_field :title, - :required => true, - :size => 60, - :maxlength => 60, - :style => "width:488px;" - %> -

    -

    - <%= f.text_area :description, - :required => true, - :cols => 60, - :rows => 11, - :class => 'wiki-edit', - :style => "width:490px;" - %> -

    - +

    + <%= f.text_field :title, + :required => true, + :size => 60, + :maxlength => 60, + :style => "width:488px;", + :onblur => "regexTitle();" + %> +

    + +

    + <%= f.text_area :description, + :required => true, + :cols => 60, + :rows => 11, + :class => 'wiki-edit', + :style => "width:490px;", + :onblur => "regexDescription();" + %> +

    +
    <%= wikitoolbar_for 'news_description' %> diff --git a/app/views/contestnotifications/index.html.erb b/app/views/contestnotifications/index.html.erb index 8a4278551..a678d87e8 100644 --- a/app/views/contestnotifications/index.html.erb +++ b/app/views/contestnotifications/index.html.erb @@ -1,3 +1,62 @@ + + <%= l(:label_notification) %> @@ -12,10 +71,9 @@ <%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest), :html => {:id => 'contestnotifications-form', :multipart => true} do |f| %> <%= render :partial => 'contestnotifications/form', :locals => {:f => f} %> - <%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %> - <%#= preview_link preview_contestnotifications_path(:contest_id => @contest), 'contestnotifications-form', target='preview', {:class => 'whiteButton m3p10'} %> + | - <%= link_to l(:button_cancel), "#", :onclick => '$("#add-contestnotifications").hide(); return false;', :class => 'whiteButton m3p10' %> + <% end if @contest %>
    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index d20bb6e6d..2eb44a0a6 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2165,3 +2165,7 @@ zh: lable_course_teacher: 涓昏鑰佸笀 lable_course_end: 璇剧▼瀛︽湡宸茬粨鏉 lable_file_sharingarea: 璧勬簮鍏变韩鍖 + label_no_contest_news_description: 绔炶禌鎻忚堪涓嶈兘涓虹┖ + label_contest_news_condition: 绔炶禌鎻忚堪瓒呰繃5000涓眽瀛 + label_no_contest_news_title: 绔炶禌鏍囬涓嶈兘涓虹┖ + label_contest_news_title_condition: 绔炶禌鏍囬瓒呰繃255涓眽瀛 From 943df643aa80be6a42f5fba4584d6819121b2087 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 23 Oct 2014 10:45:25 +0800 Subject: [PATCH 43/44] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E9=A1=B5=E9=9D=A2=E5=8F=96=E6=B6=88=E6=8C=89?= =?UTF-8?q?=E9=92=AEjs=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contestnotifications/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/contestnotifications/new.html.erb b/app/views/contestnotifications/new.html.erb index a5a1c7e58..5008a61d7 100644 --- a/app/views/contestnotifications/new.html.erb +++ b/app/views/contestnotifications/new.html.erb @@ -4,7 +4,7 @@ :html => { :id => 'contestnotifications-form', :multipart => true } do |f| %> <%= render :partial => 'contestnotifications/form', :locals => { :f => f } %> <%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> - <%= submit_tag l(:button_cancel), :class => "whiteButton m3p10 h30",:onclick => "cancel();" %> + <% end %> From d2f4b38eb6fd68a67940b8ffe735d8f7437acde1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 23 Oct 2014 10:57:23 +0800 Subject: [PATCH 44/44] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5new=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=9A=201.=E5=A2=9E=E5=8A=A0js=E9=AA=8C=E8=AF=81=EF=BC=8C?= =?UTF-8?q?=202.=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8D=B4=E6=8F=90=E4=BA=A4=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contestnotifications/_form.html.erb | 51 +++++++++++++++++ app/views/contestnotifications/index.html.erb | 55 +------------------ app/views/contestnotifications/new.html.erb | 16 ++++-- 3 files changed, 65 insertions(+), 57 deletions(-) diff --git a/app/views/contestnotifications/_form.html.erb b/app/views/contestnotifications/_form.html.erb index 908d1138d..f3861f034 100644 --- a/app/views/contestnotifications/_form.html.erb +++ b/app/views/contestnotifications/_form.html.erb @@ -1,4 +1,55 @@ <%= error_messages_for @contestnotifications %> +
    <%= l(:bale_news_notice) %>
    diff --git a/app/views/contestnotifications/index.html.erb b/app/views/contestnotifications/index.html.erb index a678d87e8..50de15698 100644 --- a/app/views/contestnotifications/index.html.erb +++ b/app/views/contestnotifications/index.html.erb @@ -1,60 +1,11 @@ diff --git a/app/views/contestnotifications/new.html.erb b/app/views/contestnotifications/new.html.erb index 5008a61d7..310a68d77 100644 --- a/app/views/contestnotifications/new.html.erb +++ b/app/views/contestnotifications/new.html.erb @@ -1,11 +1,17 @@ - + <%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest), :html => { :id => 'contestnotifications-form', :multipart => true } do |f| %> <%= render :partial => 'contestnotifications/form', :locals => { :f => f } %> - <%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> - - - + + <%= link_to l(:button_cancel), contest_contestnotifications_path(@contest.id) %> <% end %>