Skip to content

Commit

Permalink
[webui] Disable links for remote image templates
Browse files Browse the repository at this point in the history
We were linking to projects and packages of remote instances. In such a
case we don't have a valid url to point at. So users would end up with
an error when clicking this link.

To fix that we only show a link for local projects and packages on the
image template page.
  • Loading branch information
bgeuken committed Oct 10, 2017
1 parent e9d9064 commit 6e818ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/app/views/webui/image_templates/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
%fieldset.templateslist
- first_template = nil
- @projects.each do |project|
- remote = Project.is_remote_project?(project.name)
%dl.templateslist
%dt
= link_to(title_or_name(project), project_show_path(project))
= link_to_if(!remote, title_or_name(project), project_show_path(project))
- project.packages.each do |template|
%label
%input{ name: 'image', type: 'radio', class: 'hidden image_template', checked: check_first(first_template), data: { project: project, package: template } }
Expand All @@ -20,7 +21,7 @@
= sprite_tag('drive-optical-48')
%span.group
%span.name.break-words
= link_to(title_or_name(template), package_show_path(project: project, package: template))
= link_to_if(!remote, title_or_name(template), package_show_path(project: project, package: template))
%span.description.grey.break-words
= template.description
- if project.packages.empty?
Expand Down

0 comments on commit 6e818ab

Please sign in to comment.