summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/base.html35
-rw-r--r--ishtar_common/templates/ishtar/blocks/shortcut_menu.html27
-rw-r--r--ishtar_common/templates/ishtar/blocks/window_nav.html7
-rw-r--r--ishtar_common/templates/window.html2
4 files changed, 45 insertions, 26 deletions
diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html
index 4b8b68f8a..703644a35 100644
--- a/ishtar_common/templates/base.html
+++ b/ishtar_common/templates/base.html
@@ -14,12 +14,14 @@
<script language="javascript" type="text/javascript" src="{{JQUERY_URL}}?ver={{VERSION}}"></script>
<script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}jquery-ui.js?ver={{VERSION}}"></script>
<script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}ui/i18n/jquery.ui.datepicker-{{COUNTRY}}.js?ver={{VERSION}}"></script>
+ <script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/chosen/chosen.jquery.min.js?ver={{VERSION}}"></script>
<script language="javascript" type="text/javascript" src="{{STATIC_URL}}/js/prettyPhoto/js/jquery.prettyPhoto.js?ver={{VERSION}}"></script>
<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/i18n/grid.locale-{{COUNTRY}}.js?ver={{VERSION}}"></script>
<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jquery.jqGrid.min.js?ver={{VERSION}}"></script>
<script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/grid.tbltogrid.js?ver={{VERSION}}"></script>
<script language="javascript" type="text/javascript" src="{{STATIC_URL}}/js/ishtar.js?ver={{VERSION}}"></script>
<link type="text/css" href="{{JQUERY_UI_URL}}jquery-ui.css?ver={{VERSION}}" rel="stylesheet" />
+ <link type="text/css" href="{{STATIC_URL}}js/chosen/chosen.min.css?ver={{VERSION}}" rel="stylesheet" />
<link rel="stylesheet" href="{{STATIC_URL}}/font-awesome/css/font-awesome.min.css?ver={{VERSION}}" />
<link rel="stylesheet" href="{{STATIC_URL}}/js/prettyPhoto/css/prettyPhoto.css?ver={{VERSION}}" />
<link rel="stylesheet" href="{{STATIC_URL}}media/ui.jqgrid.css?ver={{VERSION}}" />
@@ -28,6 +30,9 @@
{% include "blocks/extra_head.html" %}
{% block extra_head %}
{% endblock %}
+ <script type='text/javascript'>
+ var shortcut_url = '{% url "shortcut-menu" %}';
+ </script>
</head>
<body{% if current_theme%} id='{{current_theme}}'{%endif%}>
<div id="header">
@@ -64,31 +69,8 @@
<a href='{% url "start" %}' id="logo">
{% if APP_NAME %}<p id="app_name">{{APP_NAME}}</p>{%endif%}
</a>
- {% if not reminders %}<div id="context_menu">
- {% block context %}{% if current_menu %}
- <form method="post" action="{% url 'update-current-item' %}">
- <fieldset>
- <legend>{% trans "Default selected items"%}</legend>
- <table id='current_items'>
- {% for lbl, model_name, main_cls, items in current_menu %}
- <tr>
- <td><label for="current_{{model_name}}">{{lbl}}</label></td>
- <td>
- <select class='{{main_cls}}' id='current_{{model_name}}'>
- <option class='normal' value=''>--</option>
- {% for val, label, selected, cls in items %}<option{% if cls %} class='{{cls}}'{% endif %} value='{{val}}'{% if selected %} selected="selected"{% endif %}>{% ifequal cls 'basket' %}&#xf291; {% endifequal %}{% ifequal cls 'green' %}&#xf058; {% endifequal %}{% ifequal cls 'orange' %}&#xf06a; {% endifequal %}{% ifequal cls 'red' %}&#xf071; {% endifequal %}{{label}}</option>
- {% endfor %}</select>
- </td>{% with 'show-'|add:model_name as model_url%}
- <td><a href='#' onclick='load_current_window("{% url model_url 0 %}", "{{model_name}}");' class='display_details'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td>
- {% endwith %}
- </tr>
- {% endfor %}
- </table>
- </fieldset>
- </form>
- {% endif %}{% endblock %}
- </div>{% endif %}
-{% if reminders %}<fieldset id='reminder'><legend>{% trans "Current items" %}</legend>
+ {% if not reminders %}<div id="context_menu"></div>
+ {% else %}<fieldset id='reminder'><legend>{% trans "Current items" %}</legend>
{% for lbl, value in reminders %}
<p><strong class='lbl'>{{lbl}}{% trans ":"%}</strong> <span class='value'>{{value}}</span></p>
{% endfor %}
@@ -128,6 +110,9 @@
<p class='progress-detail progress-4'>{% trans "Time to take another coffee?" %} <i class="fa fa-coffee" aria-hidden="true"></i></p>
</div>
</div>
+ <div id='message'>
+ <div class='information'><i class="fa fa-info-circle" aria-hidden="true"></i> <span class='content'></span></div>
+ </div>
</body>
</html>
diff --git a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html
new file mode 100644
index 000000000..c1100ae01
--- /dev/null
+++ b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html
@@ -0,0 +1,27 @@
+{% load i18n %}
+{% load url from future%}
+{% if current_menu %}
+<form method="post" action="{% url 'update-current-item' %}">
+<fieldset>
+<i class="icon fa fa-thumb-tack fa-2x" aria-hidden="true" title="{% trans 'Pin an item in order to constrain default searches with this item. By default only your items are displayed. New created and modified items are auto-pin.' %}"></i>
+<table id='current_items'>
+{% for lbl, model_name, main_cls, items in current_menu %}
+<tr>
+ <td><label for="current_{{model_name}}">{{lbl}}</label></td>
+ <td>
+ <select class='{{main_cls}} chosen-select' id='current_{{model_name}}'>
+ <option class='normal' value=''>--</option>
+ {% for val, label, selected, cls in items %}<option{% if cls %} class='{{cls}}'{% endif %} value='{{val}}'{% if selected %} selected="selected"{% endif %}>{% ifequal cls 'basket' %}&#xf291; {% endifequal %}{% ifequal cls 'green' %}&#xf058; {% endifequal %}{% ifequal cls 'orange' %}&#xf06a; {% endifequal %}{% ifequal cls 'red' %}&#xf071; {% endifequal %}{{label}}</option>
+ {% endfor %}</select>
+ </td>{% with 'show-'|add:model_name as model_url%}
+ <td><a href='#' onclick='load_current_window("{% url model_url 0 %}", "{{model_name}}");' class='display_details'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td>
+ <td><span class='pin-action' onclick='$.get("{% url 'unpin' model_name %}", function(){load_shortcut_menu();});' title="{% trans 'Unpin' %}">
+ <i class="fa fa-times"></i>
+ </span></td>
+ {% endwith %}
+</tr>
+{% endfor %}
+</table>
+</fieldset>
+</form>
+{% endif %}
diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html
index 13069b1eb..4ce316217 100644
--- a/ishtar_common/templates/ishtar/blocks/window_nav.html
+++ b/ishtar_common/templates/ishtar/blocks/window_nav.html
@@ -42,6 +42,13 @@
<i class="fa fa-pencil fa-stack-1x fa-inverse"></i>
</span>
</a>{% endif %}
+ {% if pin_action and item.SLUG %}
+ <span class='pin-action' onclick='$.get("{% url 'pin' item.SLUG item.pk %}", function(){load_shortcut_menu(); display_info("{% trans 'Item pined in your shortcut menu.' %}")});' title="{% trans 'Pin' %}">
+ <span class="fa-stack fa-lg">
+ <i class="fa fa-circle fa-stack-2x"></i>
+ <i class="fa fa-thumb-tack fa-stack-1x fa-inverse"></i>
+ </span>
+ </span>{% endif %}
<a class='badge' href='{% url show_url item.pk "odt" %}' title='{% trans "Export as OpenOffice.org file"%}'>ODT</a> <a class='badge' href='{% url show_url item.pk "pdf" %}' title='{% trans "Export as PDF file"%}'>PDF</a>
</div>
<hr class='clear'>
diff --git a/ishtar_common/templates/window.html b/ishtar_common/templates/window.html
index 8e8eac41e..0748cd4cd 100644
--- a/ishtar_common/templates/window.html
+++ b/ishtar_common/templates/window.html
@@ -23,7 +23,7 @@
<body>
{% if new_item_label %}
<script type='text/javascript' language='javascript'>
-save_and_close_window{% if many %}_many{% endif %}("{{parent_name}}", "{{parent_pk}}", "{{new_item_label}}", "{{new_item_pk}}");
+save_and_close_window{% if many %}_many{% endif %}("{{parent_name}}", "{{parent_pk}}", "{{new_item_label|safe}}", "{{new_item_pk}}");
</script>
{% endif %}
<div id="window_content">