Date: Mon, 19 Oct 2015 14:03:08 +0800
Subject: [PATCH 21/41] 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 22/41] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87gitla?=
=?UTF-8?q?b=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 9cea468401a43691ccd845ce1884cc8ea87a54d6 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Thu, 22 Oct 2015 09:52:01 +0800
Subject: [PATCH 23/41] =?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 24/41] =?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 25/41] =?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 4c5843a1694b9d6de483ebecfb72689a14eda011 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 22 Oct 2015 16:03:22 +0800
Subject: [PATCH 26/41] =?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 27/41] =?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 28/41] =?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 29/41] =?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 7ab6c4526268d09429a48ae02771811d7fe3d180 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 23 Oct 2015 15:37:58 +0800
Subject: [PATCH 30/41] =?UTF-8?q?1=E3=80=81=E8=BD=AC=E6=8D=A2=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA=E3=80=82=202?=
=?UTF-8?q?=E3=80=81url=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/repositories/show.html.erb | 6 +++---
app/views/repositories/to_gitlab.html.erb | 12 ++++++++++--
config/locales/projects/zh.yml | 6 +++++-
public/stylesheets/application.css | 9 +++++++++
public/stylesheets/repository.css | 7 +++++++
5 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index b1f6ba6ce..f2716c3ea 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -5,11 +5,11 @@
<%= render :partial => 'navigation' %>
-
+
<% if @repository.type.to_s=="Repository::Gitlab" %>
- <%= @repos_url %>
+ 版本库地址:<%= @repos_url %>
<% else %>
- <%= h @repository.url %>
+ 版本库地址:<%= h @repository.url %>
<% end %>
diff --git a/app/views/repositories/to_gitlab.html.erb b/app/views/repositories/to_gitlab.html.erb
index eccf7259d..d06c087ed 100644
--- a/app/views/repositories/to_gitlab.html.erb
+++ b/app/views/repositories/to_gitlab.html.erb
@@ -1,4 +1,12 @@
+
+
+ <%= l(:label_repository_migrate_dec) %>
+
<%= form_for(@repository, url: to_gitlab_project_repository_path(@project, @repository)) do |f| %>
-
转换到新版本
-<% end %>
\ No newline at end of file
+
转换到新版本
+<% end %>
+
+ <%= l(:label_repository_name_dec) %>
+
+
\ No newline at end of file
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index dbce93219..7feb6f26a 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -440,4 +440,8 @@ zh:
#
field_sharing: 共享
label_title_code_review: 代码评审
- label_home_non_project: 您还没有创建项目,您可以查看系统的其它项目!
\ No newline at end of file
+ label_home_non_project: 您还没有创建项目,您可以查看系统的其它项目!
+
+ # 版本库迁移
+ label_repository_migrate_dec: 注意:Trustie版本库近期进行了一次大的改造,历史版本需要转换成新的版本,输入新的版本库名,即可完成转换。 转换过程可能需要等待一段时间。
+ label_repository_name_dec: 版本库名仅小写字母(a-z)、数字、破折号(-)和下划线(_)可以使用,长度必须在 1 到 254 个字符之间,一旦保存,标识无法修改。
\ No newline at end of file
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index dbc91353b..d89b572e5 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -17,6 +17,15 @@ li{list-style-type:none;}
.cancel_btn {background-color: #c1c1c1; color: #ffffff; padding: 2px 5px; border: none; border-radius: 3px; cursor: pointer;}
.cancel_btn:hover {background-color:#656565; }
/*huang*/
+.repository-update-dec{
+ padding: 10px;
+}
+.repository-update-dec .c_grey {
+ color: #999999;
+}
+.repository-update-dec .c_orange {
+ color: #ff7143;
+}
.hwork_input_news{ border:1px solid #64bdd9; height:22px; width:594px; background:#fff; margin-bottom:10px; padding:5px;}
.ml55{ margin-left:55px;}
diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css
index 1a542d579..7745af1e5 100644
--- a/public/stylesheets/repository.css
+++ b/public/stylesheets/repository.css
@@ -81,4 +81,11 @@
}
.repository-title-dec{
color: #fff !important;
+}
+.repository-url{
+ color: #2D2D2D;
+ margin: auto 0px;
+ text-align: center;
+ font-size: 14px;
+ margin-bottom: 10px;
}
\ No newline at end of file
From b45d140a74c4cd916ef5d9c53608da3c73cc4c51 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 23 Oct 2015 16:20:32 +0800
Subject: [PATCH 31/41] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=98=BE=E7=A4=BA=E9=A1=B5=E9=9D=A2=20?=
=?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=8E=A5=E5=A4=B4top=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/repositories/show.html.erb | 23 ++++++++++++-----------
public/stylesheets/repository.css | 15 +++++++++++++++
2 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index f2716c3ea..bc0ff18be 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -5,32 +5,33 @@
<%= render :partial => 'navigation' %>
-
+
+ <% if @entries.nil? && authorize_for('repositories', 'browse') %>
+
+ 该版本库还没有上传代码!
+
+ <% end %>
<% if @repository.type.to_s=="Repository::Gitlab" %>
版本库地址:<%= @repos_url %>
<% else %>
版本库地址:<%= h @repository.url %>
<% end %>
+
+
+
-<%# 各类信息入口 %>
-<% if !@repository.nil? %>
- <%= render :partial => 'summary' %>
-<% end %>
-<%# end %>
-
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
+ <%# 数据统计 %>
+ <%= render :partial => 'summary' %>
+ <%# end %>
<%= render :partial => 'dir_list' %>
<% end %>
<%= render_properties(@properties) %>
-
-
点击查看如何提交代码
-
-
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>
diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css
index 7745af1e5..0fe1541d2 100644
--- a/public/stylesheets/repository.css
+++ b/public/stylesheets/repository.css
@@ -88,4 +88,19 @@
text-align: center;
font-size: 14px;
margin-bottom: 10px;
+ margin-top: 10px;
+}
+.center{
+ text-align: center;
+}
+.light-well {
+ background: #F9F9F9 none repeat scroll 0% 0%;
+ padding: 15px;
+}
+.page-title {
+ margin-top: 0px;
+ line-height: 1.5;
+ font-weight: bold;
+ margin-bottom: 5px;
+ font-size: 18px;
}
\ No newline at end of file
From 2221fb4d7a3f02bfd345ba6bd6bc95d7e2967d84 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 23 Oct 2015 16:28:17 +0800
Subject: [PATCH 32/41] =?UTF-8?q?committers=E8=B7=B3=E8=BD=AC=E9=97=AE?=
=?UTF-8?q?=E9=A2=98=20=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 6 ++++++
public/stylesheets/public.css | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index bf3875835..b3b2f414a 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -192,6 +192,12 @@ update
render :layout => "base_projects"
}
end
+ elsif request.get?
+ respond_to do |format|
+ format.html{
+ render :layout => "base_projects"
+ }
+ end
end
end
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index b254569f0..7173222da 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -12,7 +12,7 @@ textarea {resize: none;}
.pInline {margin:0px; padding:0px; display:inline-block;}
/*常用*/
-select,input,textarea{ border:1px solid #269ac9; background:#fff; color:#000; padding-left:5px; }
+select,input,textarea{ border:1px solid #269ac9; background:#fff; color:#000; padding-left:5px;padding-right: 5px; }
.sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; margin-bottom:10px; background:#dbdbdb;}
.sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
table{ background:#fff;}
From 0a4fd92d8c365fc8a0e1fb4fbdac4216d4315cc3 Mon Sep 17 00:00:00 2001
From: huang
Date: Sat, 24 Oct 2015 11:51:02 +0800
Subject: [PATCH 33/41] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=9C=A8project=E5=8F=B3=E4=BE=A7?=
=?UTF-8?q?=20=E7=BF=BB=E6=BB=9A=20=E4=BB=A3=E7=A0=81=E5=B1=95=E7=A4=BA?=
=?UTF-8?q?=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=EF=BC=88=E9=A2=9C=E8=89=B2?=
=?UTF-8?q?=E5=8C=BA=E5=88=86=E6=A0=B7=E5=BC=8F=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 7 +-
public/stylesheets/repository.css | 103 ++++++++++++++++++++-
2 files changed, 106 insertions(+), 4 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index b3b2f414a..9da22577f 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -236,13 +236,13 @@ update
#if( !User.current.member_of?(@project) || @project.hidden_repo)
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
- #g = Gitlab.client
- #project = g.project(11)
+ # g = Gitlab.client
+ # project = g.project(20)
# rr = g.trees(project.id, @path)
# r = g.get ("/projects/#{@project}/repository/tree")
# :name, :path, :kind, :size, :lastrev, :changeset
@entries = @repository.entries(@path, @rev)
- #@entries = g.trees(project.id, @path)
+ # @trees = g.trees(project, @path)
@changeset = @repository.find_changeset_by_name(@rev)
#@project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
#@ip = RepositoriesHelper::REPO_IP_ADDRESS
@@ -307,6 +307,7 @@ update
def entry
entry_and_raw(false)
+ render :layout => 'base_projects'
end
def entry_and_raw(is_raw)
diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css
index 0fe1541d2..0cb7d918e 100644
--- a/public/stylesheets/repository.css
+++ b/public/stylesheets/repository.css
@@ -103,4 +103,105 @@
font-weight: bold;
margin-bottom: 5px;
font-size: 18px;
-}
\ No newline at end of file
+}
+/************* CodeRay styles *************/
+.syntaxhl div {display: inline;}
+.syntaxhl .line-numbers {padding: 2px 4px 2px 4px; background-color: #eee; margin:0px 5px 0px 0px;}
+.syntaxhl .code pre { overflow: auto }
+.syntaxhl .debug { color: white !important; background: blue !important; }
+
+.syntaxhl .annotation { color:#007 }
+.syntaxhl .attribute-name { color:#b48 }
+.syntaxhl .attribute-value { color:#700 }
+.syntaxhl .binary { color:#509 }
+.syntaxhl .char .content { color:#D20 }
+.syntaxhl .char .delimiter { color:#710 }
+.syntaxhl .char { color:#D20 }
+.syntaxhl .class { color:#258; font-weight:bold }
+.syntaxhl .class-variable { color:#369 }
+.syntaxhl .color { color:#0A0 }
+.syntaxhl .comment { color:#385 }
+.syntaxhl .comment .char { color:#385 }
+.syntaxhl .comment .delimiter { color:#385 }
+.syntaxhl .complex { color:#A08 }
+.syntaxhl .constant { color:#258; font-weight:bold }
+.syntaxhl .decorator { color:#B0B }
+.syntaxhl .definition { color:#099; font-weight:bold }
+.syntaxhl .delimiter { color:black }
+.syntaxhl .directive { color:#088; font-weight:bold }
+.syntaxhl .doc { color:#970 }
+.syntaxhl .doc-string { color:#D42; font-weight:bold }
+.syntaxhl .doctype { color:#34b }
+.syntaxhl .entity { color:#800; font-weight:bold }
+.syntaxhl .error { color:#F00; background-color:#FAA }
+.syntaxhl .escape { color:#666 }
+.syntaxhl .exception { color:#C00; font-weight:bold }
+.syntaxhl .float { color:#06D }
+.syntaxhl .function { color:#06B; font-weight:bold }
+.syntaxhl .global-variable { color:#d70 }
+.syntaxhl .hex { color:#02b }
+.syntaxhl .imaginary { color:#f00 }
+.syntaxhl .include { color:#B44; font-weight:bold }
+.syntaxhl .inline { background-color: hsla(0,0%,0%,0.07); color: black }
+.syntaxhl .inline-delimiter { font-weight: bold; color: #666 }
+.syntaxhl .instance-variable { color:#33B }
+.syntaxhl .integer { color:#06D }
+.syntaxhl .key .char { color: #60f }
+.syntaxhl .key .delimiter { color: #404 }
+.syntaxhl .key { color: #606 }
+.syntaxhl .keyword { color:#939; font-weight:bold }
+.syntaxhl .label { color:#970; font-weight:bold }
+.syntaxhl .local-variable { color:#963 }
+.syntaxhl .namespace { color:#707; font-weight:bold }
+.syntaxhl .octal { color:#40E }
+.syntaxhl .operator { }
+.syntaxhl .predefined { color:#369; font-weight:bold }
+.syntaxhl .predefined-constant { color:#069 }
+.syntaxhl .predefined-type { color:#0a5; font-weight:bold }
+.syntaxhl .preprocessor { color:#579 }
+.syntaxhl .pseudo-class { color:#00C; font-weight:bold }
+.syntaxhl .regexp .content { color:#808 }
+.syntaxhl .regexp .delimiter { color:#404 }
+.syntaxhl .regexp .modifier { color:#C2C }
+.syntaxhl .regexp { background-color:hsla(300,100%,50%,0.06); }
+.syntaxhl .reserved { color:#080; font-weight:bold }
+.syntaxhl .shell .content { color:#2B2 }
+.syntaxhl .shell .delimiter { color:#161 }
+.syntaxhl .shell { background-color:hsla(120,100%,50%,0.06); }
+.syntaxhl .string .char { color: #46a }
+.syntaxhl .string .content { color: #46a }
+.syntaxhl .string .delimiter { color: #46a }
+.syntaxhl .string .modifier { color: #46a }
+.syntaxhl .symbol .content { color:#d33 }
+.syntaxhl .symbol .delimiter { color:#d33 }
+.syntaxhl .symbol { color:#d33 }
+.syntaxhl .tag { color:#070 }
+.syntaxhl .type { color:#339; font-weight:bold }
+.syntaxhl .value { color: #088; }
+.syntaxhl .variable { color:#037 }
+
+.syntaxhl .insert { background: hsla(120,100%,50%,0.12) }
+.syntaxhl .delete { background: hsla(0,100%,50%,0.12) }
+.syntaxhl .change { color: #bbf; background: #007; }
+.syntaxhl .head { color: #f8f; background: #505 }
+.syntaxhl .head .filename { color: white; }
+
+.syntaxhl .delete .eyecatcher { background-color: hsla(0,100%,50%,0.2); border: 1px solid hsla(0,100%,45%,0.5); margin: -1px; border-bottom: none; border-top-left-radius: 5px; border-top-right-radius: 5px; }
+.syntaxhl .insert .eyecatcher { background-color: hsla(120,100%,50%,0.2); border: 1px solid hsla(120,100%,25%,0.5); margin: -1px; border-top: none; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; }
+
+.syntaxhl .insert .insert { color: #0c0; background:transparent; font-weight:bold }
+.syntaxhl .delete .delete { color: #c00; background:transparent; font-weight:bold }
+.syntaxhl .change .change { color: #88f }
+.syntaxhl .head .head { color: #f4f }
+
+/***** Media print specific styles *****/
+@media print {
+ #top-menu, #header, #main-menu, #sidebar, #footer, .contextual, .other-formats { display:none; }
+ #main { background: #fff; }
+ #content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; overflow: visible !important;}
+ #wiki_add_attachment { display:none; }
+ .hide-when-print { display: none; }
+ .autoscroll {overflow-x: visible;}
+ table.list {margin-top:0.5em;}
+ table.list th, table.list td {border: 1px solid #aaa;}
+}
From 34a8d0890c52d41c561eaa77950f3ab190e5e827 Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 26 Oct 2015 17:18:59 +0800
Subject: [PATCH 34/41] =?UTF-8?q?=E7=9B=B8=E6=94=BF=E6=96=B0=E7=95=8C?=
=?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 | 2 +-
app/views/repositories/_navigation.html.erb | 21 +++----
app/views/repositories/show.html.erb | 62 ++++++++++++++------
public/images/vlicon/branch_icon.png | Bin 0 -> 1258 bytes
public/images/vlicon/clone_url.png | Bin 0 -> 1434 bytes
public/images/vlicon/commit_icon.png | Bin 0 -> 1379 bytes
public/images/vlicon/download_icon.png | Bin 0 -> 1457 bytes
public/images/vlicon/fork_icon.png | Bin 0 -> 1188 bytes
public/javascripts/project.js | 6 ++
public/stylesheets/repository.css | 13 ++++
10 files changed, 73 insertions(+), 31 deletions(-)
create mode 100644 public/images/vlicon/branch_icon.png
create mode 100644 public/images/vlicon/clone_url.png
create mode 100644 public/images/vlicon/commit_icon.png
create mode 100644 public/images/vlicon/download_icon.png
create mode 100644 public/images/vlicon/fork_icon.png
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 9da22577f..b0ad4d9c1 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -243,7 +243,7 @@ update
# :name, :path, :kind, :size, :lastrev, :changeset
@entries = @repository.entries(@path, @rev)
# @trees = g.trees(project, @path)
- @changeset = @repository.find_changeset_by_name(@rev)
+ # @changeset = @repository.find_changeset_by_name(@rev)
#@project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
#@ip = RepositoriesHelper::REPO_IP_ADDRESS
diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb
index 2fdf00cef..7140c6238 100644
--- a/app/views/repositories/_navigation.html.erb
+++ b/app/views/repositories/_navigation.html.erb
@@ -5,23 +5,21 @@
<%#= 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 -%>
+
+ <%= 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 -%>
+
+ <%#= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag' %>
+ <%# end -%>
<%# if @repository.supports_all_revisions? %>
<%#= l(:label_revision) %>
@@ -29,4 +27,3 @@
<%# end %>
<% end -%>
-
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index bc0ff18be..eca7a3322 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -3,28 +3,54 @@
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
- <%= render :partial => 'navigation' %>
-
-
- <% if @entries.nil? && authorize_for('repositories', 'browse') %>
-
- 该版本库还没有上传代码!
-
- <% end %>
- <% if @repository.type.to_s=="Repository::Gitlab" %>
- 版本库地址:<%= @repos_url %>
- <% else %>
- 版本库地址:<%= h @repository.url %>
- <% end %>
-
-
-
-
+ <% if @entries.nil? %>
+ <%# 未提交代码提示 %>
+
+ <% if @entries.nil? && authorize_for('repositories', 'browse') %>
+
+ 该版本库还没有上传代码!
+
+ <% end %>
+ <% if @repository.type.to_s=="Repository::Gitlab" %>
+ 版本库地址:<%= @repos_url %>
+ <% else %>
+ 版本库地址:<%= h @repository.url %>
+ <% end %>
+
+
+
+
+ <% else %>
+ <%= render :partial => 'navigation' %>
+
克隆网址:
+
+
+
+
+
+
+
+
<%#= @user_chageset_recently.user %> 提交于两天前:<%#= @user_chageset_recently.comments %>
+
+ <%= @repository.branches.count %> 个分支
+
+
+ <%=link_to @changesets.count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev} %> 提交
+
+
+ <% end %>
+
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%# 数据统计 %>
- <%= render :partial => 'summary' %>
+ <%#= render :partial => 'summary' %>
<%# end %>
<%= render :partial => 'dir_list' %>
<% end %>
diff --git a/public/images/vlicon/branch_icon.png b/public/images/vlicon/branch_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..c80e171344ed9141f8cbe09b47726e3b86110fe8
GIT binary patch
literal 1258
zcmeAS@N?(olHy`uVBq!ia0vp^B0wy`!3HFMdEYGqQj#UE5hcO-X(i=}MX3yqDfvmM
z3ZA)%>8U}fi7AzZCsS=07?_nZLn2Bde0{8v^Kf6`()~Xj@TAnpKdC8`Lf!&sHg;q@=(~U%$M(
zT(8_%FTW^V-_X+15@d#vkuFe$ZgFK^Nn(X=Ua>OF1ees}+T7#d8#0MoBXEYLU9GXQxBrqI_HztY@Xxa#7Ppj3o=u^L<)Qdy9y
zACy|0Us{w5jJPyqkW~d%&PAz-CHX}m`T04pPz=b(FUc>?$S+WE4mMNJ2+zz*$uBR~
z1grP;werj>E=kNwPW5!LRRWrzmzkMj<>qGWYH8tYZ0>02W@zYYYGGz<>S$r%Vs7YU
zYGPzz1k>x1pIn-onpXnTn}X15f>SRjDdZLaZFWg5$}CGwaVyHtRRDY0DigO`3~`zV
z)tiFbEk-!?>H{644~kf%h=vIPQxAvXofw-^Ql2Ty+Z>r&qN$n<%g4L^d^GPRaoob`1F&(6BPR&&m_#2&nK
zLD#%e;@9ur;>(xr{QG3*PS>QDUtcdgvSUK4$NVLXALTZrdheEQ)Z5Qo`crzr>FtYG
zuvALQW@ls={ITDCv-sJWnR6BP{Cx9YX~T{Gn|$1o7~sI+RcGlr+54(#iDEx+X4BNtMmibn*6IE9xuvW?$2JeCW`jbNa9B
zcrMPGwfdx)z^hNQ6Q+M&wep38;hv=@S``ZNPD}1jS76hZZ(hFanWjLmQ81z^g!?XbT|DL
z&eaB~D+Mqx5jvv@*6C(Oy^V?5llq{1THE7##?=XxMbac8SimsWT2GZfTHhVPj&E
ZU8U}fi7AzZCsS=07?_nZLn2Bde0{8v^Kf6`()~Xj@TAnpKdC8`Lf!&sHg;q@=(~U%$M(
zT(8_%FTW^V-_X+15@d#vkuFe$ZgFK^Nn(X=Ua>OF1ees}+T7#d8#0MoBXEYLU9GXQxBrqI_HztY@Xxa#7Ppj3o=u^L<)Qdy9y
zACy|0Us{w5jJPyqkW~d%&PAz-CHX}m`T04pPz=b(FUc>?$S+WE4mMNJ2+zz*$uBR~
z1grP;werj>E=kNwPW5!LRRWrzmzkMjXzpm}W@zYY>S$nMVCn2)W@P5%
z=;UVP2Gi@3pIn-onpXnTn}X2mgi|jlDdZLaZFWg5$}CGwaVyHtRRDY0DigO`EO43!
z)tiFbEtWX->H{644~kf%h=vIPQxAv?Uu)E;
zIc2ZEVp50z-3$oWbRz&w6)SEED@$9x(hdL>a
z@LPr%%&j_dcKby7PZx;EJUTAHw>6$^R}PzA@7s0>Jz*}fHEr5QeCi8I(_+{Z&vswh
zI=yUC+K+mL6pKw7vD(JPC!K9mB!A9$Iep#Pp4oj%zMZHK;%Q%U=6_h>=5{14uvu`H{J$`vPX?prP4whNp_*cD=XZ!d6epkXb
z`-|dxHq2f)<>9S2E4-?D%
zWG-xd&6&DrPAb1-j@Q;_@zNqse@-xzQ8>U5Z}{|E_#)4>pwiOQ)z4*}Q$iB}?_3bH
literal 0
HcmV?d00001
diff --git a/public/images/vlicon/commit_icon.png b/public/images/vlicon/commit_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..148dbcd4b7874b8bf5edacbc29a29d294be3184d
GIT binary patch
literal 1379
zcmeAS@N?(olHy`uVBq!ia0vp^;y^6Q!3HGPJ}O-eq$EpRBT9nv(@M${i&7aJQ}UBi
z6+Ckj(^G>|6H_V+Po~;1Ffc1+hD4M^`1)8S=jZArg4F0$^BXQ!4Z
zB&DWj=GiK}-@RW+Av48RDcsc8z_-9TH6zobswg$M$}c3jDm&RSMakYy!KT6rXh3di
zNuokUZcbjYRfVk**jy_h8zii+qySb@l5ML5aa4qFfP!;=QL2Kep0RGSfuW&-nVFuU
ziK&^Hp^k!)fuWJU0T7w#8k$&{npqi{D?ot~(6*wKG^-#NH>h1eo~=?wNlAf~zJ7Um
zxn8-kUVc%!zM-Y1CCCgTBVC{h-Qvo;lEez#ykcdT2`;I{$wiq3C7Jno3Lp~`lk!VT
zY?Xj6g?J&i0B&qvF*KNf0j6J(SfFpHX8`gNOrftYexnUy@&(kzb(T9Bihb5uTZsl3!k|
z30CjxYvq|&T#}fVoa*Ufs{}MbFEca6%Fxx)$fJ=uFhtzPEM|7
zP6p-{FugAM$)&lec_lEtDR8~61~~PCl0t3)&}Ns^qRg_?6t|-MTm`U~tuk@D#RaE%
zP`xQQ-QwbkQ?EYIG5Vm0MT%&c5HR(CnDAr^>L1bUoY}<)pOl(tlmKOD?daGNDGPgEmZ(Tg$ELW@85@+>=56*|InCxWc
z$mO&lSZ0a$iz*2#mR1fY*{VLL+Kbx9ZXB~J5tO$ns{H=r-QDu{ySaJUm`!xK|H>9P
zo!G9jHq63Uw&ZQ^!-}YNt4__cpB^L?QmLLTA?O%7HF(ukFW$>LpC=eHtlpKpH*Vz?
zool7X7wy>`bY^06=fU+-&(sd@I4)tlcR`)B-lNz9+;+xo>uearn;K$+uVk6Z9ydI`
zM@edFBm+N;7bz&+N
zxDZ;lFQr>xYDp%i^6QIzucoNQ#2pXwTRCm5C|9~^?=-t@>&l8-Yz`W5?mHd(;l~`4
z{_ld-C+(HD$VB{{Q2gQ33r)e3)-$;yK79K7eMQHD)z{oo`ySYQ5;%6C{Jxl)X!qT8
zrb7=ub2#xgK4{U9eX!xUoh6TnSLw~VlkpelF{r5}E)farlt{
literal 0
HcmV?d00001
diff --git a/public/images/vlicon/download_icon.png b/public/images/vlicon/download_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..b442730fe3a69d88cbc7cc3ffc919869f21bd183
GIT binary patch
literal 1457
zcmeAS@N?(olHy`uVBq!ia0vp^B0wy}!3HFwFZ>e#Qj#UE5hcO-X(i=}MX3yqDfvmM
z3ZA)%>8U}fi7AzZCsS=07?_nZLn2Bde0{8v^Kf6`()~Xj@TAnpKdC8`Lf!&sHg;q@=(~U%$M(
zT(8_%FTW^V-_X+15@d#vkuFe$ZgFK^Nn(X=Ua>OF1ees}+T7#d8#0MoBXEYLU9GXQxBrqI_HztY@Xxa#7Ppj3o=u^L<)Qdy9y
zACy|0Us{w5jJPyqkW~d%&PAz-CHX}m`T04pPz=b(FUc>?$S+WE4mMNJ2+zz*$uBR~
z1grP;werj>E=kNwPW5!LRRWrzmzkMjSSc;W@%_(U}|b+
zXy|0_0@Le~pIn-onpXnTn}X15iBm5qDdZLaZFWg5$}CGwaVyHtRRDY0DigO`%y60q
z)tiFbE#^4&>H{644~kf%h=vIPQxAvo;`1hQFfl1ZV#WAGf
zR??sU|LvJg8HJgrGA?dwWAi&HrvGm7TXso3WtTUl+Wp(MUYC%_Ik@cKudlCf#8&*P
z>F!rIKVq=^l=A!ib$@3Src|9_Wo>Kbd3)`m-OKKC*^{3f67zre|80Mg#4`Pp0-eSt
zHQj3EB3jcqr|fRI-unF9+{bq1>wf;f=*+`YCipV~^@M&L%{4%*o=^gX7S(JwD`6!c=T$(uR+M_kfW?YxWmZ#4uER1E`{o%|^we`sk
z={Kk8XE~blXdHik@NDgj*|#4TT%Kuc^nxwx^oiWGiXSJQJ^cTFO@Y3%@OQgE3D
zw|iWD^l!@MHxILKf7mk3CHQisLZR3Urt`}*8~uff?&+N_OnC6@SzlYnEu);@=L0$l
z-fgROc%N^}lVWA@gu(OY=D=XFoH=tdthkr4|6e?
zZ~fPM96z&pHVdB(5dL<&Up{i<@%!JNmipa2=pMkz-_W$VBtE#jdFM~FoJjr@g?mho
zUcEW8bLVOKQ;j!1O`I$rJA3k!4sYEX4mGXJJZF3_&bfa$;7~!WUy+hsX#z8QZ6$|5
Z0z>uf$IY8`uU-WeqMojPF6*2UngCHqFCYK_
literal 0
HcmV?d00001
diff --git a/public/images/vlicon/fork_icon.png b/public/images/vlicon/fork_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..45a6b0e82474d8a02aee3252c0c5f8610ed78a23
GIT binary patch
literal 1188
zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S1|*9D%+3HQ$r9IylHmNblJdl&R0hYC{G?O`
z&)mfH)S%SFl*+=BsWuD@%u1Od5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y
zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP
zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4
zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)y2=9ZF3nBND}m`vLFhHcsTY(KatnYqyQCInmZhe+73JqDfW2&$iQ6p(IL(9V
zO~LIJL!5f`fsWA!MJ!T8!-RmT2gHOYTObFX@Kf`Esl5o8tcA+gi!m@TN_e_BhE&{2
z`t$$4J@ZxuVP;XrP~K!m@gIMF?t8cO@bfM6YS@b`QYCtFwyvw3IWyL-G)uZ|hm!vL
z)IECD#c!*gm`9o~oHc9K)VxjiTh_%_3wQd@NxPTg((kL1KZ|*9u~4`9!$&N8Gt-`x
zM*7SMmOr8ML`3W|yJU<1oQV8$zyCdH{IM!{xsAh|;N@YJHWi;@WmNpOn46lK9{jS6
zb#LzT1G8EsuH116+kdlE`-`lFQg57?dPQjCm6-i?b1kMe1ZgelI8GN(8OaKQ#3f`?1+dQL|3(
zlzU%w{n90&eXk9#Tl?xxe5#VV+%b3_BZ~yX<%ETDFP@y|1(h3~u6{1-oD!M<81b7~
literal 0
HcmV?d00001
diff --git a/public/javascripts/project.js b/public/javascripts/project.js
index c74ff18bf..d9138901a 100644
--- a/public/javascripts/project.js
+++ b/public/javascripts/project.js
@@ -511,3 +511,9 @@ function submitProjectFeedback() {
$("#project_feedback_form").submit();
}
+// 点击按钮复制功能
+function jsCopy(){
+ var e=document.getElementById("copy_rep_content");
+ e.select();
+ document.execCommand("Copy");
+}
\ No newline at end of file
diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css
index 0cb7d918e..ba3a419bf 100644
--- a/public/stylesheets/repository.css
+++ b/public/stylesheets/repository.css
@@ -205,3 +205,16 @@
table.list {margin-top:0.5em;}
table.list th, table.list td {border: 1px solid #aaa;}
}
+
+.cloneUrl {width:235px; height:21px; border:1px solid #dddddd; outline:none; overflow:hidden; line-height:21px; resize:none;}
+.clone_btn {width:30px; height:21px; border-top:1px solid #dddddd; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd; outline:none; float:left; background-image:linear-gradient(#FCFCFC, #EEE); text-align:center;}
+.vl_btn {height:21px; padding:0px 5px; vertical-align:middle; border:1px solid #dddddd; float:left; line-height:21px; background-image:linear-gradient(#FCFCFC, #EEE);}
+.vl_btn_2 {height:21px; padding:0px 5px; vertical-align:middle; border-top:1px solid #dddddd; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd; float:left; line-height:21px;}
+.recordBanner {width:670px; height:30px; background-color:#f1f1f1; color:#666666; line-height:30px; vertical-align:middle;}
+.vl_copy {background:url(../images/vlicon/clone_url.png) 0px 0px no-repeat; padding-left:22px;}
+.vl_zip {background:url(../images/vlicon/download_icon.png) 0px 0px no-repeat; padding-left:22px;}
+.vl_fork {background:url(../images/vlicon/fork_icon.png) 0px -2px no-repeat; padding-left:22px;}
+.vl_commit {background:url(../images/vlicon/commit_icon.png) 0px -2px no-repeat; padding-left:22px;weight:20px;height: 24px;}
+.vl_branch {background:url(../images/vlicon/branch_icon.png) 0px -2px no-repeat; padding-left:22px}
+.mt1 {margin-top:1px;}
+.mt2 {margin-top:2px;}
\ No newline at end of file
From 7970a46469309a50615c342cfbbe7303921f632a Mon Sep 17 00:00:00 2001
From: huang
Date: Tue, 27 Oct 2015 11:41:25 +0800
Subject: [PATCH 35/41] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=EF=BC=9A=E4=BE=9D=E6=8D=AE=E5=88=86=E6=94=AF=E5=88=87?=
=?UTF-8?q?=E6=8D=A2=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=90=8C=E7=9A=84=E6=8F=90?=
=?UTF-8?q?=E4=BA=A4=E8=AE=B0=E5=BD=95=202=E3=80=81=E5=88=87=E6=8D=A2?=
=?UTF-8?q?=E5=88=86=E6=94=AF=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=203?=
=?UTF-8?q?=E3=80=81=E7=89=88=E6=9C=AC=E5=BA=93=E6=98=BE=E7=A4=BA=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E4=BF=AE=E7=A8=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 4 +-
app/views/repositories/_navigation.html.erb | 34 +++++++++--------
app/views/repositories/changes.html.erb | 3 +-
app/views/repositories/show.html.erb | 41 ++++++++++++++++++---
public/stylesheets/repository.css | 3 +-
5 files changed, 60 insertions(+), 25 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index b0ad4d9c1..742a02337 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -243,7 +243,7 @@ update
# :name, :path, :kind, :size, :lastrev, :changeset
@entries = @repository.entries(@path, @rev)
# @trees = g.trees(project, @path)
- # @changeset = @repository.find_changeset_by_name(@rev)
+ @changeset = @repository.find_changeset_by_name(@rev)
#@project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
#@ip = RepositoriesHelper::REPO_IP_ADDRESS
@@ -253,6 +253,8 @@ update
#Modified by young
# (show_error_not_found; return) unless @entries
@changesets = @repository.latest_changesets(@path, @rev)
+ @changesets_count = @repository.latest_changesets(@path, @rev).count
+ @changesets_latest_coimmit = @changesets.first
@properties = @repository.properties(@path, @rev)
@repositories = @project.repositories
@course_tag = params[:course]
diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb
index 7140c6238..c3e154f17 100644
--- a/app/views/repositories/_navigation.html.erb
+++ b/app/views/repositories/_navigation.html.erb
@@ -1,29 +1,33 @@
-<% content_for :header_tags do %>
- <%= javascript_include_tag 'repository_navigation' %>
-<% end %>
<%#= 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 ml5"}) do -%>
+ <% content_for :header_tags do %>
+ <%= javascript_include_tag 'repository_navigation' %>
+ <% 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'}) 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 -%>
-
- <%#= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag' %>
- <%# end -%>
+ <% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
+ <%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag', :style=>" display:none" %>
+ <% end -%>
- <%# if @repository.supports_all_revisions? %>
- <%#= l(:label_revision) %>
- <%#= text_field_tag 'rev', @rev, :size => 8 %>
- <%# end %>
+ <% if @repository.supports_all_revisions? %>
+ <%= hidden_field_tag 'rev', @rev, :size => 8 %>
+ <% end %>
<% end -%>
+
diff --git a/app/views/repositories/changes.html.erb b/app/views/repositories/changes.html.erb
index d3834bb41..f4037cb36 100644
--- a/app/views/repositories/changes.html.erb
+++ b/app/views/repositories/changes.html.erb
@@ -14,8 +14,7 @@
<%= render_properties(@properties) %>
-<%= render(:partial => 'revisions',
- :locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => @entry }) unless @changesets.empty? %>
+ <%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => @entry }) unless @changesets.empty? %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index eca7a3322..05293adc2 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -23,25 +23,25 @@
<% else %>
<%= render :partial => 'navigation' %>
克隆网址:
-