diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/models.py | 5 | ||||
| -rw-r--r-- | ishtar_common/static/js/ishtar.js | 7 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_nav.html | 29 | 
3 files changed, 30 insertions, 11 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index f7fac53e7..a1bae96c2 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1372,7 +1372,7 @@ class DocumentItem(object):          """          For sheet template: return "Add document / image" action          """ -        # url, base_text, icon, extra_text, extra css class +        # url, base_text, icon, extra_text, extra css class, is a quick action          actions = []          if not hasattr(self, 'SLUG'): @@ -1392,7 +1392,8 @@ class DocumentItem(object):                      _(u"Add document/image"),                      "fa fa-plus",                      _(u"doc./image"), -                    "" +                    "", +                    False                  )              ]          return actions diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index f3797408c..9846b4f1a 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -804,6 +804,13 @@ function toggle_window_menu(){      return false;  } +var register_qa_on_sheet = function(){ +    $(".btn-qa").click(function(){ +        var target = $(this).attr('data-target'); +        dt_qa_open(target); +    }); +}; +  function register_advanced_search(){      $(".advanced-search-reset").click( diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html index 764797ce2..6cd4bff40 100644 --- a/ishtar_common/templates/ishtar/blocks/window_nav.html +++ b/ishtar_common/templates/ishtar/blocks/window_nav.html @@ -31,26 +31,32 @@    {% else %}    <div class='offset-md-8 col-md-4 text-right'>    {% endif %} -      <div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'Actions' %}"> -          {% if pin_action and item.SLUG %} -          <a class="btn btn-secondary" href="#" class='pin-action' +      {% if pin_action and item.SLUG %} +      <div class="btn-group btn-group-sm" role="group" +           aria-label="{% trans 'Pin' %}"> +          <a class="btn btn-secondary pin-action" href="#"               onclick='$.get("{% url "pin" item.SLUG item.pk %}", function(){load_shortcut_menu(); display_info("{% trans 'Item pined in your shortcut menu.' %}")});' title="{% trans 'Pin' %}"> -          <i class="fa fa-thumb-tack"></i> +              <i class="fa fa-thumb-tack"></i>            </a> -          {% endif %} +      </div> +      {% endif %} +      <div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'Actions' %}">          {% block extra_actions %}{% endblock %}          {% if modify_url %} -        <a class="btn btn-secondary" href='{% url modify_url item.pk %}' +        <a class="btn btn-success" href='{% url modify_url item.pk %}'             title="{% trans 'Modify' %}">              <i class="fa fa-pencil"></i>          </a>          {% endif %} -        {% for url, base_text, icon, extra_text, css_class in extra_actions %} -        <a class="btn btn-secondary{% if css_class %} {{css_class}}{% endif %}" -           href='{{url}}' title="{{base_text}}"> +        {% for url, base_text, icon, extra_text, css_class, is_qa in extra_actions %} +        <a class="{% if is_qa %}btn-qa {% endif %}btn btn-success{% if css_class %} {{css_class}}{% endif %}" +           {% if is_qa %}href="#" data-target="{{url}}"{% else %}href='{{url}}'{% endif %} title="{{base_text}}">              <i class="{{icon}}"></i> {{extra_text}}          </a>          {% endfor %} +      </div> +      <div class="btn-group btn-group-sm" role="group" +           aria-label="{% trans 'Export' %}">            <a class="btn btn-secondary" href='{% url show_url item.pk "odt" %}'               title='{% trans "Export as OpenOffice.org file"%}'>                ODT <i class="fa fa-file-word-o" aria-hidden="true"></i> @@ -66,3 +72,8 @@    {% trans "Relation between items are not historized." %}  </div>  {% endif %} +<script type="text/javascript"> +$(document).ready(function(){ +    register_qa_on_sheet(); +}); +</script>
\ No newline at end of file | 
