Skip to content

Commit

Permalink
Fix display of git_annex urls
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 29, 2015
1 parent e700432 commit 6d193f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions app/models/repository_git_extra.rb
Expand Up @@ -16,11 +16,12 @@ class RepositoryGitExtra < ActiveRecord::Base
ALLOWED_URLS = %w[ssh http https go git git_annex]

URLS_ICONS = {
go: {label: 'Go', icon: 'fa-google'},
http: {label: 'HTTP', icon: 'fa-external-link'},
https: {label: 'HTTPS', icon: 'fa-external-link'},
ssh: {label: 'SSH', icon: 'fa-shield'},
git: {label: 'Git', icon: 'fa-git'}
go: { label: 'Go', icon: 'fa-google' },
http: { label: 'HTTP', icon: 'fa-external-link' },
https: { label: 'HTTPS', icon: 'fa-external-link' },
ssh: { label: 'SSH', icon: 'fa-shield' },
git: { label: 'Git', icon: 'fa-git' },
git_annex: { label: 'GitAnnex', icon: 'fa-git' }
}

## Attributes
Expand Down Expand Up @@ -83,6 +84,7 @@ def check_urls_order_consistency
# Add go url only for existing record to avoid chicken/egg issue
check_go_url unless new_record?
check_git_url
check_git_annex_url
end


Expand Down Expand Up @@ -116,6 +118,11 @@ def check_go_url
end


def check_git_annex_url
git_annex? ? add_url('git_annex') : remove_url('git_annex')
end


def check_git_url
git_daemon? ? add_url('git') : remove_url('git')
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/repositories/_edit_top.html.haml
Expand Up @@ -4,7 +4,7 @@
%div{ class: 'git_hosting box' }
%h3
= l(:label_repository_access_url)
= link_to l(:label_sort_urls), sort_urls_repository_git_extras_path(@repository), class: 'modal-box-close-only'
= link_to l(:label_sort_urls), sort_urls_repository_git_extras_path(@repository), class: 'modal-box-close-only' unless @repository.git_annex_enabled?

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

Expand Down
2 changes: 1 addition & 1 deletion app/views/repositories/_xitolite_options.html.haml
Expand Up @@ -63,4 +63,4 @@
%label= l(:label_browse_repository)
= link_to h(repository.url), { controller: 'repositories', action: 'show', id: @project, repository_id: repository.identifier_param }

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

0 comments on commit 6d193f7

Please sign in to comment.