Skip to content

Commit 6d193f7

Browse files
author
root
committed
Fix display of git_annex urls
1 parent e700432 commit 6d193f7

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

Diff for: app/models/repository_git_extra.rb

+12-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ class RepositoryGitExtra < ActiveRecord::Base
1616
ALLOWED_URLS = %w[ssh http https go git git_annex]
1717

1818
URLS_ICONS = {
19-
go: {label: 'Go', icon: 'fa-google'},
20-
http: {label: 'HTTP', icon: 'fa-external-link'},
21-
https: {label: 'HTTPS', icon: 'fa-external-link'},
22-
ssh: {label: 'SSH', icon: 'fa-shield'},
23-
git: {label: 'Git', icon: 'fa-git'}
19+
go: { label: 'Go', icon: 'fa-google' },
20+
http: { label: 'HTTP', icon: 'fa-external-link' },
21+
https: { label: 'HTTPS', icon: 'fa-external-link' },
22+
ssh: { label: 'SSH', icon: 'fa-shield' },
23+
git: { label: 'Git', icon: 'fa-git' },
24+
git_annex: { label: 'GitAnnex', icon: 'fa-git' }
2425
}
2526

2627
## Attributes
@@ -83,6 +84,7 @@ def check_urls_order_consistency
8384
# Add go url only for existing record to avoid chicken/egg issue
8485
check_go_url unless new_record?
8586
check_git_url
87+
check_git_annex_url
8688
end
8789

8890

@@ -116,6 +118,11 @@ def check_go_url
116118
end
117119

118120

121+
def check_git_annex_url
122+
git_annex? ? add_url('git_annex') : remove_url('git_annex')
123+
end
124+
125+
119126
def check_git_url
120127
git_daemon? ? add_url('git') : remove_url('git')
121128
end

Diff for: app/views/repositories/_edit_top.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%div{ class: 'git_hosting box' }
55
%h3
66
= l(:label_repository_access_url)
7-
= link_to l(:label_sort_urls), sort_urls_repository_git_extras_path(@repository), class: 'modal-box-close-only'
7+
= link_to l(:label_sort_urls), sort_urls_repository_git_extras_path(@repository), class: 'modal-box-close-only' unless @repository.git_annex_enabled?
88

99
= render partial: 'common/git_urls', locals: { repository: @repository }
1010

Diff for: app/views/repositories/_xitolite_options.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@
6363
%label= l(:label_browse_repository)
6464
= link_to h(repository.url), { controller: 'repositories', action: 'show', id: @project, repository_id: repository.identifier_param }
6565

66-
%p= f.submit l(:button_save) unless repository.git_annex_enabled?
66+
%p= f.submit l(:button_save)

0 commit comments

Comments
 (0)