Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #143 from N3MIS15/app_new_tab

added setting to open apps in new tab
  • Loading branch information...
commit 3bcd2cb8341f1bb9b9d193eead9ee1564efd6022 2 parents b39f918 + da32852
@gugahoi gugahoi authored
View
8 maraschino/modules.py
@@ -29,6 +29,14 @@
'static': True,
'poll': 0,
'delay': 0,
+ 'settings': [
+ {
+ 'key': 'app_new_tab',
+ 'value': '0',
+ 'description': 'Open application in new tab.',
+ 'type': 'bool',
+ },
+ ]
},
{
'name': 'diskspace',
View
2  modules/applications.py
@@ -12,9 +12,11 @@
@requires_auth
def xhr_applications():
applications = Application.query.order_by(Application.position)
+ new_tab = get_setting_value('app_new_tab') == '1'
return render_template('applications.html',
applications = applications,
+ new_tab = new_tab,
)
@app.route('/xhr/add_application_dialog')
View
3  templates/applications.html
@@ -1,5 +1,6 @@
<div id="applications" class="module" data-module="applications">
+ <div class="module_settings"><span>Settings</span></div>
<div class="module_remove"><span>Remove</span></div>
<h2>Applications</h2>
@@ -8,7 +9,7 @@
<ul>
{% for application in applications %}
<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">
{% if application.image %}<img src="/static/images/applications/{{ application.image }}" height="20" width="20">{% endif %}
<span>{{ application.name }}</span>
Please sign in to comment.
Something went wrong with that request. Please try again.