Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq
This commit is contained in:
commit
b92767bbb5
|
@ -324,6 +324,27 @@ class ProjectsController < ApplicationController
|
||||||
@trackers = Tracker.sorted.all
|
@trackers = Tracker.sorted.all
|
||||||
@wiki ||= @project.wiki
|
@wiki ||= @project.wiki
|
||||||
@select_tab = params[:tab]
|
@select_tab = params[:tab]
|
||||||
|
|
||||||
|
# 处理从新建版本库返回来的错误信息
|
||||||
|
if !params[:repository_error_message].to_s.blank?
|
||||||
|
html = ""
|
||||||
|
errors = params[:repository_error_message].flatten
|
||||||
|
errors.each do |error|
|
||||||
|
# 版本库路径为空的错误信息不予提示
|
||||||
|
if(error!=l(:label_repository_path_not_null))
|
||||||
|
html << error << ";"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if params[:repository] == "pswd_is_null"
|
||||||
|
html << l(:label_password_not_null)<< ";"
|
||||||
|
end
|
||||||
|
flash[:error] = html if !html.to_s.blank?
|
||||||
|
end
|
||||||
|
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
|
||||||
|
@repository = Repository.factory(scm)
|
||||||
|
@repository.is_default = @project.repository.nil?
|
||||||
|
@repository.project = @project
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_mail_to_member
|
def send_mail_to_member
|
||||||
|
|
|
@ -25,6 +25,7 @@ class ChangesetNotFound < Exception; end
|
||||||
class InvalidRevisionParam < Exception; end
|
class InvalidRevisionParam < Exception; end
|
||||||
|
|
||||||
class RepositoriesController < ApplicationController
|
class RepositoriesController < ApplicationController
|
||||||
|
include ApplicationHelper
|
||||||
menu_item :repository
|
menu_item :repository
|
||||||
menu_item :settings, :only => [:new, :create, :edit, :update, :destroy, :committers]
|
menu_item :settings, :only => [:new, :create, :edit, :update, :destroy, :committers]
|
||||||
default_search_scope :changesets
|
default_search_scope :changesets
|
||||||
|
@ -122,7 +123,7 @@ update
|
||||||
if request.post? && @repository.save
|
if request.post? && @repository.save
|
||||||
redirect_to settings_project_url(@project, :tab => 'repositories')
|
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||||
end
|
end
|
||||||
else # 原逻辑
|
else # 原逻辑
|
||||||
##xianbo
|
##xianbo
|
||||||
|
@ -167,11 +168,12 @@ update
|
||||||
|
|
||||||
@repository.update_attributes(:login => User.current.login.to_s)
|
@repository.update_attributes(:login => User.current.login.to_s)
|
||||||
end
|
end
|
||||||
redirect_to settings_project_url(@project, :tab => 'repositories')
|
redirect_to settings_project_url(@project, :tab => 'repositories',:repository_error_message=>@repository.errors.full_messages)
|
||||||
else if(@repository_tag)
|
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
|
else
|
||||||
render :action => 'new', :layout =>'base_projects'
|
redirect_to settings_project_url(@project, :tab => 'repositories',:repository => @repository,:repository_error_message=>@repository.errors.full_messages)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,12 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
<%if @select_tab == "modules"%>
|
<%if @select_tab == "modules"%>
|
||||||
project_setting(2);
|
project_setting(2);
|
||||||
<% else @select_tab == "versions"%>
|
<% elsif @select_tab == "versions"%>
|
||||||
project_setting(4);
|
project_setting(4);
|
||||||
|
<% elsif @select_tab == "repositories" %>
|
||||||
|
project_setting(6);
|
||||||
|
<%else%>
|
||||||
|
|
||||||
<% end%>
|
<% end%>
|
||||||
});
|
});
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
<script>
|
||||||
|
function pro_st_show_ku()
|
||||||
|
{
|
||||||
|
$("#pro_st_edit_ku").toggle();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<%= error_messages_for 'repository' %>
|
||||||
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
|
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
|
||||||
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->
|
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->
|
||||||
<% if @project.repositories.any? %>
|
<% if @project.repositories.any? %>
|
||||||
|
@ -48,7 +55,44 @@
|
||||||
<a href="javascript:viod(0)" class="c_blue fl" onclick="pro_st_show_ku();">
|
<a href="javascript:viod(0)" class="c_blue fl" onclick="pro_st_show_ku();">
|
||||||
<% course_tag = @project.project_type %>
|
<% course_tag = @project.project_type %>
|
||||||
<% if User.current.allowed_to?(:manage_repository, @project) %>
|
<% if User.current.allowed_to?(:manage_repository, @project) %>
|
||||||
<%= link_to l(:label_repository_new_repos), newrepo_project_repository_path(@project, :course => course_tag), :class => 'c_blue fl' %></p>
|
<!--newrepo_project_repository_path(@project, :course => course_tag) -->
|
||||||
|
<%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</a>
|
</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post"} do |f| %>
|
||||||
|
<div id="pro_st_edit_ku" class="pro_st_edit_ku">
|
||||||
|
<ul>
|
||||||
|
<li >
|
||||||
|
<label class="label02"> 管理系统 :</label>
|
||||||
|
<%= select_tag('repository_scm',
|
||||||
|
options_for_select(["Git"],@repository.class.name.demodulize),
|
||||||
|
:data => {:remote => true, :method => 'get'})%>
|
||||||
|
<% if @repository && ! @repository.class.scm_available %>
|
||||||
|
<span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<li >
|
||||||
|
<label class="label02"> 主版本库 :</label>
|
||||||
|
<%= f.check_box :is_default, :label => "" %></p>
|
||||||
|
</li>
|
||||||
|
<li >
|
||||||
|
<label class="label02"><span class="c_red">*</span> 版本库名 :</label>
|
||||||
|
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>""%>
|
||||||
|
<% unless @repository.identifier_frozen? %>
|
||||||
|
<span class="c_grey">长度必须在 1 到 254 个字符之间。 仅小写字母(a-z)、数字、破折号(-)和下划线(_)可以使用。
|
||||||
|
一旦保存,标识无法修改。</span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<li >
|
||||||
|
<label class="label02"><span class="c_red">*</span> 密码 :</label>
|
||||||
|
<%= f.password_field :upassword, :label=> "" %>
|
||||||
|
<span class="c_grey">该密码在项目组内可共享</span>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<a href="#" onclick="$('#repository-form').submit();" class="blue_btn fl ml110">保存</a>
|
||||||
|
<a href="<%= settings_project_path(@project, :tab => 'repositories')%>" class="grey_btn fl ml10">取消</a>
|
||||||
|
</div><!--pro_st_edit_issues end-->
|
||||||
|
<% end %>
|
|
@ -1,34 +1,34 @@
|
||||||
<%= back_url_hidden_field_tag %>
|
<%= back_url_hidden_field_tag %>
|
||||||
<%= error_messages_for 'version' %>
|
<%= error_messages_for 'version' %>
|
||||||
|
<div id="pro_st_edit_ban" class="pro_st_edit_ban_display">
|
||||||
<div class="box tabular">
|
<ul>
|
||||||
<p style="margin-left:-10px;">
|
<li >
|
||||||
<%= f.text_field :name, :maxlength => 60, :required => true %>
|
<label class="label02"><span class="c_red">*</span> 名称 :</label>
|
||||||
</p>
|
<%= f.text_field :name, :maxlength => 60,:class=>" w280", :label => ""%>
|
||||||
<p style="margin-left:-20px;">
|
</li>
|
||||||
<%= f.text_field :description, :maxlength => 60, :style => "margin-left:10px;" %>
|
<li >
|
||||||
</p>
|
<label class="label02"> 描述 :</label>
|
||||||
<p style="margin-left:-20px;">
|
<%= f.text_field :description, :maxlength => 60,:class=>" w280", :label => "" %>
|
||||||
<span style="margin-left:10px;">
|
</li>
|
||||||
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %>
|
<li >
|
||||||
</span>
|
<label class="label02"> 状态 :</label>
|
||||||
</p>
|
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]}, :label => "" %>
|
||||||
<p style="margin-left:-20px;">
|
</li>
|
||||||
<span style="margin-left:10px;">
|
<li >
|
||||||
<%= f.text_field :wiki_page_title, :size =>60, :label => :label_wiki_page, :disabled => @project.wiki.nil? %>
|
<label class="label02"> Wiki 页面 :</label>
|
||||||
</span>
|
<%= f.text_field :wiki_page_title, :size =>60, :label => "", :disabled => @project.wiki.nil? %>
|
||||||
</p>
|
</li>
|
||||||
<p style="margin-left:-20px;">
|
<li >
|
||||||
<span style="margin-left:10px;">
|
<label class="label02"> 日期 :</label>
|
||||||
<%= f.text_field :effective_date, :size => 10, :readonly => true %>
|
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>'f1',:label => "" %>
|
||||||
<%= calendar_for('version_effective_date') %>
|
<%= calendar_for('version_effective_date') %>
|
||||||
</span>
|
</li>
|
||||||
</p>
|
<div class="cl mb10"></div>
|
||||||
<p style="margin-left:-20px;">
|
<li >
|
||||||
<span style="margin-left:10px;">
|
<label class="label02"> 共享 :</label>
|
||||||
<%= f.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %>
|
<%= f.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]},:label=>"" %>
|
||||||
</span>
|
</li>
|
||||||
</p>
|
</ul>
|
||||||
|
|
||||||
<% @version.custom_field_values.each do |value| %>
|
<% @version.custom_field_values.each do |value| %>
|
||||||
<p style="margin-left:-20px;">
|
<p style="margin-left:-20px;">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<h3><%=l(:label_version)%></h3>
|
<h3><%=l(:label_version)%></h3>
|
||||||
|
|
||||||
<%= labelled_form_for @version do |f| %>
|
<%= labelled_form_for @version,:html=>{:id=>"new_project_version_form"} do |f| %>
|
||||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||||
<%= submit_tag l(:button_save) %>
|
<a href="#" onclick="$('#new_project_version_form').submit();" class="blue_btn ml110">保存</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
21
db/schema.rb
21
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20150415032102) do
|
ActiveRecord::Schema.define(:version => 20150409092151) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -969,25 +969,26 @@ ActiveRecord::Schema.define(:version => 20150415032102) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "projects", :force => true do |t|
|
create_table "projects", :force => true do |t|
|
||||||
t.string "name", :default => "", :null => false
|
t.string "name", :default => "", :null => false
|
||||||
t.text "description"
|
t.text "description"
|
||||||
t.string "homepage", :default => ""
|
t.string "homepage", :default => ""
|
||||||
t.boolean "is_public", :default => true, :null => false
|
t.boolean "is_public", :default => true, :null => false
|
||||||
t.integer "parent_id"
|
t.integer "parent_id"
|
||||||
t.datetime "created_on"
|
t.datetime "created_on"
|
||||||
t.datetime "updated_on"
|
t.datetime "updated_on"
|
||||||
t.string "identifier"
|
t.string "identifier"
|
||||||
t.integer "status", :default => 1, :null => false
|
t.integer "status", :default => 1, :null => false
|
||||||
t.integer "lft"
|
t.integer "lft"
|
||||||
t.integer "rgt"
|
t.integer "rgt"
|
||||||
t.boolean "inherit_members", :default => false, :null => false
|
t.boolean "inherit_members", :default => false, :null => false
|
||||||
t.integer "project_type"
|
t.integer "project_type"
|
||||||
t.boolean "hidden_repo", :default => false, :null => false
|
t.boolean "hidden_repo", :default => false, :null => false
|
||||||
t.integer "attachmenttype", :default => 1
|
t.integer "attachmenttype", :default => 1
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.integer "dts_test", :default => 0
|
t.integer "dts_test", :default => 0
|
||||||
t.string "enterprise_name"
|
t.string "enterprise_name"
|
||||||
t.integer "organization_id"
|
t.integer "organization_id"
|
||||||
|
t.integer "project_new_type"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
||||||
|
@ -1458,7 +1459,7 @@ ActiveRecord::Schema.define(:version => 20150415032102) do
|
||||||
t.string "file_path"
|
t.string "file_path"
|
||||||
t.integer "pack_times", :default => 1
|
t.integer "pack_times", :default => 1
|
||||||
t.integer "pack_size", :default => 0
|
t.integer "pack_size", :default => 0
|
||||||
t.text "file_digests"
|
t.string "file_digests"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
end
|
end
|
||||||
|
|
|
@ -405,6 +405,8 @@ a:hover.member_btn{ background:#329cbd;}
|
||||||
.pro_st_edit_issues{ display:none; margin-top:20px;}
|
.pro_st_edit_issues{ display:none; margin-top:20px;}
|
||||||
.pro_st_edit_issues ul li{ margin-bottom:10px;}
|
.pro_st_edit_issues ul li{ margin-bottom:10px;}
|
||||||
.pro_st_edit_ban{ display:none; margin-top:20px;}
|
.pro_st_edit_ban{ display:none; margin-top:20px;}
|
||||||
|
.pro_st_edit_ban_display{ margin-top:20px;}
|
||||||
|
.pro_st_edit_ban_display ul li{ margin-bottom:10px;}
|
||||||
.pro_st_edit_ban ul li{ margin-bottom:10px;}
|
.pro_st_edit_ban ul li{ margin-bottom:10px;}
|
||||||
.pro_st_edit_ku{display:none; margin-top:20px;}
|
.pro_st_edit_ku{display:none; margin-top:20px;}
|
||||||
.pro_st_edit_ku ul li{margin-bottom:10px;}
|
.pro_st_edit_ku ul li{margin-bottom:10px;}
|
||||||
|
|
Loading…
Reference in New Issue