Skip to content

Commit 032001b

Browse files
author
Chadwick Banning
committed
Add url helper methods around internal links
1 parent 163f254 commit 032001b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/puppet_forge_server/app/views/layout.haml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@
4040
%li.active
4141
%a{:href => 'https://forge.puppetlabs.com/', :target => 'official-puppet-forge'} Official Puppet Forge
4242
%li
43-
%a{:href => '/upload'}
43+
%a{:href => url('/upload')}
4444
Upload Puppet Module
4545
%li
4646
%a{:href => 'https://github.com/unibet/puppet-forge-server', :target => 'puppet-forge-server-github'} Help
4747
%script{ :src => 'https://code.jquery.com/jquery-2.1.3.min.js' }
4848
.section#header
4949
.side-width.clearfix
50-
%a{:href => '/'}
50+
%a{:href => url('/')}
5151
#logo
5252
%img.logo{ :src => 'img/forge-logo.png', :height => 65}
5353
%span.logo.puppet= 'Puppet Forge'
5454
%span.logo.forge= 'Server'
5555
.top-search
56-
%form{:action => '/modules', :method=>'get'}
56+
%form{:action => url('/modules'), :method=>'get'}
5757
%input{ :type => 'search', :name=>'query', :placeholder=>'Search modules', :autofocus=>''}
5858
%input.search-btn{ :type=>'submit', :value=>'Find'}
5959
%span.search_error= ''

lib/puppet_forge_server/app/views/module.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
%ul.release-dependencies
4848
- module_metadata['metadata']['dependencies'].each do |dep|
4949
%li
50-
%a{:href => "/module?name=#{dep['name']}"}= dep['name']
50+
%a{:href => url("/module?name=#{dep['name']}")}= dep['name']
5151
- if dep['version_requirement']
5252
= "(#{dep['version_requirement']})"
5353
%section{:id => 'module-release-info'}

lib/puppet_forge_server/app/views/modules.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- modules.each do |element|
2121
%li{:class => element['private'] ? 'clearfix private' : 'clearfix'}
2222
.col
23-
%a{:class => "h3", :href => "/module?name=#{element['current_release']['metadata']['name']}" }= "#{element['owner']['username']}/#{element['name']}"
23+
%a{:class => "h3", :href => url("/module?name=#{element['current_release']['metadata']['name']}") }= "#{element['owner']['username']}/#{element['name']}"
2424
%p= element['current_release']['metadata']['summary']
2525
%span.release-info= "Version #{element['current_release']['metadata']['version']}"
2626
- if element['current_release']['metadata']['issues_url']

lib/puppet_forge_server/app/views/upload.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@
4747
-else
4848
Upload has failed. #{upload_status}
4949

50-
%form{:action => '/upload', :method=>'post', :enctype=>'multipart/form-data' }
50+
%form{:action => url('/upload'), :method=>'post', :enctype=>'multipart/form-data' }
5151
%input{ :type => 'file', :name=>'file'}
5252
%input{ :type=>'submit', :value=>'Upload'}

0 commit comments

Comments
 (0)