Skip to content

Commit f76d124

Browse files
author
root
committed
Fix #324
1 parent 6b13980 commit f76d124

File tree

1 file changed

+17
-37
lines changed

1 file changed

+17
-37
lines changed

Diff for: app/views/repositories/_form.html.erb

+17-37
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,7 @@
4242
<% end %>
4343
</p>
4444

45-
<% if @project.repository.nil? %>
46-
<p>
47-
<%= hidden_field_tag "repository[is_default]", "0" %>
48-
<label><%= l(:field_repository_is_default) %></label>
49-
<span class="bootstrap-switch switch-small" data-on="primary" data-off="default" data-on-label="<%= l(:label_yes) %>" data-off-label="<%= l(:label_no) %>">
50-
<%= check_box_tag "repository[is_default]", @repository.is_default, @repository.is_default, disabled: !@repository.new_record? %>
51-
</span>
52-
</p>
53-
<% elsif @project.repository == @repository %>
54-
<p>
55-
<%= hidden_field_tag "repository[is_default]", "1" %>
56-
<label><%= l(:field_repository_is_default) %></label>
57-
<span class="label label-success"><%= l(:label_yes) %></span>
58-
</p>
59-
<% else %>
60-
<%= hidden_field_tag "repository[is_default]", "0" %>
61-
<% end %>
45+
<p><%= f.check_box :is_default, :label => :field_repository_is_default %></p>
6246

6347
<% if @repository && @repository.is_a?(Repository::Git) %>
6448
<% if @repository.new_record? %>
@@ -78,18 +62,6 @@
7862
<p><%= f.text_field :identifier %></p>
7963
<% end %>
8064

81-
<% if @repository && @repository.is_a?(Repository::Git) && !@repository.new_record? %>
82-
<p>
83-
<label><%= l(:label_browse_repository) %></label>
84-
<%= link_to h(@repository.url), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => @repository.identifier_param} %>
85-
</p>
86-
87-
<p>
88-
<%= label_tag "", l(:label_repository_exists_in_gitolite) %>
89-
<%= image_tag (@repository.exists_in_gitolite? ? 'true.png' : 'exclamation.png') %>
90-
</p>
91-
<% end %>
92-
9365
<%= content_tag('p', f.select(
9466
:path_encoding, [nil] + Setting::ENCODINGS,
9567
:label => l(:field_scm_path_encoding)
@@ -121,19 +93,15 @@
12193

12294
<p>
12395
<label><%= l(:label_enable_git_daemon) %></label>
124-
<span class="bootstrap-switch switch-small" data-on="primary" data-off="default" data-on-label="<%= l(:label_yes) %>" data-off-label="<%= l(:label_no) %>">
125-
<%= hidden_field_tag "extra[git_daemon]", "false" %>
126-
<%= check_box_tag "extra[git_daemon]", selected, (selected == "true" ? true : false), disabled: !@project.is_public %>
127-
</span>
96+
<%= hidden_field_tag "extra[git_daemon]", "false" %>
97+
<%= check_box_tag "extra[git_daemon]", selected, (selected == "true" ? true : false), disabled: !@project.is_public %>
12898
</p>
12999

130100
<% if user_allowed_to(:create_repository_git_notifications, @repository.project) %>
131101
<p>
132102
<label><%= l(:label_enable_git_notify) %></label>
133-
<span class="bootstrap-switch switch-small" data-on="primary" data-off="default" data-on-label="<%= l(:label_yes) %>" data-off-label="<%= l(:label_no) %>">
134-
<%= hidden_field_tag "extra[git_notify]", "false" %>
135-
<%= check_box_tag "extra[git_notify]", (@repository.extra[:git_notify] == 1 ? 'true' : 'false'), (@repository.extra[:git_notify] == 1 ? true : false) %>
136-
</span>
103+
<%= hidden_field_tag "extra[git_notify]", "false" %>
104+
<%= check_box_tag "extra[git_notify]", (@repository.extra[:git_notify] == 1 ? 'true' : 'false'), (@repository.extra[:git_notify] == 1 ? true : false) %>
137105
</p>
138106
<% end %>
139107

@@ -161,6 +129,18 @@
161129
<%= image_tag (RedmineGitolite::Config.mirroring_keys_installed? ? 'true.png' : 'exclamation.png') %>
162130
</p>
163131

132+
<% unless @repository.new_record? %>
133+
<p>
134+
<%= label_tag "", l(:label_repository_exists_in_gitolite) %>
135+
<%= image_tag (@repository.exists_in_gitolite? ? 'true.png' : 'exclamation.png') %>
136+
</p>
137+
138+
<p>
139+
<label><%= l(:label_browse_repository) %></label>
140+
<%= link_to h(@repository.url), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => @repository.identifier_param} %>
141+
</p>
142+
<% end %>
143+
164144
<% else %>
165145
<%= repository_field_tags(f, @repository) if @repository %>
166146
<% end %>

0 commit comments

Comments
 (0)