Skip to content

Commit

Permalink
Issue 112 - Added an option for the cgi-bin url
Browse files Browse the repository at this point in the history
  • Loading branch information
samuellapointe committed May 20, 2015
1 parent fb1fc06 commit 6678071
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 66 deletions.
1 change: 1 addition & 0 deletions development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ webui.fluid-layout = false
workspaces.directory = %(here)s/workspaces
scribe.python = %(here)s/scribeui_pyramid/modules/maps/scribe.py
cgi.directory = /usr/lib/cgi-bin
cgi.url = http://localhost/cgi-bin
mapserver.url = http://localhost/cgi-bin/mapserv
#mapcache.output.directory = /tmp/mapcache

Expand Down
1 change: 1 addition & 0 deletions production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ webui.fluid-layout = false
workspaces.directory = %(here)s/workspaces
scribe.python = %(here)s/scribeui_pyramid/modules/maps/scribe.py
cgi.directory = /usr/lib/cgi-bin
cgi.url = http://localhost/cgi-bin
mapserver.url = http://localhost/cgi-bin/mapserv
#mapcache.output.directory = /tmp/mapcache

Expand Down
12 changes: 7 additions & 5 deletions scribeui_pyramid/modules/main/templates/home.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
{% block body %}

<script type=text/javascript>
$WSNAME = '{{workspace}}';
$SETTINGS = {{settingsJSON|safe}}; //safe to remove escape characters
</script>

<!-- Header -->
<div class="navbar">
<div class="navbar">
<div id="title" class="title-left">
<img src="{{logo}}"></img>
<div class="title">
<div class="title">
<span class="faded">{{version}}</span>
</div>
</div>

<div id="logout">
<button id="workspace">{{workspace}}</button>
<button id="workspace">
{{settings.wsname}}
</button>
<!--a href="{{logout_url}}">Log Out</a-->
</div>
<ul>
Expand Down
9 changes: 8 additions & 1 deletion scribeui_pyramid/modules/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
BaseView
)

import json

class MainView(BaseView):

Expand Down Expand Up @@ -49,11 +50,17 @@ def home(self):
#If the plugins doesn't have js files to include, ignore it.
pass

settings = {
'wsname': self.request.userid ,
'cgibin_url': self.request.registry.settings.get('cgi.url', '')
}

return {
'plugins_js': plugins_js,
'plugins_css': plugins_css,
'api_url': self.request.route_url('home') + '/api',
'workspace': self.request.userid ,
'settings': settings,
'settingsJSON': json.dumps(settings),
'logo': self.request.static_url('scribeui_pyramid:static/img/logo_mini.png'),
'logout_url': self.request.route_url('auth.logout'),
'version': 'v1.3'
Expand Down
Loading

0 comments on commit 6678071

Please sign in to comment.