Date: Mon, 19 Oct 2015 14:03:08 +0800
Subject: [PATCH 021/169] 0
---
app/controllers/repositories_controller.rb | 144 ++++++++++-----------
1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 3552c0624..8f90dd65b 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -29,7 +29,7 @@ class RepositoriesController < ApplicationController
menu_item :repository
menu_item :settings, :only => [:new, :create, :edit, :update, :destroy, :committers]
default_search_scope :changesets
-
+
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo]
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo]
@@ -42,7 +42,7 @@ class RepositoriesController < ApplicationController
include RepositoriesHelper
helper :project_score
#@root_path = RepositoriesHelper::ROOT_PATH
-
+
rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
def new
@@ -62,8 +62,8 @@ class RepositoriesController < ApplicationController
end
end
-
-
+
+
def newrepo
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
@repository = Repository.factory(scm)
@@ -76,23 +76,23 @@ class RepositoriesController < ApplicationController
render :layout => 'base_projects'
end
end
-
+
def fork
@repository_url = params[:repository_url]
-
+
# @repository.url
# system "htpasswd -mb "+@root_path+"user.passwd "+params[:repository][:identifier]+" "+@upasswd
# system "echo -e '"+params[:project_id]+"-"+params[:repository][:identifier]+"-write:"+
- # " "+params[:repository][:identifier]+"' >> "+@root_path+"group.passwd"
- system "git clone --bare "+@repository_url
+ # " "+params[:repository][:identifier]+"' >> "+@root_path+"group.passwd"
+ system "git clone --bare "+@repository_url
# system "mv "+@project_path+"/hooks/post-update{.sample,}"
# system "chmod a+x "+@project_path+"/hooks/post-update"
# system "."+@project_path+"/hooks/post-update"
# system "echo -e 'Allow from all \n Order Deny,Allow \n "+
- # " \n"+
- # "Require group "+params[:project_id]+"-"+params[:repository][:identifier]+"-write \n "+
- # " \n ' >>"+
- # @project_path+"/.htaccess"
+ # " \n"+
+ # "Require group "+params[:project_id]+"-"+params[:repository][:identifier]+"-write \n "+
+ # " \n ' >>"+
+ # @project_path+"/.htaccess"
flash[:notice] = l(:label_notice_fork_successed)
@repositories = @project.repositories
render :action => 'show', :layout => 'base_projects'
@@ -141,7 +141,7 @@ update
logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name
attrs = pickup_extra_info
if((@repository_tag!="")&¶ms[:repository_scm]=="Git")
- params[:repository][:url]=@project_path
+ params[:repository][:url]=@project_path
end
###xianbo
@repository = Repository.factory(params[:repository_scm])
@@ -175,7 +175,7 @@ update
end
redirect_to settings_project_url(@project, :tab => 'repositories',:repository_error_message=>@repository.errors.full_messages)
else if(@repository_tag.blank?)
- #render :action => 'newrepo', :layout =>'base_projects'
+ #render :action => 'newrepo', :layout =>'base_projects'
redirect_to settings_project_url(@project, :tab => 'repositories',:repository => "pswd_is_null",:repository_error_message=>@repository.errors.full_messages)
else
redirect_to settings_project_url(@project, :tab => 'repositories',:repository => @repository,:repository_error_message=>@repository.errors.full_messages)
@@ -185,7 +185,7 @@ update
end
end
-
+
def edit
end
@@ -230,11 +230,11 @@ update
flash[:notice] = l(:notice_successful_update)
redirect_to settings_project_url(@project, :tab => 'repositories')
elsif request.get?
- respond_to do |format|
- format.html{
- render :layout => "base_projects"
- }
- end
+ respond_to do |format|
+ format.html{
+ render :layout => "base_projects"
+ }
+ end
end
@@ -275,7 +275,7 @@ update
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
else
#Modified by young
- # (show_error_not_found; return) unless @entries
+ # (show_error_not_found; return) unless @entries
@changesets = @repository.latest_changesets(@path, @rev)
@properties = @repository.properties(@path, @rev)
@repositories = @project.repositories
@@ -283,7 +283,7 @@ update
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
ip = RepositoriesHelper::REPO_IP_ADDRESS
@repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+
- @repository.url.slice(project_path_cut, @repository.url.length).to_s
+ @repository.url.slice(project_path_cut, @repository.url.length).to_s
if @course_tag == 1
render :action => 'show', :layout => 'base_courses'
else
@@ -309,10 +309,10 @@ update
per_page_option,
params['page']
@changesets = @repository.changesets.
- limit(@changeset_pages.per_page).
- offset(@changeset_pages.offset).
- includes(:user, :repository, :parents).
- all
+ limit(@changeset_pages.per_page).
+ offset(@changeset_pages.offset).
+ includes(:user, :repository, :parents).
+ all
respond_to do |format|
format.html { render :layout => 'base_projects' }
@@ -338,8 +338,8 @@ update
@content = @repository.cat(@path, @rev)
(show_error_not_found; return) unless @content
if is_raw ||
- (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) ||
- ! is_entry_text_data?(@content, @path)
+ (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) ||
+ ! is_entry_text_data?(@content, @path)
# Force the download
send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) }
send_type = Redmine::MimeType.of(@path)
@@ -422,8 +422,8 @@ update
filename = "changeset_r#{@rev}"
filename << "_r#{@rev_to}" if @rev_to
send_data @diff.join, :filename => "#{filename}.diff",
- :type => 'text/x-patch',
- :disposition => 'attachment'
+ :type => 'text/x-patch',
+ :disposition => 'attachment'
else
@diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
@diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
@@ -434,7 +434,7 @@ update
User.current.preference.save
end
@cache_key = "repositories/diff/#{@repository.id}/" +
- Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}-#{current_language}")
+ Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}-#{current_language}")
unless read_fragment(@cache_key)
@diff = @repository.diff(@path, @rev, @rev_to)
unless @diff
@@ -461,16 +461,16 @@ update
def graph
data = nil
case params[:graph]
- when "commits_per_month"
- data = graph_commits_per_month(@repository)
- when "commits_per_author"
- data = graph_commits_per_author(@repository)
- when "author_commits_per_month"
- data = graph_author_commits_per_month(@repository)
- when "author_commits_six_month"
- data = author_commits_six_month(@repository)
- when "author_code_six_months"
- data = author_code_six_month(@repository)
+ when "commits_per_month"
+ data = graph_commits_per_month(@repository)
+ when "commits_per_author"
+ data = graph_commits_per_author(@repository)
+ when "author_commits_per_month"
+ data = graph_author_commits_per_month(@repository)
+ when "author_commits_six_month"
+ data = author_commits_six_month(@repository)
+ when "author_code_six_months"
+ data = author_code_six_month(@repository)
end
if data
headers["Content-Type"] = "image/svg+xml"
@@ -550,14 +550,14 @@ update
@date_from = @date_to << 11
@date_from = Date.civil(@date_from.year, @date_from.month, 1)
commits_by_day = Changeset.count(
- :all, :group => :commit_date,
- :conditions => ["repository_id = ? AND commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
+ :all, :group => :commit_date,
+ :conditions => ["repository_id = ? AND commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
commits_by_month = [0] * 12
commits_by_day.each {|c| commits_by_month[(@date_to.month - c.first.to_date.month) % 12] += c.last }
changes_by_day = Change.count(
- :all, :group => :commit_date, :include => :changeset,
- :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
+ :all, :group => :commit_date, :include => :changeset,
+ :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
changes_by_month = [0] * 12
changes_by_day.each {|c| changes_by_month[(@date_to.month - c.first.to_date.month) % 12] += c.last }
@@ -565,26 +565,26 @@ update
12.times {|m| fields << month_name(((Date.today.month - 1 - m) % 12) + 1)}
graph = SVG::Graph::Bar.new(
- :height => 300,
- :width => 600,
- :fields => fields.reverse,
- :stack => :side,
- :scale_integers => true,
- :step_x_labels => 2,
- :show_data_values => true,
- :graph_title => l(:label_commits_per_month),
- :show_graph_title => true
+ :height => 300,
+ :width => 600,
+ :fields => fields.reverse,
+ :stack => :side,
+ :scale_integers => true,
+ :step_x_labels => 2,
+ :show_data_values => true,
+ :graph_title => l(:label_commits_per_month),
+ :show_graph_title => true
)
# 具状图
graph.add_data(
- :data => commits_by_month[0..11].reverse,
- :title => l(:label_revision_plural)
+ :data => commits_by_month[0..11].reverse,
+ :title => l(:label_revision_plural)
)
graph.add_data(
- :data => changes_by_month[0..11].reverse,
- :title => l(:label_change_plural)
+ :data => changes_by_month[0..11].reverse,
+ :title => l(:label_change_plural)
)
graph.burn
@@ -609,23 +609,23 @@ update
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
- :height => 400,
- :width => 600,
- :fields => fields,
- :stack => :side,
- :scale_integers => true,
- :show_data_values => true,
- :rotate_y_labels => false,
- :graph_title => l(:label_commits_per_author),
- :show_graph_title => true
+ :height => 400,
+ :width => 600,
+ :fields => fields,
+ :stack => :side,
+ :scale_integers => true,
+ :show_data_values => true,
+ :rotate_y_labels => false,
+ :graph_title => l(:label_commits_per_author),
+ :show_graph_title => true
)
graph.add_data(
- :data => commits_data,
- :title => l(:label_revision_plural)
+ :data => commits_data,
+ :title => l(:label_revision_plural)
)
graph.add_data(
- :data => changes_data,
- :title => l(:label_change_plural)
+ :data => changes_data,
+ :title => l(:label_change_plural)
)
graph.burn
end
@@ -636,7 +636,7 @@ update
@date_from = @date_to << 12
@date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day)
commits_by_author = Changeset.count(:all, :group => :committer,
- :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
+ :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25)
fields = commits_by_author.collect {|r| r.first}
From 11d1cac40da69e01582a0bf691becd96c3db67c3 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Wed, 21 Oct 2015 17:13:07 +0800
Subject: [PATCH 022/169] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87git?=
=?UTF-8?q?lab=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/application_controller.rb | 3 +-
app/controllers/repositories_controller.rb | 96 ++++++-------------
app/models/repository.rb | 5 +
.../settings/_new_repositories.html.erb | 12 ---
app/views/repositories/_form.html.erb | 7 +-
app/views/repositories/_form_create.html.erb | 3 -
lib/trustie/gitlab/helper.rb | 37 +++++++
lib/trustie/gitlab/manage_member.rb | 30 ++++--
lib/trustie/gitlab/manage_user.rb | 37 +++++++
lib/trustie/gitlab/sync.rb | 29 ++----
10 files changed, 140 insertions(+), 119 deletions(-)
create mode 100644 lib/trustie/gitlab/manage_user.rb
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 86c220bd2..a7b6ac114 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -38,7 +38,8 @@ class ApplicationController < ActionController::Base
protect_from_forgery
def handle_unverified_request
super
- cookies.delete(autologin_cookie_name)
+ raise(ActionController::InvalidAuthenticityToken)
+ # cookies.delete(autologin_cookie_name)
end
before_filter :find_first_page
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 442f6d22c..9d1284fde 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -115,74 +115,34 @@ update
}
def create
- if params[:repository_scm].to_s == 'Gitlab'
- # add by nwb
- # 增加对gitlab版本库的支持
- attrs = pickup_extra_info
- @repository = Repository.factory('Git')
- @repository.safe_attributes = params[:repository]
- if attrs[:attrs_extra].keys.any?
- @repository.merge_extra_info(attrs[:attrs_extra])
- end
- @repository.project = @project
- if request.post? && @repository.save
- redirect_to settings_project_url(@project, :tab => 'repositories')
- else
- redirect_to settings_project_url(@project, :tab => 'repositories')
- end
- else # 原逻辑
- ##xianbo
- @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] || params[:repository][:password]
- @repo_name=User.current.login.to_s+"_"+params[:repository][:identifier]
- logger.info "htpasswd -mb "+@root_path+"htdocs/user.passwd "+@repo_name+": "+@repository_tag
- logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name
- attrs = pickup_extra_info
- if((@repository_tag!="")&¶ms[:repository_scm]=="Git")
- params[:repository][:url]=@project_path
- end
- ###xianbo
- @repository = Repository.factory(params[:repository_scm])
- @repository.safe_attributes = params[:repository]
- if attrs[:attrs_extra].keys.any?
- @repository.merge_extra_info(attrs[:attrs_extra])
- end
-
- @repository.project = @project
- if request.post? && @repository.save
- if(params[:repository_scm]=="Git")
- system "htpasswd -mb "+@root_path+"htdocs/user.passwd "+@repo_name+" "+@repository_tag
- system "echo -e '"+@repo_name+"-write:"+
- " "+@repo_name+"' >> "+@root_path+"htdocs/group.passwd"
- system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s
- system "git init --bare "+@project_path
- system "mv "+@project_path+"/hooks/post-update{.sample,}"
- system "chmod a+x "+@project_path+"/hooks/post-update"
- system "echo -e 'Allow from all \n Order Deny,Allow \n "+
- " \n"+
- "Require group "+@repo_name+"-write \n "+
- " \n ' >> "+
- @root_path+"htdocs/"+ @repository_name+"/.htaccess"
- system "cd "+@project_path+" ;git update-server-info"
-
- File.open(@project_path+"/hooks/post-update", "w+") do |f|
- f.write(HOOK_TEMPLATE)
- end
-
- @repository.update_attributes(:login => User.current.login.to_s)
- end
- redirect_to settings_project_url(@project, :tab => 'repositories',:repository_error_message=>@repository.errors.full_messages)
- else if(@repository_tag.blank?)
- #render :action => 'newrepo', :layout =>'base_projects'
- redirect_to settings_project_url(@project, :tab => 'repositories',:repository => "pswd_is_null",:repository_error_message=>@repository.errors.full_messages)
- else
- redirect_to settings_project_url(@project, :tab => 'repositories',:repository => @repository,:repository_error_message=>@repository.errors.full_messages)
- end
- end
-
+ attrs = pickup_extra_info
+ @repository = Repository.factory('Git')
+ @repository.safe_attributes = params[:repository]
+ if attrs[:attrs_extra].keys.any?
+ @repository.merge_extra_info(attrs[:attrs_extra])
+ end
+ @repository.project = @project
+ @repository.type = 'Repository::Gitlab'
+ @repository.url = @repository.identifier
+ if request.post? && @repository.save
+ g = ::Gitlab.client
+ gid = @project.owner.gid
+ gproject = g.create_project(@repository.identifier,
+ path: @repository.identifier,
+ description: @project.description,
+ wiki_enabled: false,
+ wall_enabled: false,
+ issues_enabled: false,
+ snippets_enabled: false,
+ public: false,
+ user_id: gid
+ )
+ @project.gpid = gproject.id
+ @project.save!
+ redirect_to settings_project_url(@project, :tab => 'repositories')
+ else
+ redirect_to settings_project_url(@project, :tab => 'repositories',:repository_error_message=>@repository.errors.full_messages)
end
end
@@ -266,7 +226,7 @@ update
end
end
- unless @repository && @repository.type == 'Repository::Gitlab'
+ unless @repository.gitlab?
# redirect_to to_gitlab_project_repository_path(@project, @repository)
render :to_gitlab
return
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 5680f05a7..94b7905c6 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -57,6 +57,11 @@ class Repository < ActiveRecord::Base
safe_attributes 'url',
:if => lambda {|repository, user| repository.new_record?}
+
+ def gitlab?
+ self.type == 'Repository::Gitlab'
+ end
+
def repo_create_validation
unless Setting.enabled_scm.include?(self.class.name.demodulize)
errors.add(:type, :invalid)
diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb
index 0859e5e19..bfb87b16a 100644
--- a/app/views/projects/settings/_new_repositories.html.erb
+++ b/app/views/projects/settings/_new_repositories.html.erb
@@ -73,13 +73,6 @@
<%= l(:text_scm_command_not_available) %>
<% end %>
-
- <% unless judge_main_repository(@project) %>
-
- <%=l(:field_repository_is_default)%>:
- <%= f.check_box :is_default, :label => "", :no_label => true %>
-
- <% end %>
@@ -89,11 +82,6 @@
<%=l(:text_length_between,:min=>1,:max=>254)<
<% end %>
-
- * <%=l(:label_password)%>
- <%= f.password_field :upassword, :label=> "", :no_label => true%>
- <%= l(:label_upassword_info)%>
-
<%=l(:button_save)%>
diff --git a/app/views/repositories/_form.html.erb b/app/views/repositories/_form.html.erb
index bc5a060db..8c169d7be 100644
--- a/app/views/repositories/_form.html.erb
+++ b/app/views/repositories/_form.html.erb
@@ -31,12 +31,7 @@
<%= 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/repositories/_form_create.html.erb b/app/views/repositories/_form_create.html.erb
index d8c30143e..11dce9cd4 100644
--- a/app/views/repositories/_form_create.html.erb
+++ b/app/views/repositories/_form_create.html.erb
@@ -26,7 +26,6 @@ border:none
<%= l(:text_scm_command_not_available) %>
<% end %>
-<%= f.check_box :is_default, :label => :field_repository_is_default %>
@@ -36,8 +35,6 @@ border:none
<%= l(:text_repository_identifier_info).html_safe %>
<% end %>
-<%= f.password_field :upassword, :required =>true, :label=> :field_password %>
- <%= l(:label_upassword_info)%>
<%= submit_tag(@repository.new_record? ? l(:button_create) : l(:button_save)) %>
diff --git a/lib/trustie/gitlab/helper.rb b/lib/trustie/gitlab/helper.rb
index e69de29bb..5ea4c13e1 100644
--- a/lib/trustie/gitlab/helper.rb
+++ b/lib/trustie/gitlab/helper.rb
@@ -0,0 +1,37 @@
+#coding=utf-8
+
+module Trustie
+ module Gitlab
+ module Helper
+ def change_password(uid, en_pwd, salt)
+ options = {:encrypted_password=>en_pwd, :password_salt=>salt}
+ self.g.put("/users/ext/#{uid}", :body => options)
+ # g.edit_user(uid, :encrypted_password=>en_pwd, :password_salt=>salt)
+ end
+
+ def add_user(user)
+ u = nil
+ begin
+ u = self.g.get("/users?search=#{user.mail}").first
+ unless u
+ u = self.g.create_user(user.mail,
+ user.hashed_password,
+ name: user.show_name,
+ username: user.login,
+ confirm: "true")
+ user.gid = u.id
+ end
+ change_password(u.id, user.hashed_password, user.salt)
+ rescue => e
+ puts e
+ end
+ return u
+ end
+
+ def del_user(user)
+ ## gitlab unimplement
+ end
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/lib/trustie/gitlab/manage_member.rb b/lib/trustie/gitlab/manage_member.rb
index 8201d1759..d0f74ad5e 100644
--- a/lib/trustie/gitlab/manage_member.rb
+++ b/lib/trustie/gitlab/manage_member.rb
@@ -14,27 +14,41 @@ module Trustie
end
def change_gitlab_member
- if self.member.project_id == 2
+ if isGitlabProject?
@g ||= ::Gitlab.client
- @g.edit_team_member(11, self.member.user.gid, self.role.to_gitlab_role )
+ @g.edit_team_member(project.gpid, self.member.user.gid, self.role.to_gitlab_role )
end
end
def add_gitlab_member
- if self.member.project_id == 2
+ if isGitlabProject?
@g ||= ::Gitlab.client
- @g.add_team_member(11, self.member.user.gid, self.role.to_gitlab_role )
+ @g.add_team_member(project.gpid, self.member.user.gid, self.role.to_gitlab_role )
end
end
def delete_gitlab_member
- if member.roles.count <=1
- if self.member.project_id == 2
- @g ||= ::Gitlab.client
- @g.remove_team_member(11, self.member.user.gid)
+ if isGitlabProject?
+ if member.roles.count <=1
+ @g ||= ::Gitlab.client
+ @g.remove_team_member(project.gpid, self.member.user.gid)
end
end
end
+
+ private
+ def project
+ self.member.project
+ end
+
+ def repository
+ project.repository
+ end
+
+ def isGitlabProject?
+ repository && repository.gitlab?
+ end
+
end
end
diff --git a/lib/trustie/gitlab/manage_user.rb b/lib/trustie/gitlab/manage_user.rb
new file mode 100644
index 000000000..76528739c
--- /dev/null
+++ b/lib/trustie/gitlab/manage_user.rb
@@ -0,0 +1,37 @@
+#coding=utf-8
+#
+#
+require_relative 'helper'
+module Trustie
+ module Gitlab
+ module ManageUser
+ include Helper
+
+ def self.included(base)
+ base.class_eval {
+ before_create :add_gitlab_user
+ before_destroy :delete_gitlab_user
+ before_save :change_gitlab_user
+ }
+ end
+
+ def add_gitlab_user
+ add_user(self)
+ end
+
+ def delete_gitlab_user
+ del_user(self)
+ end
+
+ def change_gitlab_user
+ change_password(self.gid, self.hashed_password, self.salt)
+ end
+
+ private
+ def g
+ @g ||= ::Gitlab.client
+ end
+
+ end
+ end
+end
diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb
index 597e01a36..d941795ee 100644
--- a/lib/trustie/gitlab/sync.rb
+++ b/lib/trustie/gitlab/sync.rb
@@ -1,3 +1,7 @@
+#coding=utf-8
+
+require_relative 'helper'
+
module Trustie
module Gitlab
module UserLevel
@@ -10,33 +14,17 @@ module Trustie
class Sync
attr :g
+ include Helper
def initialize
@g = ::Gitlab.client
end
- def change_password(uid, en_pwd, salt)
- options = {:encrypted_password=>en_pwd, :password_salt=>salt}
- self.g.put("/users/ext/#{uid}", :body => options)
- # g.edit_user(uid, :encrypted_password=>en_pwd, :password_salt=>salt)
- end
-
def sync_user(user)
- begin
- u = self.g.get("/users?search=#{user.mail}").first
- unless u
- u = self.g.create_user(user.mail, user.hashed_password, name: user.show_name, username: user.login, confirm: "true")
- user.gid = u.id
- user.save!
- puts "create user #{user.login}"
- end
- change_password(u.id, user.hashed_password, user.salt)
- rescue => e
- puts e
- end
+ u = add_user(user)
+ user.save! if u
end
-
def sync_project(project, opt={})
gid = project.owner.gid
raise "unknow gid" unless gid
@@ -48,7 +36,6 @@ module Trustie
if opt[:password]
import_url.sub('@', ":#{opt[:password]}@")
end
-
# import url http://xianbo_trustie2:1234@repository.trustie.net/xianbo/trustie2.git
# can use password
@@ -80,7 +67,7 @@ module Trustie
def remove_project
end
-
end
+
end
end
\ No newline at end of file
From 7e21c00aed2d82f75be0f53cfe2036c55c4c6996 Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 22 Oct 2015 09:20:19 +0800
Subject: [PATCH 023/169] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E7=9A=84=E5=9B=9E=E5=A4=8D=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/words_controller.rb | 38 +++++
app/models/homework_common.rb | 13 ++
app/views/users/_course_homework.html.erb | 72 ++++++++-
.../users/_user_homework_detail.html.erb | 150 ++++++++++++++++++
app/views/users/_user_homework_list.html.erb | 114 +++++--------
app/views/words/leave_homework_message.js.erb | 7 +
config/routes.rb | 1 +
7 files changed, 316 insertions(+), 79 deletions(-)
create mode 100644 app/views/users/_user_homework_detail.html.erb
create mode 100644 app/views/words/leave_homework_message.js.erb
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 6304055ed..6ad1a66b4 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -243,7 +243,45 @@ class WordsController < ApplicationController
flash[:error] = feedback.errors.full_messages[0]
redirect_to course_feedback_url(params[:id])
end
+ end
+
+ #作业的回复
+ def leave_homework_message
+ if User.current.logged?
+ @user = User.current
+ @homework_common = HomeworkCommon.find(params[:id]);
+ if params[:homework_message].size>0 && User.current.logged? && @user
+ feedback = HomeworkCommon.add_homework_jour(@user, params[:homework_message], params[:id])
+ if (feedback.errors.empty?)
+ if params[:asset_id]
+ ids = params[:asset_id].split(',')
+ update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE
+ end
+ course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework_common.id}").first
+ if course_activity
+ course_activity.updated_at = Time.now
+ course_activity.save
+ end
+ user_activity = UserActivity.where("act_type='HomeworkCommon' and act_id =#{@homework_common.id}").first
+ if user_activity
+ user_activity.updated_at = Time.now
+ user_activity.save
+ end
+ respond_to do |format|
+ format.js{
+ @user_activity_id = params[:user_activity_id]
+ @is_in_course = params[:is_in_course]
+ @homework_common_id = params[:homework_common_id]
+ }
+ end
+ else
+ flash[:error] = feedback.errors.full_messages[0]
+ end
+ end
+ else
+ render_403
+ end
end
def add_brief_introdution
diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb
index 796080645..03a7644a2 100644
--- a/app/models/homework_common.rb
+++ b/app/models/homework_common.rb
@@ -12,6 +12,7 @@ class HomeworkCommon < ActiveRecord::Base
has_many :homework_tests, :dependent => :destroy
has_many :student_works, :dependent => :destroy, :conditions => "is_test=0"
has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表
+ has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy #用户活动
# 课程动态
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy
@@ -60,6 +61,18 @@ class HomeworkCommon < ActiveRecord::Base
self.homework_type == 2 && self.homework_detail_programing
end
+ ###添加回复
+ def self.add_homework_jour(user, notes, id , options = {})
+ homework = HomeworkCommon.find(id)
+ if options.count == 0
+ jfm = homework.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0)
+ else
+ jfm = homework.journals_for_messages.build(options)
+ end
+ jfm.save
+ jfm
+ end
+
delegate :language_name, :language, :to => :homework_detail_programing
end
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 2d3bc68de..df42f6ee9 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -1,5 +1,5 @@
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
-
+
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
@@ -71,4 +71,74 @@
+
+ <% count=activity.journals_for_messages.count %>
+
+
+
+
+ 回复(<%= count %>)
+
+
+ <%if count>3 %>
+
+ <% end %>
+
+
+ <% replies_all_i = 0 %>
+ <% if count > 0 %>
+
+
+ <% activity.journals_for_messages.reorder("created_on desc").each do |comment| %>
+
+ <% replies_all_i = replies_all_i + 1 %>
+
+
+ <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
+
+
+
+ <% if comment.try(:user).try(:realname) == ' ' %>
+ <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(comment.created_on) %>
+
+
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
+
+
+ <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%>
+ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
+
+
+
发送
+
+
+ <% end%>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
new file mode 100644
index 000000000..40400c71e
--- /dev/null
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -0,0 +1,150 @@
+<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
+
+
+
+ <%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
+
+
+
+ <%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
+ TO
+ <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
+
+
+ <%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
+
+
+ <% if homework_common.homework_detail_manual%>
+ <% if homework_common.homework_detail_manual.comment_status == 1%>
+
未开启匿评
+ <% elsif homework_common.homework_detail_manual.comment_status == 2%>
+
匿评中
+ <% elsif homework_common.homework_detail_manual.comment_status == 3%>
+
匿评已结束
+ <% end%>
+ <% end%>
+
+
+
+ <%= user_for_homework_common homework_common,is_teacher %>
+
+ <% if homework_common.homework_type == 2 && is_teacher%>
+
+ <%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: homework_common.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
+
+ <% end %>
+ <% if homework_common.homework_type == 2%>
+
+ 语言:
+ <%= homework_common.language_name%>
+
+ <% end %>
+
+ <%= l(:label_end_time)%>:<%= homework_common.end_time%>
+
+
+
+ <%= homework_common.description.html_safe %>
+
+
+ <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
+
+
+ <% if is_teacher%>
+ <%# if false%>
+
+
+
+
+
+ <%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => is_in_course), :class => "postOptionLink"%>
+
+
+ <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
+
+
+ <%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) if homework_common.homework_detail_manual.comment_status == 1%>
+
+
+ <%= homework_anonymous_comment homework_common %>
+
+
+
+
+
+ <% end%>
+
+
+
+
+ <% count=homework_common.journals_for_messages.count %>
+
+
+
+
+ 回复(<%= count %>)
+
+
+ <%if count>3 %>
+
+ <% end %>
+
+
+ <% replies_all_i = 0 %>
+ <% if count > 0 %>
+
+
+ <% homework_common.journals_for_messages.reorder("created_on desc").each do |comment| %>
+
+ <% replies_all_i = replies_all_i + 1 %>
+
+
+ <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
+
+
+
+ <% if comment.try(:user).try(:realname) == ' ' %>
+ <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(comment.created_on) %>
+
+
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
+
+
+ <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => homework_common.id},:method => "post", :remote => true) do |f|%>
+ <%= hidden_field_tag 'homework_common_id',params[:homework_common_id],:value =>homework_common.id %>
+ <%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %>
+
+
+
发送
+
+
+ <% end%>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb
index 44f992bb4..ad39ad14f 100644
--- a/app/views/users/_user_homework_list.html.erb
+++ b/app/views/users/_user_homework_list.html.erb
@@ -1,83 +1,41 @@
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
+
<% homework_commons.each do |homework_common|%>
- <% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
-
-
-
- <%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
-
-
-
- <%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
- TO
- <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
-
-
- <%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
-
+
+ <%= render :partial => 'users/user_homework_detail', :locals => {:homework_common => homework_common,:is_in_course => is_in_course} %>
<% end%>
<% if homework_commons.count == 10%>
<% if is_in_course == 1%>
diff --git a/app/views/words/leave_homework_message.js.erb b/app/views/words/leave_homework_message.js.erb
new file mode 100644
index 000000000..91525c889
--- /dev/null
+++ b/app/views/words/leave_homework_message.js.erb
@@ -0,0 +1,7 @@
+<% if @user_activity_id %>
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id}) %>");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+<% elsif @homework_common_id && @is_in_course %>
+ $("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>");
+ init_activity_KindEditor_data(<%= @homework_common_id%>,"","87%");
+<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 810c22e7a..d140c240a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -855,6 +855,7 @@ RedmineApp::Application.routes.draw do
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message"
+ post 'words/:id/leave_homework_message', :to => 'words#leave_homework_message', :as => "leave_homework_message"
post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin'
From 9cea468401a43691ccd845ce1884cc8ea87a54d6 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Thu, 22 Oct 2015 09:52:01 +0800
Subject: [PATCH 024/169] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=A9=BA=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E6=97=B6=E5=8F=96trees=E4=BC=9A=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/redmine/scm/adapters/gitlab_adapter.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/redmine/scm/adapters/gitlab_adapter.rb b/lib/redmine/scm/adapters/gitlab_adapter.rb
index 404243c89..32429fe35 100644
--- a/lib/redmine/scm/adapters/gitlab_adapter.rb
+++ b/lib/redmine/scm/adapters/gitlab_adapter.rb
@@ -100,6 +100,8 @@ module Redmine
entries.sort_by_name
rescue ScmCommandAborted
nil
+ rescue Exception
+ nil
end
def lastrev(path, rev)
From 1157dcaa06dd0c42a7358d9d23a47dd7c2c5cca2 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 22 Oct 2015 13:44:35 +0800
Subject: [PATCH 025/169] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93summary=20?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95=20=E6=96=B0=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E5=BA=93=E5=9C=B0=E5=9D=80=20=E6=8C=89=E5=88=86?=
=?UTF-8?q?=E6=94=AF=E6=98=BE=E7=A4=BA=E6=8F=90=E4=BA=A4=E8=AE=B0=E5=BD=95?=
=?UTF-8?q?=20=E7=9B=B8=E5=85=B3=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 10 +-
app/helpers/repositories_helper.rb | 5 +
app/views/layouts/base_projects.html.erb | 2 +-
app/views/repositories/_breadcrumbs.html.erb | 40 +-
.../repositories/_dir_list_content.html.erb | 4 +-
.../repositories/_link_to_functions.html.erb | 8 +-
app/views/repositories/_navigation.html.erb | 30 +-
app/views/repositories/_summary.html.erb | 37 +
app/views/repositories/show.html.erb | 61 +-
config/locales/en.yml | 1 +
config/locales/zh.yml | 3 +-
db/schema.rb | 1726 +----------------
public/stylesheets/repository.css | 56 +
13 files changed, 152 insertions(+), 1831 deletions(-)
create mode 100644 app/views/repositories/_summary.html.erb
create mode 100644 public/stylesheets/repository.css
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index e9c6df64e..fa7c27b1b 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -283,7 +283,6 @@ update
@entries = @repository.entries(@path, @rev)
#@entries = g.trees(project.id, @path)
@changeset = @repository.find_changeset_by_name(@rev)
-
#@project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
#@ip = RepositoriesHelper::REPO_IP_ADDRESS
@@ -298,8 +297,13 @@ update
@course_tag = params[:course]
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
ip = RepositoriesHelper::REPO_IP_ADDRESS
- @repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+
- @repository.url.slice(project_path_cut, @repository.url.length).to_s
+ gitlab_address = RepositoriesHelper::REPO_GITLAB_ADDRESS
+ if @repository.type.to_s=="Repository::Gitlab"
+ @repos_url = "http://"+gitlab_address.to_s+"/"+repository_creater(@repository).lastname.to_s+"/"+@repository.identifier+"."+"git"
+ else
+ @repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+
+ @repository.url.slice(project_path_cut, @repository.url.length).to_s
+ end
if @course_tag == 1
render :action => 'show', :layout => 'base_courses'
else
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index 710b7488f..ba99fe454 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -25,6 +25,7 @@ module RepositoriesHelper
end
PROJECT_PATH_CUT = 40
REPO_IP_ADDRESS = Setting.host_repository
+ REPO_GITLAB_ADDRESS = "git.trustie.net"
def format_revision(revision)
if revision.respond_to? :format_identifier
@@ -34,6 +35,10 @@ module RepositoriesHelper
end
end
+ def repository_creater rep
+ repository_creater = User.find_by_login(rep.login) unless rep.login.nil?
+ end
+
def truncate_at_line_break(text, length = 255)
if text
text.gsub(%r{^(.{#{length}}[^\n]*)\n.+$}m, '\\1...')
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 02085b95a..0f622d831 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -12,7 +12,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
- <%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header' %>
+ <%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move' %>
<%= call_hook :view_layouts_base_html_head %>
diff --git a/app/views/repositories/_breadcrumbs.html.erb b/app/views/repositories/_breadcrumbs.html.erb
index db570d948..5c54fc490 100644
--- a/app/views/repositories/_breadcrumbs.html.erb
+++ b/app/views/repositories/_breadcrumbs.html.erb
@@ -1,32 +1,12 @@
-<%= link_to @repository.identifier.present? ? h(@repository.identifier) : 'root',
- {:action => 'show', :id => @project,
- :repository_id => @repository.identifier_param,
- :path => nil, :rev => @rev },
- :class=>"fl c_blue f14 fb" %>
-<%
- dirs = path.split('/')
- if 'file' == kind
- filename = dirs.pop
- end
- link_path = ''
- dirs.each do |dir|
- next if dir.blank?
- link_path << '/' unless link_path.empty?
- link_path << "#{dir}"
-%>
- / <%= link_to h(dir), :action => 'show', :id => @project, :repository_id => @repository.identifier_param,
- :path => to_path_param(link_path), :rev => @rev %>
-<% end %>
-<% if filename %>
- / <%= link_to h(filename),
- :action => 'changes', :id => @project, :repository_id => @repository.identifier_param,
- :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %>
-<% end %>
-<%
- # @rev is revsion or Git and Mercurial branch or tag.
- # For Mercurial *tip*, @rev and @changeset are nil.
- rev_text = @changeset.nil? ? @rev : format_revision(@changeset)
-%>
-<%= "@ #{h rev_text}" unless rev_text.blank? %>
+
+ <%= link_to @repository.identifier.present? ? h(@repository.identifier) : 'root',
+ {:action => 'show', :id => @project,
+ :repository_id => @repository.identifier_param,
+ :path => nil, :rev => @rev }
+ %>
+ /
+ <%=link_to repository_creater(@repository).show_name, user_path(repository_creater(@repository)) %>
+
+
<% html_title(with_leading_slash(path)) -%>
diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb
index e595a77dd..abee097c5 100644
--- a/app/views/repositories/_dir_list_content.html.erb
+++ b/app/views/repositories/_dir_list_content.html.erb
@@ -7,6 +7,7 @@
">
<% if entry.is_dir? %>
+<%# 展开文件目录 %>
<% end %>
<%= link_to h(ent_name),
- {:action => (entry.is_dir? ? 'show' : 'changes'), :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
+ {:action => (entry.is_dir? ? 'show' : 'entry'), :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
:class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
<%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %>
+
<% if @repository.report_last_commit %>
<%= link_to_revision(entry.changeset, @repository) if entry.changeset %>
<%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %>
diff --git a/app/views/repositories/_link_to_functions.html.erb b/app/views/repositories/_link_to_functions.html.erb
index fc3784d46..aaefd2dbc 100644
--- a/app/views/repositories/_link_to_functions.html.erb
+++ b/app/views/repositories/_link_to_functions.html.erb
@@ -1,10 +1,10 @@
<% if @entry && @entry.kind == 'file' %>
-<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
-<% if @repository.supports_cat? %>
- <%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
-<% end %>
+<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %>
+<%# if @repository.supports_cat? %>
+ <%#= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
+<%# end %>
<% if @repository.supports_annotate? %>
<%= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
<% end %>
diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb
index d8ce218eb..024fad34c 100644
--- a/app/views/repositories/_navigation.html.erb
+++ b/app/views/repositories/_navigation.html.erb
@@ -1,34 +1,30 @@
<% content_for :header_tags do %>
<%= javascript_include_tag 'repository_navigation' %>
<% end %>
-
-<%= link_to l(:label_statistics),
+
+<%#= link_to l(:label_statistics),
{:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
:class => 'mt3 c_blue fl' if @repository.supports_all_revisions? %>
<%= form_tag({:action => controller.action_name,
- :id => @project,
- :repository_id => @repository.identifier_param,
- :path => to_path_param(@path),
- :rev => nil},
+ :id => @project,
+ :repository_id => @repository.identifier_param,
+ :path => to_path_param(@path),
+ :rev => nil},
{:method => :get, :id => 'revision_selector', :class => "fl c_grey02 ml5"}) do -%>
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
- | <%= l(:label_branch) %>:
- <%= select_tag :branch,
- options_for_select([''] + @repository.branches, @rev),
- :id => 'branch' %>
+ <%= l(:label_branch) %>:
+ <%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), :id => 'branch' %>
<% end -%>
<% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
| <%= l(:label_tag) %>:
- <%= select_tag :tag,
- options_for_select([''] + @repository.tags, @rev),
- :id => 'tag' %>
+ <%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag' %>
<% end -%>
- <% if @repository.supports_all_revisions? %>
- | <%= l(:label_revision) %>:
- <%= text_field_tag 'rev', @rev, :size => 8 %>
- <% end %>
+ <%# if @repository.supports_all_revisions? %>
+ | <%#= l(:label_revision) %>:
+ <%#= text_field_tag 'rev', @rev, :size => 8 %>
+ <%# end %>
<% end -%>
diff --git a/app/views/repositories/_summary.html.erb b/app/views/repositories/_summary.html.erb
new file mode 100644
index 000000000..1527abf49
--- /dev/null
+++ b/app/views/repositories/_summary.html.erb
@@ -0,0 +1,37 @@
+
\ No newline at end of file
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index 28a260178..65609afc5 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -4,76 +4,35 @@
- <%= render :partial => 'breadcrumbs',
- :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
+ <%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
<%= render :partial => 'navigation' %>
-
+
- <% if @repository.type.to_s=="Repository::Git" %>
+ <% if @repository.type.to_s=="Repository::Gitlab" %>
<%= @repos_url %>
<% else %>
<%= h @repository.url %>
<% end %>
-
-
- (<%= l(:label_all_revisions) %><%= @repositories.sort.collect { |repo|
- link_to h(repo.name),
- {:controller => 'repositories', :action => 'show',
- :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
- :class => 'repository' + (repo == @repository ? ' selected' : ''),
- :class => "mb10 break_word c_orange" }.join(' | ').html_safe %>)
-
+
+<%# 各类信息入口 %>
+<% if !@repository.nil? %>
+ <%= render :partial => 'summary' %>
+<% end %>
+<%# end %>
+
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %>
<% end %>
<%= render_properties(@properties) %>
-<% if authorize_for('repositories', 'revisions') %>
- <%# if @changesets && !@changesets.empty? %>
-
- <%= l(:label_latest_revision_plural) %>
-
- <%= render :partial => 'revisions',
- :locals => {:project => @project, :path => @path,
- :revisions => @changesets, :entry => nil} %>
- <%# end %>
-
- <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
- sep = '' %>
- <% if @repository.supports_all_revisions? && @path.blank? %>
- <%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project,
- :repository_id => @repository.identifier_param},
- :class => "orange_u_btn" %>
- <% sep = '|' %>
- <% end %>
- <% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
- <%= sep %>
- <%= link_to l(:label_view_revisions),
- {:action => 'changes',
- :path => to_path_param(@path),
- :id => @project,
- :repository_id => @repository.identifier_param,
- :rev => @rev},
- :class => "orange_u_btn" %>
- <% end %>
-
- <% if @repository.supports_all_revisions? %>
- <% content_for :header_tags do %>
- <%= auto_discovery_link_tag(
- :atom, params.merge(
- {:format => 'atom', :action => 'revisions',
- :id => @project, :page => nil, :key => User.current.rss_key})) %>
- <% end %>
- <% end %>
-<% end %>
点击查看如何提交代码
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 2071529f0..2bed45103 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -481,6 +481,7 @@ en:
label_attribute_plural: Attributes
label_change_status: Change status
label_history: History
+ label_commit_history: Commit History
label_attachment: Files
label_attachment_delete: Delete file
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 5efe4a2cc..2b95c917d 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -580,6 +580,7 @@ zh:
label_change_status: 变更状态
label_history: 历史记录
+ label_commit_history: 历史变更记录
label_attachment: 文件
label_file_upload: 上传资料
@@ -924,7 +925,7 @@ zh:
button_change_password: 修改密码
button_copy: 复制
button_copy_and_follow: 复制并转到新问题
- button_annotate: 追溯
+ button_annotate: 代码定位
button_configure: 配置
button_quote: 引用
diff --git a/db/schema.rb b/db/schema.rb
index de210ce22..053bf1e79 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20151013023237) do
+ActiveRecord::Schema.define(:version => 20151020021234) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -1086,1728 +1086,6 @@ ActiveRecord::Schema.define(:version => 20151013023237) do
t.datetime "updated_at", :null => false
end
- create_table "project_infos", :force => true do |t|
- t.integer "project_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "project_scores", :force => true do |t|
- t.string "project_id"
- t.integer "score"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "issue_num", :default => 0
- t.integer "issue_journal_num", :default => 0
- t.integer "news_num", :default => 0
- t.integer "documents_num", :default => 0
- t.integer "changeset_num", :default => 0
- t.integer "board_message_num", :default => 0
- end
-
- create_table "project_statuses", :force => true do |t|
- t.integer "changesets_count"
- t.integer "watchers_count"
- t.integer "project_id"
- t.integer "project_type"
- t.float "grade", :default => 0.0
- t.integer "course_ac_para", :default => 0
- end
-
- add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade"
-
- create_table "projecting_softapplictions", :force => true do |t|
- t.integer "user_id"
- t.integer "softapplication_id"
- t.integer "project_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "projects", :force => true do |t|
- t.string "name", :default => "", :null => false
- t.text "description"
- t.string "homepage", :default => ""
- t.boolean "is_public", :default => true, :null => false
- t.integer "parent_id"
- t.datetime "created_on"
- t.datetime "updated_on"
- t.string "identifier"
- t.integer "status", :default => 1, :null => false
- t.integer "lft"
- t.integer "rgt"
- t.boolean "inherit_members", :default => false, :null => false
- t.integer "project_type"
- t.boolean "hidden_repo", :default => false, :null => false
- t.integer "attachmenttype", :default => 1
- t.integer "user_id"
- t.integer "dts_test", :default => 0
- t.string "enterprise_name"
- t.integer "organization_id"
- t.integer "project_new_type"
- t.integer "gpid"
- end
-
- add_index "projects", ["lft"], :name => "index_projects_on_lft"
- add_index "projects", ["rgt"], :name => "index_projects_on_rgt"
-
- create_table "projects_trackers", :id => false, :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.integer "tracker_id", :default => 0, :null => false
- end
-
- add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true
- add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id"
-
- create_table "queries", :force => true do |t|
- t.integer "project_id"
- t.string "name", :default => "", :null => false
- t.text "filters"
- t.integer "user_id", :default => 0, :null => false
- t.boolean "is_public", :default => false, :null => false
- t.text "column_names"
- t.text "sort_criteria"
- t.string "group_by"
- t.string "type"
- end
-
- add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
- add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
-
- create_table "relative_memo_to_open_source_projects", :force => true do |t|
- t.integer "osp_id"
- t.integer "relative_memo_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "relative_memos", :force => true do |t|
- t.integer "osp_id"
- t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :limit => 16777215, :null => false
- t.integer "author_id"
- t.integer "replies_count", :default => 0
- t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.boolean "is_quote", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count_crawl", :default => 0
- t.integer "viewed_count_local", :default => 0
- t.string "url"
- t.string "username"
- t.string "userhomeurl"
- t.date "date_collected"
- t.string "topic_resource"
- end
-
- create_table "repositories", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.string "url", :default => "", :null => false
- t.string "login", :limit => 60, :default => ""
- t.string "password", :default => ""
- t.string "root_url", :default => ""
- t.string "type"
- t.string "path_encoding", :limit => 64
- t.string "log_encoding", :limit => 64
- t.text "extra_info"
- t.string "identifier"
- t.boolean "is_default", :default => false
- t.boolean "hidden", :default => false
- end
-
- add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
-
- create_table "rich_rich_files", :force => true do |t|
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "rich_file_file_name"
- t.string "rich_file_content_type"
- t.integer "rich_file_file_size"
- t.datetime "rich_file_updated_at"
- t.string "owner_type"
- t.integer "owner_id"
- t.text "uri_cache"
- t.string "simplified_type", :default => "file"
- end
-
- create_table "roles", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "position", :default => 1
- t.boolean "assignable", :default => true
- t.integer "builtin", :default => 0, :null => false
- t.text "permissions"
- t.string "issues_visibility", :limit => 30, :default => "default", :null => false
- end
-
- create_table "schools", :force => true do |t|
- t.string "name"
- t.string "province"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "logo_link"
- end
-
- create_table "seems_rateable_cached_ratings", :force => true do |t|
- t.integer "cacheable_id", :limit => 8
- t.string "cacheable_type"
- t.float "avg", :null => false
- t.integer "cnt", :null => false
- t.string "dimension"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "seems_rateable_rates", :force => true do |t|
- t.integer "rater_id", :limit => 8
- t.integer "rateable_id"
- t.string "rateable_type"
- t.float "stars", :null => false
- t.string "dimension"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "is_teacher_score", :default => 0
- end
-
- create_table "settings", :force => true do |t|
- t.string "name", :default => "", :null => false
- t.text "value"
- t.datetime "updated_on"
- end
-
- add_index "settings", ["name"], :name => "index_settings_on_name"
-
- create_table "shares", :force => true do |t|
- t.date "created_on"
- t.string "url"
- t.string "title"
- t.integer "share_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "project_id"
- t.integer "user_id"
- t.string "description"
- end
-
- create_table "softapplications", :force => true do |t|
- t.string "name"
- t.text "description"
- t.integer "app_type_id"
- t.string "app_type_name"
- t.string "android_min_version_available"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "contest_id"
- t.integer "softapplication_id"
- t.integer "is_public"
- t.string "application_developers"
- t.string "deposit_project_url"
- t.string "deposit_project"
- t.integer "project_id"
- end
-
- create_table "student_work_tests", :force => true do |t|
- t.integer "student_work_id"
- t.integer "status"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.text "results"
- t.text "src"
- end
-
- create_table "student_works", :force => true do |t|
- t.string "name"
- t.text "description", :limit => 2147483647
- t.integer "homework_common_id"
- t.integer "user_id"
- t.float "final_score"
- t.float "teacher_score"
- t.float "student_score"
- t.float "teaching_asistant_score"
- t.integer "project_id", :default => 0
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "late_penalty", :default => 0
- t.integer "absence_penalty", :default => 0
- t.float "system_score", :default => 0.0
- t.boolean "is_test", :default => false
- end
-
- create_table "student_works_evaluation_distributions", :force => true do |t|
- t.integer "student_work_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "student_works_scores", :force => true do |t|
- t.integer "student_work_id"
- t.integer "user_id"
- t.integer "score"
- t.text "comment"
- t.integer "reviewer_role"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "students_for_courses", :force => true do |t|
- t.integer "student_id"
- t.integer "course_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id"
- add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id"
-
- create_table "system_messages", :force => true do |t|
- t.integer "user_id"
- t.string "content"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.text "description"
- t.string "subject"
- end
-
- create_table "taggings", :force => true do |t|
- t.integer "tag_id"
- t.integer "taggable_id"
- t.string "taggable_type"
- t.integer "tagger_id"
- t.string "tagger_type"
- t.string "context", :limit => 128
- t.datetime "created_at"
- end
-
- add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
- add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
- add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type"
-
- create_table "tags", :force => true do |t|
- t.string "name"
- end
-
- create_table "teachers", :force => true do |t|
- t.string "tea_name"
- t.string "location"
- t.integer "couurse_time"
- t.integer "course_code"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "extra"
- end
-
- create_table "time_entries", :force => true do |t|
- t.integer "project_id", :null => false
- t.integer "user_id", :null => false
- t.integer "issue_id"
- t.float "hours", :null => false
- t.string "comments"
- t.integer "activity_id", :null => false
- t.date "spent_on", :null => false
- t.integer "tyear", :null => false
- t.integer "tmonth", :null => false
- t.integer "tweek", :null => false
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- end
-
- add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id"
- add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on"
- add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id"
- add_index "time_entries", ["project_id"], :name => "time_entries_project_id"
- add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id"
-
- create_table "tokens", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.string "action", :limit => 30, :default => "", :null => false
- t.string "value", :limit => 40, :default => "", :null => false
- t.datetime "created_on", :null => false
- end
-
- add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id"
- add_index "tokens", ["value"], :name => "tokens_value", :unique => true
-
- create_table "trackers", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.boolean "is_in_chlog", :default => false, :null => false
- t.integer "position", :default => 1
- t.boolean "is_in_roadmap", :default => true, :null => false
- t.integer "fields_bits", :default => 0
- end
-
- create_table "user_activities", :force => true do |t|
- t.string "act_type"
- t.integer "act_id"
- t.string "container_type"
- t.integer "container_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "user_id"
- end
-
- create_table "user_extensions", :force => true do |t|
- t.integer "user_id", :null => false
- t.date "birthday"
- t.string "brief_introduction"
- t.integer "gender"
- t.string "location"
- t.string "occupation"
- t.integer "work_experience"
- t.integer "zip_code"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "technical_title"
- t.integer "identity"
- t.string "student_id"
- t.string "teacher_realname"
- t.string "student_realname"
- t.string "location_city"
- t.integer "school_id"
- t.string "description", :default => ""
- end
-
- create_table "user_feedback_messages", :force => true do |t|
- t.integer "user_id"
- t.integer "journals_for_message_id"
- t.string "journals_for_message_type"
- t.integer "viewed"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "user_grades", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "project_id", :null => false
- t.float "grade", :default => 0.0
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade"
- add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id"
- add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id"
-
- create_table "user_levels", :force => true do |t|
- t.integer "user_id"
- t.integer "level"
- end
-
- create_table "user_preferences", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.text "others"
- t.boolean "hide_mail", :default => false
- t.string "time_zone"
- end
-
- add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id"
-
- create_table "user_score_details", :force => true do |t|
- t.integer "current_user_id"
- t.integer "target_user_id"
- t.string "score_type"
- t.string "score_action"
- t.integer "user_id"
- t.integer "old_score"
- t.integer "new_score"
- t.integer "current_user_level"
- t.integer "target_user_level"
- t.integer "score_changeable_obj_id"
- t.string "score_changeable_obj_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "user_scores", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "collaboration"
- t.integer "influence"
- t.integer "skill"
- t.integer "active"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "user_statuses", :force => true do |t|
- t.integer "changesets_count"
- t.integer "watchers_count"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.float "grade", :default => 0.0
- end
-
- add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count"
- add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade"
- add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count"
-
- create_table "users", :force => true do |t|
- t.string "login", :default => "", :null => false
- t.string "hashed_password", :limit => 40, :default => "", :null => false
- t.string "firstname", :limit => 30, :default => "", :null => false
- t.string "lastname", :default => "", :null => false
- t.string "mail", :limit => 60, :default => "", :null => false
- t.boolean "admin", :default => false, :null => false
- t.integer "status", :default => 1, :null => false
- t.datetime "last_login_on"
- t.string "language", :limit => 5, :default => ""
- t.integer "auth_source_id"
- t.datetime "created_on"
- t.datetime "updated_on"
- t.string "type"
- t.string "identity_url"
- t.string "mail_notification", :default => "", :null => false
- t.string "salt", :limit => 64
- t.integer "gid"
- end
-
- add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
- add_index "users", ["id", "type"], :name => "index_users_on_id_and_type"
- add_index "users", ["type"], :name => "index_users_on_type"
-
- create_table "versions", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.string "name", :default => "", :null => false
- t.string "description", :default => ""
- t.date "effective_date"
- t.datetime "created_on"
- t.datetime "updated_on"
- t.string "wiki_page_title"
- t.string "status", :default => "open"
- t.string "sharing", :default => "none", :null => false
- end
-
- add_index "versions", ["project_id"], :name => "versions_project_id"
- add_index "versions", ["sharing"], :name => "index_versions_on_sharing"
-
- create_table "visitors", :force => true do |t|
- t.integer "user_id"
- t.integer "master_id"
- t.datetime "updated_on"
- t.datetime "created_on"
- end
-
- add_index "visitors", ["master_id"], :name => "index_visitors_master_id"
- add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on"
- add_index "visitors", ["user_id"], :name => "index_visitors_user_id"
-
- create_table "watchers", :force => true do |t|
- t.string "watchable_type", :default => "", :null => false
- t.integer "watchable_id", :default => 0, :null => false
- t.integer "user_id"
- end
-
- add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type"
- add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id"
- add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type"
-
- create_table "web_footer_companies", :force => true do |t|
- t.string "name"
- t.string "logo_size"
- t.string "url"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "web_footer_oranizers", :force => true do |t|
- t.string "name"
- t.text "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "wiki_content_versions", :force => true do |t|
- t.integer "wiki_content_id", :null => false
- t.integer "page_id", :null => false
- t.integer "author_id"
- t.binary "data", :limit => 2147483647
- t.string "compression", :limit => 6, :default => ""
- t.string "comments", :default => ""
- t.datetime "updated_on", :null => false
- t.integer "version", :null => false
- end
-
- add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on"
- add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid"
-
- create_table "wiki_contents", :force => true do |t|
- t.integer "page_id", :null => false
- t.integer "author_id"
- t.text "text", :limit => 2147483647
- t.string "comments", :default => ""
- t.datetime "updated_on", :null => false
- t.integer "version", :null => false
- end
-
- add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id"
- add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id"
-
- create_table "wiki_pages", :force => true do |t|
- t.integer "wiki_id", :null => false
- t.string "title", :null => false
- t.datetime "created_on", :null => false
- t.boolean "protected", :default => false, :null => false
- t.integer "parent_id"
- end
-
- add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id"
- add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title"
- add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id"
-
- create_table "wiki_redirects", :force => true do |t|
- t.integer "wiki_id", :null => false
- t.string "title"
- t.string "redirects_to"
- t.datetime "created_on", :null => false
- end
-
- add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title"
- add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id"
-
- create_table "wikis", :force => true do |t|
- t.integer "project_id", :null => false
- t.string "start_page", :null => false
- t.integer "status", :default => 1, :null => false
- end
-
- add_index "wikis", ["project_id"], :name => "wikis_project_id"
-
- create_table "workflows", :force => true do |t|
- t.integer "tracker_id", :default => 0, :null => false
- t.integer "old_status_id", :default => 0, :null => false
- t.integer "new_status_id", :default => 0, :null => false
- t.integer "role_id", :default => 0, :null => false
- t.boolean "assignee", :default => false, :null => false
- t.boolean "author", :default => false, :null => false
- t.string "type", :limit => 30
- t.string "field_name", :limit => 30
- t.string "rule", :limit => 30
- end
-
- add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id"
- add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id"
- add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status"
- add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id"
-
- create_table "works_categories", :force => true do |t|
- t.string "category"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "zip_packs", :force => true do |t|
- t.integer "user_id"
- t.integer "homework_id"
- t.string "file_digest"
- t.string "file_path"
- t.integer "pack_times", :default => 1
- t.integer "pack_size", :default => 0
- t.text "file_digests"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
-end
-=======
-# encoding: UTF-8
-# This file is auto-generated from the current state of the database. Instead
-# of editing this file, please use the migrations feature of Active Record to
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20151014023806) do
-
- create_table "activities", :force => true do |t|
- t.integer "act_id", :null => false
- t.string "act_type", :null => false
- t.integer "user_id", :null => false
- t.integer "activity_container_id"
- t.string "activity_container_type", :default => ""
- t.datetime "created_at"
- end
-
- add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type"
- add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
- add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
-
- create_table "activity_notifies", :force => true do |t|
- t.integer "activity_container_id"
- t.string "activity_container_type"
- t.integer "activity_id"
- t.string "activity_type"
- t.integer "notify_to"
- t.datetime "created_on"
- t.integer "is_read"
- end
-
- add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id"
- add_index "activity_notifies", ["created_on"], :name => "index_an_created_on"
- add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to"
-
- create_table "api_keys", :force => true do |t|
- t.string "access_token"
- t.datetime "expires_at"
- t.integer "user_id"
- t.boolean "active", :default => true
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
- add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
-
- create_table "applied_projects", :force => true do |t|
- t.integer "project_id", :null => false
- t.integer "user_id", :null => false
- end
-
- create_table "apply_project_masters", :force => true do |t|
- t.integer "user_id"
- t.string "apply_type"
- t.integer "apply_id"
- t.integer "status"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "attachments", :force => true do |t|
- t.integer "container_id"
- t.string "container_type", :limit => 30
- t.string "filename", :default => "", :null => false
- t.string "disk_filename", :default => "", :null => false
- t.integer "filesize", :default => 0, :null => false
- t.string "content_type", :default => ""
- t.string "digest", :limit => 40, :default => "", :null => false
- t.integer "downloads", :default => 0, :null => false
- t.integer "author_id", :default => 0, :null => false
- t.datetime "created_on"
- t.string "description"
- t.string "disk_directory"
- t.integer "attachtype", :default => 1
- t.integer "is_public", :default => 1
- t.integer "copy_from"
- t.integer "quotes"
- end
-
- add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id"
- add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type"
- add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on"
-
- create_table "attachmentstypes", :force => true do |t|
- t.integer "typeId", :null => false
- t.string "typeName", :limit => 50
- end
-
- create_table "auth_sources", :force => true do |t|
- t.string "type", :limit => 30, :default => "", :null => false
- t.string "name", :limit => 60, :default => "", :null => false
- t.string "host", :limit => 60
- t.integer "port"
- t.string "account"
- t.string "account_password", :default => ""
- t.string "base_dn"
- t.string "attr_login", :limit => 30
- t.string "attr_firstname", :limit => 30
- t.string "attr_lastname", :limit => 30
- t.string "attr_mail", :limit => 30
- t.boolean "onthefly_register", :default => false, :null => false
- t.boolean "tls", :default => false, :null => false
- t.string "filter"
- t.integer "timeout"
- end
-
- add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type"
-
- create_table "biding_projects", :force => true do |t|
- t.integer "project_id"
- t.integer "bid_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "bids", :force => true do |t|
- t.string "name"
- t.string "budget", :null => false
- t.integer "author_id"
- t.date "deadline"
- t.text "description"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.integer "commit"
- t.integer "reward_type"
- t.integer "homework_type"
- t.integer "parent_id"
- t.string "password"
- t.integer "is_evaluation"
- t.integer "proportion", :default => 60
- t.integer "comment_status", :default => 0
- t.integer "evaluation_num", :default => 3
- t.integer "open_anonymous_evaluation", :default => 1
- end
-
- create_table "boards", :force => true do |t|
- t.integer "project_id", :null => false
- t.string "name", :default => "", :null => false
- t.string "description"
- t.integer "position", :default => 1
- t.integer "topics_count", :default => 0, :null => false
- t.integer "messages_count", :default => 0, :null => false
- t.integer "last_message_id"
- t.integer "parent_id"
- t.integer "course_id"
- end
-
- add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
- add_index "boards", ["project_id"], :name => "boards_project_id"
-
- create_table "bug_to_osps", :force => true do |t|
- t.integer "osp_id"
- t.integer "relative_memo_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "changes", :force => true do |t|
- t.integer "changeset_id", :null => false
- t.string "action", :limit => 1, :default => "", :null => false
- t.text "path", :null => false
- t.text "from_path"
- t.string "from_revision"
- t.string "revision"
- t.string "branch"
- end
-
- add_index "changes", ["changeset_id"], :name => "changesets_changeset_id"
-
- create_table "changeset_parents", :id => false, :force => true do |t|
- t.integer "changeset_id", :null => false
- t.integer "parent_id", :null => false
- end
-
- add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids"
- add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
-
- create_table "changesets", :force => true do |t|
- t.integer "repository_id", :null => false
- t.string "revision", :null => false
- t.string "committer"
- t.datetime "committed_on", :null => false
- t.text "comments"
- t.date "commit_date"
- t.string "scmid"
- t.integer "user_id"
- end
-
- add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
- add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true
- add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid"
- add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id"
- add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id"
-
- create_table "changesets_issues", :id => false, :force => true do |t|
- t.integer "changeset_id", :null => false
- t.integer "issue_id", :null => false
- end
-
- add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true
-
- create_table "code_review_assignments", :force => true do |t|
- t.integer "issue_id"
- t.integer "change_id"
- t.integer "attachment_id"
- t.string "file_path"
- t.string "rev"
- t.string "rev_to"
- t.string "action_type"
- t.integer "changeset_id"
- end
-
- create_table "code_review_project_settings", :force => true do |t|
- t.integer "project_id"
- t.integer "tracker_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "updated_by"
- t.boolean "hide_code_review_tab", :default => false
- t.integer "auto_relation", :default => 1
- t.integer "assignment_tracker_id"
- t.text "auto_assign"
- t.integer "lock_version", :default => 0, :null => false
- t.boolean "tracker_in_review_dialog", :default => false
- end
-
- create_table "code_review_user_settings", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.integer "mail_notification", :default => 0, :null => false
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- create_table "code_reviews", :force => true do |t|
- t.integer "project_id"
- t.integer "change_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "line"
- t.integer "updated_by_id"
- t.integer "lock_version", :default => 0, :null => false
- t.integer "status_changed_from"
- t.integer "status_changed_to"
- t.integer "issue_id"
- t.string "action_type"
- t.string "file_path"
- t.string "rev"
- t.string "rev_to"
- t.integer "attachment_id"
- t.integer "file_count", :default => 0, :null => false
- t.boolean "diff_all"
- end
-
- create_table "comments", :force => true do |t|
- t.string "commented_type", :limit => 30, :default => "", :null => false
- t.integer "commented_id", :default => 0, :null => false
- t.integer "author_id", :default => 0, :null => false
- t.text "comments"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- end
-
- add_index "comments", ["author_id"], :name => "index_comments_on_author_id"
- add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type"
-
- create_table "contest_notifications", :force => true do |t|
- t.text "title"
- t.text "content"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "contesting_projects", :force => true do |t|
- t.integer "project_id"
- t.string "contest_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "contesting_softapplications", :force => true do |t|
- t.integer "softapplication_id"
- t.integer "contest_id"
- t.integer "user_id"
- t.string "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- end
-
- create_table "contestnotifications", :force => true do |t|
- t.integer "contest_id"
- t.string "title"
- t.string "summary"
- t.text "description"
- t.integer "author_id"
- t.integer "notificationcomments_count"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "contests", :force => true do |t|
- t.string "name"
- t.string "budget", :default => ""
- t.integer "author_id"
- t.date "deadline"
- t.string "description"
- t.integer "commit"
- t.string "password"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- end
-
- create_table "course_activities", :force => true do |t|
- t.integer "user_id"
- t.integer "course_id"
- t.integer "course_act_id"
- t.string "course_act_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "course_attachments", :force => true do |t|
- t.string "filename"
- t.string "disk_filename"
- t.integer "filesize"
- t.string "content_type"
- t.string "digest"
- t.integer "downloads"
- t.string "author_id"
- t.string "integer"
- t.string "description"
- t.string "disk_directory"
- t.integer "attachtype"
- t.integer "is_public"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "container_id", :default => 0
- end
-
- create_table "course_groups", :force => true do |t|
- t.string "name"
- t.integer "course_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "course_infos", :force => true do |t|
- t.integer "course_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "course_messages", :force => true do |t|
- t.integer "user_id"
- t.integer "course_id"
- t.integer "course_message_id"
- t.string "course_message_type"
- t.integer "viewed"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "content"
- t.integer "status"
- end
-
- create_table "course_statuses", :force => true do |t|
- t.integer "changesets_count"
- t.integer "watchers_count"
- t.integer "course_id"
- t.float "grade", :default => 0.0
- t.integer "course_ac_para", :default => 0
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "courses", :force => true do |t|
- t.integer "tea_id"
- t.string "name"
- t.integer "state"
- t.string "code"
- t.integer "time"
- t.string "extra"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "location"
- t.string "term"
- t.string "string"
- t.string "password"
- t.string "setup_time"
- t.string "endup_time"
- t.string "class_period"
- t.integer "school_id"
- t.text "description"
- t.integer "status", :default => 1
- t.integer "attachmenttype", :default => 2
- t.integer "lft"
- t.integer "rgt"
- t.integer "is_public", :limit => 1, :default => 1
- t.integer "inherit_members", :limit => 1, :default => 1
- t.integer "open_student", :default => 0
- end
-
- create_table "custom_fields", :force => true do |t|
- t.string "type", :limit => 30, :default => "", :null => false
- t.string "name", :limit => 30, :default => "", :null => false
- t.string "field_format", :limit => 30, :default => "", :null => false
- t.text "possible_values"
- t.string "regexp", :default => ""
- t.integer "min_length", :default => 0, :null => false
- t.integer "max_length", :default => 0, :null => false
- t.boolean "is_required", :default => false, :null => false
- t.boolean "is_for_all", :default => false, :null => false
- t.boolean "is_filter", :default => false, :null => false
- t.integer "position", :default => 1
- t.boolean "searchable", :default => false
- t.text "default_value"
- t.boolean "editable", :default => true
- t.boolean "visible", :default => true, :null => false
- t.boolean "multiple", :default => false
- end
-
- add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type"
-
- create_table "custom_fields_projects", :id => false, :force => true do |t|
- t.integer "custom_field_id", :default => 0, :null => false
- t.integer "project_id", :default => 0, :null => false
- end
-
- add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true
-
- create_table "custom_fields_trackers", :id => false, :force => true do |t|
- t.integer "custom_field_id", :default => 0, :null => false
- t.integer "tracker_id", :default => 0, :null => false
- end
-
- add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true
-
- create_table "custom_values", :force => true do |t|
- t.string "customized_type", :limit => 30, :default => "", :null => false
- t.integer "customized_id", :default => 0, :null => false
- t.integer "custom_field_id", :default => 0, :null => false
- t.text "value"
- end
-
- add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id"
- add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized"
-
- create_table "delayed_jobs", :force => true do |t|
- t.integer "priority", :default => 0, :null => false
- t.integer "attempts", :default => 0, :null => false
- t.text "handler", :null => false
- t.text "last_error"
- t.datetime "run_at"
- t.datetime "locked_at"
- t.datetime "failed_at"
- t.string "locked_by"
- t.string "queue"
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
-
- create_table "discuss_demos", :force => true do |t|
- t.string "title"
- t.text "body"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "documents", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.integer "category_id", :default => 0, :null => false
- t.string "title", :limit => 60, :default => "", :null => false
- t.text "description"
- t.datetime "created_on"
- t.integer "user_id", :default => 0
- t.integer "is_public", :default => 1
- end
-
- add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
- add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
- add_index "documents", ["project_id"], :name => "documents_project_id"
-
- create_table "dts", :force => true do |t|
- t.string "IPLineCode"
- t.string "Description"
- t.string "Num"
- t.string "Variable"
- t.string "TraceInfo"
- t.string "Method"
- t.string "File"
- t.string "IPLine"
- t.string "Review"
- t.string "Category"
- t.string "Defect"
- t.string "PreConditions"
- t.string "StartLine"
- t.integer "project_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "enabled_modules", :force => true do |t|
- t.integer "project_id"
- t.string "name", :null => false
- t.integer "course_id"
- end
-
- add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id"
-
- create_table "enumerations", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "position", :default => 1
- t.boolean "is_default", :default => false, :null => false
- t.string "type"
- t.boolean "active", :default => true, :null => false
- t.integer "project_id"
- t.integer "parent_id"
- t.string "position_name", :limit => 30
- end
-
- add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
- add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
-
- create_table "first_pages", :force => true do |t|
- t.string "web_title"
- t.string "title"
- t.text "description"
- t.string "page_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "sort_type"
- t.integer "image_width", :default => 107
- t.integer "image_height", :default => 63
- t.integer "show_course", :default => 1
- t.integer "show_contest", :default => 1
- end
-
- create_table "forge_activities", :force => true do |t|
- t.integer "user_id"
- t.integer "project_id"
- t.integer "forge_act_id"
- t.string "forge_act_type"
- t.integer "org_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id"
-
- create_table "forge_messages", :force => true do |t|
- t.integer "user_id"
- t.integer "project_id"
- t.integer "forge_message_id"
- t.string "forge_message_type"
- t.integer "viewed"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "secret_key"
- t.integer "status"
- end
-
- create_table "forums", :force => true do |t|
- t.string "name", :null => false
- t.text "description"
- t.integer "topic_count", :default => 0
- t.integer "memo_count", :default => 0
- t.integer "last_memo_id", :default => 0
- t.integer "creator_id", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "sticky"
- t.integer "locked"
- end
-
- create_table "groups_users", :id => false, :force => true do |t|
- t.integer "group_id", :null => false
- t.integer "user_id", :null => false
- end
-
- add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true
-
- create_table "homework_attaches", :force => true do |t|
- t.integer "bid_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "reward"
- t.string "name"
- t.text "description"
- t.integer "state"
- t.integer "project_id", :default => 0
- t.float "score", :default => 0.0
- t.integer "is_teacher_score", :default => 0
- end
-
- add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
-
- create_table "homework_commons", :force => true do |t|
- t.string "name"
- t.integer "user_id"
- t.text "description"
- t.date "publish_time"
- t.date "end_time"
- t.integer "homework_type", :default => 1
- t.string "late_penalty"
- t.integer "course_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "teacher_priority", :default => 1
- end
-
- create_table "homework_detail_manuals", :force => true do |t|
- t.float "ta_proportion"
- t.integer "comment_status"
- t.date "evaluation_start"
- t.date "evaluation_end"
- t.integer "evaluation_num"
- t.integer "absence_penalty", :default => 1
- t.integer "homework_common_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "homework_detail_programings", :force => true do |t|
- t.string "language"
- t.text "standard_code", :limit => 2147483647
- t.integer "homework_common_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.float "ta_proportion", :default => 0.1
- t.integer "question_id"
- end
-
- create_table "homework_evaluations", :force => true do |t|
- t.string "user_id"
- t.string "homework_attach_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "homework_for_courses", :force => true do |t|
- t.integer "course_id"
- t.integer "bid_id"
- end
-
- add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
- add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
-
- create_table "homework_tests", :force => true do |t|
- t.text "input"
- t.text "output"
- t.integer "homework_common_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "result"
- t.text "error_msg"
- end
-
- create_table "homework_users", :force => true do |t|
- t.string "homework_attach_id"
- t.string "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "invite_lists", :force => true do |t|
- t.integer "project_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "mail"
- end
-
- create_table "issue_categories", :force => true do |t|
- t.integer "project_id", :default => 0, :null => false
- t.string "name", :limit => 30, :default => "", :null => false
- t.integer "assigned_to_id"
- end
-
- add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id"
- add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id"
-
- create_table "issue_relations", :force => true do |t|
- t.integer "issue_from_id", :null => false
- t.integer "issue_to_id", :null => false
- t.string "relation_type", :default => "", :null => false
- t.integer "delay"
- end
-
- add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true
- add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id"
- add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id"
-
- create_table "issue_statuses", :force => true do |t|
- t.string "name", :limit => 30, :default => "", :null => false
- t.boolean "is_closed", :default => false, :null => false
- t.boolean "is_default", :default => false, :null => false
- t.integer "position", :default => 1
- t.integer "default_done_ratio"
- end
-
- add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed"
- add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default"
- add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position"
-
- create_table "issues", :force => true do |t|
- t.integer "tracker_id", :null => false
- t.integer "project_id", :null => false
- t.string "subject", :default => "", :null => false
- t.text "description"
- t.date "due_date"
- t.integer "category_id"
- t.integer "status_id", :null => false
- t.integer "assigned_to_id"
- t.integer "priority_id", :null => false
- t.integer "fixed_version_id"
- t.integer "author_id", :null => false
- t.integer "lock_version", :default => 0, :null => false
- t.datetime "created_on"
- t.datetime "updated_on"
- t.date "start_date"
- t.integer "done_ratio", :default => 0, :null => false
- t.float "estimated_hours"
- t.integer "parent_id"
- t.integer "root_id"
- t.integer "lft"
- t.integer "rgt"
- t.boolean "is_private", :default => false, :null => false
- t.datetime "closed_on"
- t.integer "project_issues_index"
- end
-
- add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id"
- add_index "issues", ["author_id"], :name => "index_issues_on_author_id"
- add_index "issues", ["category_id"], :name => "index_issues_on_category_id"
- add_index "issues", ["created_on"], :name => "index_issues_on_created_on"
- add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id"
- add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id"
- add_index "issues", ["project_id"], :name => "issues_project_id"
- add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt"
- add_index "issues", ["status_id"], :name => "index_issues_on_status_id"
- add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id"
-
- create_table "join_in_competitions", :force => true do |t|
- t.integer "user_id"
- t.integer "competition_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "join_in_contests", :force => true do |t|
- t.integer "user_id"
- t.integer "bid_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "journal_details", :force => true do |t|
- t.integer "journal_id", :default => 0, :null => false
- t.string "property", :limit => 30, :default => "", :null => false
- t.string "prop_key", :limit => 30, :default => "", :null => false
- t.text "old_value"
- t.text "value"
- end
-
- add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
-
- create_table "journal_details_copy", :force => true do |t|
- t.integer "journal_id", :default => 0, :null => false
- t.string "property", :limit => 30, :default => "", :null => false
- t.string "prop_key", :limit => 30, :default => "", :null => false
- t.text "old_value"
- t.text "value"
- end
-
- add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
-
- create_table "journal_replies", :id => false, :force => true do |t|
- t.integer "journal_id"
- t.integer "user_id"
- t.integer "reply_id"
- end
-
- add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id"
- add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id"
- add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id"
-
- create_table "journals", :force => true do |t|
- t.integer "journalized_id", :default => 0, :null => false
- t.string "journalized_type", :limit => 30, :default => "", :null => false
- t.integer "user_id", :default => 0, :null => false
- t.text "notes"
- t.datetime "created_on", :null => false
- t.boolean "private_notes", :default => false, :null => false
- end
-
- add_index "journals", ["created_on"], :name => "index_journals_on_created_on"
- add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id"
- add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id"
- add_index "journals", ["user_id"], :name => "index_journals_on_user_id"
-
- create_table "journals_for_messages", :force => true do |t|
- t.integer "jour_id"
- t.string "jour_type"
- t.integer "user_id"
- t.text "notes"
- t.integer "status"
- t.integer "reply_id"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.string "m_parent_id"
- t.boolean "is_readed"
- t.integer "m_reply_count"
- t.integer "m_reply_id"
- t.integer "is_comprehensive_evaluation"
- end
-
- create_table "kindeditor_assets", :force => true do |t|
- t.string "asset"
- t.integer "file_size"
- t.string "file_type"
- t.integer "owner_id"
- t.string "asset_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "owner_type", :default => 0
- end
-
- create_table "member_roles", :force => true do |t|
- t.integer "member_id", :null => false
- t.integer "role_id", :null => false
- t.integer "inherited_from"
- end
-
- add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id"
- add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id"
-
- create_table "members", :force => true do |t|
- t.integer "user_id", :default => 0, :null => false
- t.integer "project_id", :default => 0
- t.datetime "created_on"
- t.boolean "mail_notification", :default => false, :null => false
- t.integer "course_id", :default => -1
- t.integer "course_group_id", :default => 0
- end
-
- add_index "members", ["project_id"], :name => "index_members_on_project_id"
- add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true
- add_index "members", ["user_id"], :name => "index_members_on_user_id"
-
- create_table "memo_messages", :force => true do |t|
- t.integer "user_id"
- t.integer "forum_id"
- t.integer "memo_id"
- t.string "memo_type"
- t.integer "viewed"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "memos", :force => true do |t|
- t.integer "forum_id", :null => false
- t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
- t.integer "author_id", :null => false
- t.integer "replies_count", :default => 0
- t.integer "last_reply_id"
- t.boolean "lock", :default => false
- t.boolean "sticky", :default => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "viewed_count", :default => 0
- end
-
- create_table "message_alls", :force => true do |t|
- t.integer "user_id"
- t.integer "message_id"
- t.string "message_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "messages", :force => true do |t|
- t.integer "board_id", :null => false
- t.integer "parent_id"
- t.string "subject", :default => "", :null => false
- t.text "content"
- t.integer "author_id"
- t.integer "replies_count", :default => 0, :null => false
- t.integer "last_reply_id"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :null => false
- t.boolean "locked", :default => false
- t.integer "sticky", :default => 0
- t.integer "reply_id"
- end
-
- add_index "messages", ["author_id"], :name => "index_messages_on_author_id"
- add_index "messages", ["board_id"], :name => "messages_board_id"
- add_index "messages", ["created_on"], :name => "index_messages_on_created_on"
- add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
- add_index "messages", ["parent_id"], :name => "messages_parent_id"
-
- create_table "news", :force => true do |t|
- t.integer "project_id"
- t.string "title", :limit => 60, :default => "", :null => false
- t.string "summary", :default => ""
- t.text "description"
- t.integer "author_id", :default => 0, :null => false
- t.datetime "created_on"
- t.integer "comments_count", :default => 0, :null => false
- t.integer "course_id"
- end
-
- add_index "news", ["author_id"], :name => "index_news_on_author_id"
- add_index "news", ["created_on"], :name => "index_news_on_created_on"
- add_index "news", ["project_id"], :name => "news_project_id"
-
- create_table "no_uses", :force => true do |t|
- t.integer "user_id", :null => false
- t.string "no_use_type"
- t.integer "no_use_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "notificationcomments", :force => true do |t|
- t.string "notificationcommented_type"
- t.integer "notificationcommented_id"
- t.integer "author_id"
- t.text "notificationcomments"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "onclick_times", :force => true do |t|
- t.integer "user_id"
- t.datetime "onclick_time"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "open_id_authentication_associations", :force => true do |t|
- t.integer "issued"
- t.integer "lifetime"
- t.string "handle"
- t.string "assoc_type"
- t.binary "server_url"
- t.binary "secret"
- end
-
- create_table "open_id_authentication_nonces", :force => true do |t|
- t.integer "timestamp", :null => false
- t.string "server_url"
- t.string "salt", :null => false
- end
-
- create_table "open_source_projects", :force => true do |t|
- t.string "name"
- t.text "description"
- t.integer "commit_count", :default => 0
- t.integer "code_line", :default => 0
- t.integer "users_count", :default => 0
- t.date "last_commit_time"
- t.string "url"
- t.date "date_collected"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "option_numbers", :force => true do |t|
- t.integer "user_id"
- t.integer "memo"
- t.integer "messages_for_issues"
- t.integer "issues_status"
- t.integer "replay_for_message"
- t.integer "replay_for_memo"
- t.integer "follow"
- t.integer "tread"
- t.integer "praise_by_one"
- t.integer "praise_by_two"
- t.integer "praise_by_three"
- t.integer "tread_by_one"
- t.integer "tread_by_two"
- t.integer "tread_by_three"
- t.integer "changeset"
- t.integer "document"
- t.integer "attachment"
- t.integer "issue_done_ratio"
- t.integer "post_issue"
- t.integer "score_type"
- t.integer "total_score"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "project_id"
- end
-
- create_table "organizations", :force => true do |t|
- t.string "name"
- t.string "logo_link"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "phone_app_versions", :force => true do |t|
- t.string "version"
- t.text "description"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "poll_answers", :force => true do |t|
- t.integer "poll_question_id"
- t.text "answer_text"
- t.integer "answer_position"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "poll_questions", :force => true do |t|
- t.string "question_title"
- t.integer "question_type"
- t.integer "is_necessary"
- t.integer "poll_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.integer "question_number"
- end
-
- create_table "poll_users", :force => true do |t|
- t.integer "user_id"
- t.integer "poll_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "poll_votes", :force => true do |t|
- t.integer "user_id"
- t.integer "poll_question_id"
- t.integer "poll_answer_id"
- t.text "vote_text"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "polls", :force => true do |t|
- t.string "polls_name"
- t.string "polls_type"
- t.integer "polls_group_id"
- t.integer "polls_status"
- t.integer "user_id"
- t.datetime "published_at"
- t.datetime "closed_at"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.text "polls_description"
- t.integer "show_result", :default => 1
- end
-
- create_table "praise_tread_caches", :force => true do |t|
- t.integer "object_id", :null => false
- t.string "object_type"
- t.integer "praise_num"
- t.integer "tread_num"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "praise_treads", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "praise_tread_object_id"
- t.string "praise_tread_object_type"
- t.integer "praise_or_tread"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
create_table "principal_activities", :force => true do |t|
t.integer "user_id"
t.integer "principal_id"
@@ -2877,6 +1155,7 @@ ActiveRecord::Schema.define(:version => 20151014023806) do
t.string "enterprise_name"
t.integer "organization_id"
t.integer "project_new_type"
+ t.integer "gpid"
end
add_index "projects", ["lft"], :name => "index_projects_on_lft"
@@ -3293,6 +1572,7 @@ ActiveRecord::Schema.define(:version => 20151014023806) do
t.string "identity_url"
t.string "mail_notification", :default => "", :null => false
t.string "salt", :limit => 64
+ t.integer "gid"
end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css
new file mode 100644
index 000000000..432ad1d9a
--- /dev/null
+++ b/public/stylesheets/repository.css
@@ -0,0 +1,56 @@
+.git_usr_title{
+ margin: 0px;
+ overflow: hidden;
+ font-size: 18px;
+ font-weight: bold;
+ color: #444;
+ text-overflow: ellipsis;
+ vertical-align: top;
+ white-space: nowrap;
+}
+.overall-summary{
+ position: relative;
+ margin-bottom: 10px;
+ border: 1px solid #DDD;
+ border-radius: 3px;
+}
+.overall-summary .overall-summary-bottomless{
+ margin-bottom: 0px;
+ border-bottom: 0px none;
+ border-radius: 3px 3px 0px 0px;
+}
+.stats-switcher-viewport{
+ height: 38px;
+ overflow: hidden;
+}
+.stats-switcher-viewport .stats-switcher-wrapper{
+ position: relative;
+ top: 0px;
+ transition: top 0.25s ease-in-out 0s;
+}
+.numbers-summary{
+ display: table;
+ width: 100%;
+ table-layout: fixed;
+}
+.numbers-summary li{
+ display: table-cell;
+ padding: 0px;
+ margin: 0px;
+ text-align: center;
+ white-space: nowrap;
+}
+.numbers-summary .octicon {
+ color: #999;
+}
+.text-emphasized {
+ font-weight: bold;
+ color: #333;
+}
+.octicon .octicon-history {
+ font: 16px/1 octicons;
+ display: inline-block;
+ text-decoration: none;
+ text-rendering: auto;
+ -moz-user-select: none;
+}
\ No newline at end of file
From c7204576cc5bb69e5d39d0e7d0154165f2708eff Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 22 Oct 2015 14:25:57 +0800
Subject: [PATCH 026/169] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=88=9B?=
=?UTF-8?q?=E5=BB=BA=E4=BA=BA=E4=B8=BAprojectowner=20=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E6=96=B0=E7=9A=84=E7=89=88=E6=9C=AC=E5=BA=93=E5=9C=B0=E5=9D=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 2 +-
app/views/repositories/_breadcrumbs.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 11e949444..96ade096d 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -258,7 +258,7 @@ update
ip = RepositoriesHelper::REPO_IP_ADDRESS
gitlab_address = RepositoriesHelper::REPO_GITLAB_ADDRESS
if @repository.type.to_s=="Repository::Gitlab"
- @repos_url = "http://"+gitlab_address.to_s+"/"+repository_creater(@repository).lastname.to_s+"/"+@repository.identifier+"."+"git"
+ @repos_url = "http://"+gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git"
else
@repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+
@repository.url.slice(project_path_cut, @repository.url.length).to_s
diff --git a/app/views/repositories/_breadcrumbs.html.erb b/app/views/repositories/_breadcrumbs.html.erb
index 5c54fc490..ce6719d62 100644
--- a/app/views/repositories/_breadcrumbs.html.erb
+++ b/app/views/repositories/_breadcrumbs.html.erb
@@ -5,7 +5,7 @@
:path => nil, :rev => @rev }
%>
/
- <%=link_to repository_creater(@repository).show_name, user_path(repository_creater(@repository)) %>
+ <%=link_to @project.owner, user_path(@project.owner) %>
From 4b8c65d12e84d4ac0fb850e74b6de961614162be Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Thu, 22 Oct 2015 14:31:14 +0800
Subject: [PATCH 027/169] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 40 +++++++++++++++++++
app/views/users/dealwith_apply_request.js.erb | 11 +++++
2 files changed, 51 insertions(+)
create mode 100644 app/views/users/dealwith_apply_request.js.erb
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 7adba7cbf..7425692c0 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -239,6 +239,46 @@ class UsersController < ApplicationController
end
end
+ #处理加入课程成为教辅教师的请求
+ #status 1 同意 2 拒绝
+ def dealwith_apply_request
+ @msg = CourseMessage.find(params[:msg_id])
+
+ case params[:agree]
+ when 'Y'
+ apply_user = User.find(@msg.course_message_id)
+
+ if apply_user.member_of_course?(Course.find(@msg.course_id))
+ #将角色改为老师或者教辅
+ member = Course.find(@msg.course_id).members.where(:user_id=>apply_user.id).all[0]
+ member.role_ids = [@msg.content] # msg content保存的是申请的职位角色
+ #删除为学生的记录
+ joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,@msg.course_id)
+ joined.each do |join|
+ join.delete
+ end
+
+ member.course_group_id = 0
+ member.save
+ CourseMessage.create(:user_id => @msg.course_message_id, :course_id => @msg.course_id, :viewed => false,:content=> @msg.content,:course_message_id=>User.current.id,:content=>@msg.content,:course_message_type=>'CourseRequestDealResult',:status=>1)
+ @msg.update_attributes(:status=>1,:viewed=>1)
+ else
+ members = []
+ members << Member.new(:role_ids => [@msg.content.to_i], :user_id => @msg.course_message_id)
+ Course.find(@msg.course_id).members << members
+ CourseMessage.create(:user_id => @msg.course_message_id, :course_id => @msg.course_id, :viewed => false,:content=> @msg.content,:course_message_id=>User.current.id,:content=>@msg.content,:course_message_type=>'CourseRequestDealResult',:status=>1)
+ @msg.update_attributes(:status=>1,:viewed=>1)
+ end
+
+ when 'N'
+ CourseMessage.create(:user_id => @msg.course_message_id, :course_id => @msg.course_id, :viewed => false,:content=> @msg.content,:course_message_id=>User.current.id,:content=>@msg.content,:course_message_type=>'CourseRequestDealResult',:status=>2)
+ @msg.update_attributes(:status=>2,:viewed=>1)
+ end
+ respond_to do |format|
+ format.js
+ end
+ end
+
# added by bai
def show_score
diff --git a/app/views/users/dealwith_apply_request.js.erb b/app/views/users/dealwith_apply_request.js.erb
new file mode 100644
index 000000000..e31c0be85
--- /dev/null
+++ b/app/views/users/dealwith_apply_request.js.erb
@@ -0,0 +1,11 @@
+$("#deal_info_<%=@msg.id%>").html(
+<% if @msg.status == 0 || @msg.status.nil?%>
+<%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>@msg.id),:remote=>'true'%>
+'|'
+<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>@msg.id),:remote=>'true'%>
+<% elsif @msg.status == 1%>
+ '您已经同意了该申请'
+<% elsif @msg.status == 2%>
+ '您已经拒绝了该申请'
+<%end %>
+);
\ No newline at end of file
From 35719f9c28de94dfd6f47d78cf14e36b5162d026 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Thu, 22 Oct 2015 15:41:20 +0800
Subject: [PATCH 028/169] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=A4=84=E7=90=86?=
=?UTF-8?q?=E8=B7=AF=E7=94=B1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/routes.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/config/routes.rb b/config/routes.rb
index d140c240a..649cfbb75 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -387,6 +387,7 @@ RedmineApp::Application.routes.draw do
get 'user_resource_type'
get 'user_ref_resource_search'
post 'import_resources_to_homework'
+ get 'dealwith_apply_request'
get 'store_selected_resource'
# end
end
From f7545e623b332c467b850c253e5512254fdd4eca Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Thu, 22 Oct 2015 15:41:52 +0800
Subject: [PATCH 029/169] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=88=AA=E6=AD=A2=E6=97=A5=E6=9C=9F=E5=BF=AB?=
=?UTF-8?q?=E5=88=B0=E6=97=B6=EF=BC=8C=E5=A4=9A=E5=8F=91=E9=80=81=E4=B8=80?=
=?UTF-8?q?=E6=9D=A1=E6=B6=88=E6=81=AF=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_course.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index b98e3be53..720e5f9c5 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -37,7 +37,7 @@
<%= time_tag(ma.created_at).html_safe %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil?%>
<%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
<%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
From 4c5843a1694b9d6de483ebecfb72689a14eda011 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 22 Oct 2015 16:03:22 +0800
Subject: [PATCH 030/169] =?UTF-8?q?1=E3=80=81title=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=202=E3=80=81summary=E8=B0=83=E6=95=B4=203?=
=?UTF-8?q?=E3=80=81=E6=9C=AC=E7=89=88=E5=BA=93=E6=98=BE=E7=A4=BA=EF=BC=8C?=
=?UTF-8?q?=E5=8F=98=E6=9B=B4=E9=A1=B5=E9=9D=A2=204=E3=80=81=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3CSS?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/repositories/_breadcrumbs.html.erb | 5 +-
app/views/repositories/_navigation.html.erb | 42 +++++++--------
app/views/repositories/_summary.html.erb | 6 +--
app/views/repositories/changes.html.erb | 11 ++--
app/views/repositories/show.html.erb | 54 ++++++++++++++++----
public/stylesheets/project.css | 1 +
public/stylesheets/public.css | 3 ++
public/stylesheets/repository.css | 30 ++++++++++-
8 files changed, 111 insertions(+), 41 deletions(-)
diff --git a/app/views/repositories/_breadcrumbs.html.erb b/app/views/repositories/_breadcrumbs.html.erb
index ce6719d62..84111afeb 100644
--- a/app/views/repositories/_breadcrumbs.html.erb
+++ b/app/views/repositories/_breadcrumbs.html.erb
@@ -2,10 +2,11 @@
<%= link_to @repository.identifier.present? ? h(@repository.identifier) : 'root',
{:action => 'show', :id => @project,
:repository_id => @repository.identifier_param,
- :path => nil, :rev => @rev }
+ :path => nil, :rev => @rev },
+ :class => "repository-title-dec"
%>
/
- <%=link_to @project.owner, user_path(@project.owner) %>
+ <%=link_to @project.owner, user_path(@project.owner), :class => "repository-title-dec" %>
diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb
index 024fad34c..2fdf00cef 100644
--- a/app/views/repositories/_navigation.html.erb
+++ b/app/views/repositories/_navigation.html.erb
@@ -5,26 +5,28 @@
<%#= link_to l(:label_statistics),
{:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
:class => 'mt3 c_blue fl' if @repository.supports_all_revisions? %>
+
+ <%= form_tag({:action => controller.action_name,
+ :id => @project,
+ :repository_id => @repository.identifier_param,
+ :path => to_path_param(@path),
+ :rev => nil},
+ {:method => :get, :id => 'revision_selector', :class => "fl c_grey02"}) do -%>
+
+ <% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
+ <%= l(:label_branch) %>:
+ <%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), :id => 'branch' %>
+ <% end -%>
-<%= form_tag({:action => controller.action_name,
- :id => @project,
- :repository_id => @repository.identifier_param,
- :path => to_path_param(@path),
- :rev => nil},
- {:method => :get, :id => 'revision_selector', :class => "fl c_grey02 ml5"}) do -%>
-
- <% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
- <%= l(:label_branch) %>:
- <%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), :id => 'branch' %>
- <% end -%>
+ <% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
+ | <%= l(:label_tag) %>:
+ <%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag' %>
+ <% end -%>
- <% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
- | <%= l(:label_tag) %>:
- <%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag' %>
- <% end -%>
+ <%# if @repository.supports_all_revisions? %>
+ <%#= l(:label_revision) %>
+ <%#= text_field_tag 'rev', @rev, :size => 8 %>
+ <%# end %>
+ <% end -%>
+
- <%# if @repository.supports_all_revisions? %>
- | <%#= l(:label_revision) %>:
- <%#= text_field_tag 'rev', @rev, :size => 8 %>
- <%# end %>
-<% end -%>
diff --git a/app/views/repositories/_summary.html.erb b/app/views/repositories/_summary.html.erb
index 1527abf49..3bd86cd45 100644
--- a/app/views/repositories/_summary.html.erb
+++ b/app/views/repositories/_summary.html.erb
@@ -7,7 +7,7 @@
- <%=link_to @changesets.count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev}, :class => "num text-emphasized" %>
+ <%=link_to @changesets.count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev}, :class => "num text-emphasized c_blue" %>
commits
@@ -15,7 +15,7 @@
-
+
<%= @repository.branches.count %>
branches
@@ -24,7 +24,7 @@
- <%=link_to @repository.committers.count, committers_repository_path(@repository) %>
+ <%=link_to @repository.committers.count, committers_repository_path(@repository), :class => "c_blue" %>
contributors
diff --git a/app/views/repositories/changes.html.erb b/app/views/repositories/changes.html.erb
index 302c839ba..d3834bb41 100644
--- a/app/views/repositories/changes.html.erb
+++ b/app/views/repositories/changes.html.erb
@@ -1,16 +1,19 @@
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
-
- <%= render :partial => 'navigation' %>
+
+
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
-
<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %>
+
+ <%= render :partial => 'navigation' %>
+
+
<%= render :partial => 'link_to_functions' %>
<%= render_properties(@properties) %>
-
+
<%= render(:partial => 'revisions',
:locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => @entry }) unless @changesets.empty? %>
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index 65609afc5..80f9ec979 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -1,22 +1,16 @@
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
-
版本库
+
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
-
- <%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
- <%= render :partial => 'navigation' %>
-
+ <%= render :partial => 'navigation' %>
-
-
- <% if @repository.type.to_s=="Repository::Gitlab" %>
+ <% if @repository.type.to_s=="Repository::Gitlab" %>
<%= @repos_url %>
- <% else %>
+ <% else %>
<%= h @repository.url %>
- <% end %>
-
+ <% end %>
@@ -32,7 +26,45 @@
<%= render_properties(@properties) %>
+<% if authorize_for('repositories', 'revisions') %>
+ <%# if @changesets && !@changesets.empty? %>
+
+ <%= l(:label_latest_revision_plural) %>
+
+ <%= render :partial => 'revisions',
+ :locals => {:project => @project, :path => @path,
+ :revisions => @changesets, :entry => nil} %>
+ <%# end %>
+
+ <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
+ sep = '' %>
+ <% if @repository.supports_all_revisions? && @path.blank? %>
+ <%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project,
+ :repository_id => @repository.identifier_param},
+ :class => "orange_u_btn" %>
+ <% sep = '|' %>
+ <% end %>
+ <% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
+ <%= sep %>
+ <%= link_to l(:label_view_revisions),
+ {:action => 'changes',
+ :path => to_path_param(@path),
+ :id => @project,
+ :repository_id => @repository.identifier_param,
+ :rev => @rev},
+ :class => "orange_u_btn" %>
+ <% end %>
+
+ <% if @repository.supports_all_revisions? %>
+ <% content_for :header_tags do %>
+ <%= auto_discovery_link_tag(
+ :atom, params.merge(
+ {:format => 'atom', :action => 'revisions',
+ :id => @project, :page => nil, :key => User.current.rss_key})) %>
+ <% end %>
+ <% end %>
+<% end %>
点击查看如何提交代码
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index 27bb66bbb..f383835bc 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -13,6 +13,7 @@ a:hover.lg-foot{ color:#787b7e;}
/*右侧内容--动态*/
.project_r_h{ width:670px; height:40px; background:#eaeaea; margin-bottom:10px;}
.project_h2{ background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;}
+.project_h2_repository{ background:#64bdd9; color:#fff; height:33px; width:auto; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;}
.project_h22{ background:#64bdd9; color:#fff; height:33px; width:124px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;}
.project_r_box{ border:1px solid #e2e1e1; width:670px; margin-top:10px;}
.project_h3 { color:#646464; font-size:14px; padding:0 10px; border-bottom:1px solid #e2e1e1;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 45580e95e..b254569f0 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -104,6 +104,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mt8{ margin-top:8px;}
.mt10{ margin-top:10px !important;}
.mt30{ margin-top: 30px;}
+.mt40{ margin-top: 40px;}
.mt12 { margin-top:12px !important;}
.mt15 {margin-top:15px;}
.mt19 {margin-top:19px !important;}
@@ -115,6 +116,8 @@ h4{ font-size:14px; color:#3b3b3b;}
.mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;}
.pt5{ padding-top:5px;}
+.pt10{ padding-top:10px;}
+.pb5{ padding-bottom: 5px;}
.w20{ width:20px;}
.w40{width: 40px;}
.w45{ width: 45px;}
diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css
index 432ad1d9a..1a542d579 100644
--- a/public/stylesheets/repository.css
+++ b/public/stylesheets/repository.css
@@ -3,10 +3,10 @@
overflow: hidden;
font-size: 18px;
font-weight: bold;
- color: #444;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
+ padding: 0px 10px;
}
.overall-summary{
position: relative;
@@ -32,6 +32,7 @@
display: table;
width: 100%;
table-layout: fixed;
+ margin-top: 9px;
}
.numbers-summary li{
display: table-cell;
@@ -53,4 +54,31 @@
text-decoration: none;
text-rendering: auto;
-moz-user-select: none;
+}
+.select2-container {
+ margin: 0px;
+ position: relative;
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.select2-container .select2-choice {
+ display: block;
+ height: 26px;
+ padding: 0px 0px 0px 8px;
+ overflow: hidden;
+ position: relative;
+ border: 1px solid #AAA;
+ white-space: nowrap;
+ line-height: 26px;
+ color: #444;
+ text-decoration: none;
+ border-radius: 4px;
+ background-clip: padding-box;
+ -moz-user-select: none;
+ background-color: #FFF;
+ background-image: linear-gradient(to top, #EEE 0%, #FFF 50%);
+}
+.repository-title-dec{
+ color: #fff !important;
}
\ No newline at end of file
From bd793a00fe25a763af238e46206a1ddae0a25f48 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 22 Oct 2015 16:16:23 +0800
Subject: [PATCH 031/169] =?UTF-8?q?=E8=B4=A1=E7=8C=AE=E8=80=85=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 4 ----
app/views/repositories/committers.html.erb | 6 +++++-
config/locales/zh.yml | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 96ade096d..bf3875835 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -187,15 +187,11 @@ update
# Build a hash with repository usernames as keys and corresponding user ids as values
@repository.committer_ids = params[:committers].values.inject({}) {|h, c| h[c.first] = c.last; h}
flash[:notice] = l(:notice_successful_update)
- redirect_to settings_project_url(@project, :tab => 'repositories')
- elsif request.get?
respond_to do |format|
format.html{
render :layout => "base_projects"
}
end
-
-
end
end
diff --git a/app/views/repositories/committers.html.erb b/app/views/repositories/committers.html.erb
index ccb037e09..93350889d 100644
--- a/app/views/repositories/committers.html.erb
+++ b/app/views/repositories/committers.html.erb
@@ -1,4 +1,8 @@
-<%= l(:label_repository) %>
+
+
+
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
+
+
<%= simple_format(l(:text_repository_usernames_mapping)) %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 2b95c917d..f53389969 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -988,7 +988,7 @@ zh:
text_enumeration_destroy_question: "%{count} 个对象被关联到了这个枚举值。"
text_enumeration_category_reassign_to: '将它们关联到新的枚举值:'
text_email_delivery_not_configured: "邮件参数尚未配置,因此邮件通知功能已被禁用。\n请在config/configuration.yml中配置您的SMTP服务器信息并重新启动以使其生效。"
- text_repository_usernames_mapping: "选择或更新与版本库中的用户名对应的Trustie用户。\n版本库中与Trustie中的同名用户将被自动对应。"
+ text_repository_usernames_mapping: "选择或更新与版本库中的用户名对应的Trustie用户,版本库中与Trustie中的同名用户将被自动对应。"
text_diff_truncated: '... 差别内容超过了可显示的最大行数并已被截断'
text_custom_field_possible_values_info: '每项数值一行'
text_wiki_page_destroy_question: 此页面有 %{descendants} 个子页面和下级页面。您想进行那种操作?
From 13a157939587d8d94729f0ce5a0a6ddfec765fe3 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 22 Oct 2015 16:44:35 +0800
Subject: [PATCH 032/169] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../repositories/_link_to_functions.html.erb | 8 ++--
app/views/repositories/entry.html.erb | 20 +++++-----
app/views/repositories/show.html.erb | 39 -------------------
3 files changed, 15 insertions(+), 52 deletions(-)
diff --git a/app/views/repositories/_link_to_functions.html.erb b/app/views/repositories/_link_to_functions.html.erb
index aaefd2dbc..fc3784d46 100644
--- a/app/views/repositories/_link_to_functions.html.erb
+++ b/app/views/repositories/_link_to_functions.html.erb
@@ -1,10 +1,10 @@
<% if @entry && @entry.kind == 'file' %>
-<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %>
-<%# if @repository.supports_cat? %>
- <%#= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
-<%# end %>
+<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
+<% if @repository.supports_cat? %>
+ <%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
+<% end %>
<% if @repository.supports_annotate? %>
<%= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
<% end %>
diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb
index 5aea99dcc..00eb66638 100644
--- a/app/views/repositories/entry.html.erb
+++ b/app/views/repositories/entry.html.erb
@@ -1,15 +1,17 @@
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
+
+
+ <%= render :partial => 'navigation' %>
+
-
- <%= render :partial => 'navigation' %>
-
+
<%= @path %>
-
<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %>
+ <%= render :partial => 'link_to_functions' %>
-<%= render :partial => 'link_to_functions' %>
+ <%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
-<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
+ <% content_for :header_tags do %>
+ <%= stylesheet_link_tag "scm" %>
+ <% end %>
+
-<% content_for :header_tags do %>
-<%= stylesheet_link_tag "scm" %>
-<% end %>
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index 80f9ec979..b1f6ba6ce 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -26,45 +26,6 @@
<%= render_properties(@properties) %>
-<% if authorize_for('repositories', 'revisions') %>
- <%# if @changesets && !@changesets.empty? %>
-
- <%= l(:label_latest_revision_plural) %>
-
- <%= render :partial => 'revisions',
- :locals => {:project => @project, :path => @path,
- :revisions => @changesets, :entry => nil} %>
- <%# end %>
-
-
- <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
- sep = '' %>
- <% if @repository.supports_all_revisions? && @path.blank? %>
- <%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project,
- :repository_id => @repository.identifier_param},
- :class => "orange_u_btn" %>
- <% sep = '|' %>
- <% end %>
- <% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
- <%= sep %>
- <%= link_to l(:label_view_revisions),
- {:action => 'changes',
- :path => to_path_param(@path),
- :id => @project,
- :repository_id => @repository.identifier_param,
- :rev => @rev},
- :class => "orange_u_btn" %>
- <% end %>
-
- <% if @repository.supports_all_revisions? %>
- <% content_for :header_tags do %>
- <%= auto_discovery_link_tag(
- :atom, params.merge(
- {:format => 'atom', :action => 'revisions',
- :id => @project, :page => nil, :key => User.current.rss_key})) %>
- <% end %>
- <% end %>
-<% end %>
点击查看如何提交代码
From 03c2948a7ccfab161cf83ef9e716592db1cf37bf Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 22 Oct 2015 16:53:36 +0800
Subject: [PATCH 033/169] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=86=85=E5=AE=B9?=
=?UTF-8?q?=E5=AF=B9=E6=AF=94?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/repositories/diff.html.erb | 5 ++++-
app/views/repositories/entry.html.erb | 2 +-
config/locales/zh.yml | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/views/repositories/diff.html.erb b/app/views/repositories/diff.html.erb
index a3afebfff..4e40bd5e8 100644
--- a/app/views/repositories/diff.html.erb
+++ b/app/views/repositories/diff.html.erb
@@ -1,4 +1,7 @@
-<%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %>
+
+
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
+
+<%= l(:label_revision_path) %> :<%=h @path %>
<%= form_tag({:action => 'diff', :id => @project,
diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb
index 00eb66638..bb2fa6dae 100644
--- a/app/views/repositories/entry.html.erb
+++ b/app/views/repositories/entry.html.erb
@@ -4,7 +4,7 @@
<%= render :partial => 'navigation' %>
-
<%= @path %>
+
<%= l(:label_revision_path) %> :<%= @path %>
<%= render :partial => 'link_to_functions' %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index f53389969..a7274c3c2 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -675,6 +675,7 @@ zh:
label_branch: 分支
label_tag: 标签
label_revision: 修订
+ label_revision_path: 当前路径
label_revision_plural: 修订
lable_revision_code_count: 代码量
label_revision_commit_count: 提交次数
From 4b6f8efc5a1bbf3fdd0673743adf33def8597bbc Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 22 Oct 2015 16:57:36 +0800
Subject: [PATCH 034/169] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=9C=E4=B8=9A=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../student_work/_student_work_list.html.erb | 1 +
app/views/student_work/index.html.erb | 76 +++++++++++++++++++
app/views/users/_user_homework_list.html.erb | 18 ++---
public/stylesheets/courses.css | 10 +++
4 files changed, 96 insertions(+), 9 deletions(-)
diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb
index 197fecac9..2d0e9220c 100644
--- a/app/views/student_work/_student_work_list.html.erb
+++ b/app/views/student_work/_student_work_list.html.erb
@@ -12,6 +12,7 @@
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
<% end%>
+ [ 显示作业信息 ]
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb
index e28cdb1e2..72ca36ca9 100644
--- a/app/views/student_work/index.html.erb
+++ b/app/views/student_work/index.html.erb
@@ -28,6 +28,33 @@
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
}
+ $(function(){
+ $("#homework_info_hidden").click(function(){
+ $("#homeworkInformation").hide();
+ $("#homework_info_hidden").hide();
+ $("#homework_info_show").show();
+ });
+ $("#homework_info_show").click(function(){
+ $("#homework_info_show").hide();
+ $("#homeworkInformation").show();
+ $("#homework_info_hidden").show();
+ });
+
+ if($("#homework_description").height() > 54) {
+ $("#homeworkDetailShow").show();
+ }
+ $("#homeworkDetailShow").click(function(){
+ $("#homeworkDetail").toggleClass("max_h54");
+ $("#homeworkDetailShow").hide();
+ $("#homeworkDetailHide").show();
+ });
+ $("#homeworkDetailHide").click(function(){
+ $("#homeworkDetail").toggleClass("max_h54");
+ $("#homeworkDetailHide").hide();
+ $("#homeworkDetailShow").show();
+ });
+ });
+
+
+
diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb
index ad39ad14f..cf511c51f 100644
--- a/app/views/users/_user_homework_list.html.erb
+++ b/app/views/users/_user_homework_list.html.erb
@@ -1,15 +1,15 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
<% homework_commons.each do |homework_common|%>
<% if activity && activity.course_act%>
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index df42f6ee9..4bde4476d 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -43,9 +43,15 @@
截止时间:<%= activity.end_time.to_s %>
-
- <%= activity.description.html_safe %>
+
+
+ <%= activity.description.html_safe %>
+
+
+
+
+
<%# if is_teacher%>
<% if ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? %>
-
+ <%= link_to image_tag(url_to_avatar(ma.course_message.homework_common.user), :width => "30", :height => "30"), user_path(ma.course_message.homework_common.user) %>
- ">迟交作业,不能参与作业匿评!
+ <%=link_to ma.course_message.homework_common.user.show_name, user_path(ma.course_message.homework_common.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">发布的作业:
-
- <%= link_to "由于迟交作业,您及您的作品都不能参与作业的匿评", student_work_index_path(:homework => ma.course_message.homework_common_id),
+
+ <%= link_to "作业题目:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id),
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -393,11 +395,18 @@
<%= User.current.lastname + User.current.firstname %>
<%= User.current.allowed_to?(:as_teacher,ma.course_message.homework_common.course) ? '老师':'同学'%>您好!由于迟交作业,您及您的作品都不能参与以下作业的匿评。作业详情如下:
- 课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)
- 作业标题:<%=ma.course_message.homework_common.name %>
- 提交截止:<%=ma.course_message.homework_common.end_time %> 24:00
- 提交时间:<%=format_time(ma.course_message.created_at) %>
+
+
+ 课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)
+
+ 作业标题:<%= ma.course_message.homework_common.name %>
+ 提交截止:<%= ma.course_message.homework_common.end_time %> 24:00
+ 提交时间:<%= format_time(ma.course_message.created_at) %>
+ 迟交扣分:<%= ma.course_message.homework_common.late_penalty %>分
+
+ 如需获得最终成绩,请您联系主讲老师对您的作品进行单独评分!
+
您迟交了作品!
<%= time_tag(ma.created_at).html_safe %>
<% end %>
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 872d8df6d..83fe0456f 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -1296,3 +1296,5 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
.list_style ul li{list-style-type: disc;margin-left: 20px;}
+.list_style_disc {list-style-type:disc;margin-left:5px;}
+.system_message_style li{color:#909090}
From 4a188dc81d7660b8881df47e68ca7f089e58ddaa Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Fri, 23 Oct 2015 14:28:24 +0800
Subject: [PATCH 038/169] =?UTF-8?q?=E5=AF=B9=E6=89=80=E6=9C=89=E4=BD=9C?=
=?UTF-8?q?=E4=B8=9A=E6=B6=88=E6=81=AF=EF=BC=8C=E7=BB=9F=E4=B8=80=E5=9C=A8?=
=?UTF-8?q?=E5=86=85=E5=AE=B9=E5=89=8D=E5=8A=A0=E5=9C=86=E7=82=B9=EF=BC=8C?=
=?UTF-8?q?=E5=B9=B6=E4=B8=94=E8=B0=83=E6=95=B4=E9=A2=9C=E8=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_course.html.erb | 170 +++++++++---------
public/images/news_dot.png | Bin 0 -> 976 bytes
public/images/news_dot2.png | Bin 0 -> 976 bytes
public/stylesheets/new_user.css | 4 +-
4 files changed, 86 insertions(+), 88 deletions(-)
create mode 100644 public/images/news_dot.png
create mode 100644 public/images/news_dot2.png
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index 38f895e4c..fb63f4fc0 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -62,27 +62,31 @@
<%= User.current.lastname + User.current.firstname %>老师您好!
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.show_name + "老师")%>刚刚发布了一个作业:
- 课程名称:<%= ma.course_message.course.name %>
- (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 24点
- 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
- 迟交扣分:<%= ma.course_message.late_penalty %>分
- 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
+ 课程名称:<%= ma.course_message.course.name %>
+ (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ 作业标题:<%= ma.course_message.name %>
+ 提交截止:<%= ma.course_message.end_time %> 24点
+ 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
+ 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+ 迟交扣分:<%= ma.course_message.late_penalty %>分
+ 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
您可以修改作业内容、评分规则、匿评过程等,谢谢!
<% else %>
<%= User.current.lastname + User.current.firstname %>同学您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:
- 课程名称:<%= ma.course_message.course.name %>
- (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 24点
- 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
- 迟交扣分:<%= ma.course_message.late_penalty %>分
- 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
+ 课程名称:<%= ma.course_message.course.name %>
+ (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ 作业标题:<%= ma.course_message.name %>
+ 提交截止:<%= ma.course_message.end_time %> 24点
+ 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
+ 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+ 迟交扣分:<%= ma.course_message.late_penalty %>分
+ 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
请抓紧时间提交您的作品,谢谢!
@@ -109,24 +113,16 @@
<%= User.current.lastname + User.current.firstname %>同学您好!
<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师发布的作业截止日期快到了:
- 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 24点
- 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
- 迟交扣分:<%= ma.course_message.late_penalty %>分
- 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
- 请抓紧时间提交您的作品,谢谢!
- <% else %>
- <%= User.current.lastname + User.current.firstname %>老师您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师发布的作业截止日期快到了:
- 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 24点
- 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
- 迟交扣分:<%= ma.course_message.late_penalty %>分
- 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
- 您可以修改作业内容、评分规则、匿评过程等,谢谢!
+
+ 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ 作业标题:<%= ma.course_message.name %>
+ 提交截止:<%= ma.course_message.end_time %> 24点
+ 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
+ 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+ 迟交扣分:<%= ma.course_message.late_penalty %>分
+ 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+ 请抓紧时间提交您的作品,谢谢!
+
<% end %>
截止时间快到了!
@@ -154,12 +150,12 @@
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师' : '同学' %>您好!
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>开启了匿评,作业详情如下:
-
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
-
作业标题:<%= ma.course_message.name %>
-
缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
-
- 匿评截止:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
-
+
+ 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ 作业标题:<%= ma.course_message.name %>
+ 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+ 匿评截止:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+
<% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%>
请您尽早完成匿评!如果您在规定时间内未完成匿评,一次将被扣<%= ma.course_message.homework_detail_manual.absence_penalty %>分。
<% end%>
@@ -184,8 +180,10 @@
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>关闭了匿评,作业详情如下:
-
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
-
作业标题:<%= ma.course_message.name %>
+
+ 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ 作业标题:<%= ma.course_message.name %>
+
<%= time_tag(ma.created_at).html_safe %>
@@ -210,14 +208,14 @@
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher, ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败!
-
失败原因:提交作品的人数低于2人
-
- 作业详情如下:
- 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
-
- 提交截止:<%= ma.course_message.end_time%> 24点
+
+
+ 失败原因:提交作品的人数低于2人
+ 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)
+ 作业标题:<%= ma.course_message.name %>
+ 提交截止:<%= ma.course_message.end_time%> 24点
+
<%= time_tag(ma.created_at).html_safe %>
@@ -304,16 +302,16 @@
<%= User.current.show_name %>同学您好!
<%= ma.course_message.reviewer_role == 3? "匿名用户" : (ma.course_message.user.show_name + "老师")%><%= ma.status == 0? "评阅了您的作品":"重新评阅了您的作品"%>。详情如下:
- 课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
- 作业标题:<%=ma.course_message.student_work.homework_common.name %>
- <% content = ma.content.gsub("作业评分:","").split(" 评语:")%>
-
- 作品评分:<%= content[0] %>分
-
- <% if content.size > 1 %>
- 作品评语:
- <%= content[1] %>
- <% end %>
+
+ 课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
+ 作业标题:<%=ma.course_message.student_work.homework_common.name %>
+ <% content = ma.content.gsub("作业评分:","").split(" 评语:")%>
+ 作品评分:<%= content[0] %>分
+ <% if content.size > 1 %>
+
作品评语:
+ <%= content[1] %>
+ <% end %>
+
本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %> 24点结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。 期待您取得更大的进步!
@@ -351,7 +349,7 @@
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname +
- "#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"同学":"老师"}",
+ "#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"}",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
">回复了作品评论:
@@ -365,12 +363,12 @@
<%= User.current.show_name %>老师您好!
<%= ma.course_message.user.show_name%><%= ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"学生"%>回复了您的作品评论。详情如下:
- 回复内容:
- <%= ma.course_message.notes %>
- 您的评论:
- <%= ma.course_message.jour.comment %>
- 课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
- 作业标题:<%=ma.course_message.jour.student_work.homework_common.name %>
+
+ 回复内容:<%= ma.course_message.notes %>
+ 您的评论:<%= ma.course_message.jour.comment %>
+ 课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
+ 作业标题:<%=ma.course_message.jour.student_work.homework_common.name %>
+
<%= time_tag(ma.created_at).html_safe %>
@@ -395,14 +393,12 @@
<%= User.current.lastname + User.current.firstname %>
<%= User.current.allowed_to?(:as_teacher,ma.course_message.homework_common.course) ? '老师':'同学'%>您好!由于迟交作业,您及您的作品都不能参与以下作业的匿评。作业详情如下:
-
<% end %>
diff --git a/public/images/news_dot.png b/public/images/news_dot.png
new file mode 100644
index 0000000000000000000000000000000000000000..7dea0bbe497f2c0f9b39e489ae60c723fe2b48eb
GIT binary patch
literal 976
zcmaJ=zi-n(7R|b%XopTzev1*#sc1T1VMQNmFV2ER1605b(*cak<
zLLHEpVB#-eMEn6TpbiWm76urQkg84$Na?_e#5qk;27+b#e(1gTefNFup4O`OmKLuq
zavZl*E@^c(F2vu(_<#IqSYpFfsyFF2>Ck~0V6I@3HU?$a?BY5$?fr)z@CL_SfKH=H
zn?^;ph|8NXhL2pIu{myIGxAMq7gNy2UB^@4@a;PY99w}q86#!*D(*R@g8*+IR2$a8
zu9dUl=3TH6$xOh-)C7^c=Y?{lz>%)Z=JB=w!3aWk6?m3Z)2IQJ1Q=xabka&81SE+^
zYZ*yGcYv5eqL5;*ltgQCMv}!W7(b9j3+#?u*NWp
zVhvGDGDI@m_ox{qy>NA+pyAL89G^PG1F@pnCVi?vmg(6MTz@L-h2t`@f(eo73y4p}
zN16Z)B|0N!TMk
zP`4#;Ysc|yG6-*v@P;9my^xxoh0B@(nF8-Pwyfzzy`W|FY)&j9q-VBLlBkQB^)$++
z)ihEkT#ZZ5ncUb4uFoQCIB*_eyBH7`jE*cjvvW~r>W#Vf>|C^&T!AGc
z#Et!{(UUFao_IR7En7^Dk3Hu0fZ6)XD|E!JgjUuHjp$qZ*Xe1?YPEhWoUDM({K@KHxPfQB`G@C_CzDnZ+=Hg4IjObG$-pdF^zI!{
z3}qtVKx}}}IdTIzROp$mOxDpcOM@8%4;1<=sJ31QD)J!^nQX@7cpgX+!{jv{Ok%Fzpet1lS<14#JQiW8-kfVKk0ra5%aUN&sIeCs9UqbD
ziI$78C7Z?ILzhguPsaLfCi#+F39YK_wZb2rSDdkOGm%j98(%3ty}>4bHMYRX#X9_{H?<@5g_(pWIJnH($Ts0-vd;-PE<6;LS;N$ExL;_O5hz
F{1*rxDeM3M
literal 0
HcmV?d00001
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index ee3d96b4b..599ea5476 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -1298,5 +1298,5 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
.list_style ul li{list-style-type: disc;margin-left: 20px;}
-.list_style_disc {list-style-type:disc;margin-left:5px;}
-.system_message_style li{color:#909090}
+.ul_grey li {color:#909090; list-style-position:inside; padding-left:1px;list-style-image:url('../images/news_dot2.png')}
+.ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('../images/news_dot.png')}
From fde4ce74ba5378eb2d8b8ac5f4210043979a0535 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 23 Oct 2015 14:45:56 +0800
Subject: [PATCH 039/169] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=A2=9E=E5=8A=A0=E8=AF=84=E5=88=86=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_common_controller.rb | 9 +++++++--
app/controllers/student_work_controller.rb | 8 +++++++-
app/views/homework_common/score_rule_set.js.erb | 6 ++++++
app/views/student_work/_set_score_rule.html.erb | 3 +++
app/views/student_work/index.html.erb | 2 +-
app/views/users/_user_homework_detail.html.erb | 3 +++
config/routes.rb | 1 +
7 files changed, 28 insertions(+), 4 deletions(-)
create mode 100644 app/views/homework_common/score_rule_set.js.erb
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 9e3a4b836..7793ef097 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -6,8 +6,8 @@ class HomeworkCommonController < ApplicationController
include StudentWorkHelper
before_filter :find_course, :only => [:index,:new,:create]
- before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr]
- before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr]
+ before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set]
+ before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set]
before_filter :member_of_course, :only => [:index]
def index
@@ -215,6 +215,11 @@ class HomeworkCommonController < ApplicationController
end
end
+ #评分设置
+ def score_rule_set
+
+ end
+
private
#获取课程
def find_course
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index e5e1bf391..529c5ea72 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -457,7 +457,13 @@ class StudentWorkController < ApplicationController
end
end
respond_to do |format|
- format.html{redirect_to student_work_index_url(:homework => @homework.id)}
+ format.html{
+ if params[:student_path]
+ redirect_to student_work_index_url(:homework => @homework.id)
+ else
+ redirect_to user_homeworks_user_path(User.current.id)
+ end
+ }
end
end
diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb
new file mode 100644
index 000000000..5ff42dff7
--- /dev/null
+++ b/app/views/homework_common/score_rule_set.js.erb
@@ -0,0 +1,6 @@
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false}) %>');
+showModal('ajax-modal', '350px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ " ");
+$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
\ No newline at end of file
diff --git a/app/views/student_work/_set_score_rule.html.erb b/app/views/student_work/_set_score_rule.html.erb
index 7deed7fb8..508b89a1c 100644
--- a/app/views/student_work/_set_score_rule.html.erb
+++ b/app/views/student_work/_set_score_rule.html.erb
@@ -1,4 +1,7 @@
<%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id},:method => "post") do |f|%>
+ <% if student_path %>
+ <%=hidden_field_tag 'student_path', params[:student_path], :value => student_path %>
+ <% end %>