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/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..fb6c2e8fe 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 @@ -217,25 +217,21 @@ class AdminController < ApplicationController if request.get? @contest_page = FirstPage.find_by_page_type('contest') @first_page = FirstPage.find_by_page_type('project') - @notification = ContestNotification.first; elsif request.post? @first_page = FirstPage.find_by_page_type('project') @contest_page = FirstPage.find_by_page_type('contest') - @notification = ContestNotification.first; @first_page.web_title = params[:web_title] @contest_page.web_title = params[:web_title] @contest_page.title = params[:contest_title] @contest_page.image_width = params[:image_width] @contest_page.image_height = params[:image_height] @contest_page.description = params[:contest_description] - @notification.title = params[:contest_notification_title] - @notification.content = params[:contest_notification][:content] - if @first_page.save && @contest_page.save && @notification.save + if @first_page.save && @contest_page.save 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 +266,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..67948a8e1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -499,19 +499,19 @@ class ApplicationController < ActionController::Base def render_403(options={}) @project = nil - #render_error({:message => :notice_not_authorized, :status => 403}.merge(options)) - render :template => 'common/403' + render_error({:message => :notice_not_authorized, :status => 403}.merge(options),'common/403') + #render :template => 'common/403' return false end def render_404(options={}) - #render_error({:message => :notice_file_not_found, :status => 404}.merge(options)) - render :template => 'common/404' + render_error({:message => :notice_file_not_found, :status => 404}.merge(options),'common/404') + #render :template => 'common/404' return false end # Renders an error response - def render_error(arg) + def render_error(arg,template = 'common/error') arg = {:message => arg} unless arg.is_a?(Hash) @message = arg[:message] @lay = arg[:layout] @@ -521,9 +521,9 @@ class ApplicationController < ActionController::Base respond_to do |format| format.html { if @lay - render :template => 'common/error', :layout => @lay,:status => @status + render :template => template, :layout => @lay,:status => @status else - render :template => 'common/error', :layout => use_layout, :status => @status + render :template => template, :layout => use_layout, :status => @status end } @@ -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/attachments_controller.rb b/app/controllers/attachments_controller.rb index 905bbb0a2..75b87c6f0 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -84,7 +84,10 @@ class AttachmentsController < ApplicationController candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3 candown = true + elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses + candown = User.current.member_of_course?(@attachment.container.courses.first) || (course.is_public == 1 && @attachment.is_public == 1) else + candown = @attachment.is_public == 1 end if candown || User.current.admin? || User.current.id == @attachment.author_id diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index c54a419cb..8402c05f0 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -21,30 +21,37 @@ class CoursesController < ApplicationController before_filter :toggleCourse, only: [:finishcourse, :restartcourse] before_filter :require_login, :only => [:join, :unjoin] - before_filter :allow_join, :only => [:join] + #before_filter :allow_join, :only => [:join] def join if User.current.logged? - course = Course.find(params[:object_id]) - unless User.current.member_of_course? course - if params[:course_password] == course.password - members = [] - members << Member.new(:role_ids => [10], :user_id => User.current.id) - course.members << members - StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id]) - @state = 0 + course = Course.find_by_id params[:object_id] + if course + if course_endTime_timeout? course + @state = 2 else - @state = 1 + if User.current.member_of_course?(course) + @state = 3 + else + if params[:course_password] == course.password + members = [] + members << Member.new(:role_ids => [10], :user_id => User.current.id) + course.members << members + StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id]) + @state = 0 + else + @state = 1 + end + end end else - @state = 3 + @state = 4 end else - @state = 4 + @state = 5 end respond_to do |format| - # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} - format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Course.find(params[:object_id]), :object_id => params[:object_id]} } + format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => course, :object_id => params[:object_id]} } end rescue Exception => e @state = 4 @@ -424,9 +431,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 @@ -434,49 +439,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 @@ -518,18 +511,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?) @@ -697,8 +686,8 @@ class CoursesController < ApplicationController private - def allow_join - if course_endTime_timeout? Course.find(params[:object_id]) + def allow_join course + if course_endTime_timeout? course respond_to do |format| format.js { @state = 2 @@ -719,7 +708,4 @@ class CoursesController < ApplicationController render_404 end end - - - end diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 89ad42c17..313afa1c7 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -113,7 +113,7 @@ class FilesController < ApplicationController end if order_by.count == 1 - sort += "#{Attachment.table_name}.#{attribute} desc " + sort += "#{Attachment.table_name}.#{attribute} asc " elsif order_by.count == 2 sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} " end diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 4e23fc41b..00c843045 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -130,7 +130,7 @@ class MyController < ApplicationController @user.pref.save @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) set_language_if_valid @user.language - flash.now[:notice] = l(:notice_account_updated) + flash[:notice] = l(:notice_account_updated) redirect_to user_url(@user) return else 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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9d1bb1472..7e6e3d04a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -33,15 +33,16 @@ class UsersController < ApplicationController before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info, :user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :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,:update_score,:user_activities] + :activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index] #edit has been deleted by huang, 2013-9-23 before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :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/controllers/web_footer_companies_controller.rb b/app/controllers/web_footer_companies_controller.rb index 4c5748e40..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,8 +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]}" - new - render :action => 'new' + respond_to do |format| + format.html { render :action => 'new'} + format.api { render_validation_errors(@company) } + end + end end @@ -42,7 +45,6 @@ class WebFooterCompaniesController < ApplicationController redirect_to web_footer_companies_url else flash[:error] = "#{l :web_footer_company_update_fail}: #{@company.errors.full_messages[0]}" - edit render :action => 'edit' end end 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/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 3a8b1b09a..99b21d8cc 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() @@ -504,20 +503,8 @@ module CoursesHelper activities[news.course_id]+=1 end - #feedbackc_count - JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess| - activities[jourformess.jour_id]+=1 - end - - #activities!=0 - i=0; - courses.each do |course| - id=course.id - if activities[id]==0 - activities[id]=1 - end - end - + # 鍔ㄦ佹暟 + 1 ( 鏌愭煇鍒涘缓浜嗚璇剧▼ ) + activities.each_pair { |key, value| activities[key] = value + 1 } return activities end 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/admin/_tab_partial.html.erb b/app/views/admin/_tab_partial.html.erb new file mode 100644 index 000000000..86191fdb5 --- /dev/null +++ b/app/views/admin/_tab_partial.html.erb @@ -0,0 +1,8 @@ +
+ +
\ No newline at end of file diff --git a/app/views/admin/contest_page_made.html.erb b/app/views/admin/contest_page_made.html.erb index dab3b6885..a25f149ed 100644 --- a/app/views/admin/contest_page_made.html.erb +++ b/app/views/admin/contest_page_made.html.erb @@ -5,14 +5,7 @@ <%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>

-
- -
+ <%= render 'tab_partial' %>

<%=l(:label_contest_first_page)%>

@@ -38,26 +31,7 @@ <%= text_area_tag 'contest_description',@contest_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>

-

- - -

-
- -

- <%= text_field_tag 'contest_notification_title', params[:label_contest_notification_title], :value => @notification.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %> -

- - <%= text_area 'contest_notification', 'content', :value => @notification.content,:cols => 80, :rows => 15, :class => 'wiki-edit' %> - <%= wikitoolbar_for 'contest_notification_content' %> - - -
<%= submit_tag l(:button_save), :class => "small", :name => nil %> <% end %>
diff --git a/app/views/admin/course_page_made.html.erb b/app/views/admin/course_page_made.html.erb index aa99dc7cd..8b91e2600 100644 --- a/app/views/admin/course_page_made.html.erb +++ b/app/views/admin/course_page_made.html.erb @@ -5,14 +5,7 @@ <%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>

-
- -
+ <%= render 'tab_partial' %>

<%=l(:label_course_first_page)%>

diff --git a/app/views/admin/first_page_made.html.erb b/app/views/admin/first_page_made.html.erb index e4403457c..d8fbc0533 100644 --- a/app/views/admin/first_page_made.html.erb +++ b/app/views/admin/first_page_made.html.erb @@ -5,14 +5,7 @@ <%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>

-
- -
+ <%= render 'tab_partial' %>

<%=l(:label_project_first_page)%>

diff --git a/app/views/admin/web_footer_made.html.erb b/app/views/admin/web_footer_made.html.erb index 52f7cd5eb..65e77631c 100644 --- a/app/views/admin/web_footer_made.html.erb +++ b/app/views/admin/web_footer_made.html.erb @@ -5,14 +5,7 @@ <%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>

-
- -
+ <%= render 'tab_partial' %>
<%= link_to l(:label_cooperation_compnay), web_footer_companies_path %>

<%=l(:label_web_footer_page)%>

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/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index 145e01f1c..29033ec59 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -21,15 +21,18 @@ <%= error_messages_for 'bid' %> -

<%= l(:label_homeworks_form_new_description) %>

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %> -

-

+

+ +

-

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

-

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :onchange => "regexDeadLine();") %> +

+ <%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %> +

+

+ <%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :onchange => "regexDeadLine();") %> <%= calendar_for('bid_deadline')%> @@ -44,6 +47,10 @@ <%= hidden_field_tag 'course_id', @course.id %>

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

<%= render :partial => 'attachments/form', :locals => {:container => @bid} %>

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

+ <%= render :partial => 'attachments/form', :locals => {:container => @bid} %> +

\ No newline at end of file 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{ } 椤甸潰涓嶈浜嗭紒寤鸿鎮

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/_form.html.erb b/app/views/contestnotifications/_form.html.erb index 36bcd78c6..f3861f034 100644 --- a/app/views/contestnotifications/_form.html.erb +++ b/app/views/contestnotifications/_form.html.erb @@ -1,26 +1,80 @@ <%= error_messages_for @contestnotifications %> +
<%= 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 870c4cd4c..50de15698 100644 --- a/app/views/contestnotifications/index.html.erb +++ b/app/views/contestnotifications/index.html.erb @@ -1,3 +1,13 @@ + + <%= l(:label_notification) %> @@ -12,20 +22,50 @@ <%= 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 %>
<% 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 +97,7 @@
<% end %> - <% end %> +
diff --git a/app/views/contestnotifications/new.html.erb b/app/views/contestnotifications/new.html.erb index a5a1c7e58..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" %> - <%= submit_tag l(:button_cancel), :class => "whiteButton m3p10 h30",:onclick => "cancel();" %> - - + + <%= link_to l(:button_cancel), contest_contestnotifications_path(@contest.id) %> <% 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/courses/_course.html.erb b/app/views/courses/_course.html.erb index 239f2da26..9298c253c 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 %>

@@ -46,13 +47,11 @@

<%= 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))) %>

- <%= 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 +61,7 @@ <% if(course_endTime_timeout? @course) %> - 璇剧▼瀛︽湡宸茬粨鏉 + <%= l(:lable_course_end) %> <% else %> <%= join_in_course_for_list(@course, User.current,['regular'])%> @@ -80,10 +79,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/_course_form.html.erb b/app/views/courses/_course_form.html.erb index 1b1c86b64..4324c5d47 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -2,7 +2,7 @@ function get_options(value) { $.ajax({ type: "POST", - url: '/school/get_options/' + encodeURIComponent(value), + url: 'http://<%= Setting.host_name%>/school/get_options/' + encodeURIComponent(value), data: 'text', success: function (data) { $("#occupation").html(data); diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index b397b8d8f..7d1171116 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -21,30 +21,40 @@ <%= error_messages_for 'bid' %> -

<%= l(:label_homeworks_form_new_description) %>

- <%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %> + <%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", + :maxlength => Bid::NAME_LENGTH_LIMIT, + :onblur => "regexName();" %>

-

+

+ +

-

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

- +

+ <%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", + :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %> +

<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %> <%= calendar_for('bid_deadline')%>

-

<%= f.select :is_evaluation, is_evaluation_option %> +

+ <%= f.select :is_evaluation, is_evaluation_option %>

-

<%= f.select :proportion, proportion_option %> +

+ <%= f.select :proportion, proportion_option %>

-

<%= hidden_field_tag 'course_id', @course.id %> +

+ <%= hidden_field_tag 'course_id', @course.id %>

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

<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>

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

+ <%= render :partial => 'attachments/form', :locals => {:container => @homework} %> +

\ No newline at end of file diff --git a/app/views/courses/_join_private_course.html.erb b/app/views/courses/_join_private_course.html.erb index 60223922f..35e075b8c 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/_set_join.js.erb b/app/views/courses/_set_join.js.erb index fb9b9924e..c125e34bc 100644 --- a/app/views/courses/_set_join.js.erb +++ b/app/views/courses/_set_join.js.erb @@ -11,8 +11,8 @@ <% elsif @state == 3 %> alert("鎮ㄥ凡缁忓姞鍏ヤ簡璇剧▼"); <% elsif @state == 4 %> - alert("鎮ㄥ凡缁忕殑璇剧▼涓嶅瓨鍦"); - <% elsif @state == 4 %> + alert("鎮ㄥ姞鍏ョ殑璇剧▼涓嶅瓨鍦"); + <% elsif @state == 5 %> alert("鎮ㄨ繕鏈櫥褰"); <% else %> alert("鏈煡閿欒锛岃绋嶅悗鍐嶈瘯"); 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/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/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index f685e4543..ab0f20257 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 %> @@ -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/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) %>
- + 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_new.html.erb b/app/views/files/_course_new.html.erb index 960b2d399..2eaa70cb6 100644 --- a/app/views/files/_course_new.html.erb +++ b/app/views/files/_course_new.html.erb @@ -1,14 +1,16 @@ -

<%=l(:label_attachment_new)%>

+

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

<% attachmenttypes = course.attachmenttypes %> <%= error_messages_for 'attachment' %> + <%= form_tag(course_files_path(course), :multipart => true,:remote => true,:method => :post,:name=>"upload_form", :class => "tabular") do %>

<% 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 %>

diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb index 15ef36580..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") %> - <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype",: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/forums/_form.html.erb b/app/views/forums/_form.html.erb index 4679420f4..556238732 100644 --- a/app/views/forums/_form.html.erb +++ b/app/views/forums/_form.html.erb @@ -18,9 +18,12 @@ <%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %>
- - <%= 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/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_admin.html.erb b/app/views/layouts/base_admin.html.erb index 636e33a3f..5b36febaf 100644 --- a/app/views/layouts/base_admin.html.erb +++ b/app/views/layouts/base_admin.html.erb @@ -36,7 +36,6 @@ <%= yield %> <%= call_hook :view_layouts_base_content %>
- <%= render_flash_messages %>
<%= render :partial => 'layouts/base_footer'%>
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_courses.html.erb b/app/views/layouts/base_courses.html.erb index bfb8d11d5..b7b832fb5 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -6,7 +6,9 @@ - <%= h html_title %> + + <%= h html_title %> + <%= csrf_meta_tag %> @@ -32,7 +34,11 @@ - + - - + +
楂樻牎璇剧▼瀹炶返绀惧尯<%= l(:label_user_location) %> : + + <%= l(:label_user_location) %> : + +
<%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %>

<%= link_to "涓婚〉", home_path %> - > <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %> - > <%= link_to @course.name, nil %>

+ <%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %> + +

+ <%= link_to "涓婚〉", home_path %> + > <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %> + > <%= link_to @course.name, nil %> +

+
@@ -67,8 +79,9 @@ - - + @@ -105,30 +115,33 @@ <% if User.current.member_of_course?(@course) %> <%= link_to "#{teacherCount(@course)}", course_member_path(@course, :role => 1), :course => '1' %> <% else %> - <%= teacherCount(@course)%> + + <%= teacherCount(@course)%> + <% end%> - + -
<%= link_to @course.name,course_path(@course) %> + <%= link_to @course.name,course_path(@course) %> +
@@ -80,9 +93,6 @@ <% else %> <%= join_in_course(@course, User.current) %> <% end %> - <%# unless User.current.member_of_course?(@course) %> - - <%# end %> <% end %> <% if User.current.member_of_course?(@course) %> <%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %> <% else %> - <%= studentCount(@course)%> + + <%= studentCount(@course)%> + <% end %> <%= link_to files_count, course_files_path(@course) %> + <%= link_to files_count, course_files_path(@course) %> +
- <%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %> <%= l(:label_x_base_courses_student, :count => studentCount(@course)) %> - <%= l(:label_x_course_data, :count => files_count) %>
@@ -140,46 +153,74 @@ - <%= l(:label_main_teacher) %> : - <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %> + + <%= l(:label_main_teacher) %> : + + + <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %> + - - <%= l(:label_setup_time) %> : - <%= @course.setup_time %> + + <%= l(:label_setup_time) %> : + + + <%= @course.setup_time %> + - <%= l(:label_endup_time) %> : - <%= @course.endup_time %> + + <%= l(:label_endup_time) %> : + + + <%= @course.endup_time %> + - <%= l(:label_class_period) %> : - <%= @course.class_period %> <%= l(:label_class_hour) %> + + <%= l(:label_class_period) %> : + + + <%= @course.class_period %>  + <%= l(:label_class_hour) %> + - <%= l(:label_main_term) %> : - <%= @course.time %> <%= @course.term %> + + <%= l(:label_main_term) %> : + + + <%= @course.time %> + <%= @course.term %> + <% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %> - <%= l(:label_teacher_work_unit) %> : - - <%= @course.teacher.user_extensions.school %> + + <%= l(:label_teacher_work_unit) %> : + + + + <%= @course.teacher.user_extensions.school %> + + <% else %> - <%= l(:label_teacher_work_unit) %> : - <%= l(:field_course_un) %> + + <%= l(:label_teacher_work_unit) %> : + + + <%= l(:field_course_un) %> + <% end %> - -
@@ -187,11 +228,9 @@
<%= l(:label_new_course_description) %>
-
<% if @course.description && !@course.description.blank? %>
- <%= textilizable @course.description %>
<% else %> @@ -200,7 +239,10 @@
<% end %>
- <%= l(:label_create_time) %>锛<%= format_time(@course.created_at) %> + + <%= l(:label_create_time) %>锛 + + <%= format_time(@course.created_at) %>
@@ -240,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 %> @@ -257,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 01813bf52..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 %> @@ -33,17 +35,26 @@ - - + - + <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %> + +
    楂樻牎璇剧▼瀹炶返绀惧尯<%= l(:label_user_location) %> : + <%= l(:label_user_location) %> : +
    - <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %>

    <%= link_to "涓婚〉", home_path %> - > <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> > - <%= link_to(course.name.to_s, homework_course_path(course)) if course %> - > - <%= link_to(@bid.name, respond_path(@bid)) %>

    +

    <%= link_to "涓婚〉", home_path %> + > + <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> + > + + <%= link_to(course.name.to_s, homework_course_path(course)) if course %> + + > + <%= link_to(@bid.name, respond_path(@bid)) %> +

    +
    @@ -93,53 +104,84 @@ + + <%= l(:label_new_course_description) %> : + + - + - - + + - - + + - - + + - - + + - - - - <% unless @user.user_extensions.nil? || @user.user_extensions.school.nil? %> - - <% end %> - -
    - <%= l(:label_new_course_description) %> :
    <%= textilizable course.description %> + <%= textilizable course.description %> +
    <%= l(:label_create_time) %> :<%= format_time course.created_at %> + <%= l(:label_create_time) %> : + + <%= format_time course.created_at %> +
    涓昏鑰佸笀 :<%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %> + <%= l(:lable_course_teacher) %> : + + <%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %> +
    <%= l(:label_class_period) %> :<%= course.class_period.to_s %> <%= l(:label_class_hour) %> + <%= l(:label_class_period) %> : + + <%= course.class_period.to_s %>  + <%= l(:label_class_hour) %> +
    <%= l(:label_main_term) %> :<%= course.time.to_s %> <%= course.term %> + <%= l(:label_main_term) %> : + + <%= course.time.to_s %> + <%= course.term %> +
    <%= l(:label_teacher_work_unit) %> :<%= link_to @user.user_extensions.school,"http://course.trustie.net/?school_id=#{@user.user_extensions.school.id}" %>
    - -
    + + + <%= l(:label_teacher_work_unit) %> : + + + <% unless @user.user_extensions.nil? || @user.user_extensions.school.nil? %> + + <%= link_to @user.user_extensions.school,"http://#{Setting.host_course}/?school_id=#{@user.user_extensions.school.id}" %> + + <% end %> + + + +
    - - + - + <% unless @bid.parent_id.nil? %> @@ -160,7 +202,9 @@
    <%= l(:label_limit_time) %>: <%= @bid.deadline %> + <%= l(:label_limit_time) %>: + <%= @bid.deadline %> +
    浣滀笟绫诲瀷: <%= @bid.homework_type==Bid::HomeworkFile ? "鎻愪氦鏂囦欢" : "鎻愪氦椤圭洰" %>
    - +
    <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %> + <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %> +
    @@ -238,7 +282,9 @@
    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/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 1410e2277..97d5fc47f 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -274,14 +274,14 @@ <% if @user.user_extensions.identity == 2 %> <%= render_menu :user_enterprise_menu %> <% else %> - <%= render_menu :user_menu %> + <%= render_menu :user_menu,@user %> <% end %>
    <%= yield %> <%= call_hook :view_layouts_base_content %>
    - <%= render_flash_messages %> + <%#= render_flash_messages %> 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"); diff --git a/app/views/memos/_form.html.erb b/app/views/memos/_form.html.erb index 116f97149..41ea73fcd 100644 --- a/app/views/memos/_form.html.erb +++ b/app/views/memos/_form.html.erb @@ -1,13 +1,3 @@ <%= error_messages_for 'bid' %> - -

    <%= l(:label_homeworks_form_new_description) %>

    -

    <%= 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/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 %> 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 diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index 2cfeea80e..eb0a7f53e 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -4,25 +4,15 @@
    - <% unless replying %> -

    - -
    - <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :maxlength => 254 %> -

    - <% else %> -

    - -
    - <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %> -

    - <% end %> + <% extra_option = replying ? { readonly: true} : { maxlength: 254 } %> +

    + +
    + <%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %> +

    <% unless replying %> <% if @message.safe_attribute? 'sticky' %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 8f118de05..ab77620fd 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -16,10 +16,10 @@ function get_options(value) { $.ajax({ type: "POST", - url: '<%= Setting.host_name == "micros.nudt.edu.cn" ? '/ros/school/get_options/' : '/school/get_options/'%>' + encodeURIComponent(value), + url: 'http://<%= Setting.host_name%>/school/get_options/' + encodeURIComponent(value), data: 'text', success: function (data) { - $("#province").val(value) + $("#province").val(value); $("#schoollist").html(data); } }); @@ -110,7 +110,7 @@ <%= l(:field_occupation) %> * - + <% end %>

    diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 7b4c209b0..70fca5e48 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -141,7 +141,7 @@ <%= format_time(comment.created_on) %> - <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, + <%= link_to_if_authorized image_tag('delete.png'), delete_news_comments_path(id: @news, comment: comment), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index f4b505065..eac6f85ce 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -4,10 +4,10 @@ - - - - + + + + @@ -37,7 +37,7 @@ <% end %> <% elsif repository.scm_name=="Git"%> <%if User.current.allowed_to?(:manage_repository, @project) %> - <%= link_to(l(:label_user_plural), committers_repository_path(repository), :class => 'icon icon-user') %> diff --git a/app/views/projects/settings/_versions.html.erb b/app/views/projects/settings/_versions.html.erb index 778803bf3..98d7c5563 100644 --- a/app/views/projects/settings/_versions.html.erb +++ b/app/views/projects/settings/_versions.html.erb @@ -1,35 +1,65 @@ <% if @project.shared_versions.any? %> -
    <%= l(:field_identifier) %><%= l(:field_repository_is_default) %><%= l(:label_scm) %><%= l(:label_repository_path) %><%= l(:field_identifier) %><%= l(:field_repository_is_default) %><%= l(:label_scm) %><%= l(:label_repository_path) %>
    - - - - - - - +
    <%= l(:label_version) %><%= l(:field_effective_date) %><%= l(:field_description) %><%= l(:field_status) %><%= l(:field_sharing) %><%= l(:label_wiki_page) %>
    + + + + + + + + -<% for version in @project.shared_versions.sort %> - - - - - - - - - -<% end; reset_cycle %> - + <% for version in @project.shared_versions.sort %> + + + + + + + + + + <% end; reset_cycle %> +
    + <%= l(:label_version) %> + + <%= l(:field_effective_date) %> + + <%= l(:field_description) %> + + <%= l(:field_status) %> + + <%= l(:field_sharing) %> + + <%= l(:label_wiki_page) %> +
    <%= link_to_version version %><%= format_date(version.effective_date) %><%=h version.description %><%= l("version_status_#{version.status}") %><%= link_to_if_authorized(h(version.wiki_page_title), {:controller => 'wiki', :action => 'show', :project_id => version.project, :id => Wiki.titleize(version.wiki_page_title)}) || h(version.wiki_page_title) unless version.wiki_page_title.blank? || version.project.wiki.nil? %> - <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> - <%= link_to l(:button_edit), edit_version_path(version), :class => 'icon icon-edit' %> - <%= delete_link version_path(version) %> - <% end %> -
    + <%= link_to_version version %> + + <%= format_date(version.effective_date) %> + + <%=h version.description %> + + <%= l("version_status_#{version.status}") %> + + <%= link_to_if_authorized(h(version.wiki_page_title), {:controller => 'wiki', + :action => 'show', + :project_id => version.project, + :id => Wiki.titleize(version.wiki_page_title)}) || h(version.wiki_page_title) unless version.wiki_page_title.blank? || version.project.wiki.nil? %> + + <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> + <%= link_to l(:button_edit), edit_version_path(version), :class => 'icon icon-edit' %> + <%= delete_link version_path(version) %> + <% end %> +
    <% else %> -

    <%= l(:label_no_data) %>

    +

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

    <% end %>
    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]';" %>

    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/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/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} %>