Skip to content

Commit 459cbb1

Browse files
authored
Merge pull request #74 from walkamongus/master
Allow running the app mounted on different paths on a server
2 parents 163f254 + 318fd2b commit 459cbb1

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
%div.code-block
3737
%pre
3838
:markdown
39-
curl -F "file=@pkg/_<name>_-_<version>_.tar.gz" #{request.env['REQUEST_URI']}
39+
curl -F "file=@pkg/_<name>_-_<version>_.tar.gz" #{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}#{request.env['REQUEST_URI']}
4040

4141
%span.search_error
4242
-if upload_status
@@ -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)