Skip to content

Commit

Permalink
Merge pull request #143 from N3MIS15/app_new_tab
Browse files Browse the repository at this point in the history
added setting to open apps in new tab
  • Loading branch information
gugahoi committed May 28, 2012
2 parents b39f918 + da32852 commit 3bcd2cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions maraschino/modules.py
Expand Up @@ -29,6 +29,14 @@
'static': True, 'static': True,
'poll': 0, 'poll': 0,
'delay': 0, 'delay': 0,
'settings': [
{
'key': 'app_new_tab',
'value': '0',
'description': 'Open application in new tab.',
'type': 'bool',
},
]
}, },
{ {
'name': 'diskspace', 'name': 'diskspace',
Expand Down
2 changes: 2 additions & 0 deletions modules/applications.py
Expand Up @@ -12,9 +12,11 @@
@requires_auth @requires_auth
def xhr_applications(): def xhr_applications():
applications = Application.query.order_by(Application.position) applications = Application.query.order_by(Application.position)
new_tab = get_setting_value('app_new_tab') == '1'


return render_template('applications.html', return render_template('applications.html',
applications = applications, applications = applications,
new_tab = new_tab,
) )


@app.route('/xhr/add_application_dialog') @app.route('/xhr/add_application_dialog')
Expand Down
3 changes: 2 additions & 1 deletion templates/applications.html
@@ -1,5 +1,6 @@
<div id="applications" class="module" data-module="applications"> <div id="applications" class="module" data-module="applications">


<div class="module_settings"><span>Settings</span></div>
<div class="module_remove"><span>Remove</span></div> <div class="module_remove"><span>Remove</span></div>


<h2>Applications</h2> <h2>Applications</h2>
Expand All @@ -8,7 +9,7 @@ <h2>Applications</h2>
<ul> <ul>
{% for application in applications %} {% for application in applications %}
<li> <li>
<a class="clearfix" data-id="{{ application.id }}" title="Launch {{ application.name }}" href="{{ application.url }}"> <a class="clearfix" data-id="{{ application.id }}" title="Launch {{ application.name }}" href="{{ application.url }}"{% if new_tab %} target="_blank"{% endif %}>
<span class="name"> <span class="name">
{% if application.image %}<img src="/static/images/applications/{{ application.image }}" height="20" width="20">{% endif %} {% if application.image %}<img src="/static/images/applications/{{ application.image }}" height="20" width="20">{% endif %}
<span>{{ application.name }}</span> <span>{{ application.name }}</span>
Expand Down

0 comments on commit 3bcd2cb

Please sign in to comment.