版本库编辑功能修改

GitlabVersion
nwb 11 years ago
parent c675ac67e0
commit cc6949d427

@ -149,6 +149,7 @@ class RepositoriesController < ApplicationController
# 连接创建成功后的gitlab版本库 # 连接创建成功后的gitlab版本库
gitproject = GitlabProject.find_by_gitlab_project_id(temp[:gitprojectid]) gitproject = GitlabProject.find_by_gitlab_project_id(temp[:gitprojectid])
@repository.login = user.login
@repository.url = gitproject.repository_url @repository.url = gitproject.repository_url
@repository.root_url = gitproject.repository_url @repository.root_url = gitproject.repository_url
if request.post? && @repository.save if request.post? && @repository.save

@ -35,12 +35,12 @@
<%if User.current.allowed_to?(:manage_repository, @project) %> <%if User.current.allowed_to?(:manage_repository, @project) %>
<!-- <%= link_to(l(:button_edit), edit_repository_path(repository), <!-- <%= link_to(l(:button_edit), edit_repository_path(repository),
:class => 'icon icon-edit') %> --> :class => 'icon icon-edit') %> -->
<%= link_to(l(:label_user_plural), committers_repository_path(repository), <%= link_to(l(:label_user_plural), committers_repository_path(repository),:class => 'icon icon-user') %>
:class => 'icon icon-user') %> <%= link_to(l(:button_edit), edit_repository_path(repository),:class => 'icon icon-edit') %>
<% if repository.login.to_s==User.current.login.to_s %> <%# if repository.login.to_s==User.current.login.to_s %>
<%= delete_link repository_path(repository) %> <%= delete_link repository_path(repository) %>
<%#= link_to l(:button_delete), repository_path(repository), :method => :delete,:data => {:confirm => l(:label_are_you_sure)},:class => 'icon icon-del'%> <%#= link_to l(:button_delete), repository_path(repository), :method => :delete,:data => {:confirm => l(:label_are_you_sure)},:class => 'icon icon-del'%>
<% end %> <%# end %>
<% end %> <% end %>
<% end %> <% end %>
</td> </td>

@ -3,11 +3,16 @@
<div class="box tabular"> <div class="box tabular">
<p> <p>
<%= label_tag('repository_scm', l(:label_scm)) %> <%= label_tag('repository_scm', l(:label_scm)) %>
<!--Modified by tanxianbo--> <% if @repository.identifier_frozen? %>
<%= select_tag('repository_scm', <%= select_tag('repository_scm',
options_for_select(["Subversion"],@repository.class.name.demodulize), options_for_select([@repository.class.name.demodulize],@repository.class.name.demodulize),
:data => {:remote => true, :method => 'get'})%> :data => {:remote => true, :method => 'get'})%>
<!--Ended by tanxianbo--> <% else %>
<%= select_tag('repository_scm',
options_for_select(["Subversion"],@repository.class.name.demodulize),
:data => {:remote => true, :method => 'get'})%>
<% end %>
</p> </p>
<p><%= f.check_box :is_default, :label => :field_repository_is_default %></p> <p><%= f.check_box :is_default, :label => :field_repository_is_default %></p>
@ -20,10 +25,10 @@
<p><%= f.text_field :url, :size => 60, :required => true, :disabled => !@repository.safe_attribute?('url') %> <p><%= f.text_field :url, :size => 60, :required => true, :disabled => !@repository.safe_attribute?('url') %>
<em class='info'><%= "#{l(:label_exist_repository_path)}" %></em> <em class='info'><%= "#{l(:label_exist_repository_path)}" %></em>
</p> </p>
<p><%= f.text_field :login, :size => 30 %></p> <p><%= f.text_field :login, :size => 30 , :disabled => @repository.identifier_frozen? %></p>
<p><%= f.password_field :password, :size => 30, :name => 'ignore', :value => ((@repository.new_record? || @repository.password.blank?) ? '' : ('x'*15)), <p><%= f.password_field :password, :size => 30, :name => 'ignore', :value => ((@repository.new_record? || @repository.password.blank?) ? '' : ('x'*15)),
:onfocus => "this.value=''; this.name='repository[password]';", :onfocus => "this.value=''; this.name='repository[password]';",
:onchange => "this.name='repository[password]';" %></p> :onchange => "this.name='repository[password]';", :disabled => @repository.identifier_frozen? %></p>
</div> </div>
<!--Ended by tanxianbo--> <!--Ended by tanxianbo-->
<p> <p>

Loading…
Cancel
Save