Projet

Général

Profil

0001-misc-apply-djhtml-69419.patch

Valentin Deniaud, 22 septembre 2022 10:13

Télécharger (200 ko)

Voir les différences:

Subject: [PATCH 1/2] misc: apply djhtml (#69419)

 data/themes/django/templates/wcs/base.html    |  42 +--
 data/themes/django/templates/wcs/home.html    |  24 +-
 .../qommon/forms/widgets/select--test.html    |  20 +-
 wcs/qommon/templates/qommon/email_body.html   |  34 +-
 wcs/qommon/templates/qommon/forms/widget.html |  74 ++--
 .../qommon/forms/widgets/block_sub.html       |  14 +-
 .../qommon/forms/widgets/checkboxes.html      |  28 +-
 .../qommon/forms/widgets/comment.html         |   6 +-
 .../templates/qommon/forms/widgets/date.html  |  54 +--
 .../templates/qommon/forms/widgets/file.html  |  92 ++---
 .../forms/widgets/map-marker-selection.html   |  32 +-
 .../templates/qommon/forms/widgets/map.html   |  22 +-
 .../qommon/forms/widgets/mini-rich-text.html  |  12 +-
 .../qommon/forms/widgets/multiselect.html     |  24 +-
 .../qommon/forms/widgets/radiobuttons.html    |  22 +-
 .../forms/widgets/select-timetable.html       | 318 ++++++++---------
 .../qommon/forms/widgets/select.html          |  22 +-
 .../forms/widgets/select_jsonp--address.html  |  12 +-
 .../qommon/forms/widgets/select_jsonp.html    |  26 +-
 .../templates/qommon/forms/widgets/time.html  |  28 +-
 wcs/qommon/templates/qommon/saml-error.html   |   6 +-
 wcs/templates/wcs/action.html                 |  36 +-
 wcs/templates/wcs/backoffice-legacy.html      |   2 +-
 wcs/templates/wcs/backoffice.html             |  48 +--
 wcs/templates/wcs/backoffice/api_access.html  |  50 +--
 .../wcs/backoffice/api_accesses.html          |  24 +-
 wcs/templates/wcs/backoffice/base.html        |  10 +-
 .../wcs/backoffice/block-inspect.html         |  40 +--
 wcs/templates/wcs/backoffice/blocks.html      |  46 +--
 .../wcs/backoffice/card-data-import-form.html |  38 +-
 wcs/templates/wcs/backoffice/cards.html       |  20 +-
 wcs/templates/wcs/backoffice/category.html    | 108 +++---
 wcs/templates/wcs/backoffice/changes.html     |  24 +-
 .../wcs/backoffice/data-management.html       |  16 +-
 wcs/templates/wcs/backoffice/data-source.html | 192 +++++-----
 .../wcs/backoffice/data-sources.html          | 166 ++++-----
 .../wcs/backoffice/deprecations.html          |  60 ++--
 wcs/templates/wcs/backoffice/error.html       |  10 +-
 .../wcs/backoffice/formdata-inspect.html      | 130 +++----
 .../wcs/backoffice/formdef-inspect.html       | 146 ++++----
 wcs/templates/wcs/backoffice/forms.html       |  70 ++--
 .../backoffice/includes/inspect-field.html    |  18 +-
 .../wcs/backoffice/logged-error.html          |  98 +++---
 .../wcs/backoffice/logged-errors.html         |  20 +-
 .../wcs/backoffice/mail-template.html         |  52 +--
 .../wcs/backoffice/mail-templates.html        |  46 +--
 .../wcs/backoffice/popup_response.html        |   6 +-
 wcs/templates/wcs/backoffice/processing.html  |  20 +-
 .../wcs/backoffice/settings/import.html       |  94 ++---
 wcs/templates/wcs/backoffice/snapshots.html   | 160 ++++-----
 .../wcs/backoffice/snapshots_compare.html     |  44 +--
 wcs/templates/wcs/backoffice/studio.html      | 108 +++---
 .../workflow-fullscreen-schema.html           |   8 +-
 .../wcs/backoffice/workflow-inspect.html      | 178 +++++-----
 .../wcs/backoffice/workflow-status.html       | 186 +++++-----
 wcs/templates/wcs/backoffice/workflow.html    | 332 +++++++++---------
 wcs/templates/wcs/backoffice/wscall.html      |  74 ++--
 wcs/templates/wcs/backoffice/wscalls.html     |  26 +-
 wcs/templates/wcs/formdata_filling.html       |  34 +-
 wcs/templates/wcs/formdata_history.html       | 100 +++---
 wcs/templates/wcs/formdata_popup_filling.html |  10 +-
 wcs/templates/wcs/formdata_sidebox.html       |  64 ++--
 wcs/templates/wcs/formdata_status.html        |  62 ++--
 wcs/templates/wcs/formdata_steps.html         |  28 +-
 wcs/templates/wcs/formdata_validation.html    |  14 +-
 wcs/templates/wcs/includes/drafts-recall.html |  32 +-
 66 files changed, 1981 insertions(+), 1981 deletions(-)
data/themes/django/templates/wcs/base.html
8 8
    {% endblock %}
9 9
  </head>
10 10
  <body>
11
  <div {% if onload %}onload="{{ onload }}"{% endif %}>
12
    <div id="page">
13
    <div id="top">
14
    {% block header %}
15
    <h1>WIP/DJANGO - {% if title %}{{ title }}{% else %}{{ site_name }}{% endif %}</h1>
16
    {% endblock %}
17
    </div>
18
    <div id="main-content">
19
    {% block content %}
20
    {{ prelude }}
11
    <div {% if onload %}onload="{{ onload }}"{% endif %}>
12
      <div id="page">
13
        <div id="top">
14
          {% block header %}
15
            <h1>WIP/DJANGO - {% if title %}{{ title }}{% else %}{{ site_name }}{% endif %}</h1>
16
          {% endblock %}
17
        </div>
18
        <div id="main-content">
19
          {% block content %}
20
            {{ prelude }}
21 21

  
22
    {% if breadcrumb %}
23
    <p id="breadcrumb">{{ breadcrumb|safe }}</p>
24
    {% endif %}
22
            {% if breadcrumb %}
23
              <p id="breadcrumb">{{ breadcrumb|safe }}</p>
24
            {% endif %}
25 25

  
26
    {% block body %}
27
    {{ body|safe }}
28
    {% endblock %}
26
            {% block body %}
27
              {{ body|safe }}
28
            {% endblock %}
29 29

  
30
    {% endblock %}
31
  </div>
32
  <div id="footer">{{ footer }}</div>
33
  </body>
34
</html>
30
          {% endblock %}
31
        </div>
32
        <div id="footer">{{ footer }}</div>
33
      </body>
34
    </html>
data/themes/django/templates/wcs/home.html
2 2

  
3 3
{% block body %}
4 4

  
5
<div>
6
<h2>HELLO WORLD</h2>
5
  <div>
6
    <h2>HELLO WORLD</h2>
7 7

  
8
{% regroup forms by category as category_list %}
9
{% for category in category_list %}
10
{% if category.grouper %}<h3>{{ category.grouper }}</h3>{% endif %}
11
<ul>
12
{% for form in category.list %}
13
<li><a href="{{ form.url }}">{{ form.title }}</a></li>
14
{% endfor %}
15
</ul>
16
{% endfor %}
8
    {% regroup forms by category as category_list %}
9
    {% for category in category_list %}
10
      {% if category.grouper %}<h3>{{ category.grouper }}</h3>{% endif %}
11
      <ul>
12
        {% for form in category.list %}
13
          <li><a href="{{ form.url }}">{{ form.title }}</a></li>
14
        {% endfor %}
15
      </ul>
16
    {% endfor %}
17 17

  
18
</div>
18
  </div>
19 19

  
20 20
{% endblock %}
tests/templates/qommon/forms/widgets/select--test.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2
{% block widget-control %}
3
<!-- TEST TEMPLATE -->
4
<!-- backoffice: {{ request.is_in_backoffice|pprint }} -->
5
<!-- backoffice compat: {{ request.quixote_request.is_in_backoffice|pprint }} -->
6
<!-- substitution variable: {{ example_url }} -->
7
<select id="form_{{widget.name}}" name="{{widget.name}}"
3
  <!-- TEST TEMPLATE -->
4
  <!-- backoffice: {{ request.is_in_backoffice|pprint }} -->
5
  <!-- backoffice compat: {{ request.quixote_request.is_in_backoffice|pprint }} -->
6
  <!-- substitution variable: {{ example_url }} -->
7
  <select id="form_{{widget.name}}" name="{{widget.name}}"
8 8
    {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}"{% endfor %}>
9
  <option value="">---</option>
10
  {% for option in widget.get_options %}
11
    <option{% for attr in option.attrs.items %} {{attr.0}}="{{attr.1}}"{% endfor %}
9
    <option value="">---</option>
10
    {% for option in widget.get_options %}
11
      <option{% for attr in option.attrs.items %} {{attr.0}}="{{attr.1}}"{% endfor %}
12 12
      >{{ option.description }}</option>
13
  {% endfor %}
14
</select>
13
    {% endfor %}
14
  </select>
15 15
{% endblock %}
wcs/qommon/templates/qommon/email_body.html
1 1
<!DOCTYPE html>
2 2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
  <meta charset="utf-8">
5
</head>
6
<body>
7
  <div style="max-width: 60ex;">
8
    <div class="content">
9
      {% block content %}
10
      {{ content }}
3
  <head>
4
    <meta charset="utf-8">
5
  </head>
6
  <body>
7
    <div style="max-width: 60ex;">
8
      <div class="content">
9
        {% block content %}
10
          {{ content }}
11
        {% endblock %}
12
      </div>
13
      {% block footer %}
14
        {% if email_signature %}
15
          <div style="font-size: smaller; font-color: #888; margin-top: 2em;">
16
            {{ email_signature|linebreaks }}
17
          </div>
18
        {% endif %}
11 19
      {% endblock %}
12 20
    </div>
13
    {% block footer %}
14
    {% if email_signature %}
15
    <div style="font-size: smaller; font-color: #888; margin-top: 2em;">
16
      {{ email_signature|linebreaks }}
17
    </div>
18
    {% endif %}
19
    {% endblock %}
20
  </div>
21
</body>
21
  </body>
22 22
</html>
wcs/qommon/templates/qommon/forms/widget.html
1 1
<div class="{% block widget-css-classes %}widget {{widget.class_name}} {{widget.extra_css_class}}
2
     {% if widget.readonly %}widget-readonly{% endif %}
3
     {% if widget.get_error %}widget-with-error{% endif %}
4
     {% if widget.is_required %}widget-required{% else %}widget-optional{% endif %}
5
     {% if widget.is_prefilled %}widget-prefilled{% endif %}{% endblock %}"
6
     {% block widget-attrs %}
7
     {% if widget.is_hidden %}style="display: none"{% endif %}
8
     {% if widget.field %}data-field-id="{{ widget.field.id }}"{% endif %}
9
     data-widget-name="{{ widget.name }}"
10
     {% if widget.div_id %}id="{{widget.div_id}}" data-valuecontainerid="form_{{widget.name}}"{% endif %}
11
     {% if widget.a11y_role %}role="{{ a11y_role }}"{% endif %}
12
     {% if widget.a11y_labelledby %}aria-labelledby="form_label_{{widget.name}}"{% endif %}
13
     {% for attr in widget.prefill_attributes %}
14
     data-{{attr}}="{{widget.prefill_attributes|get:attr}}"
15
     {% endfor %}
16
     {% if "data-dynamic-display-child-of" in widget.attrs %}
17
     data-dynamic-display-child-of="{{widget.attrs|get:"data-dynamic-display-child-of"}}"
18
     {% endif %}
19
     {% if "data-dynamic-display-value" in widget.attrs %}
20
     data-dynamic-display-value="{{widget.attrs|get:"data-dynamic-display-value"}}"
21
     {% endif %}
22
     {% if "data-dynamic-display-value-in" in widget.attrs %}
23
     data-dynamic-display-value-in="{{widget.attrs|get:"data-dynamic-display-value-in"}}"
24
     {% endif %}
25
     {% if widget.live_condition_source %}data-live-source="true"{% endif %}
26
     {% endblock %}
27
     >
2
  {% if widget.readonly %}widget-readonly{% endif %}
3
  {% if widget.get_error %}widget-with-error{% endif %}
4
  {% if widget.is_required %}widget-required{% else %}widget-optional{% endif %}
5
  {% if widget.is_prefilled %}widget-prefilled{% endif %}{% endblock %}"
6
  {% block widget-attrs %}
7
    {% if widget.is_hidden %}style="display: none"{% endif %}
8
    {% if widget.field %}data-field-id="{{ widget.field.id }}"{% endif %}
9
    data-widget-name="{{ widget.name }}"
10
    {% if widget.div_id %}id="{{widget.div_id}}" data-valuecontainerid="form_{{widget.name}}"{% endif %}
11
    {% if widget.a11y_role %}role="{{ a11y_role }}"{% endif %}
12
    {% if widget.a11y_labelledby %}aria-labelledby="form_label_{{widget.name}}"{% endif %}
13
    {% for attr in widget.prefill_attributes %}
14
      data-{{attr}}="{{widget.prefill_attributes|get:attr}}"
15
    {% endfor %}
16
    {% if "data-dynamic-display-child-of" in widget.attrs %}
17
      data-dynamic-display-child-of="{{widget.attrs|get:"data-dynamic-display-child-of"}}"
18
    {% endif %}
19
    {% if "data-dynamic-display-value" in widget.attrs %}
20
      data-dynamic-display-value="{{widget.attrs|get:"data-dynamic-display-value"}}"
21
    {% endif %}
22
    {% if "data-dynamic-display-value-in" in widget.attrs %}
23
      data-dynamic-display-value-in="{{widget.attrs|get:"data-dynamic-display-value-in"}}"
24
    {% endif %}
25
    {% if widget.live_condition_source %}data-live-source="true"{% endif %}
26
  {% endblock %}
27
>
28 28
  {% block widget-title %}
29
  {{widget.rendered_title}}
29
    {{widget.rendered_title}}
30 30
  {% endblock %}
31 31
  {% block widget-content %}
32
  <div class="content {{widget.content.content_extra_css_class}}"
33
     {% for attr, value in widget.content_extra_attributes.items %}
34
     {{attr}}="{{value}}"
35
     {% endfor %}
36
       >
37
    {% block widget-error %}{{widget.rendered_error}}{% endblock %}
38
    {% block widget-control %}{{widget.render_content|safe}}{% endblock %}
39
    {% block widget-hint %}{{widget.rendered_hint}}{% endblock %}
40
  </div>
32
    <div class="content {{widget.content.content_extra_css_class}}"
33
      {% for attr, value in widget.content_extra_attributes.items %}
34
        {{attr}}="{{value}}"
35
      {% endfor %}
36
    >
37
      {% block widget-error %}{{widget.rendered_error}}{% endblock %}
38
      {% block widget-control %}{{widget.render_content|safe}}{% endblock %}
39
      {% block widget-hint %}{{widget.rendered_hint}}{% endblock %}
40
    </div>
41 41
  {% endblock %}
42 42
  {% if widget.render_br %}
43
  <br class="content {{widget.content.content_extra_css_class}}">
43
    <br class="content {{widget.content.content_extra_css_class}}">
44 44
  {% endif %}
45 45
</div>
wcs/qommon/templates/qommon/forms/widgets/block_sub.html
2 2
{% load i18n %}
3 3

  
4 4
{% block widget-attrs %}
5
{{ block.super }} data-block-row="element{{ widget.index }}"
5
  {{ block.super }} data-block-row="element{{ widget.index }}"
6 6
{% endblock %}
7 7

  
8 8
{% block widget-content %}
9
{% for subwidget in widget.get_widgets %}
10
{% if widget.readonly and not subwidget.field.include_in_validation_page %}<div style="display: none">{% endif %}
11
  {{ subwidget.render|safe }}
12
{% if widget.readonly and not subwidget.field.include_in_validation_page %}</div>{% endif %}
13
{% endfor %}
14
{% if not widget.readonly and widget.remove_button %}<button class="remove-button" title="{% trans "Remove" %}"><span>-</span></button>{% endif %} {% endblock %}
9
  {% for subwidget in widget.get_widgets %}
10
    {% if widget.readonly and not subwidget.field.include_in_validation_page %}<div style="display: none">{% endif %}
11
    {{ subwidget.render|safe }}
12
    {% if widget.readonly and not subwidget.field.include_in_validation_page %}</div>{% endif %}
13
  {% endfor %}
14
  {% if not widget.readonly and widget.remove_button %}<button class="remove-button" title="{% trans "Remove" %}"><span>-</span></button>{% endif %} {% endblock %}
wcs/qommon/templates/qommon/forms/widgets/checkboxes.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2

  
3 3
{% block widget-control %}
4
<ul {% if widget.inline %}class="inline"{% endif %} data-base-for-name="{{ widget.get_name_for_id }}_op_">
5
  {% for option in widget.get_options %}
6
  <li {% if option.disabled %}class="disabled"{% endif %}><label for="{{ widget.get_name_for_id }}_op_{{ forloop.counter0 }}"><input
7
   id="{{ widget.get_name_for_id }}_op_{{ forloop.counter0 }}"
8
   {% if option.selected %}checked="checked"
9
   {% elif widget.readonly or option.disabled %}disabled{% endif %}
10
   {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
11
   type="checkbox"
12
   {% if widget.readonly %}value="yes" disabled {% else %}name="{{ option.name }}" value="yes"{% endif %}
13
   ><span>{{ option.label }}</span></label>
14
   {% if widget.readonly and option.selected %}<input type="hidden" name="{{ option.name }}" value="yes">{% endif %}
15
   </li>
16
{% endfor %}
17
</ul>
4
  <ul {% if widget.inline %}class="inline"{% endif %} data-base-for-name="{{ widget.get_name_for_id }}_op_">
5
    {% for option in widget.get_options %}
6
      <li {% if option.disabled %}class="disabled"{% endif %}><label for="{{ widget.get_name_for_id }}_op_{{ forloop.counter0 }}"><input
7
        id="{{ widget.get_name_for_id }}_op_{{ forloop.counter0 }}"
8
        {% if option.selected %}checked="checked"
9
        {% elif widget.readonly or option.disabled %}disabled{% endif %}
10
        {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
11
        type="checkbox"
12
        {% if widget.readonly %}value="yes" disabled {% else %}name="{{ option.name }}" value="yes"{% endif %}
13
      ><span>{{ option.label }}</span></label>
14
        {% if widget.readonly and option.selected %}<input type="hidden" name="{{ option.name }}" value="yes">{% endif %}
15
      </li>
16
    {% endfor %}
17
  </ul>
18 18
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/comment.html
1 1
<div {% if widget.field.id %}data-field-id="{{ widget.field.id }}"{% endif %}
2
     {% if widget.is_hidden %}style="display: none"{% endif %}
3
     class="comment-field {{widget.extra_css_class|default_if_none:"" }}">
2
  {% if widget.is_hidden %}style="display: none"{% endif %}
3
  class="comment-field {{widget.extra_css_class|default_if_none:"" }}">
4 4
  {% block widget-content %}
5
  {{ widget.content|safe }}
5
    {{ widget.content|safe }}
6 6
  {% endblock %}
7 7
</div>
wcs/qommon/templates/qommon/forms/widgets/date.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2

  
3 3
{% block widget-control %}
4
{% if "readonly" in widget.attrs %}
5
{# for readonly mode, add an hidden field with the correct value and a text #}
6
{# input with the formated date value; this will avoid displaying the date in #}
7
{# Y-m-d format, or including a date input with an ineffective reset × button. #}
8
<input type="hidden" name="{{widget.name}}" {% if widget.value %}value="{{ widget.value|date:"Y-m-d" }}"{% endif %}>
9
<input type="text" {% if widget.value %}value="{{ widget.value|date }}"{% endif %}
10
{% else %}
11
{# otherwise, use an <input type="date"> but also include js datetime picker #}
12
{# attributes, in case it's not supported. #}
13
<input name="{{widget.name}}" {% if widget.value %}value="{{ widget.value|date:"Y-m-d" }}"{% endif %}
14
  type="date"
15
  {% if widget.value %}data-formatted-value="{{ widget.value|default:"" }}"{% endif %}
16
  class="date-pick"
17
  data-date-format="{{widget.date_format}}"
4
  {% if "readonly" in widget.attrs %}
5
    {# for readonly mode, add an hidden field with the correct value and a text #}
6
    {# input with the formated date value; this will avoid displaying the date in #}
7
    {# Y-m-d format, or including a date input with an ineffective reset × button. #}
8
    <input type="hidden" name="{{widget.name}}" {% if widget.value %}value="{{ widget.value|date:"Y-m-d" }}"{% endif %}>
9
    <input type="text" {% if widget.value %}value="{{ widget.value|date }}"{% endif %}
10
  {% else %}
11
    {# otherwise, use an <input type="date"> but also include js datetime picker #}
12
    {# attributes, in case it's not supported. #}
13
    <input name="{{widget.name}}" {% if widget.value %}value="{{ widget.value|date:"Y-m-d" }}"{% endif %}
14
    type="date"
15
    {% if widget.value %}data-formatted-value="{{ widget.value|default:"" }}"{% endif %}
16
    class="date-pick"
17
    data-date-format="{{widget.date_format}}"
18 18

  
19
  {# set widget not to go into the time pages #}
20
  data-min-view="2"
19
    {# set widget not to go into the time pages #}
20
    data-min-view="2"
21 21

  
22
  {# if there is no value we set the initial view to be the view of decades, #}
23
  {# it is more appropriate to select a far away date. #}
24
  data-start-view="{% if widget.value %}2{% else %}4{% endif %}"
22
    {# if there is no value we set the initial view to be the view of decades, #}
23
    {# it is more appropriate to select a far away date. #}
24
    data-start-view="{% if widget.value %}2{% else %}4{% endif %}"
25 25

  
26
  {% if widget.minimum_date %}
27
  data-start-date="{{ widget.start_date }}"
28
  min="{{widget.minimum_date|date:"Y-m-d"}}"
26
    {% if widget.minimum_date %}
27
      data-start-date="{{ widget.start_date }}"
28
      min="{{widget.minimum_date|date:"Y-m-d"}}"
29
    {% endif %}
30
    {% if widget.maximum_date %}
31
      data-end-date="{{ widget.end_date }}"
32
      max="{{widget.maximum_date|date:"Y-m-d"}}"
33
    {% endif %}
29 34
  {% endif %}
30
  {% if widget.maximum_date %}
31
  data-end-date="{{ widget.end_date }}"
32
  max="{{widget.maximum_date|date:"Y-m-d"}}"
33
  {% endif %}
34
{% endif %}
35 35
  id="form_{{widget.get_name_for_id}}"
36 36
  {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
37 37
  {% if widget.required %}aria-required="true"{% endif %}
wcs/qommon/templates/qommon/forms/widgets/file.html
2 2
{% load i18n %}
3 3

  
4 4
{% block widget-control %}
5
<div class="file-button {% if widget.is_image %}file-image{% endif %}"
6
     {% if widget.automatic_image_resize %}data-image-resize="true"{% endif %}>
7
{% for w in widget.get_widgets %}
8
  {{ w.render|safe }}
9
{% endfor %}
10
<div class="widget-message click-to-upload">
11
  {% trans "Drop a file or click to select one" %}
12
</div>
13
<div class="widget-message upload-done">
14
  {% trans "Upload done" %}
15
</div>
16
<style>.click-to-upload, .upload-done { display: none; }</style>
17
<div class="fileprogress" style="display: none;">
18
  <div class="bar"
19
       role="progressbar"
20
       aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-valuetext="0%"
21
       aria-label="" tabindex="-1"
22
       data-upload="{% trans "Upload in progress..." %}"
23
       data-resize="{% trans "Resizing image..." %}"
24
       data-error="{% trans "Error during upload." %}"></div>
25
</div>
26
<div class="fileinfo {% if widget.readonly and widget.has_tempfile_image %}thumbnail{% endif %}">
27
  <span class="filename">{% if widget.tempfile and not widget.is_remote_storage %}<a
28
    href="tempfile?t={{ widget.tempfile.token }}"
29
    download="{{widget.tempfile.base_filename}}"
30
    >{{ widget.tempfile.base_filename }}</a>{% elif widget.tempfile %}{{ widget.tempfile.base_filename }}{% endif %}</span>
31
{% if not widget.readonly %}
32
  <a href="#" role="button" class="remove" title="{% trans 'Remove this file' %}">{% trans "remove" %}</a>
33
{% elif widget.has_tempfile_image %}
34
  <img alt="" src="tempfile?t={{ widget.tempfile.token }}&thumbnail=1"/>
35
{% endif %}
36
</div>
37
</div>
38
{% block portfolio-picker %}
39
{% if not widget.readonly and widget.allow_portfolio_picking and session_user %}
40
  <p class="use-file-from-fargo"><span
41
     data-src="{{site_url}}/fargo/pick" data-width="500" data-height="400"
42
     data-title="{% trans "Pick a file from the portfolio" %}"
43
     data-popup>{% trans "Use file from the portfolio" %}</span></p>
44
{% endif %}
45
{% endblock %}
5
  <div class="file-button {% if widget.is_image %}file-image{% endif %}"
6
    {% if widget.automatic_image_resize %}data-image-resize="true"{% endif %}>
7
    {% for w in widget.get_widgets %}
8
      {{ w.render|safe }}
9
    {% endfor %}
10
    <div class="widget-message click-to-upload">
11
      {% trans "Drop a file or click to select one" %}
12
    </div>
13
    <div class="widget-message upload-done">
14
      {% trans "Upload done" %}
15
    </div>
16
    <style>.click-to-upload, .upload-done { display: none; }</style>
17
    <div class="fileprogress" style="display: none;">
18
      <div class="bar"
19
        role="progressbar"
20
        aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-valuetext="0%"
21
        aria-label="" tabindex="-1"
22
        data-upload="{% trans "Upload in progress..." %}"
23
        data-resize="{% trans "Resizing image..." %}"
24
        data-error="{% trans "Error during upload." %}"></div>
25
    </div>
26
    <div class="fileinfo {% if widget.readonly and widget.has_tempfile_image %}thumbnail{% endif %}">
27
      <span class="filename">{% if widget.tempfile and not widget.is_remote_storage %}<a
28
        href="tempfile?t={{ widget.tempfile.token }}"
29
        download="{{widget.tempfile.base_filename}}"
30
      >{{ widget.tempfile.base_filename }}</a>{% elif widget.tempfile %}{{ widget.tempfile.base_filename }}{% endif %}</span>
31
      {% if not widget.readonly %}
32
        <a href="#" role="button" class="remove" title="{% trans 'Remove this file' %}">{% trans "remove" %}</a>
33
      {% elif widget.has_tempfile_image %}
34
        <img alt="" src="tempfile?t={{ widget.tempfile.token }}&thumbnail=1"/>
35
      {% endif %}
36
    </div>
37
  </div>
38
  {% block portfolio-picker %}
39
    {% if not widget.readonly and widget.allow_portfolio_picking and session_user %}
40
      <p class="use-file-from-fargo"><span
41
        data-src="{{site_url}}/fargo/pick" data-width="500" data-height="400"
42
        data-title="{% trans "Pick a file from the portfolio" %}"
43
        data-popup>{% trans "Use file from the portfolio" %}</span></p>
44
    {% endif %}
45
  {% endblock %}
46 46

  
47
<script>
48
$(function() {
49
  $('[data-widget-name="{{ widget.name }}"]').each($.WcsFileUpload.prepare);
50
});
51
</script>
47
  <script>
48
    $(function() {
49
      $('[data-widget-name="{{ widget.name }}"]').each($.WcsFileUpload.prepare);
50
    });
51
  </script>
52 52
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/map-marker-selection.html
11 11
{% endblock %}
12 12

  
13 13
{% block widget-control %}
14
{{ block.super }}
14
  {{ block.super }}
15 15

  
16
<style>
17
.item-marker input + span {
18
  position: relative;
19
  z-index: 1000;
20
  margin-top: -55px;
21
  margin-left: -5px;
22
  display: block;
23
  width: 25px;
24
  height: 41px;
25
  background: url(/static/images/blank-marker-icon.png);
26
}
27
.item-marker input:checked + span {
28
  background: url(/static/xstatic/images/marker-icon.png);
29
}
30
</style>
16
  <style>
17
    .item-marker input + span {
18
      position: relative;
19
      z-index: 1000;
20
      margin-top: -55px;
21
      margin-left: -5px;
22
      display: block;
23
      width: 25px;
24
      height: 41px;
25
      background: url(/static/images/blank-marker-icon.png);
26
    }
27
    .item-marker input:checked + span {
28
      background: url(/static/xstatic/images/marker-icon.png);
29
    }
30
  </style>
31 31
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/map.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2

  
3 3
{% block widget-control %}
4
<input type="hidden" name="{{widget.name}}$latlng" {% if widget.value %}value="{{widget.value}}"{% endif %}>
5
<div id="map-{{widget.get_name_for_id}}" class="qommon-map"
6
  {% if widget.readonly %}data-readonly="true"{% endif %}
7
  {% if widget.sync_map_and_address_fields %}data-address-sync="true"{% endif %}
8
  {% for key, value in widget.map_attributes.items %}{{key}}="{{value}}" {% endfor %}
9
  {% if widget.initial_position %}
10
    data-init-lat="{{ widget.initial_position.lat }}"
11
    data-init-lng="{{ widget.initial_position.lng }}"
12
  {% endif %}
13
  {% block widget-control-attributes %}{% endblock %}
14
></div>
4
  <input type="hidden" name="{{widget.name}}$latlng" {% if widget.value %}value="{{widget.value}}"{% endif %}>
5
  <div id="map-{{widget.get_name_for_id}}" class="qommon-map"
6
    {% if widget.readonly %}data-readonly="true"{% endif %}
7
    {% if widget.sync_map_and_address_fields %}data-address-sync="true"{% endif %}
8
    {% for key, value in widget.map_attributes.items %}{{key}}="{{value}}" {% endfor %}
9
    {% if widget.initial_position %}
10
      data-init-lat="{{ widget.initial_position.lat }}"
11
      data-init-lng="{{ widget.initial_position.lng }}"
12
    {% endif %}
13
    {% block widget-control-attributes %}{% endblock %}
14
  ></div>
15 15
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/mini-rich-text.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2
{% block widget-control %}
3
<textarea style="width: 100%" id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
3
  <textarea style="width: 100%" id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
4 4
    {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
5
    >{{widget.value|default:""}}</textarea>
6
<script type="module">
7
import Godo from "/static/xstatic/js/godo.js?{{version_hash}}";
8
new Godo(document.getElementById('form_{{widget.get_name_for_id}}'), {schema: 'basic'});
9
</script>
5
  >{{widget.value|default:""}}</textarea>
6
  <script type="module">
7
    import Godo from "/static/xstatic/js/godo.js?{{version_hash}}";
8
    new Godo(document.getElementById('form_{{widget.get_name_for_id}}'), {schema: 'basic'});
9
  </script>
10 10
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/multiselect.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2
{% block widget-control %}
3
<select
3
  <select
4 4
    {% if widget.readonly %}
5
    hidden
6
    id="form_{{widget.get_name_for_id}}_hidden" name="{{widget.name}}[]"
5
      hidden
6
      id="form_{{widget.get_name_for_id}}_hidden" name="{{widget.name}}[]"
7 7
    {% else %}
8
    id="form_{{widget.get_name_for_id}}" name="{{widget.name}}[]"
9
    data-autocomplete="true"
8
      id="form_{{widget.get_name_for_id}}" name="{{widget.name}}[]"
9
      data-autocomplete="true"
10 10
    {% endif %}
11 11
    {% if widget.required %}data-required="true"{% endif %}
12 12
    {% for attr in widget.attrs.items %}{% if attr.0 != 'readonly' %}{{attr.0}}="{{attr.1}}" {% endif %}{% endfor %}>
13
  {% for option in widget.get_options %}
14
  <option value="{{ option.value }}" {% if option.disabled %}disabled{% endif %} {% if option.selected %}selected{% endif %}>{{ option.label }}</option>
15
  {% endfor %}
16
</select>
17
{% if widget.readonly %}
18
<input readonly id="form_{{widget.get_name_for_id}}" value="{{ widget.get_selected_options_labels|join:", " }}">
19
{% endif %}
13
    {% for option in widget.get_options %}
14
      <option value="{{ option.value }}" {% if option.disabled %}disabled{% endif %} {% if option.selected %}selected{% endif %}>{{ option.label }}</option>
15
    {% endfor %}
16
  </select>
17
  {% if widget.readonly %}
18
    <input readonly id="form_{{widget.get_name_for_id}}" value="{{ widget.get_selected_options_labels|join:", " }}">
19
  {% endif %}
20 20
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/radiobuttons.html
3 3
{% block widget-css-classes %}{{ block.super }}{% if widget.field.inline %} widget-inline-radio{% endif %}{% endblock %}
4 4

  
5 5
{% block widget-control %}
6
{% for option in widget.get_options %}
7
<label for="{{ widget.get_name_for_id }}_op_{{ forloop.counter0 }}"
8
   {% if option.disabled %}class="disabled"{% endif %}><input
9
   id="{{ widget.get_name_for_id }}_op_{{ forloop.counter0 }}"
10
   {% if option.selected %}checked="checked"
11
   {% elif widget.readonly or option.disabled %}disabled="disabled"{% endif %}
12
   {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
13
   type="radio" name="{{ widget.name }}"
14
   value="{{ option.value }}"><span>{{ option.label }}</span></label>
15
   {% if not forloop.last %}{{ widget.delim|safe }}{% endif %}
16
{% endfor %}
6
  {% for option in widget.get_options %}
7
    <label for="{{ widget.get_name_for_id }}_op_{{ forloop.counter0 }}"
8
      {% if option.disabled %}class="disabled"{% endif %}><input
9
        id="{{ widget.get_name_for_id }}_op_{{ forloop.counter0 }}"
10
        {% if option.selected %}checked="checked"
11
        {% elif widget.readonly or option.disabled %}disabled="disabled"{% endif %}
12
        {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
13
        type="radio" name="{{ widget.name }}"
14
        value="{{ option.value }}"><span>{{ option.label }}</span></label>
15
    {% if not forloop.last %}{{ widget.delim|safe }}{% endif %}
16
  {% endfor %}
17 17
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/select-timetable.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2
{% load qommon i18n %}
3 3
{% block widget-control %}
4
<select style="display: none" id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
4
  <select style="display: none" id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
5 5
    {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}"{% endfor %}>
6
  <option value="">---</option>
7
  {% for option in widget.get_options %}
8
    {% with datetime=option.options.datetime|parse_datetime %}
9
    <option{% for attr in option.attrs.items %} {{attr.0}}="{{attr.1}}"{% endfor %}
6
    <option value="">---</option>
7
    {% for option in widget.get_options %}
8
      {% with datetime=option.options.datetime|parse_datetime %}
9
        <option{% for attr in option.attrs.items %} {{attr.0}}="{{attr.1}}"{% endfor %}
10 10
          data-weekday="{{ datetime|date:"l" }}"
11 11
          data-date="{{ datetime|date:"Y-m-d" }}"
12 12
          data-time="{{ datetime|date:"H:i" }}"
13
      >{{ option.description }}</option>
14
    {% endwith %}
15
  {% endfor %}
16
</select>
17
<div id="form_{{widget.get_name_for_id}}_table" class="timetable-widget meetings_table">
18
</div>
19
<script>
20
$(function() {
21
  var ALIGN_DATE = null;
22
  {% with widget.field.get_initial_date_alignment as alignment_date %}
23
    {% if alignment_date %}var ALIGN_DATE = "{{ alignment_date|date:"Y-m-d" }}";{% endif %}
24
  {% endwith %}
25
  var WEEKDAYS = ["{% trans "Sunday" %}", "{% trans "Monday" %}",
26
                  "{% trans "Tuesday" %}", "{% trans "Wednesday" %}",
27
                  "{% trans "Thursday" %}", "{% trans "Friday" %}",
28
                  "{% trans "Saturday" %}"];
29
  var $select = $('#form_{{widget.get_name_for_id}}');
30
  var $table = $('#form_{{widget.get_name_for_id}}_table');
31
  var column_count = 5;
13
        >{{ option.description }}</option>
14
      {% endwith %}
15
    {% endfor %}
16
  </select>
17
  <div id="form_{{widget.get_name_for_id}}_table" class="timetable-widget meetings_table">
18
  </div>
19
  <script>
20
    $(function() {
21
      var ALIGN_DATE = null;
22
      {% with widget.field.get_initial_date_alignment as alignment_date %}
23
        {% if alignment_date %}var ALIGN_DATE = "{{ alignment_date|date:"Y-m-d" }}";{% endif %}
24
      {% endwith %}
25
      var WEEKDAYS = ["{% trans "Sunday" %}", "{% trans "Monday" %}",
26
        "{% trans "Tuesday" %}", "{% trans "Wednesday" %}",
27
        "{% trans "Thursday" %}", "{% trans "Friday" %}",
28
        "{% trans "Saturday" %}"];
29
      var $select = $('#form_{{widget.get_name_for_id}}');
30
      var $table = $('#form_{{widget.get_name_for_id}}_table');
31
      var column_count = 5;
32 32

  
33
  function fill_with_items(items) {
34
    $select.empty();
35
    $('<option value=""></option>').appendTo($select);
36
    for (var i=0; i<items.length; i++) {
37
      var date = new Date(items[i].datetime.slice(0, 10));
38
      var $option = $('<option></option>', {
39
              value: items[i].id,
40
              text: items[i].text,
41
              'data-weekday': WEEKDAYS[date.getDay()],
42
              'data-date': items[i].datetime.slice(0, 10),
43
              'data-time': items[i].datetime.slice(11, 16)
44
      });
45
      if (items[i].disabled) {
46
          $option.prop('disabled', true);
47
      }
48
      if (items[i].selected) {
49
          $option.attr('selected', true);
33
      function fill_with_items(items) {
34
        $select.empty();
35
        $('<option value=""></option>').appendTo($select);
36
        for (var i=0; i<items.length; i++) {
37
          var date = new Date(items[i].datetime.slice(0, 10));
38
          var $option = $('<option></option>', {
39
            value: items[i].id,
40
            text: items[i].text,
41
            'data-weekday': WEEKDAYS[date.getDay()],
42
            'data-date': items[i].datetime.slice(0, 10),
43
            'data-time': items[i].datetime.slice(11, 16)
44
          });
45
          if (items[i].disabled) {
46
            $option.prop('disabled', true);
47
          }
48
          if (items[i].selected) {
49
            $option.attr('selected', true);
50
          }
51
          $option.appendTo($select);
52
        }
50 53
      }
51
      $option.appendTo($select);
52
    }
53
  }
54 54

  
55
  $select.on('wcs:options-change', function(ev, data) {
56
    if (data !== undefined) {
57
      fill_with_items(data.items);
58
    }
59
  $table.empty();
60
  var options = $select.find('option');
61
  var current_date = null;
62
  var current_day_div = null;
63
  var current_offset = null;
64
  var alignment_offset = null;
65
  var nb_days = 0;
55
      $select.on('wcs:options-change', function(ev, data) {
56
        if (data !== undefined) {
57
          fill_with_items(data.items);
58
        }
59
        $table.empty();
60
        var options = $select.find('option');
61
        var current_date = null;
62
        var current_day_div = null;
63
        var current_offset = null;
64
        var alignment_offset = null;
65
        var nb_days = 0;
66 66

  
67
  for (var i=0; i<options.length; i++) {
68
    var $option = $(options[i]);
69
    if ($option.attr('value') == '') continue;
70
    var option_date = $option.data('date');
71
    if (option_date !== current_date) {
72
      var day_label = $option.text().split(' ', 3).join(' ');
73
      if (Intl && Intl.DateTimeFormat) {
74
        // create day label from actual date, this works for event agendas.
75
        var date = new Date(option_date);
76
        var month = new Intl.DateTimeFormat('fr', {month: 'long'}).format(date);
77
        day_label = date.getDate() + ' ' + month + ' ' + date.getFullYear();
78
      }
79
      var weekday = $option.data('weekday');
80
      nb_days += 1;
81
      current_day_div = $('<div><div class="head">' + weekday + '<br>' + day_label + '</div></div>');
82
      current_day_div.appendTo($table);
83
      current_date = option_date;
84
    }
85
    var day_time = $option.data('time');
86
    var option_span = $('<span class="timetable-cell selectable" data-idx="' + i + '"><span>' + day_time + '</span></span>').appendTo(current_day_div);
87
    if ($option.attr('disabled')) {
88
      $(option_span).addClass('disabled').removeClass('selectable');
89
    }
90
    if ($option.attr('selected')) {
91
      current_offset = nb_days - 1;
92
      $(option_span).addClass('on');
93
    }
94
    if (current_offset === null && ALIGN_DATE !== null && alignment_offset === null && option_date >= ALIGN_DATE) {
95
      alignment_offset = nb_days - 1;
96
    }
97
  }
98
  if (current_offset === null && ALIGN_DATE !== null && alignment_offset === null) {
99
    alignment_offset = nb_days - 1;
100
  }
101
  if (current_offset === null && alignment_offset !== null) {
102
    current_offset = Math.max(Math.min(alignment_offset, nb_days-column_count), 0);
103
  } else if (current_offset === null) {
104
    current_offset = 0;
105
  }
106
  var go_prev = $('<button class="prev">←</button>');
107
  var go_next = $('<button class="next">→</button>');
108
  go_prev.prependTo($table);
109
  go_next.appendTo($table);
110
  go_prev.on('click', function() {
111
    current_offset = Math.max(0, current_offset - 1);
112
    display(current_offset);
113
    return false;
114
  });
115
  go_next.on('click', function() {
116
    current_offset = Math.min(current_offset + 1, Math.max(0, nb_days-column_count));
117
    display(current_offset);
118
    return false;
119
  });
67
        for (var i=0; i<options.length; i++) {
68
          var $option = $(options[i]);
69
          if ($option.attr('value') == '') continue;
70
          var option_date = $option.data('date');
71
          if (option_date !== current_date) {
72
            var day_label = $option.text().split(' ', 3).join(' ');
73
            if (Intl && Intl.DateTimeFormat) {
74
              // create day label from actual date, this works for event agendas.
75
              var date = new Date(option_date);
76
              var month = new Intl.DateTimeFormat('fr', {month: 'long'}).format(date);
77
              day_label = date.getDate() + ' ' + month + ' ' + date.getFullYear();
78
            }
79
            var weekday = $option.data('weekday');
80
            nb_days += 1;
81
            current_day_div = $('<div><div class="head">' + weekday + '<br>' + day_label + '</div></div>');
82
            current_day_div.appendTo($table);
83
            current_date = option_date;
84
          }
85
          var day_time = $option.data('time');
86
          var option_span = $('<span class="timetable-cell selectable" data-idx="' + i + '"><span>' + day_time + '</span></span>').appendTo(current_day_div);
87
          if ($option.attr('disabled')) {
88
            $(option_span).addClass('disabled').removeClass('selectable');
89
          }
90
          if ($option.attr('selected')) {
91
            current_offset = nb_days - 1;
92
            $(option_span).addClass('on');
93
          }
94
          if (current_offset === null && ALIGN_DATE !== null && alignment_offset === null && option_date >= ALIGN_DATE) {
95
            alignment_offset = nb_days - 1;
96
          }
97
        }
98
        if (current_offset === null && ALIGN_DATE !== null && alignment_offset === null) {
99
          alignment_offset = nb_days - 1;
100
        }
101
        if (current_offset === null && alignment_offset !== null) {
102
          current_offset = Math.max(Math.min(alignment_offset, nb_days-column_count), 0);
103
        } else if (current_offset === null) {
104
          current_offset = 0;
105
        }
106
        var go_prev = $('<button class="prev">←</button>');
107
        var go_next = $('<button class="next">→</button>');
108
        go_prev.prependTo($table);
109
        go_next.appendTo($table);
110
        go_prev.on('click', function() {
111
          current_offset = Math.max(0, current_offset - 1);
112
          display(current_offset);
113
          return false;
114
        });
115
        go_next.on('click', function() {
116
          current_offset = Math.min(current_offset + 1, Math.max(0, nb_days-column_count));
117
          display(current_offset);
118
          return false;
119
        });
120 120

  
121
  function display(offset) {
122
    $table.children('div').each(function(idx, elem) {
123
      if (idx >= offset && idx < offset+column_count) {
124
        $(elem).show();
125
      } else {
126
        $(elem).hide();
127
      }
128
    });
129
    if (go_prev.next().is(':visible')) {
130
      go_prev.prop('disabled', true);
131
    } else {
132
      go_prev.prop('disabled', null);
133
    }
134
    if (go_next.prev().is(':visible')) {
135
      go_next.prop('disabled', true);
136
    } else {
137
      go_next.prop('disabled', null);
138
    }
139
    current_offset = offset;
140
  }
121
        function display(offset) {
122
          $table.children('div').each(function(idx, elem) {
123
            if (idx >= offset && idx < offset+column_count) {
124
              $(elem).show();
125
            } else {
126
              $(elem).hide();
127
            }
128
          });
129
          if (go_prev.next().is(':visible')) {
130
            go_prev.prop('disabled', true);
131
          } else {
132
            go_prev.prop('disabled', null);
133
          }
134
          if (go_next.prev().is(':visible')) {
135
            go_next.prop('disabled', true);
136
          } else {
137
            go_next.prop('disabled', null);
138
          }
139
          current_offset = offset;
140
        }
141 141

  
142
  function set_layout() {
143
    if ($select.parents('form').width() > 600) {
144
      // desktop layout
145
      column_count = 5;
146
      $table.removeClass('mobile');
147
    } else {
148
      // mobile layout
149
      column_count = 1;
150
      $table.addClass('mobile');
151
    }
152
    display(current_offset);
153
    t1 = new Date();
154
  }
155
  set_layout();
156
  var layout_change_timeout_id = null;
157
  $(window).on('resize', function() {
158
    clearTimeout(layout_change_timeout_id);
159
    layout_change_timeout_id = setTimeout(set_layout, 200);
160
  });
142
        function set_layout() {
143
          if ($select.parents('form').width() > 600) {
144
            // desktop layout
145
            column_count = 5;
146
            $table.removeClass('mobile');
147
          } else {
148
            // mobile layout
149
            column_count = 1;
150
            $table.addClass('mobile');
151
          }
152
          display(current_offset);
153
          t1 = new Date();
154
        }
155
        set_layout();
156
        var layout_change_timeout_id = null;
157
        $(window).on('resize', function() {
158
          clearTimeout(layout_change_timeout_id);
159
          layout_change_timeout_id = setTimeout(set_layout, 200);
160
        });
161 161

  
162
  $table.find('span.selectable').on('click', function() {
163
   $table.find('span.timetable-cell').removeClass('on');
164
   $(this).addClass('on');
165
   $select.val($(options[$(this).data('idx')]).attr('value'));
166
   $select.parents('div.widget-prefilled').removeClass('widget-prefilled');
167
   $select.trigger('wcs:change');
168
  });
169
});
170
  $select.trigger('wcs:options-change');
171
});
172
</script>
162
        $table.find('span.selectable').on('click', function() {
163
          $table.find('span.timetable-cell').removeClass('on');
164
          $(this).addClass('on');
165
          $select.val($(options[$(this).data('idx')]).attr('value'));
166
          $select.parents('div.widget-prefilled').removeClass('widget-prefilled');
167
          $select.trigger('wcs:change');
168
        });
169
      });
170
      $select.trigger('wcs:options-change');
171
    });
172
  </script>
173 173
{% endblock %}
174 174

  
175 175
{% block widget-hint %}
176
{% if widget.hint %}<div class="hint">{{widget.hint}}</div>{% endif %}
176
  {% if widget.hint %}<div class="hint">{{widget.hint}}</div>{% endif %}
177 177
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/select.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2
{% block widget-control %}
3
<select id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
3
  <select id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
4 4
    {% if widget.select2 %}data-autocomplete="true"{% endif %}
5 5
    {% if widget.required %}data-required="true"{% endif %}
6 6
    {% for attr in widget.attrs.items %}{% if attr.0 != 'readonly' %}{{attr.0}}="{{attr.1}}"{% endif %}{% endfor %}>
7
  {% if not widget.separate_hint and widget.hint %}
8
  <option value="" data-hint="{{ widget.hint }}">{% if not widget.select2 %}{{ widget.hint }}{% endif %}</option>
9
  {% endif %}
10
  {% for option in widget.get_options %}
11
  <option{% for attr in option.attrs.items %} {{attr.0}}="{{attr.1}}"{% endfor %}>{{ option.description }}</option>
12
  {% empty %}
13
    {% if widget.separate_hint or not widget.hint %}
14
    <option value="">---</option>
7
    {% if not widget.separate_hint and widget.hint %}
8
      <option value="" data-hint="{{ widget.hint }}">{% if not widget.select2 %}{{ widget.hint }}{% endif %}</option>
15 9
    {% endif %}
16
  {% endfor %}
17
</select>
10
    {% for option in widget.get_options %}
11
      <option{% for attr in option.attrs.items %} {{attr.0}}="{{attr.1}}"{% endfor %}>{{ option.description }}</option>
12
    {% empty %}
13
      {% if widget.separate_hint or not widget.hint %}
14
        <option value="">---</option>
15
      {% endif %}
16
    {% endfor %}
17
  </select>
18 18
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/select_jsonp--address.html
1 1
{% extends "qommon/forms/widgets/select_jsonp.html" %}
2 2
{% load i18n %}
3 3
{% block widget-control %}
4
{{ block.super }}
5
{% if not widget.readonly %}
6
<div>
7
<label><input class="wcs-manual-address" type="checkbox"><span>{% trans "If you cannot find this address in the list you can check this box to manually enter it." %}</span></label>
8
</div>
9
{% endif %}
4
  {{ block.super }}
5
  {% if not widget.readonly %}
6
    <div>
7
      <label><input class="wcs-manual-address" type="checkbox"><span>{% trans "If you cannot find this address in the list you can check this box to manually enter it." %}</span></label>
8
    </div>
9
  {% endif %}
10 10
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/select_jsonp.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2
{% load i18n %}
3 3
{% block widget-control %}
4
<div class="wcs-widget-select2-container">
5
<select id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
6
    data-select2-url="{{widget.get_select2_url}}"
7
    {% if widget.value %}data-value="{{ widget.value }}"{% endif %}
8
    data-required="{% if widget.is_required %}true{% endif %}"
9
    data-initial-display-value="{{widget.get_display_value|default_if_none:''}}">
10
</select>
11
{% if widget.add_related_url %}
12
<a class="add-related pk-button" id="add_form_{{ widget.get_name_for_id }}"
13
    href="{{ widget.add_related_url }}?_popup=1"
14
    title="{% blocktrans with card=widget.get_title %}Add another {{ card }}{% endblocktrans %}">+</a>
15
{% endif %}
16
</div>
4
  <div class="wcs-widget-select2-container">
5
    <select id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
6
      data-select2-url="{{widget.get_select2_url}}"
7
      {% if widget.value %}data-value="{{ widget.value }}"{% endif %}
8
      data-required="{% if widget.is_required %}true{% endif %}"
9
      data-initial-display-value="{{widget.get_display_value|default_if_none:''}}">
10
    </select>
11
    {% if widget.add_related_url %}
12
      <a class="add-related pk-button" id="add_form_{{ widget.get_name_for_id }}"
13
        href="{{ widget.add_related_url }}?_popup=1"
14
        title="{% blocktrans with card=widget.get_title %}Add another {{ card }}{% endblocktrans %}">+</a>
15
    {% endif %}
16
  </div>
17 17
{% endblock %}
wcs/qommon/templates/qommon/forms/widgets/time.html
1 1
{% extends "qommon/forms/widget.html" %}
2 2

  
3 3
{% block widget-control %}
4
<input id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
5
  type="{% if "readonly" in widget.attrs %}text{% else %}time{% endif %}"
6
  {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
7
  {% if widget.required %}aria-required="true"{% endif %}
8
  {% if "readonly" in widget.attrs %}
9
    {% if widget.value %}value="{{ widget.value }}"{% endif %}
10
  {% else %}
4
  <input id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
5
    type="{% if "readonly" in widget.attrs %}text{% else %}time{% endif %}"
6
    {% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
7
    {% if widget.required %}aria-required="true"{% endif %}
8
    {% if "readonly" in widget.attrs %}
9
      {% if widget.value %}value="{{ widget.value }}"{% endif %}
10
    {% else %}
11 11

  
12
  value="{{ widget.value|default:"" }}" data-formatted-value="{{ widget.value|default:"" }}"
13
  class="date-pick"
14
  data-date-format="hh:ii"
12
      value="{{ widget.value|default:"" }}" data-formatted-value="{{ widget.value|default:"" }}"
13
      class="date-pick"
14
      data-date-format="hh:ii"
15 15

  
16
  data-min-view="0"
17
  data-max-view="0"
18
  data-start-view="0"
16
      data-min-view="0"
17
      data-max-view="0"
18
      data-start-view="0"
19 19

  
20
  {% endif %}
20
    {% endif %}
21 21
  >
22 22
{% endblock %}
23 23

  
wcs/qommon/templates/qommon/saml-error.html
2 2
{% load i18n %}
3 3

  
4 4
{% block body %}
5
<div class="warningnotice">{% trans "There was a temporary error during your authentication, please retry later." %}</div>
5
  <div class="warningnotice">{% trans "There was a temporary error during your authentication, please retry later." %}</div>
6 6

  
7
<form method="post">
7
  <form method="post">
8 8
    <button>{% trans "Retry" %}</button>
9
</form>
9
  </form>
10 10
{% endblock %}
wcs/templates/wcs/action.html
2 2
{% load i18n %}
3 3

  
4 4
{% block body %}
5
{% if done %}
6
<p>
7
{% if done_message %}
8
{{ done_message }}
9
{% else %}
10
{% trans "The action has been confirmed.  You can now close this window." %}
11
{% endif %}
12
</p>
13
{% else %}
14
<p>
15
{% if message %}
16
{{ message }}
17
{% else %}
18
{% trans "Please confirm action." %}
19
{% endif %}
20
</p>
21
{{ html_form.render|safe }}
22
{% endif %}
5
  {% if done %}
6
    <p>
7
      {% if done_message %}
8
        {{ done_message }}
9
      {% else %}
10
        {% trans "The action has been confirmed.  You can now close this window." %}
11
      {% endif %}
12
    </p>
13
  {% else %}
14
    <p>
15
      {% if message %}
16
        {{ message }}
17
      {% else %}
18
        {% trans "Please confirm action." %}
19
      {% endif %}
20
    </p>
21
    {{ html_form.render|safe }}
22
  {% endif %}
23 23
{% endblock %}
wcs/templates/wcs/backoffice-legacy.html
1 1
{% extends "wcs/backoffice.html" %}
2 2

  
3 3
{% block main-content %}
4
{{ body|safe }}
4
  {{ body|safe }}
5 5
{% endblock %}
6 6

  
wcs/templates/wcs/backoffice.html
5 5
{% block footer %}w.c.s. — Copyright © Entr'ouvert{% endblock %}
6 6

  
7 7
{% block gadjo-js %}
8
{{script|safe}}
8
  {{script|safe}}
9 9
{% endblock %}
10 10

  
11 11
{% block gadjo-css %}
12
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/qommon.css?{% version_hash %}"/>
13
{{ block.super }}
14
{% block css %}{% endblock %}
15
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/dc2/admin.css?{% version_hash %}"/>
12
  <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/qommon.css?{% version_hash %}"/>
13
  {{ block.super }}
14
  {% block css %}{% endblock %}
15
  <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/dc2/admin.css?{% version_hash %}"/>
16 16
{% endblock %}
17 17

  
18 18
{% block bodyargs %}class="section-{{section}} {% if admin_for_all %}admin-for-all{% endif %}"{% endblock %}
......
27 27
{% endblock %}
28 28

  
29 29
{% block sidepage %}
30
<div id="sidepage">
31
  <span id="applabel">{{app_label}}</span>
32
  {{ header_menu|safe }}
33
</div>
30
  <div id="sidepage">
31
    <span id="applabel">{{app_label}}</span>
32
    {{ header_menu|safe }}
33
  </div>
34 34
{% endblock %}
35 35

  
36 36
{% block main-content %}
37 37
  {% block content %}
38 38
    {% block appbar %}
39
<div id="appbar">
40
<h2>{% block appbar-title %}{% endblock %}</h2>
41
<span class="actions">{% block appbar-actions %}{% endblock %}</span>
42
</div>
39
      <div id="appbar">
40
        <h2>{% block appbar-title %}{% endblock %}</h2>
41
        <span class="actions">{% block appbar-actions %}{% endblock %}</span>
42
      </div>
43 43
    {% endblock %}
44 44
    {% block session-message %}
45
{{session_message|safe}}
45
      {{session_message|safe}}
46 46
    {% endblock %}
47 47
  {% endblock %}
48 48
{% endblock %}
49 49

  
50 50
{% block sidebar %}
51
{% if sidebar or has_sidebar %}
52
<aside id="sidebar">
53
  <span id="sidebar-toggle">&#8286;</span>
54
  <div id="sticky-sidebar">
55
    {% block sidebar-content %}
56
    {{ sidebar|safe }}
57
    {% endblock %}
58
  </div>
59
</aside>
60
{% endif %}
51
  {% if sidebar or has_sidebar %}
52
    <aside id="sidebar">
53
      <span id="sidebar-toggle">&#8286;</span>
54
      <div id="sticky-sidebar">
55
        {% block sidebar-content %}
56
          {{ sidebar|safe }}
57
        {% endblock %}
58
      </div>
59
    </aside>
60
  {% endif %}
61 61
{% endblock %}
wcs/templates/wcs/backoffice/api_access.html
1 1
{% load i18n %}
2 2

  
3 3
{% block body %}
4
<div id="appbar">
5
  <h2>{% trans "API access" %} - {{ api_access.name }}</h2>
6
<span class="actions">
7
  <a href="delete" rel="popup">{% trans "Delete" %}</a>
8
  <a href="edit">{% trans "Edit" %}</a>
9
</span>
10
</div>
4
  <div id="appbar">
5
    <h2>{% trans "API access" %} - {{ api_access.name }}</h2>
6
    <span class="actions">
7
      <a href="delete" rel="popup">{% trans "Delete" %}</a>
8
      <a href="edit">{% trans "Edit" %}</a>
9
    </span>
10
  </div>
11 11

  
12
{% if api_access.description %}
13
<div class="bo-block">{{ api_access.description }}</div>
14
{% endif %}
12
  {% if api_access.description %}
13
    <div class="bo-block">{{ api_access.description }}</div>
14
  {% endif %}
15 15

  
16
<div class="bo-block">
17
  <h3>{% trans "Parameters" %}</h3>
18
  <ul>
19
    <li>{% trans "Access identifier:" %} {{ api_access.access_identifier }}</li>
20
    <li>{% trans "Access key:" %} {{ api_access.access_key }}</li>
21
    {% if api_access.restrict_to_anonymised_data %}<li>{% trans "Restricted to anonymised data" %}</li>{% endif %}
22
    {% if api_access.get_roles %}
23
    <li>{% trans "Roles:" %}
24
      <ul>
25
      {% for role in api_access.get_roles %}<li>{{ role.name }}</li>{% endfor %}
26
      </ul>
27
    </li>
28
    {% endif %}
29
  </ul>
30
</div>
16
  <div class="bo-block">
17
    <h3>{% trans "Parameters" %}</h3>
18
    <ul>
19
      <li>{% trans "Access identifier:" %} {{ api_access.access_identifier }}</li>
20
      <li>{% trans "Access key:" %} {{ api_access.access_key }}</li>
21
      {% if api_access.restrict_to_anonymised_data %}<li>{% trans "Restricted to anonymised data" %}</li>{% endif %}
22
      {% if api_access.get_roles %}
23
        <li>{% trans "Roles:" %}
24
          <ul>
25
            {% for role in api_access.get_roles %}<li>{{ role.name }}</li>{% endfor %}
26
          </ul>
27
        </li>
28
      {% endif %}
29
    </ul>
30
  </div>
31 31
{% endblock %}
wcs/templates/wcs/backoffice/api_accesses.html
4 4
{% block appbar-title %}{% trans "API access" %}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
<a rel="popup" href="new">{% trans "New API access" %}</a>
7
  <a rel="popup" href="new">{% trans "New API access" %}</a>
8 8
{% endblock %}
9 9

  
10 10
{% block content %}
11
{% if api_accesses %}
12
<ul class="objects-list single-links">
13
  {% for api_access in api_accesses %}
14
  <li><a href="{{ api_access.id }}/">{{ api_access.name }} ({{ api_access.access_identifier }})</a></li>
15
  {% endfor %}
16
</ul>
17
{% else %}
18
<div class="infonotice">
19
{% trans "There are no API access defined." %}
20
</div>
21
{% endif %}
11
  {% if api_accesses %}
12
    <ul class="objects-list single-links">
13
      {% for api_access in api_accesses %}
14
        <li><a href="{{ api_access.id }}/">{{ api_access.name }} ({{ api_access.access_identifier }})</a></li>
15
      {% endfor %}
16
    </ul>
17
  {% else %}
18
    <div class="infonotice">
19
      {% trans "There are no API access defined." %}
20
    </div>
21
  {% endif %}
22 22
{% endblock %}
wcs/templates/wcs/backoffice/base.html
1 1
{% block appbar %}
2
<div id="appbar">
3
<h2>{% block appbar-title %}{% endblock %}</h2>
4
<span class="actions">{% block appbar-actions %}{% endblock %}</span>
5
</div>
2
  <div id="appbar">
3
    <h2>{% block appbar-title %}{% endblock %}</h2>
4
    <span class="actions">{% block appbar-actions %}{% endblock %}</span>
5
  </div>
6 6
{% endblock %}
7 7

  
8 8
{% block session-message %}
9
{{session_message|safe}}
9
  {{session_message|safe}}
10 10
{% endblock %}
11 11

  
12 12
{% block content %}
wcs/templates/wcs/backoffice/block-inspect.html
5 5

  
6 6
{% block content %}
7 7

  
8
<div class="pk-tabs inspect-tabs inspect-form-tabs">
9
 <div class="pk-tabs--tab-list" role="tablist">
10
  <button role="tab" aria-selected="true" aria-controls="inspect-infos" id="tab-infos" tabindex="0">{% trans "Information" %}</button>
11
  <button role="tab" aria-selected="false" aria-controls="inspect-fields" id="tab-fields" tabindex="-1">{% trans "Fields" %}</button>
12
 </div>
13
 <div class="pk-tabs--container">
8
  <div class="pk-tabs inspect-tabs inspect-form-tabs">
9
    <div class="pk-tabs--tab-list" role="tablist">
10
      <button role="tab" aria-selected="true" aria-controls="inspect-infos" id="tab-infos" tabindex="0">{% trans "Information" %}</button>
11
      <button role="tab" aria-selected="false" aria-controls="inspect-fields" id="tab-fields" tabindex="-1">{% trans "Fields" %}</button>
12
    </div>
13
    <div class="pk-tabs--container">
14 14

  
15
 <div id="inspect-infos" role="tabpanel" tabindex="0" aria-labelledby="tab-info">
16
<ul>
17
<li><span class="parameter">{% trans "Title" %}{% trans ":" %}</span> {{ blockdef.name|default:"-" }}</li>
18
<li><span class="parameter">{% trans "Category" %}{% trans ":" %}</span> {% if blockdef.category %}<a href="{{ blockdef.category.get_admin_url }}">{{ blockdef.category.name }}</a>{% else %}-{% endif %}</li>
19
<li><span class="parameter">{% trans "Digest Template" %}{% trans ":" %}</span> {{ blockdef.digest_template|default:"-" }}</li>
20
</ul>
21
</div>
15
      <div id="inspect-infos" role="tabpanel" tabindex="0" aria-labelledby="tab-info">
16
        <ul>
17
          <li><span class="parameter">{% trans "Title" %}{% trans ":" %}</span> {{ blockdef.name|default:"-" }}</li>
18
          <li><span class="parameter">{% trans "Category" %}{% trans ":" %}</span> {% if blockdef.category %}<a href="{{ blockdef.category.get_admin_url }}">{{ blockdef.category.name }}</a>{% else %}-{% endif %}</li>
19
          <li><span class="parameter">{% trans "Digest Template" %}{% trans ":" %}</span> {{ blockdef.digest_template|default:"-" }}</li>
20
        </ul>
21
      </div>
22 22

  
23
<div id="inspect-fields" role="tabpanel" tabindex="0" aria-labelledby="tab-fields" hidden>
24
{% for field in blockdef.fields %}
25
{% include "wcs/backoffice/includes/inspect-field.html" with path=blockdef.get_admin_url %}
26
{% endfor %}
27
</div>
28
</div>
23
      <div id="inspect-fields" role="tabpanel" tabindex="0" aria-labelledby="tab-fields" hidden>
24
        {% for field in blockdef.fields %}
25
          {% include "wcs/backoffice/includes/inspect-field.html" with path=blockdef.get_admin_url %}
26
        {% endfor %}
27
      </div>
28
    </div>
29 29

  
30
</div>
30
  </div>
31 31
{% endblock %}
wcs/templates/wcs/backoffice/blocks.html
4 4
{% block appbar-title %}{% trans "Field Blocks" %}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
<a href="categories/">{% trans "Categories" %}</a>
8
<a rel="popup" href="import">{% trans "Import" %}</a>
9
<a rel="popup" href="new">{% trans "New field block" %}</a>
7
  <a href="categories/">{% trans "Categories" %}</a>
8
  <a rel="popup" href="import">{% trans "Import" %}</a>
9
  <a rel="popup" href="new">{% trans "New field block" %}</a>
10 10
{% endblock %}
11 11

  
12 12
{% block content %}
13
{% if categories %}
14
{% for category in categories %}
15
  {% if category.blocks %}
16
  <div class="section">
17
    <h2>{{ category.name }}</h2>
13
  {% if categories %}
14
    {% for category in categories %}
15
      {% if category.blocks %}
16
        <div class="section">
17
          <h2>{{ category.name }}</h2>
18
          <ul class="objects-list single-links">
19
            {% for block in category.blocks %}
20
              <li><a href="{{ block.id }}/">{{ block.name }}</a></li>
21
            {% endfor %}
22
          </ul>
23
        </div>
24
      {% endif %}
25
    {% endfor %}
26
  {% elif blocks %}
18 27
    <ul class="objects-list single-links">
19
      {% for block in category.blocks %}
20
      <li><a href="{{ block.id }}/">{{ block.name }}</a></li>
28
      {% for block in blocks %}
29
        <li><a href="{{ block.id }}/">{{ block.name }}</a></li>
21 30
      {% endfor %}
22 31
    </ul>
23
  </div>
32
  {% else %}
33
    <div class="infonotice">
34
      {% trans "There are no field blocks defined." %}
35
    </div>
24 36
  {% endif %}
25
{% endfor %}
26
{% elif blocks %}
27
<ul class="objects-list single-links">
28
  {% for block in blocks %}
29
  <li><a href="{{ block.id }}/">{{ block.name }}</a></li>
30
  {% endfor %}
31
</ul>
32
{% else %}
33
<div class="infonotice">
34
{% trans "There are no field blocks defined." %}
35
</div>
36
{% endif %}
37 37
{% endblock %}
wcs/templates/wcs/backoffice/card-data-import-form.html
2 2
{% load i18n %}
3 3

  
4 4
{% block appbar %}
5
<div id="appbar">
6
<h2>{% trans "Import File" %}</h2>
7
</div>
5
  <div id="appbar">
6
    <h2>{% trans "Import File" %}</h2>
7
  </div>
8 8
{% endblock %}
9 9

  
10 10
{% block content %}
11 11

  
12
<p>{% trans "You can add data to this card by uploading a file." %}</p>
12
  <p>{% trans "You can add data to this card by uploading a file." %}</p>
13 13

  
14
{% if not impossible_csv_fields %}
15
<p><a href="data-sample-csv">{% trans "Download sample CSV file for this card" %}</a></p>
16
{% else %}
17
<div class="warningnotice">
18
  <p>
19
  {% blocktrans count fields=impossible_csv_fields|length with labels=impossible_csv_fields|join:", " %}
20
  {{ labels }} is required but cannot be filled from CSV.
21
  {% plural %}
22
  {{ labels }} are required but cannot be filled from CSV.
23
  {% endblocktrans %}
24
  {% trans "Only JSON files can be imported." %}
25
  </p>
26
</div>
27
{% endif %}
14
  {% if not impossible_csv_fields %}
15
    <p><a href="data-sample-csv">{% trans "Download sample CSV file for this card" %}</a></p>
16
  {% else %}
17
    <div class="warningnotice">
18
      <p>
19
        {% blocktrans count fields=impossible_csv_fields|length with labels=impossible_csv_fields|join:", " %}
20
          {{ labels }} is required but cannot be filled from CSV.
21
        {% plural %}
22
          {{ labels }} are required but cannot be filled from CSV.
23
        {% endblocktrans %}
24
        {% trans "Only JSON files can be imported." %}
25
      </p>
26
    </div>
27
  {% endif %}
28 28

  
29
{{ html_form.render|safe }}
29
  {{ html_form.render|safe }}
30 30

  
31 31
{% endblock %}
wcs/templates/wcs/backoffice/cards.html
4 4
{% block appbar-title %}{% trans "Card Models" %}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
{% if is_global_accessible_forms %}
8
  <a href="../forms/data-sources/">{% trans "Data sources" %}</a>
9
  <a href="../forms/blocks/">{% trans "Fields blocks" %}</a>
10
{% endif %}
11
{% if is_global_accessible_cards %}
12
  <a href="categories/">{% trans "Categories" %}</a>
13
{% endif %}
14
<a rel="popup" href="import">{% trans "Import" %}</a>
15
<a rel="popup" href="new">{% trans "New Card Model" %}</a>
7
  {% if is_global_accessible_forms %}
8
    <a href="../forms/data-sources/">{% trans "Data sources" %}</a>
9
    <a href="../forms/blocks/">{% trans "Fields blocks" %}</a>
10
  {% endif %}
11
  {% if is_global_accessible_cards %}
12
    <a href="categories/">{% trans "Categories" %}</a>
13
  {% endif %}
14
  <a rel="popup" href="import">{% trans "Import" %}</a>
15
  <a rel="popup" href="new">{% trans "New Card Model" %}</a>
16 16
{% endblock %}
17 17

  
18 18
{% block no-objects %}
19
{% trans "There are no card models defined." %}
19
  {% trans "There are no card models defined." %}
20 20
{% endblock %}
wcs/templates/wcs/backoffice/category.html
4 4
{% block appbar-title %}{{ category.name }}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
{% if not category.is_readonly %}
8
<a href="delete" rel="popup">{% trans "Delete" %}</a>
9
<a href="edit">{% trans "Edit" %}</a>
10
{% endif %}
7
  {% if not category.is_readonly %}
8
    <a href="delete" rel="popup">{% trans "Delete" %}</a>
9
    <a href="edit">{% trans "Edit" %}</a>
10
  {% endif %}
11 11
{% endblock %}
12 12

  
13 13
{% block content %}
14
{{ block.super }}
14
  {{ block.super }}
15 15

  
16
{% if not category.snapshot_object %}{{ view.last_modification_block|safe }}{% endif %}
16
  {% if not category.snapshot_object %}{{ view.last_modification_block|safe }}{% endif %}
17 17

  
18
{% if category.description %}
19
<div class="bo-block">{{ category.get_description_html_text|safe }}</div>
20
{% endif %}
18
  {% if category.description %}
19
    <div class="bo-block">{{ category.get_description_html_text|safe }}</div>
20
  {% endif %}
21 21

  
22
{% if not category.snapshot_object %}
23
<div class="section">
24
<h3>{% trans view.usage_title %}</h3>
25
{% with view.get_formdefs as formdefs %}
26
  {% if formdefs %}
27
  <ul class="objects-list single-links">
28
  {% for formdef in formdefs %}
29
  <li><a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a></li>
30
  {% endfor %}
31
  </ul>
32
  {% else %}
33
  <div><p>{% trans view.empty_message %}</p></div>
22
  {% if not category.snapshot_object %}
23
    <div class="section">
24
      <h3>{% trans view.usage_title %}</h3>
25
      {% with view.get_formdefs as formdefs %}
26
        {% if formdefs %}
27
          <ul class="objects-list single-links">
28
            {% for formdef in formdefs %}
29
              <li><a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a></li>
30
            {% endfor %}
31
          </ul>
32
        {% else %}
33
          <div><p>{% trans view.empty_message %}</p></div>
34
        {% endif %}
35
      {% endwith %}
36
    </div>
34 37
  {% endif %}
35
{% endwith %}
36
</div>
37
{% endif %}
38 38

  
39
{% if category.export_roles or category.statistics_roles or category.management_roles %}
40
<div class="section">
41
<h3>{% trans "Permissions" %}</h3>
42
<div>
43
  <ul>
44
    {% if category.management_roles %}
45
    <li>{% trans "Management roles:" %}
46
      <ul>
47
      {% for role in category.management_roles %}<li>{{ role.name }}</li>{% endfor %}
48
      </ul>
49
    </li>
50
    {% endif %}
51
    {% if category.export_roles %}
52
    <li>{% trans "Export roles:" %}
53
      <ul>
54
      {% for role in category.export_roles %}<li>{{ role.name }}</li>{% endfor %}
55
      </ul>
56
    </li>
57
    {% endif %}
58
    {% if category.statistics_roles %}
59
    <li>{% trans "Statistics roles:" %}
60
      <ul>
61
      {% for role in category.statistics_roles %}<li>{{ role.name }}</li>{% endfor %}
62
      </ul>
63
    </li>
64
    {% endif %}
65
  </ul>
66
</div>
67
</div>
68
{% endif %}
39
  {% if category.export_roles or category.statistics_roles or category.management_roles %}
40
    <div class="section">
41
      <h3>{% trans "Permissions" %}</h3>
42
      <div>
43
        <ul>
44
          {% if category.management_roles %}
45
            <li>{% trans "Management roles:" %}
46
              <ul>
47
                {% for role in category.management_roles %}<li>{{ role.name }}</li>{% endfor %}
48
              </ul>
49
            </li>
50
          {% endif %}
51
          {% if category.export_roles %}
52
            <li>{% trans "Export roles:" %}
53
              <ul>
54
                {% for role in category.export_roles %}<li>{{ role.name }}</li>{% endfor %}
55
              </ul>
56
            </li>
57
          {% endif %}
58
          {% if category.statistics_roles %}
59
            <li>{% trans "Statistics roles:" %}
60
              <ul>
61
                {% for role in category.statistics_roles %}<li>{{ role.name }}</li>{% endfor %}
62
              </ul>
63
            </li>
64
          {% endif %}
65
        </ul>
66
      </div>
67
    </div>
68
  {% endif %}
69 69
{% endblock %}
wcs/templates/wcs/backoffice/changes.html
4 4
{% block appbar-title %}{% trans "All changes" context 'studio' %}{% endblock %}
5 5

  
6 6
{% block content %}
7
<ul class="objects-list single-links">
8
  {% for obj in objects %}
9
  <li>
10
    <a href="{{ obj.get_admin_url }}">
11
      {{ obj.name }}
12
      <span class="extra-info">{{ obj.snapshot_timestamp }}</span>
13
      <span class="badge">{{ obj.verbose_name }}</span>
14
    </a>
15
  </li>
16
  {% endfor %}
17
</ul>
18
{{ pagination_links|safe }}
7
  <ul class="objects-list single-links">
8
    {% for obj in objects %}
9
      <li>
10
        <a href="{{ obj.get_admin_url }}">
11
          {{ obj.name }}
12
          <span class="extra-info">{{ obj.snapshot_timestamp }}</span>
13
          <span class="badge">{{ obj.verbose_name }}</span>
14
        </a>
15
      </li>
16
    {% endfor %}
17
  </ul>
18
  {{ pagination_links|safe }}
19 19
{% endblock %}
wcs/templates/wcs/backoffice/data-management.html
4 4
{% block appbar-title %}{% trans "Cards" %}{% endblock %}
5 5

  
6 6
{% block content %}
7
{% regroup view.get_carddefs by category.id as category_list %}
8
<ul class="biglist">
9
  {% for category_id, object_list in category_list %}
10
    {% if not forloop.first or category_id %}<li><h3>{{ object_list.0.category.name|default:_('Misc') }}</h3></li>{% endif %}
11
    {% for carddef in object_list %}
12
    <li><a href="{{ carddef.url_name }}/">{{ carddef.name }}</a></li>
7
  {% regroup view.get_carddefs by category.id as category_list %}
8
  <ul class="biglist">
9
    {% for category_id, object_list in category_list %}
10
      {% if not forloop.first or category_id %}<li><h3>{{ object_list.0.category.name|default:_('Misc') }}</h3></li>{% endif %}
11
      {% for carddef in object_list %}
12
        <li><a href="{{ carddef.url_name }}/">{{ carddef.name }}</a></li>
13
      {% endfor %}
13 14
    {% endfor %}
14
  {% endfor %}
15
</ul>
15
  </ul>
16 16
{% endblock %}
wcs/templates/wcs/backoffice/data-source.html
1 1
{% load i18n %}
2 2

  
3 3
{% block body %}
4
<div id="appbar">
5
<h2>{% trans "Data Source" %} - {{ datasource.name }}</h2>
6
<span class="actions">
7
  {% if not datasource.is_readonly %}
8
  <a href="edit">{% trans "Edit" %}</a>
4
  <div id="appbar">
5
    <h2>{% trans "Data Source" %} - {{ datasource.name }}</h2>
6
    <span class="actions">
7
      {% if not datasource.is_readonly %}
8
        <a href="edit">{% trans "Edit" %}</a>
9
      {% endif %}
10
    </span>
11
  </div>
12

  
13
  {% if datasource.description %}
14
    <div class="bo-block">{{ datasource.description }}</div>
9 15
  {% endif %}
10
</span>
11
</div>
12 16

  
13
{% if datasource.description %}
14
<div class="bo-block">{{ datasource.description }}</div>
15
{% endif %}
17
  {% if datasource.data_source %}
18
    <div class="section">
19
      <h3>{% trans "Configuration" %}</h3>
20
      <ul>
21
        {% if datasource.agenda_ds %}
22
          {% with datasource.agenda_ds_origin as origin %}
23
            <li>{% trans "Type of source:" %} {% trans "Agenda data" %}{% if origin %} ({% trans "Copy of:" %} <a href="{{ origin.get_admin_url }}">{{ origin.name }}</a>){% endif %}</li>
24
            <li>{% trans "URL:" %} <a href="{{ url }}">{{ datasource.data_source.value }}</a></li>
25
            {% if datasource.qs_data %}
26
              <li>{% trans "Extra query string data:" %}
27
                <ul>
28
                  {% for k, v in datasource.qs_data.items %}
29
                    <li>{% blocktrans %}{{ k }}:{% endblocktrans %} {{ v }}</li>
30
                  {% endfor %}
31
                </ul>
32
              </li>
33
            {% endif %}
34
          {% endwith %}
35
        {% else %}
36
          <li>{% trans "Type of source:" %} {{ datasource.type_label }}</li>
37
          {% if datasource.data_source.type == 'json' or datasource.data_source.type == 'jsonp' or datasource.data_source.type == 'geojson' %}
38
            <li>{% trans "URL:" %} <a href="{{ url }}">{{ datasource.data_source.value }}</a></li>
39
          {% elif datasource.data_source.type == 'formula' %}
40
            <li>{% trans "Python Expression:" %} {{ datasource.data_source.value }}</li>
41
          {% elif datasource.data_source.type == 'wcs:users' %}
42
            {% spaceless %}
43
              <li>{% trans "Users with roles:" %}
44
                <ul>
45
                  {% for role in roles %}
46
                    {% if role.0 in datasource.users_included_roles %}
47
                      <li>{{ role.1 }}</li>
48
                    {% endif %}
49
                  {% endfor %}
50
                </ul>
51
              </li>
52
              <li>{% trans "Users without roles:" %}
53
                <ul>
54
                  {% for role in roles %}
55
                    {% if role.0 in datasource.users_excluded_roles %}
56
                      <li>{{ role.1 }}</li>
57
                    {% endif %}
58
                  {% endfor %}
59
                </ul>
60
              </li>
61
              <li>{% trans "Include disabled users:" %}
62
                {% if datasource.include_disabled_users %}
63
                  {% trans "Yes" %}
64
                {% else %}
65
                  {% trans "No" %}
66
                {% endif %}
67
              </li>
68
            {% endspaceless %}
69
          {% endif %}
70
        {% endif %}
71
        {% if datasource.cache_duration %}
72
          <li>{% trans "Cache Duration:" %} {{ datasource.humanized_cache_duration }}
73
        {% endif %}
74
        {% if not datasource.data_source.type == 'wcs:users' %}
75
          <li>{% trans "Notify on errors:" %} {{ datasource.notify_on_errors|yesno }}</li>
76
          <li>{% trans "Record on errors:" %} {{ datasource.record_on_errors|yesno }}</li>
77
        {% endif %}
78
      </ul>
79
    </div>
16 80

  
17
{% if datasource.data_source %}
18
<div class="section">
19
<h3>{% trans "Configuration" %}</h3>
20
<ul>
21
  {% if datasource.agenda_ds %}
22
   {% with datasource.agenda_ds_origin as origin %}
23
   <li>{% trans "Type of source:" %} {% trans "Agenda data" %}{% if origin %} ({% trans "Copy of:" %} <a href="{{ origin.get_admin_url }}">{{ origin.name }}</a>){% endif %}</li>
24
    <li>{% trans "URL:" %} <a href="{{ url }}">{{ datasource.data_source.value }}</a></li>
25
    {% if datasource.qs_data %}
26
    <li>{% trans "Extra query string data:" %}
27
        <ul>
28
          {% for k, v in datasource.qs_data.items %}
29
            <li>{% blocktrans %}{{ k }}:{% endblocktrans %} {{ v }}</li>
30
          {% endfor %}
31
        </ul>
32
      </li>
33
    {% endif %}
81
    {% with preview_block=view.preview_block %}
82
      {% if preview_block %}
83
        <div class="section">
84
          <h3>{% trans "Preview (first items only)" %}</h3>
85
          <div class="data-source-preview">
86
            {{ view.preview_block|safe }}
87
          </div>
88
        </div>
89
      {% endif %}
34 90
    {% endwith %}
35
  {% else %}
36
    <li>{% trans "Type of source:" %} {{ datasource.type_label }}</li>
37
    {% if datasource.data_source.type == 'json' or datasource.data_source.type == 'jsonp' or datasource.data_source.type == 'geojson' %}
38
    <li>{% trans "URL:" %} <a href="{{ url }}">{{ datasource.data_source.value }}</a></li>
39
    {% elif datasource.data_source.type == 'formula' %}
40
    <li>{% trans "Python Expression:" %} {{ datasource.data_source.value }}</li>
41
    {% elif datasource.data_source.type == 'wcs:users' %}
42
    {% spaceless %}
43
    <li>{% trans "Users with roles:" %}
44
        <ul>
45
            {% for role in roles %}
46
            {% if role.0 in datasource.users_included_roles %}
47
            <li>{{ role.1 }}</li>
48
            {% endif %}
49
            {% endfor %}
50
        </ul>
51
    </li>
52
    <li>{% trans "Users without roles:" %}
53
        <ul>
54
            {% for role in roles %}
55
            {% if role.0 in datasource.users_excluded_roles %}
56
            <li>{{ role.1 }}</li>
57
            {% endif %}
91

  
92
    {% with formdefs=view.usage_in_formdefs %}
93
      {% if formdefs %}
94
        <div class="section">
95
          <h3>{% trans "Usage in forms" %}</h3>
96
          <ul class="objects-list single-links">
97
            {% for formdef in formdefs %}
98
              <li><a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a></li>
58 99
            {% endfor %}
59
        </ul>
60
    </li>
61
    <li>{% trans "Include disabled users:" %}
62
      {% if datasource.include_disabled_users %}
63
        {% trans "Yes" %}
64
      {% else %}
65
        {% trans "No" %}
100
          </ul>
101
        </div>
66 102
      {% endif %}
67
    </li>
68
    {% endspaceless %}
69
    {% endif %}
70
  {% endif %}
71
  {% if datasource.cache_duration %}
72
  <li>{% trans "Cache Duration:" %} {{ datasource.humanized_cache_duration }}
73
  {% endif %}
74
  {% if not datasource.data_source.type == 'wcs:users' %}
75
    <li>{% trans "Notify on errors:" %} {{ datasource.notify_on_errors|yesno }}</li>
76
    <li>{% trans "Record on errors:" %} {{ datasource.record_on_errors|yesno }}</li>
77
  {% endif %}
78
</ul>
79
</div>
80

  
81
{% with preview_block=view.preview_block %}
82
{% if preview_block %}
83
  <div class="section">
84
  <h3>{% trans "Preview (first items only)" %}</h3>
85
  <div class="data-source-preview">
86
  {{ view.preview_block|safe }}
87
  </div>
88
  </div>
89
{% endif %}
90
{% endwith %}
103
    {% endwith %}
91 104

  
92
{% with formdefs=view.usage_in_formdefs %}
93
  {% if formdefs %}
94
  <div class="section">
95
  <h3>{% trans "Usage in forms" %}</h3>
96
  <ul class="objects-list single-links">
97
  {% for formdef in formdefs %}
98
    <li><a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a></li>
99
  {% endfor %}
100
  </ul>
101
  </div>
105
  {% else %}
106
    <p class="infonotice">{% trans "Not configured" %}</p>
102 107
  {% endif %}
103
{% endwith %}
104

  
105
{% else %}
106
<p class="infonotice">{% trans "Not configured" %}</p>
107
{% endif %}
108 108

  
109 109
{% endblock %}
wcs/templates/wcs/backoffice/data-sources.html
4 4
{% block appbar-title %}{% trans "Data Sources" %}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
<a href="categories/">{% trans "Categories" %}</a>
8
{% if has_chrono %}
9
<a href="sync-agendas">{% trans "Refresh agendas" %}</a>
10
{% endif %}
11
<a data-popup href="import">{% trans "Import" %}</a>
12
{% if has_users %}
13
<a href="new-users">{% trans "New User Data Source" %}</a>
14
{% endif %}
15
<a href="new">{% trans "New Data Source" %}</a>
7
  <a href="categories/">{% trans "Categories" %}</a>
8
  {% if has_chrono %}
9
    <a href="sync-agendas">{% trans "Refresh agendas" %}</a>
10
  {% endif %}
11
  <a data-popup href="import">{% trans "Import" %}</a>
12
  {% if has_users %}
13
    <a href="new-users">{% trans "New User Data Source" %}</a>
14
  {% endif %}
15
  <a href="new">{% trans "New Data Source" %}</a>
16 16
{% endblock %}
17 17

  
18 18
{% block content %}
19
{% if has_users %}
20
<div class="section foldable">
21
<h2>{% trans "Users Data Sources" %}</h2>
22
{% if user_data_sources %}
23
<ul class="objects-list single-links">
24
  {% for data_source in user_data_sources %}
25
  <li><a href="{{ data_source.id }}/">{{ data_source.name }} ({{ data_source.slug }})</a></li>
26
  {% endfor %}
27
</ul>
28
{% else %}
29
<div>
30
{% trans "There are no users data sources defined." %}
31
</div>
32
{% endif %}
33
</div>
34
{% endif %}
19
  {% if has_users %}
20
    <div class="section foldable">
21
      <h2>{% trans "Users Data Sources" %}</h2>
22
      {% if user_data_sources %}
23
        <ul class="objects-list single-links">
24
          {% for data_source in user_data_sources %}
25
            <li><a href="{{ data_source.id }}/">{{ data_source.name }} ({{ data_source.slug }})</a></li>
26
          {% endfor %}
27
        </ul>
28
      {% else %}
29
        <div>
30
          {% trans "There are no users data sources defined." %}
31
        </div>
32
      {% endif %}
33
    </div>
34
  {% endif %}
35 35

  
36
{% if categories %}
37
{% for category in categories %}
38
  {% if category.data_sources %}
39
  <div class="section foldable">
40
    <h2>{{ category.name }}</h2>
41
    <ul class="objects-list single-links">
42
      {% for data_source in category.data_sources %}
43
      <li><a href="{{ data_source.id }}/">{{ data_source.name }} ({{ data_source.slug }})</a></li>
44
      {% endfor %}
45
    </ul>
46
  </div>
36
  {% if categories %}
37
    {% for category in categories %}
38
      {% if category.data_sources %}
39
        <div class="section foldable">
40
          <h2>{{ category.name }}</h2>
41
          <ul class="objects-list single-links">
42
            {% for data_source in category.data_sources %}
43
              <li><a href="{{ data_source.id }}/">{{ data_source.name }} ({{ data_source.slug }})</a></li>
44
            {% endfor %}
45
          </ul>
46
        </div>
47
      {% endif %}
48
    {% endfor %}
49
  {% else %}
50
    {% if data_sources %}
51
      <div class="section foldable">
52
        <h2>{% trans "Manually Configured Data Sources" %}</h2>
53
        <ul class="objects-list single-links">
54
          {% for data_source in data_sources %}
55
            <li><a href="{{ data_source.id }}/">{{ data_source.name }} ({{ data_source.slug }})</a></li>
56
          {% endfor %}
57
        </ul>
58
      </div>
59
    {% else %}
60
      <div>
61
        {% trans "There are no data sources defined." %}
62
      </div>
63
    {% endif %}
47 64
  {% endif %}
48
{% endfor %}
49
{% else %}
50
{% if data_sources %}
51
<div class="section foldable">
52
<h2>{% trans "Manually Configured Data Sources" %}</h2>
53
<ul class="objects-list single-links">
54
  {% for data_source in data_sources %}
55
  <li><a href="{{ data_source.id }}/">{{ data_source.name }} ({{ data_source.slug }})</a></li>
56
  {% endfor %}
57
</ul>
58
</div>
59
{% else %}
60
<div>
61
{% trans "There are no data sources defined." %}
62
</div>
63
{% endif %}
64
{% endif %}
65 65

  
66
<div class="section foldable">
67
<h2>{% trans "Data Sources from Card Models" %}  - {% trans "automatically configured" %}</h2>
68
{% if generated_data_sources %}
69
<ul class="objects-list single-links">
70
  {% for data_source in generated_data_sources %}
71
  <li><a href="{{ data_source.0.get_url }}{% if data_source.3 %}{{ data_source.3.get_url_slug }}/{% endif %}">{{ data_source.1 }}</a></li>
72
  {% endfor %}
73
</ul>
74
{% else %}
75
<div>
76
{% trans "There are no data sources from card models." %}
77
</div>
78
{% endif %}
79
</div>
66
  <div class="section foldable">
67
    <h2>{% trans "Data Sources from Card Models" %}  - {% trans "automatically configured" %}</h2>
68
    {% if generated_data_sources %}
69
      <ul class="objects-list single-links">
70
        {% for data_source in generated_data_sources %}
71
          <li><a href="{{ data_source.0.get_url }}{% if data_source.3 %}{{ data_source.3.get_url_slug }}/{% endif %}">{{ data_source.1 }}</a></li>
72
        {% endfor %}
73
      </ul>
74
    {% else %}
75
      <div>
76
        {% trans "There are no data sources from card models." %}
77
      </div>
78
    {% endif %}
79
  </div>
80 80

  
81
{% if has_chrono %}
82
<div class="section foldable">
83
<h2>{% trans "Agendas" %} - {% trans "automatically configured" %}</h2>
84
{% if agenda_data_sources %}
85
<ul class="objects-list single-links">
86
  {% for data_source in agenda_data_sources %}
87
  <li><a href="{{ data_source.id }}/">{{ data_source.name }} ({{ data_source.slug }}){% if data_source.external_status == 'not-found' %} - <span class="extra-info">{% trans "not found" %}</span>{% endif %}</a></li>
88
  {% endfor %}
89
</ul>
90
{% else %}
91
<div>
92
{% trans "There are no agendas." %}
93
</div>
94
{% endif %}
95
</div>
96
{% endif %}
81
  {% if has_chrono %}
82
    <div class="section foldable">
83
      <h2>{% trans "Agendas" %} - {% trans "automatically configured" %}</h2>
84
      {% if agenda_data_sources %}
85
        <ul class="objects-list single-links">
86
          {% for data_source in agenda_data_sources %}
87
            <li><a href="{{ data_source.id }}/">{{ data_source.name }} ({{ data_source.slug }}){% if data_source.external_status == 'not-found' %} - <span class="extra-info">{% trans "not found" %}</span>{% endif %}</a></li>
88
          {% endfor %}
89
        </ul>
90
      {% else %}
91
        <div>
92
          {% trans "There are no agendas." %}
93
        </div>
94
      {% endif %}
95
    </div>
96
  {% endif %}
97 97
{% endblock %}
wcs/templates/wcs/backoffice/deprecations.html
3 3

  
4 4
{% block content %}
5 5

  
6
<div id="appbar">
7
<h2>{% trans "Deprecations Report" %}</h2>
8
<span class="actions">
9
<a href="scan">{% trans "Rescan for deprecations" %}</a>
10
</span>
11
</div>
6
  <div id="appbar">
7
    <h2>{% trans "Deprecations Report" %}</h2>
8
    <span class="actions">
9
      <a href="scan">{% trans "Rescan for deprecations" %}</a>
10
    </span>
11
  </div>
12 12

  
13
{% if not report.report_lines %}
14
<div class="no-deprecations">
15
        <p>{% trans "No deprecated items were found on this site." %}</p>
16
</div>
13
  {% if not report.report_lines %}
14
    <div class="no-deprecations">
15
      <p>{% trans "No deprecated items were found on this site." %}</p>
16
    </div>
17 17

  
18
{% else %}
19
<div class="section deprecations">
18
  {% else %}
19
    <div class="section deprecations">
20 20

  
21
{% regroup report.report_lines by category as category_report_lines %}
22
{% for category in category_report_lines %}
23
<h3>{{ view.titles|get:category.grouper }}</h3>
24
<div class="section--{{ category.grouper }}">
25
<div class="pk-information">
26
  <p>{{ view.short_docs|get:category.grouper }}
27
  <a href="{{ view.help_urls|get:category.grouper }}">{% trans "Read more" %}</a></p>
28
</div>
29
<ul>
30
 {% for report_line in category.list %}
31
 <li><a href="{{ report_line.url }}">{{ report_line.location_label }}</a></li>
32
 {% endfor %}
33
</ul>
34
</div>
35
{% endfor %}
36
</div>
21
      {% regroup report.report_lines by category as category_report_lines %}
22
      {% for category in category_report_lines %}
23
        <h3>{{ view.titles|get:category.grouper }}</h3>
24
        <div class="section--{{ category.grouper }}">
25
          <div class="pk-information">
26
            <p>{{ view.short_docs|get:category.grouper }}
27
              <a href="{{ view.help_urls|get:category.grouper }}">{% trans "Read more" %}</a></p>
28
          </div>
29
          <ul>
30
            {% for report_line in category.list %}
31
              <li><a href="{{ report_line.url }}">{{ report_line.location_label }}</a></li>
32
            {% endfor %}
33
          </ul>
34
        </div>
35
      {% endfor %}
36
    </div>
37 37

  
38
<p>{% trans "Generated on:" %} {{ report.now|datetime }}</p>
39
{% endif %}
38
    <p>{% trans "Generated on:" %} {{ report.now|datetime }}</p>
39
  {% endif %}
40 40

  
41 41
{% endblock %}
wcs/templates/wcs/backoffice/error.html
2 2
{% load i18n %}
3 3

  
4 4
{% block content %}
5
<div class="error-page pk-error">
6
<h2>{{ title }}</h2>
7
<p>{{ error_message }}</p>
8
<p><a href="javascript: window.history.back();">{% trans "Go back" %}</a></p>
9
</div>
5
  <div class="error-page pk-error">
6
    <h2>{{ title }}</h2>
7
    <p>{{ error_message }}</p>
8
    <p><a href="javascript: window.history.back();">{% trans "Go back" %}</a></p>
9
  </div>
10 10
{% endblock %}
wcs/templates/wcs/backoffice/formdata-inspect.html
4 4
{% block appbar-title %}{% trans "Data Inspector" %}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
{% for action in actions %}
8
<a href="{{ action.url }}">{{ action.label }}</a>
9
{% endfor %}
7
  {% for action in actions %}
8
    <a href="{{ action.url }}">{{ action.label }}</a>
9
  {% endfor %}
10 10
{% endblock %}
11 11

  
12 12
{% block content %}
13
{{ block.super }}
13
  {{ block.super }}
14 14

  
15
<div id="inspect-test-tools" class="section">
16
<h2>{% trans "Test tools" %}</h2>
17
<div>
18
{{ html_form.render|safe }}
19
<div id="test-tool-result">
20
{{ view.test_tool_result|safe }}
21
</div>
22
</div>
23
</div>
15
  <div id="inspect-test-tools" class="section">
16
    <h2>{% trans "Test tools" %}</h2>
17
    <div>
18
      {{ html_form.render|safe }}
19
      <div id="test-tool-result">
20
        {{ view.test_tool_result|safe }}
21
      </div>
22
    </div>
23
  </div>
24 24

  
25
<div class="pk-tabs inspect-tabs">
26
 <div class="pk-tabs--tab-list" role="tablist">
27
  <button role="tab" aria-selected="true" aria-controls="inspect-variables" id="tab-variables" tabindex="0">{% trans "Variables" %}</button>
28
  {% if view.formdef.workflow.roles %}
29
  <button role="tab" aria-selected="false" aria-controls="inspect-functions" id="tab-functions" tabindex="-1">{% trans "Functions" %}</button>
30
  {% endif %}
31
  {% if has_tracing %}
32
  <button role="tab" aria-selected="false" aria-controls="inspect-timeline" id="tab-timeline" tabindex="-1">{% trans "Actions Tracing" %}</button>
33
  {% endif %}
34
  {% if has_markers_stack %}
35
  <button role="tab" aria-selected="false" aria-controls="inspect-markers" id="tab-markers" tabindex="-1">{% trans "Markers Stack" %}</button>
36
  {% endif %}
37
  {% if has_relations %}
38
  <button role="tab" aria-selected="false" aria-controls="inspect-relations" id="tab-relations" tabindex="-1">{% trans "Related Forms/Cards" %}</button>
39
  {% endif %}
40
 </div>
41
 <div class="pk-tabs--container">
25
  <div class="pk-tabs inspect-tabs">
26
    <div class="pk-tabs--tab-list" role="tablist">
27
      <button role="tab" aria-selected="true" aria-controls="inspect-variables" id="tab-variables" tabindex="0">{% trans "Variables" %}</button>
28
      {% if view.formdef.workflow.roles %}
29
        <button role="tab" aria-selected="false" aria-controls="inspect-functions" id="tab-functions" tabindex="-1">{% trans "Functions" %}</button>
30
      {% endif %}
31
      {% if has_tracing %}
32
        <button role="tab" aria-selected="false" aria-controls="inspect-timeline" id="tab-timeline" tabindex="-1">{% trans "Actions Tracing" %}</button>
33
      {% endif %}
34
      {% if has_markers_stack %}
35
        <button role="tab" aria-selected="false" aria-controls="inspect-markers" id="tab-markers" tabindex="-1">{% trans "Markers Stack" %}</button>
36
      {% endif %}
37
      {% if has_relations %}
38
        <button role="tab" aria-selected="false" aria-controls="inspect-relations" id="tab-relations" tabindex="-1">{% trans "Related Forms/Cards" %}</button>
39
      {% endif %}
40
    </div>
41
    <div class="pk-tabs--container">
42 42

  
43
<div id="inspect-variables" role="tabpanel" tabindex="0" aria-labelledby="tab-variables">
44
<ul class="form-inspector biglist">
45
{{ view.inspect_variables|safe }}
46
</ul>
47
</div>
43
      <div id="inspect-variables" role="tabpanel" tabindex="0" aria-labelledby="tab-variables">
44
        <ul class="form-inspector biglist">
45
          {{ view.inspect_variables|safe }}
46
        </ul>
47
      </div>
48 48

  
49
{% if view.formdef.workflow.roles %}
50
<div id="inspect-functions" role="tabpanel" tabindex="0" aria-labelledby="tab-functions" hidden>
51
<ul class="form-inspector biglist">
52
{{ view.inspect_functions|safe }}
53
</ul>
54
</div>
55
{% endif %}
49
      {% if view.formdef.workflow.roles %}
50
        <div id="inspect-functions" role="tabpanel" tabindex="0" aria-labelledby="tab-functions" hidden>
51
          <ul class="form-inspector biglist">
52
            {{ view.inspect_functions|safe }}
53
          </ul>
54
        </div>
55
      {% endif %}
56 56

  
57
{% if has_tracing %}
58
<div id="inspect-timeline" role="tabpanel" tabindex="0" aria-labelledby="tab-timeline" hidden>
59
<ul class="form-inspector biglist">
60
{{ view.inspect_tracing|safe }}
61
</ul>
62
</div>
63
{% endif %}
57
      {% if has_tracing %}
58
        <div id="inspect-timeline" role="tabpanel" tabindex="0" aria-labelledby="tab-timeline" hidden>
59
          <ul class="form-inspector biglist">
60
            {{ view.inspect_tracing|safe }}
61
          </ul>
62
        </div>
63
      {% endif %}
64 64

  
65
{% if has_markers_stack %}
66
<div id="inspect-markers" role="tabpanel" tabindex="0" aria-labelledby="tab-markers" hidden>
67
<ul class="form-inspector biglist">
68
{{ view.inspect_markers_stack|safe }}
69
</ul>
70
</div>
71
{% endif %}
65
      {% if has_markers_stack %}
66
        <div id="inspect-markers" role="tabpanel" tabindex="0" aria-labelledby="tab-markers" hidden>
67
          <ul class="form-inspector biglist">
68
            {{ view.inspect_markers_stack|safe }}
69
          </ul>
70
        </div>
71
      {% endif %}
72 72

  
73
{% if has_relations %}
74
<div id="inspect-relations" role="tabpanel" tabindex="0" aria-labelledby="tab-relations" hidden>
75
<ul class="form-inspector biglist">
76
{{ view.inspect_relations|safe }}
77
</ul>
78
</div>
79
{% endif %}
73
      {% if has_relations %}
74
        <div id="inspect-relations" role="tabpanel" tabindex="0" aria-labelledby="tab-relations" hidden>
75
          <ul class="form-inspector biglist">
76
            {{ view.inspect_relations|safe }}
77
          </ul>
78
        </div>
79
      {% endif %}
80 80

  
81
</div>
82
</div>
81
    </div>
82
  </div>
83 83
{% endblock %}
wcs/templates/wcs/backoffice/formdef-inspect.html
5 5

  
6 6
{% block content %}
7 7

  
8
<div class="pk-tabs inspect-tabs inspect-form-tabs">
9
 <div class="pk-tabs--tab-list" role="tablist">
10
  <button role="tab" aria-selected="true" aria-controls="inspect-infos" id="tab-infos" tabindex="0">{% trans "Information" %}</button>
11
  <button role="tab" aria-selected="false" aria-controls="inspect-workflow" id="tab-workflow" tabindex="-1">{% trans "Workflow" %}</button>
12
  <button role="tab" aria-selected="false" aria-controls="inspect-options" id="tab-options" tabindex="-1">{% trans "Options" %}</button>
13
  <button role="tab" aria-selected="false" aria-controls="inspect-fields" id="tab-fields" tabindex="-1">{% trans "Fields" %}</button>
14
 </div>
15
 <div class="pk-tabs--container">
8
  <div class="pk-tabs inspect-tabs inspect-form-tabs">
9
    <div class="pk-tabs--tab-list" role="tablist">
10
      <button role="tab" aria-selected="true" aria-controls="inspect-infos" id="tab-infos" tabindex="0">{% trans "Information" %}</button>
11
      <button role="tab" aria-selected="false" aria-controls="inspect-workflow" id="tab-workflow" tabindex="-1">{% trans "Workflow" %}</button>
12
      <button role="tab" aria-selected="false" aria-controls="inspect-options" id="tab-options" tabindex="-1">{% trans "Options" %}</button>
13
      <button role="tab" aria-selected="false" aria-controls="inspect-fields" id="tab-fields" tabindex="-1">{% trans "Fields" %}</button>
14
    </div>
15
    <div class="pk-tabs--container">
16 16

  
17
 <div id="inspect-infos" role="tabpanel" tabindex="0" aria-labelledby="tab-info">
18
<ul>
19
<li><span class="parameter">{% trans "Title" %}{% trans ":" %}</span> {{ formdef.name|default:"-" }}</li>
20
<li><span class="parameter">{% trans "Description" %}{% trans ":" %}</span> {{ formdef.description|default:"-"|safe }}</li>
21
<li><span class="parameter">{% trans "Keywords" %}{% trans ":" %}</span> {{ formdef.keywords|default:"-" }}</li>
22
<li><span class="parameter">{% trans "Category" %}{% trans ":" %}</span> {% if formdef.category %}<a href="{{ formdef.category.get_admin_url }}">{{ formdef.category.name }}</a>{% else %}-{% endif %}</li>
23
</ul>
24
</div>
17
      <div id="inspect-infos" role="tabpanel" tabindex="0" aria-labelledby="tab-info">
18
        <ul>
19
          <li><span class="parameter">{% trans "Title" %}{% trans ":" %}</span> {{ formdef.name|default:"-" }}</li>
20
          <li><span class="parameter">{% trans "Description" %}{% trans ":" %}</span> {{ formdef.description|default:"-"|safe }}</li>
21
          <li><span class="parameter">{% trans "Keywords" %}{% trans ":" %}</span> {{ formdef.keywords|default:"-" }}</li>
22
          <li><span class="parameter">{% trans "Category" %}{% trans ":" %}</span> {% if formdef.category %}<a href="{{ formdef.category.get_admin_url }}">{{ formdef.category.name }}</a>{% else %}-{% endif %}</li>
23
        </ul>
24
      </div>
25 25

  
26
<div id="inspect-workflow" role="tabpanel" tabindex="0" aria-labelledby="tab-workflow" hidden>
27
<ul>
28
<li><span class="parameter">{% trans "Workflow" %}{% trans ":" %}</span> <a href="{{ formdef.workflow.get_admin_url }}">{{ formdef.workflow.name }}</a></li>
29
<li><span class="parameter">{% trans "Options" %}{% trans ":" %}</span> {% if not workflow_options %}-{% else %}<ul>
30
  {% for label, value in workflow_options.items %}
31
  {% if value == '__title__' or value == '__subtitle__' %}<li><strong>{{ label }}</strong></li>
32
  {% elif value == '__comment__' %}<li>{{ label }}</li>
33
  {% else %}
34
  <li>{{ label }} → {{ value|safe|default:"-" }}</li>
35
  {% endif %}
36
  {% endfor %}
37
</ul>{% endif %}</li>
38
{% for wf_role_id, wf_role_label, role_label in workflow_roles %}
39
<li><span class="parameter">{{ wf_role_label }}{% trans ":" %}</span> {{ role_label|default:"-" }}</li>
40
{% endfor %}
41
<li><span class="parameter">{% trans "User Roles" %}{% trans ":" %}</span> {{ view.get_roles_label_and_auth_context|default:"-" }}</li>
42
<li><span class="parameter">{% trans "Backoffice Submission Role" %}{% trans ":" %}</span> {{ backoffice_submission_roles|default:"-" }}</li>
43
</ul>
44
</div>
26
      <div id="inspect-workflow" role="tabpanel" tabindex="0" aria-labelledby="tab-workflow" hidden>
27
        <ul>
28
          <li><span class="parameter">{% trans "Workflow" %}{% trans ":" %}</span> <a href="{{ formdef.workflow.get_admin_url }}">{{ formdef.workflow.name }}</a></li>
29
          <li><span class="parameter">{% trans "Options" %}{% trans ":" %}</span> {% if not workflow_options %}-{% else %}<ul>
30
            {% for label, value in workflow_options.items %}
31
              {% if value == '__title__' or value == '__subtitle__' %}<li><strong>{{ label }}</strong></li>
32
              {% elif value == '__comment__' %}<li>{{ label }}</li>
33
              {% else %}
34
                <li>{{ label }} → {{ value|safe|default:"-" }}</li>
35
              {% endif %}
36
            {% endfor %}
37
          </ul>{% endif %}</li>
38
          {% for wf_role_id, wf_role_label, role_label in workflow_roles %}
39
            <li><span class="parameter">{{ wf_role_label }}{% trans ":" %}</span> {{ role_label|default:"-" }}</li>
40
          {% endfor %}
41
          <li><span class="parameter">{% trans "User Roles" %}{% trans ":" %}</span> {{ view.get_roles_label_and_auth_context|default:"-" }}</li>
42
          <li><span class="parameter">{% trans "Backoffice Submission Role" %}{% trans ":" %}</span> {{ backoffice_submission_roles|default:"-" }}</li>
43
        </ul>
44
      </div>
45 45

  
46
<div id="inspect-options" role="tabpanel" tabindex="0" aria-labelledby="tab-options" hidden>
47
<ul>
48
 <li><span class="parameter">{% trans "Confirmation Page" %}{% trans ":" %}</span> {{ formdef.confirmation|yesno }}</li>
49
 <li><span class="parameter">{% trans "Limit to one form" %}{% trans ":" %}</span> {{ formdef.only_allow_one|yesno }}</li>
50
 {% if formdef.roles %}
51
 <li><span class="parameter">{% trans "Display to unlogged users" %}{% trans ":" %}</span> {{ formdef.always_advertise|yesno }}</li>
52
 {% endif %}
53
 <li><span class="parameter">{% trans "Include button to download all files" %}{% trans ":" %}</span> {{ formdef.include_download_all_button|yesno }}</li>
54
 <li><span class="parameter">{% trans "Skip from per user view" %}{% trans ":" %}</span> {{ formdef.skip_from_360_view|yesno }}</li>
55
 <li><span class="parameter">{% trans "Tracking codes" %}{% trans ":" %}</span> {{ formdef.enable_tracking_codes|yesno }}</li>
56
 {% if formdef.enable_tracking_codes %}
57
 <li><span class="parameter">{% trans "Fields to check after entering the tracking code" %}{% trans ":" %}</span> {{ tracking_code_verify_fields_labels|default:"-" }}</li>
58
 {% endif %}
59
 <li><span class="parameter">{% trans "Lifespan of drafts (in days)" %}{% trans ":" %}</span> {{ formdef.drafts_lifespan|default_if_none:_('default value') }}</li>
60
 <li><span class="parameter">{% trans "Templates" %}</span>
61
   <ul>
62
     <li><span class="parameter">{% trans "Digest" %}{% trans ":" %}</span> {{ formdef.default_digest_template|default:"-" }}</li>
63
     <li><span class="parameter">{% trans "Lateral Block" %}{% trans ":" %}</span> {{ formdef.lateral_template|default:"-" }}</li>
64
     <li><span class="parameter">{% trans "Submission Lateral Block" %}{% trans ":" %}</span> {{ formdef.submission_lateral_template|default:"-" }}</li>
65
   </ul>
66
 </li>
67
 <li><span class="parameter">{% trans "Disable access to form" %}{% trans ":" %}</span> {{ formdef.disabled|yesno }}</li>
68
 <li><span class="parameter">{% trans "Redirection when disabled" %}{% trans ":" %}</span> {{ formdef.disabled_redirection|default:"-" }}</li>
69
 <li><span class="parameter">{% trans "Publication date" %}{% trans ":" %}</span> {{ formdef.publication_date|default:"-" }}</li>
70
 <li><span class="parameter">{% trans "Expiration date" %}{% trans ":" %}</span> {{ formdef.expiration_date|default:"-" }}</li>
46
      <div id="inspect-options" role="tabpanel" tabindex="0" aria-labelledby="tab-options" hidden>
47
        <ul>
48
          <li><span class="parameter">{% trans "Confirmation Page" %}{% trans ":" %}</span> {{ formdef.confirmation|yesno }}</li>
49
          <li><span class="parameter">{% trans "Limit to one form" %}{% trans ":" %}</span> {{ formdef.only_allow_one|yesno }}</li>
50
          {% if formdef.roles %}
51
            <li><span class="parameter">{% trans "Display to unlogged users" %}{% trans ":" %}</span> {{ formdef.always_advertise|yesno }}</li>
52
          {% endif %}
53
          <li><span class="parameter">{% trans "Include button to download all files" %}{% trans ":" %}</span> {{ formdef.include_download_all_button|yesno }}</li>
54
          <li><span class="parameter">{% trans "Skip from per user view" %}{% trans ":" %}</span> {{ formdef.skip_from_360_view|yesno }}</li>
55
          <li><span class="parameter">{% trans "Tracking codes" %}{% trans ":" %}</span> {{ formdef.enable_tracking_codes|yesno }}</li>
56
          {% if formdef.enable_tracking_codes %}
57
            <li><span class="parameter">{% trans "Fields to check after entering the tracking code" %}{% trans ":" %}</span> {{ tracking_code_verify_fields_labels|default:"-" }}</li>
58
          {% endif %}
59
          <li><span class="parameter">{% trans "Lifespan of drafts (in days)" %}{% trans ":" %}</span> {{ formdef.drafts_lifespan|default_if_none:_('default value') }}</li>
60
          <li><span class="parameter">{% trans "Templates" %}</span>
61
            <ul>
62
              <li><span class="parameter">{% trans "Digest" %}{% trans ":" %}</span> {{ formdef.default_digest_template|default:"-" }}</li>
63
              <li><span class="parameter">{% trans "Lateral Block" %}{% trans ":" %}</span> {{ formdef.lateral_template|default:"-" }}</li>
64
              <li><span class="parameter">{% trans "Submission Lateral Block" %}{% trans ":" %}</span> {{ formdef.submission_lateral_template|default:"-" }}</li>
65
            </ul>
66
          </li>
67
          <li><span class="parameter">{% trans "Disable access to form" %}{% trans ":" %}</span> {{ formdef.disabled|yesno }}</li>
68
          <li><span class="parameter">{% trans "Redirection when disabled" %}{% trans ":" %}</span> {{ formdef.disabled_redirection|default:"-" }}</li>
69
          <li><span class="parameter">{% trans "Publication date" %}{% trans ":" %}</span> {{ formdef.publication_date|default:"-" }}</li>
70
          <li><span class="parameter">{% trans "Expiration date" %}{% trans ":" %}</span> {{ formdef.expiration_date|default:"-" }}</li>
71 71

  
72
</ul>
73
</div>
72
        </ul>
73
      </div>
74 74

  
75
<div id="inspect-fields" role="tabpanel" tabindex="0" aria-labelledby="tab-fields" hidden>
76
<div class="pk-information page-field-counters"><p>
77
{% blocktrans count page_count=formdef.page_count %}{{ page_count }} page{% plural %}{{ page_count }} pages{% endblocktrans %},
78
{% blocktrans count fields_count=formdef.fields|count %}{{ fields_count }} field{% plural %}{{ fields_count }} fields{% endblocktrans %}.
79
</p></div>
80
{% for field in formdef.fields %}
81
{% include "wcs/backoffice/includes/inspect-field.html" with path=formdef.get_admin_url|add:"fields/" %}
82
{% endfor %}
83
</div>
84
</div>
75
      <div id="inspect-fields" role="tabpanel" tabindex="0" aria-labelledby="tab-fields" hidden>
76
        <div class="pk-information page-field-counters"><p>
77
          {% blocktrans count page_count=formdef.page_count %}{{ page_count }} page{% plural %}{{ page_count }} pages{% endblocktrans %},
78
          {% blocktrans count fields_count=formdef.fields|count %}{{ fields_count }} field{% plural %}{{ fields_count }} fields{% endblocktrans %}.
79
        </p></div>
80
        {% for field in formdef.fields %}
81
          {% include "wcs/backoffice/includes/inspect-field.html" with path=formdef.get_admin_url|add:"fields/" %}
82
        {% endfor %}
83
      </div>
84
    </div>
85 85

  
86
</div>
86
  </div>
87 87
{% endblock %}
wcs/templates/wcs/backoffice/forms.html
4 4
{% block appbar-title %}{% trans "Forms" %}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
{% if has_roles %}
8
  {% if is_global_accessible_forms %}
9
  <a href="data-sources/">{% trans "Data sources" %}</a>
10
  <a href="blocks/">{% trans "Fields blocks" %}</a>
11
    {% if is_global_accessible_categories %}
12
    <a href="categories/">{% trans "Categories" %}</a>
7
  {% if has_roles %}
8
    {% if is_global_accessible_forms %}
9
      <a href="data-sources/">{% trans "Data sources" %}</a>
10
      <a href="blocks/">{% trans "Fields blocks" %}</a>
11
      {% if is_global_accessible_categories %}
12
        <a href="categories/">{% trans "Categories" %}</a>
13
      {% endif %}
13 14
    {% endif %}
15
    <a rel="popup" href="import">{% trans "Import" %}</a>
16
    <a rel="popup" href="new">{% trans "New Form" %}</a>
14 17
  {% endif %}
15
  <a rel="popup" href="import">{% trans "Import" %}</a>
16
  <a rel="popup" href="new">{% trans "New Form" %}</a>
17
{% endif %}
18 18
{% endblock %}
19 19

  
20 20
{% block content %}
21
{% if not has_roles %}
22
<p>{% trans "You first have to define roles." %}</p>
23
{% elif objects %}
24
{% for category in categories %}
25
  {% if category.objects %}
26
  <div class="section">
27
    {% if category.name %}<h2>{{ category.name }}</h2>{% endif %}
28
    <ul class="objects-list single-links">
29
      {% for item in category.objects %}
30
      <li {% if item.disabled %}class="disabled"{% endif %}><a href="{{ item.id }}/">{{ item.name }}
31
        {% if item.disabled and item.disabled_redirection %}
32
        <span class="extra-info">- {% trans "redirection" %}</span>
33
        {% endif %}
34
        </a>
35
      </li>
36
      {% endfor %}
37
    </ul>
38
  </div>
21
  {% if not has_roles %}
22
    <p>{% trans "You first have to define roles." %}</p>
23
  {% elif objects %}
24
    {% for category in categories %}
25
      {% if category.objects %}
26
        <div class="section">
27
          {% if category.name %}<h2>{{ category.name }}</h2>{% endif %}
28
          <ul class="objects-list single-links">
29
            {% for item in category.objects %}
30
              <li {% if item.disabled %}class="disabled"{% endif %}><a href="{{ item.id }}/">{{ item.name }}
31
                {% if item.disabled and item.disabled_redirection %}
32
                  <span class="extra-info">- {% trans "redirection" %}</span>
33
                {% endif %}
34
              </a>
35
              </li>
36
            {% endfor %}
37
          </ul>
38
        </div>
39
      {% endif %}
40
    {% endfor %}
41
  {% else %}
42
    <div class="infonotice">
43
      {% block no-objects %}
44
        {% trans "There are no forms defined." %}
45
      {% endblock %}
46
    </div>
39 47
  {% endif %}
40
{% endfor %}
41
{% else %}
42
<div class="infonotice">
43
{% block no-objects %}
44
{% trans "There are no forms defined." %}
45
{% endblock %}
46
</div>
47
{% endif %}
48 48
{% endblock %}
wcs/templates/wcs/backoffice/includes/inspect-field.html
1 1
<div class="inspect-field inspect-field--{{ field.key }} {% if forloop.first %}inspect-field--first{% endif %}"
2
     data-field-id="{{ field.id }}">
3
<h4><a href="{{ path|default:"fields/" }}{{ field.id }}/">{{ field.ellipsized_label }}</a>
4
     <span class="inspect-field-type">-
5
             {% if field.key == 'block' %}<a href="{{ field.block.get_admin_url }}inspect">{% endif %}
6
             {{ field.get_type_label }}
7
             {% if field.key == 'block' %}</a>{% endif %}
8
     </span>
9
</h4>
10
{{ field.get_parameters_view|safe }}
2
  data-field-id="{{ field.id }}">
3
  <h4><a href="{{ path|default:"fields/" }}{{ field.id }}/">{{ field.ellipsized_label }}</a>
4
    <span class="inspect-field-type">-
5
      {% if field.key == 'block' %}<a href="{{ field.block.get_admin_url }}inspect">{% endif %}
6
      {{ field.get_type_label }}
7
      {% if field.key == 'block' %}</a>{% endif %}
8
    </span>
9
  </h4>
10
  {{ field.get_parameters_view|safe }}
11 11
</div>
wcs/templates/wcs/backoffice/logged-error.html
5 5

  
6 6
{% block content %}
7 7

  
8
<div class="pk-tabs logged-error-tabs">
9
 <div class="pk-tabs--tab-list" role="tablist">
10
  <button role="tab" aria-selected="true" aria-controls="panel-general" id="tab-general" tabindex="0">{% trans "General" %}</button>
11
  {% for tab in tabs %}
12
  <button role="tab" aria-selected="false" aria-controls="panel-{{ tab.slug }}" id="tab-{{ tab.slug }}" tabindex="-1">{{ tab.label }}</button>
13
  {% endfor %}
14
 </div>
15
 <div class="pk-tabs--container">
8
  <div class="pk-tabs logged-error-tabs">
9
    <div class="pk-tabs--tab-list" role="tablist">
10
      <button role="tab" aria-selected="true" aria-controls="panel-general" id="tab-general" tabindex="0">{% trans "General" %}</button>
11
      {% for tab in tabs %}
12
        <button role="tab" aria-selected="false" aria-controls="panel-{{ tab.slug }}" id="tab-{{ tab.slug }}" tabindex="-1">{{ tab.label }}</button>
13
      {% endfor %}
14
    </div>
15
    <div class="pk-tabs--container">
16 16

  
17
 <div id="panel-general" role="tabpanel" tabindex="0" aria-labelledby="tab-general">
18
<ul>
19
 <li>{% trans "First occurence:" %} {{ error.first_occurence_timestamp }}</li>
20
 <li>{% trans "Latest occurence:" %} {{ error.latest_occurence_timestamp }}</li>
21
 <li>{% trans "Count:" %} {{ error.formatted_occurences_count }}</li>
22
 {% if formdef %}
23
 <li>{{ formdef.verbose_name }}{% trans ":" %} <a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a>
24
         (<a href="{{ formdef.get_admin_url }}inspect">{% trans "inspector" %}</a>)</li>
25
 {% endif %}
26
 {% if workflow %}
27
 <li>{% trans "Workflow:" %} <a href="{{ workflow.get_admin_url }}">{{ workflow.name }}</a>
28
         (<a href="{{ workflow.get_admin_url }}inspect">{% trans "inspector" %}</a>)
29
   {% if status %}
30
     <ul>
31
       <li>{% trans "Status:" %} <a href="{{ workflow.get_admin_url }}status/{{ status.id }}/">{{ status.name }}</a></li>
32
       {% if status_item %}
33
       <li>{% trans "Action:" %} <a href="{{ workflow.get_admin_url }}status/{{ status.id }}/items/{{ status_item.id }}/">{% trans status_item.description %}</a></li>
34
       {% endif %}
35
     </ul>
36
   {% endif %}
37
   </li>
38
 {% endif %}
39
 {% if error.expression or error.expression_type %}
40
 <li>{{ view.error_expression_type_label }}{% trans ":" %} <code>{{ error.expression }}</code></li>
41
 {% endif %}
42
 {% if error.exception_class or error.exception_message %}
43
 <li>{% trans "Error message:" %} <code>{{ error.exception_class }}: {{ error.exception_message }}</code></li>
44
 {% endif %}
45
 {% if formdata %}
46
 <li>{% trans "Data:" %} <a href="{{ formdata.get_backoffice_url }}">{{ formdata.get_display_name }}</a>
47
         (<a href="{{ formdata.get_backoffice_url }}inspect">{% trans "inspector" %}</a>)</li>
48
 {% endif %}
49
</ul>
50
</div>
17
      <div id="panel-general" role="tabpanel" tabindex="0" aria-labelledby="tab-general">
18
        <ul>
19
          <li>{% trans "First occurence:" %} {{ error.first_occurence_timestamp }}</li>
20
          <li>{% trans "Latest occurence:" %} {{ error.latest_occurence_timestamp }}</li>
21
          <li>{% trans "Count:" %} {{ error.formatted_occurences_count }}</li>
22
          {% if formdef %}
23
            <li>{{ formdef.verbose_name }}{% trans ":" %} <a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a>
24
              (<a href="{{ formdef.get_admin_url }}inspect">{% trans "inspector" %}</a>)</li>
25
          {% endif %}
26
          {% if workflow %}
27
            <li>{% trans "Workflow:" %} <a href="{{ workflow.get_admin_url }}">{{ workflow.name }}</a>
28
              (<a href="{{ workflow.get_admin_url }}inspect">{% trans "inspector" %}</a>)
29
              {% if status %}
30
                <ul>
31
                  <li>{% trans "Status:" %} <a href="{{ workflow.get_admin_url }}status/{{ status.id }}/">{{ status.name }}</a></li>
32
                  {% if status_item %}
33
                    <li>{% trans "Action:" %} <a href="{{ workflow.get_admin_url }}status/{{ status.id }}/items/{{ status_item.id }}/">{% trans status_item.description %}</a></li>
34
                  {% endif %}
35
                </ul>
36
              {% endif %}
37
            </li>
38
          {% endif %}
39
          {% if error.expression or error.expression_type %}
40
            <li>{{ view.error_expression_type_label }}{% trans ":" %} <code>{{ error.expression }}</code></li>
41
          {% endif %}
42
          {% if error.exception_class or error.exception_message %}
43
            <li>{% trans "Error message:" %} <code>{{ error.exception_class }}: {{ error.exception_message }}</code></li>
44
          {% endif %}
45
          {% if formdata %}
46
            <li>{% trans "Data:" %} <a href="{{ formdata.get_backoffice_url }}">{{ formdata.get_display_name }}</a>
47
              (<a href="{{ formdata.get_backoffice_url }}inspect">{% trans "inspector" %}</a>)</li>
48
          {% endif %}
49
        </ul>
50
      </div>
51 51

  
52
{% for tab in tabs %}
53
<div id="panel-{{ tab.slug }}" role="tabpanel" tabindex="0" aria-labelledby="tab-{{ tab.slug }}" hidden>
54
  {{ tab.content.getvalue|safe }}
55
</div>
56
{% endfor %}
52
      {% for tab in tabs %}
53
        <div id="panel-{{ tab.slug }}" role="tabpanel" tabindex="0" aria-labelledby="tab-{{ tab.slug }}" hidden>
54
          {{ tab.content.getvalue|safe }}
55
        </div>
56
      {% endfor %}
57 57

  
58
</div>
59
</div>
58
    </div>
59
  </div>
60 60

  
61 61
{% endblock %}
wcs/templates/wcs/backoffice/logged-errors.html
4 4
{% block appbar-title %}{% trans "Logged Errors" %}{% endblock %}
5 5

  
6 6
{% block content %}
7
<ul class="objects-list single-links">
8
  {% for error in errors %}
9
  <li><a href="{{ error.id }}/">{{ error.summary }}
10
                  {% if error.exception_class or error.exception_message %}
11
                  <span class="extra-info">- {{error.exception_class}} ({{error.exception_message}})</span>
12
                  {% endif %}
13
          </a><span class="badge">{{ error.formatted_occurences_count }}</span></li>
14
  {% endfor %}
15
</ul>
16
{{ pagination_links|safe }}
7
  <ul class="objects-list single-links">
8
    {% for error in errors %}
9
      <li><a href="{{ error.id }}/">{{ error.summary }}
10
        {% if error.exception_class or error.exception_message %}
11
          <span class="extra-info">- {{error.exception_class}} ({{error.exception_message}})</span>
12
        {% endif %}
13
      </a><span class="badge">{{ error.formatted_occurences_count }}</span></li>
14
    {% endfor %}
15
  </ul>
16
  {{ pagination_links|safe }}
17 17
{% endblock %}
wcs/templates/wcs/backoffice/mail-template.html
4 4
{% block appbar-title %}{% trans "Mail Template" %} - {{ mail_template.name }}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
{% if not mail_template.is_readonly %}
8
<a href="edit">{% trans "Edit" %}</a>
9
{% endif %}
7
  {% if not mail_template.is_readonly %}
8
    <a href="edit">{% trans "Edit" %}</a>
9
  {% endif %}
10 10
{% endblock %}
11 11

  
12 12
{% block content %}
13
{% if mail_template.description %}
14
<div class="bo-block">{{ mail_template.description }}</div>
15
{% endif %}
13
  {% if mail_template.description %}
14
    <div class="bo-block">{{ mail_template.description }}</div>
15
  {% endif %}
16 16

  
17
{% if mail_template.subject and mail_template.body %}
18
<div class="section">
19
<h3 class="mail-subject"><strong>{% trans "Subject:" %}</strong> <span>{{ mail_template.subject }}</span></h3>
20
<div class="mail-body">{{ mail_template.body }}</div>
21
</div>
17
  {% if mail_template.subject and mail_template.body %}
18
    <div class="section">
19
      <h3 class="mail-subject"><strong>{% trans "Subject:" %}</strong> <span>{{ mail_template.subject }}</span></h3>
20
      <div class="mail-body">{{ mail_template.body }}</div>
21
    </div>
22 22

  
23
{% for workflow in mail_template.get_places_of_use %}
24
{% if forloop.first %}
25
<div class="section">
26
 <h3>{% trans "Usage in workflows" %}</h3>
27
 <ul class="objects-list single-links">
28
{% endif %}
29
  <li><a href="{{ workflow.get_admin_url }}">{{ workflow.name }}</a></li>
30
{% if forloop.last %}
31
 </ul>
32
</div>
33
{% endif %}
34
{% endfor %}
23
    {% for workflow in mail_template.get_places_of_use %}
24
      {% if forloop.first %}
25
        <div class="section">
26
          <h3>{% trans "Usage in workflows" %}</h3>
27
          <ul class="objects-list single-links">
28
      {% endif %}
29
      <li><a href="{{ workflow.get_admin_url }}">{{ workflow.name }}</a></li>
30
      {% if forloop.last %}
31
        </ul>
32
        </div>
33
      {% endif %}
34
    {% endfor %}
35 35

  
36
{% else %}
37
<div class="infonotice">{% trans "This mail template still needs to be configured." %}</div>
38
{% endif %}
36
  {% else %}
37
    <div class="infonotice">{% trans "This mail template still needs to be configured." %}</div>
38
  {% endif %}
39 39

  
40 40
{% endblock %}
wcs/templates/wcs/backoffice/mail-templates.html
4 4
{% block appbar-title %}{% trans "Mail Templates" %}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
<a href="categories/">{% trans "Categories" %}</a>
8
<a rel="popup" href="import">{% trans "Import" %}</a>
9
<a rel="popup" href="new">{% trans "New mail template" %}</a>
7
  <a href="categories/">{% trans "Categories" %}</a>
8
  <a rel="popup" href="import">{% trans "Import" %}</a>
9
  <a rel="popup" href="new">{% trans "New mail template" %}</a>
10 10
{% endblock %}
11 11

  
12 12
{% block content %}
13
{% if categories %}
14
{% for category in categories %}
15
  {% if category.mail_templates %}
16
  <div class="section">
17
    <h2>{{ category.name }}</h2>
13
  {% if categories %}
14
    {% for category in categories %}
15
      {% if category.mail_templates %}
16
        <div class="section">
17
          <h2>{{ category.name }}</h2>
18
          <ul class="objects-list single-links">
19
            {% for mail_template in category.mail_templates %}
20
              <li><a href="{{ mail_template.id }}/">{{ mail_template.name }}</a></li>
21
            {% endfor %}
22
          </ul>
23
        </div>
24
      {% endif %}
25
    {% endfor %}
26
  {% elif mail_templates %}
18 27
    <ul class="objects-list single-links">
19
      {% for mail_template in category.mail_templates %}
20
      <li><a href="{{ mail_template.id }}/">{{ mail_template.name }}</a></li>
28
      {% for mail_template in mail_templates %}
29
        <li><a href="{{ mail_template.id }}/">{{ mail_template.name }}</a></li>
21 30
      {% endfor %}
22 31
    </ul>
23
  </div>
32
  {% else %}
33
    <div class="infonotice">
34
      {% trans "There are no mail templates defined." %}
35
    </div>
24 36
  {% endif %}
25
{% endfor %}
26
{% elif mail_templates %}
27
<ul class="objects-list single-links">
28
  {% for mail_template in mail_templates %}
29
  <li><a href="{{ mail_template.id }}/">{{ mail_template.name }}</a></li>
30
  {% endfor %}
31
</ul>
32
{% else %}
33
<div class="infonotice">
34
{% trans "There are no mail templates defined." %}
35
</div>
36
{% endif %}
37 37
{% endblock %}
wcs/templates/wcs/backoffice/popup_response.html
3 3
  <head><title>{% trans 'Popup closing...' %}</title></head>
4 4
  <body>
5 5
    <script type="text/javascript"
6
            id="popup-response-constants"
7
            src="{% static "/js/popup_response.js" %}"
8
            data-popup-response="{{ popup_response_data }}">
6
      id="popup-response-constants"
7
      src="{% static "/js/popup_response.js" %}"
8
      data-popup-response="{{ popup_response_data }}">
9 9
    </script>
10 10
  </body>
11 11
</html>
wcs/templates/wcs/backoffice/processing.html
4 4
{% block appbar-title %}{% trans "Executing task..." %}{% endblock %}
5 5

  
6 6
{% block content %}
7
<div class="section">
8
<dl class="job-status">
9
  <dt>{{ job.label }}</dt>
10
  <dd><span class="afterjob" id="{{ job.id }}">{% trans job.status %}</span></dd>
11
</dl>
12
</div>
7
  <div class="section">
8
    <dl class="job-status">
9
      <dt>{{ job.label }}</dt>
10
      <dd><span class="afterjob" id="{{ job.id }}">{% trans job.status %}</span></dd>
11
    </dl>
12
  </div>
13 13

  
14
<div class="done" style="display: none">
15
  <a {% for attr in job.done_button_attributes.items %}{{ attr.0 }}="{{ attr.1 }}"{% endfor %}
16
     class="button" href="{{ job.done_action_url }}">{{ job.done_action_label }}</a>
17
</div>
14
  <div class="done" style="display: none">
15
    <a {% for attr in job.done_button_attributes.items %}{{ attr.0 }}="{{ attr.1 }}"{% endfor %}
16
      class="button" href="{{ job.done_action_url }}">{{ job.done_action_label }}</a>
17
  </div>
18 18
{% endblock %}
wcs/templates/wcs/backoffice/settings/import.html
4 4
{% block appbar-title %}{% trans "Import" %}{% endblock %}
5 5

  
6 6
{% block content %}
7
{% if error %}
8
 <p>{% trans "Error:" %} {{ error }}</p>
9
{% else %}
10
 <p>{% trans "Imported successfully:" %}</p>
11
 <ul>
12
 {% if results.formdefs %}
13
 <li>{% blocktrans count counter=results.formdefs %}1 form{% plural %}{{ counter }} forms{% endblocktrans %}</li>
14
 {% endif %}
15
 {% if results.carddefs %}
16
 <li>{% blocktrans count counter=results.carddefs %}1 card{% plural %}{{ counter }} cards{% endblocktrans %}</li>
17
 {% endif %}
18
 {% if results.blockdefs %}
19
 <li>{% blocktrans count counter=results.blockdefs %}1 fields block{% plural %}{{ counter }} fields blocks{% endblocktrans %}</li>
20
 {% endif %}
21
 {% if results.workflows %}
22
 <li>{% blocktrans count counter=results.workflows %}1 workflow{% plural %}{{ counter }} workflows{% endblocktrans %}</li>
23
 {% endif %}
24
 {% if results.roles %}
25
 <li>{% blocktrans count counter=results.roles %}1 role{% plural %}{{ counter }} roles{% endblocktrans %}</li>
26
 {% endif %}
27
 {% if results.categories %}
28
 <li>{% blocktrans count counter=results.categories %}1 category{% plural %}{{ counter }} categories{% endblocktrans %}</li>
29
 {% endif %}
30
 {% if results.carddef_categories %}
31
 <li>{% blocktrans count counter=results.carddef_categories %}1 card category{% plural %}{{ counter }} card categories{% endblocktrans %}</li>
32
 {% endif %}
33
 {% if results.workflow_categories %}
34
 <li>{% blocktrans count counter=results.workflow_categories %}1 workflow category{% plural %}{{ counter }} workflow categories{% endblocktrans %}</li>
35
 {% endif %}
36
 {% if results.datasources %}
37
 <li>{% blocktrans count counter=results.datasources %}1 data source{% plural %}{{ counter }} data sources{% endblocktrans %}</li>
38
 {% endif %}
39
 {% if results.mail_templates %}
40
 <li>{% blocktrans count counter=results.mail_templates %}1 mail template{% plural %}{{ counter }} mail templates{% endblocktrans %}</li>
41
 {% endif %}
42
 {% if results.wscalls %}
43
 <li>{% blocktrans count counter=results.wscalls %}1 webservice call{% plural %}{{ counter }} webservice calls{% endblocktrans %}</li>
44
 {% endif %}
45
 {% if results.apiaccess %}
46
 <li>{% blocktrans count counter=results.apiaccess %}1 API access{% plural %}{{ counter }} API accesses{% endblocktrans %}</li>
47
 {% endif %}
48
 {% if results.settings %}
49
 <li>{% trans "Settings" %}</li>
50
 {% endif %}
51
 </ul>
52
 {% endif %}
7
  {% if error %}
8
    <p>{% trans "Error:" %} {{ error }}</p>
9
  {% else %}
10
    <p>{% trans "Imported successfully:" %}</p>
11
    <ul>
12
      {% if results.formdefs %}
13
        <li>{% blocktrans count counter=results.formdefs %}1 form{% plural %}{{ counter }} forms{% endblocktrans %}</li>
14
      {% endif %}
15
      {% if results.carddefs %}
16
        <li>{% blocktrans count counter=results.carddefs %}1 card{% plural %}{{ counter }} cards{% endblocktrans %}</li>
17
      {% endif %}
18
      {% if results.blockdefs %}
19
        <li>{% blocktrans count counter=results.blockdefs %}1 fields block{% plural %}{{ counter }} fields blocks{% endblocktrans %}</li>
20
      {% endif %}
21
      {% if results.workflows %}
22
        <li>{% blocktrans count counter=results.workflows %}1 workflow{% plural %}{{ counter }} workflows{% endblocktrans %}</li>
23
      {% endif %}
24
      {% if results.roles %}
25
        <li>{% blocktrans count counter=results.roles %}1 role{% plural %}{{ counter }} roles{% endblocktrans %}</li>
26
      {% endif %}
27
      {% if results.categories %}
28
        <li>{% blocktrans count counter=results.categories %}1 category{% plural %}{{ counter }} categories{% endblocktrans %}</li>
29
      {% endif %}
30
      {% if results.carddef_categories %}
31
        <li>{% blocktrans count counter=results.carddef_categories %}1 card category{% plural %}{{ counter }} card categories{% endblocktrans %}</li>
32
      {% endif %}
33
      {% if results.workflow_categories %}
34
        <li>{% blocktrans count counter=results.workflow_categories %}1 workflow category{% plural %}{{ counter }} workflow categories{% endblocktrans %}</li>
35
      {% endif %}
36
      {% if results.datasources %}
37
        <li>{% blocktrans count counter=results.datasources %}1 data source{% plural %}{{ counter }} data sources{% endblocktrans %}</li>
38
      {% endif %}
39
      {% if results.mail_templates %}
40
        <li>{% blocktrans count counter=results.mail_templates %}1 mail template{% plural %}{{ counter }} mail templates{% endblocktrans %}</li>
41
      {% endif %}
42
      {% if results.wscalls %}
43
        <li>{% blocktrans count counter=results.wscalls %}1 webservice call{% plural %}{{ counter }} webservice calls{% endblocktrans %}</li>
44
      {% endif %}
45
      {% if results.apiaccess %}
46
        <li>{% blocktrans count counter=results.apiaccess %}1 API access{% plural %}{{ counter }} API accesses{% endblocktrans %}</li>
47
      {% endif %}
48
      {% if results.settings %}
49
        <li>{% trans "Settings" %}</li>
50
      {% endif %}
51
    </ul>
52
  {% endif %}
53 53

  
54
 <p><a href=".">{% trans "Back" %}</a></p>
54
  <p><a href=".">{% trans "Back" %}</a></p>
55 55
{% endblock %}
wcs/templates/wcs/backoffice/snapshots.html
1 1
{% load i18n %}
2 2

  
3 3
{% block body %}
4
<div id="appbar">
5
<h2>{% trans "History" %}</h2>
6
</div>
4
  <div id="appbar">
5
    <h2>{% trans "History" %}</h2>
6
  </div>
7 7

  
8
{{ publisher.get_request.session.display_message|safe }}
8
  {{ publisher.get_request.session.display_message|safe }}
9 9

  
10
{% with snapshots=view.snapshots %}
11
{% if snapshots %}
12
<div class="section">
13
<form action="compare" method="get">
14
{% if snapshots|length > 1 %}
15
<p><button>{% trans "Show differences" %}</button></p>
16
{% endif %}
17
<table class="main snapshots-table">
18
  <thead>
19
    <th>{% trans "Identifier" %}</th>
20
    <th>{% trans "Compare" %}</th>
21
    <th colspan="2">{% trans 'Date' %}</th>
22
    <th colspan="3">{% trans "Description" %}</th>
23
    <th>{% trans 'User' %}</th>
24
    <th colspan="2">{% trans 'Actions' %}</th>
25
  </thead>
26
  <tbody class="snapshots-list">
27
    {% for snapshot in snapshots %}
28
    <tr data-day="{{ snapshot.timestamp|date:"Y-m-d" }}" class="{% if snapshot.new_day %}new-day{% elif snapshot.label %}has-label{% else %}collapsed{% endif %}">
29
      <td>
30
        <span class="counter">#{{ snapshot.id }}</span>
31
      </td>
32
      <td>
33
        {% if snapshots|length > 1 %}
34
          {% if not forloop.last %}<input type="radio" name="version1" value="{{ snapshot.id }}" {% if forloop.first %}checked="checked"{% endif %} />{% else %}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{% endif %}
35
          {% if not forloop.first %}<input type="radio" name="version2" value="{{ snapshot.id }}" {% if forloop.counter == 2 %}checked="checked"{% endif %}/>{% else %}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{% endif %}
36
        {% endif %}
37
      </td>
38
      <td colspan="2">
39
        {{ snapshot.timestamp }}
40
        {% if snapshot.new_day and snapshot.day_other_count %} — <a class="reveal"
41
                href="#day-{{ snapshot.timestamp|date:"Y-m-d"}}">
42
          {% if snapshot.day_other_count >= 50 %}<strong>{% endif %}
43
          {% blocktrans trimmed count counter=snapshot.day_other_count %}
44
            1 other this day
45
          {% plural %}
46
            {{ counter }} others
47
          {% endblocktrans %}
48
        {% endif %}
49
      </td>
50
      <td class="label" colspan="3">
51
        {% if snapshot.label %}<strong>{{ snapshot.label }}</strong>{% elif snapshot.comment %}{{ snapshot.comment }}{% endif %}
52
      </td>
53
      <td>{% if snapshot.user_id %}{{ snapshot.user }}{% endif %}</td>
54
      <td colspan="2">
55
          <a href="{{snapshot.id}}/view/">{% trans "View" %}</a>
56
          
57
          <a data-popup href="{{snapshot.id}}/restore">{% trans "Restore" %}</a>
58
          
59
          <a href="{{snapshot.id}}/export">{% trans "Export" %}</a>
60
      </td>
61
    </tr>
62
    {% endfor %}
63
  </tbody>
64
</table>
65
<ul class="objects-list snapshots-list">
66
</ul>
67
</form>
68
</div>
69
{% else %}
70
<div class="infonotice"><p>{% trans "No changes history" %}</p></div>
71
{% endif %}
72
{% endwith %}
10
  {% with snapshots=view.snapshots %}
11
    {% if snapshots %}
12
      <div class="section">
13
        <form action="compare" method="get">
14
          {% if snapshots|length > 1 %}
15
            <p><button>{% trans "Show differences" %}</button></p>
16
          {% endif %}
17
          <table class="main snapshots-table">
18
            <thead>
19
              <th>{% trans "Identifier" %}</th>
20
              <th>{% trans "Compare" %}</th>
21
              <th colspan="2">{% trans 'Date' %}</th>
22
              <th colspan="3">{% trans "Description" %}</th>
23
              <th>{% trans 'User' %}</th>
24
              <th colspan="2">{% trans 'Actions' %}</th>
25
            </thead>
26
            <tbody class="snapshots-list">
27
              {% for snapshot in snapshots %}
28
                <tr data-day="{{ snapshot.timestamp|date:"Y-m-d" }}" class="{% if snapshot.new_day %}new-day{% elif snapshot.label %}has-label{% else %}collapsed{% endif %}">
29
                  <td>
30
                    <span class="counter">#{{ snapshot.id }}</span>
31
                  </td>
32
                  <td>
33
                    {% if snapshots|length > 1 %}
34
                      {% if not forloop.last %}<input type="radio" name="version1" value="{{ snapshot.id }}" {% if forloop.first %}checked="checked"{% endif %} />{% else %}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{% endif %}
35
                      {% if not forloop.first %}<input type="radio" name="version2" value="{{ snapshot.id }}" {% if forloop.counter == 2 %}checked="checked"{% endif %}/>{% else %}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{% endif %}
36
                    {% endif %}
37
                  </td>
38
                  <td colspan="2">
39
                    {{ snapshot.timestamp }}
40
                    {% if snapshot.new_day and snapshot.day_other_count %} — <a class="reveal"
41
                      href="#day-{{ snapshot.timestamp|date:"Y-m-d"}}">
42
                      {% if snapshot.day_other_count >= 50 %}<strong>{% endif %}
43
                      {% blocktrans trimmed count counter=snapshot.day_other_count %}
44
                        1 other this day
45
                      {% plural %}
46
                        {{ counter }} others
47
                      {% endblocktrans %}
48
                    {% endif %}
49
                  </td>
50
                  <td class="label" colspan="3">
51
                    {% if snapshot.label %}<strong>{{ snapshot.label }}</strong>{% elif snapshot.comment %}{{ snapshot.comment }}{% endif %}
52
                  </td>
53
                  <td>{% if snapshot.user_id %}{{ snapshot.user }}{% endif %}</td>
54
                  <td colspan="2">
55
                    <a href="{{snapshot.id}}/view/">{% trans "View" %}</a>
56
                    
57
                    <a data-popup href="{{snapshot.id}}/restore">{% trans "Restore" %}</a>
58
                    
59
                    <a href="{{snapshot.id}}/export">{% trans "Export" %}</a>
60
                  </td>
61
                </tr>
62
              {% endfor %}
63
            </tbody>
64
          </table>
65
          <ul class="objects-list snapshots-list">
66
          </ul>
67
        </form>
68
      </div>
69
    {% else %}
70
      <div class="infonotice"><p>{% trans "No changes history" %}</p></div>
71
    {% endif %}
72
  {% endwith %}
73 73

  
74 74

  
75
<script>
76
$(function() {
77
  $('tr.new-day a.reveal').on('click', function() {
78
    var day = $(this).parents('tr.new-day').data('day');
79
    $('.snapshots-list tr[data-day="' + day + '"]:not(.new-day)').toggleClass('collapsed');
80
    return false;
81
  });
82
  $('input[name="version1"]').on('click', function() {
83
    var next = $(this).parent('tr').next();
84
    $('input[name="version2"]', next).prop('checked', true);
85
  });
86
});
87
</script>
75
  <script>
76
    $(function() {
77
      $('tr.new-day a.reveal').on('click', function() {
78
        var day = $(this).parents('tr.new-day').data('day');
79
        $('.snapshots-list tr[data-day="' + day + '"]:not(.new-day)').toggleClass('collapsed');
80
        return false;
81
      });
82
      $('input[name="version1"]').on('click', function() {
83
        var next = $(this).parent('tr').next();
84
        $('input[name="version2"]', next).prop('checked', true);
85
      });
86
    });
87
  </script>
88 88

  
89 89
{% endblock %}
wcs/templates/wcs/backoffice/snapshots_compare.html
3 3

  
4 4
{% block appbar-title %}{% trans "Compare snapshots" %}{% if has_inspect %} ({% if mode == 'xml' %}{% trans "XML" %}{% else %}{% trans "Inspect" %}{% endif %}){% endif %}{% endblock %}
5 5
{% block appbar-actions %}
6
{% if has_inspect %}
7
<a href="?version1={{ snapshot1.id }}&version2={{ snapshot2.id }}&mode=inspect">{% trans "Compare inspect" %}</a>
8
<a href="?version1={{ snapshot1.id }}&version2={{ snapshot2.id }}&mode=xml">{% trans "Compare XML" %}</a>
9
{% endif %}
6
  {% if has_inspect %}
7
    <a href="?version1={{ snapshot1.id }}&version2={{ snapshot2.id }}&mode=inspect">{% trans "Compare inspect" %}</a>
8
    <a href="?version1={{ snapshot1.id }}&version2={{ snapshot2.id }}&mode=xml">{% trans "Compare XML" %}</a>
9
  {% endif %}
10 10
{% endblock %}
11 11

  
12 12
{% block content %}
13
<p class="snapshot-description">{{ fromdesc|safe }} ➔ {{ todesc|safe }}</p>
14
<div class="diff">
15
{% if mode == 'xml' %}
16
    {{ diff_serialization|safe }}
17
{% else %}
18
  <div class="{{ tab_class_names }}">
19
    <div class="pk-tabs--tab-list" role="tablist">
20
      {% for tab in tabs %}{{ tab|safe }}{% endfor %}
21
      {{ tab_list|safe }}
22
    </div>
23
    <div class="pk-tabs--container">
24
      {% for attrs, panel in panels %}
25
        <div{% for k, v in attrs.items %} {{ k }}="{{ v }}"{% endfor %}>
26
          {{ panel|safe }}
13
  <p class="snapshot-description">{{ fromdesc|safe }} ➔ {{ todesc|safe }}</p>
14
  <div class="diff">
15
    {% if mode == 'xml' %}
16
      {{ diff_serialization|safe }}
17
    {% else %}
18
      <div class="{{ tab_class_names }}">
19
        <div class="pk-tabs--tab-list" role="tablist">
20
          {% for tab in tabs %}{{ tab|safe }}{% endfor %}
21
          {{ tab_list|safe }}
27 22
        </div>
28
      {% endfor %}
29
    </div>
23
        <div class="pk-tabs--container">
24
          {% for attrs, panel in panels %}
25
            <div{% for k, v in attrs.items %} {{ k }}="{{ v }}"{% endfor %}>
26
              {{ panel|safe }}
27
            </div>
28
          {% endfor %}
29
        </div>
30
      </div>
31
    {% endif %}
30 32
  </div>
31
{% endif %}
32
</div>
33 33
{% endblock %}
wcs/templates/wcs/backoffice/studio.html
3 3

  
4 4
{% block content %}
5 5

  
6
{% block appbar %}
7
<div id="appbar" class="highlight">
8
<h2>{% trans "Studio" %}</h2>
9
</div>
10
{% endblock %}
11

  
12
<div id="studio">
13
  <div class="fx-grid--t3">
14
    <div class="fx-grid--t2">
15
      {% if user.can_go_in_backoffice_forms %}
16
      <a class="button button-paragraph size--1-1" href="../forms/">{% trans "Forms" context "studio" %}
17
        <p>{% trans "Forms are typically used to collect user demands." %}</p>
18
      </a>
19
      {% endif %}
20
      {% if user.can_go_in_backoffice_cards %}
21
      <a class="button button-paragraph size--1-1" href="../cards/">{% trans "Cards" context "studio" %}
22
        <p>{% trans "Cards are used to store list of structured data." %}</p>
23
      </a>
24
      {% endif %}
25
      {% if user.can_go_in_backoffice_workflows %}
26
      <a class="button button-paragraph size--1-1" href="../workflows/">{% trans "Workflows" context "studio" %}
27
        <p>{% trans "Workflows are used to add custom behaviours or actions to forms and cards." %}</p>
28
      </a>
29
      {% endif %}
30
      {% for link, label in extra_links %}
31
      <a class="button button-paragraph" href="{{ link }}">{{ label }}</a>
32
      {% endfor %}
6
  {% block appbar %}
7
    <div id="appbar" class="highlight">
8
      <h2>{% trans "Studio" %}</h2>
33 9
    </div>
10
  {% endblock %}
34 11

  
35
    <div class="paragraph">
36
      <h3>{% trans "Recent changes" context "studio" %}</h3>
37
      <ul class="recent-changes">
38
        {% for obj in recent_objects %}
39
        <li><a href="{{ obj.get_admin_url }}">{{ obj.name }} ({{ obj.verbose_name }})</a>
40
                <span class="timestamp">{{ obj.snapshot_timestamp }}</span></li>
12
  <div id="studio">
13
    <div class="fx-grid--t3">
14
      <div class="fx-grid--t2">
15
        {% if user.can_go_in_backoffice_forms %}
16
          <a class="button button-paragraph size--1-1" href="../forms/">{% trans "Forms" context "studio" %}
17
            <p>{% trans "Forms are typically used to collect user demands." %}</p>
18
          </a>
19
        {% endif %}
20
        {% if user.can_go_in_backoffice_cards %}
21
          <a class="button button-paragraph size--1-1" href="../cards/">{% trans "Cards" context "studio" %}
22
            <p>{% trans "Cards are used to store list of structured data." %}</p>
23
          </a>
24
        {% endif %}
25
        {% if user.can_go_in_backoffice_workflows %}
26
          <a class="button button-paragraph size--1-1" href="../workflows/">{% trans "Workflows" context "studio" %}
27
            <p>{% trans "Workflows are used to add custom behaviours or actions to forms and cards." %}</p>
28
          </a>
29
        {% endif %}
30
        {% for link, label in extra_links %}
31
          <a class="button button-paragraph" href="{{ link }}">{{ label }}</a>
41 32
        {% endfor %}
42
      </ul>
43
      {% if show_all_changes %}
44
        <p><a class="all-changes pk-button" href="all-changes/">{% trans "See all changes" %}</a></p>
45
      {% endif %}
46
    </div>
33
      </div>
47 34

  
48
    <div class="errors-and-deprecations">
49
    <div class="paragraph recent-errors {% if not recent_errors %}no-recent-errors{% endif %}">
50
      <h3>{% trans "Recent errors" context "studio" %}</h3>
51
      {% if recent_errors %}
52
        <ul>
53
          {% for error in recent_errors %}
54
          <li><a href="logged-errors/{{ error.id }}/">{{ error.wbr_summary|safe|truncatechars_html:150 }}</a></li>
35
      <div class="paragraph">
36
        <h3>{% trans "Recent changes" context "studio" %}</h3>
37
        <ul class="recent-changes">
38
          {% for obj in recent_objects %}
39
            <li><a href="{{ obj.get_admin_url }}">{{ obj.name }} ({{ obj.verbose_name }})</a>
40
              <span class="timestamp">{{ obj.snapshot_timestamp }}</span></li>
55 41
          {% endfor %}
56 42
        </ul>
57
        <p><a class="logged-errors-all pk-button" href="logged-errors/">{% trans "See all errors" context "studio" %}</a></p>
58
      {% else %}
59
        <p>{% trans "No errors, congratulations!" %}</p>
60
      {% endif %}
61
    </div>
62
    <div>
63
      <p><a class="button button-paragraph" href="deprecations/">{% trans "Deprecations Report" %}</a></p>
64
    </div>
43
        {% if show_all_changes %}
44
          <p><a class="all-changes pk-button" href="all-changes/">{% trans "See all changes" %}</a></p>
45
        {% endif %}
46
      </div>
47

  
48
      <div class="errors-and-deprecations">
49
        <div class="paragraph recent-errors {% if not recent_errors %}no-recent-errors{% endif %}">
50
          <h3>{% trans "Recent errors" context "studio" %}</h3>
51
          {% if recent_errors %}
52
            <ul>
53
              {% for error in recent_errors %}
54
                <li><a href="logged-errors/{{ error.id }}/">{{ error.wbr_summary|safe|truncatechars_html:150 }}</a></li>
55
              {% endfor %}
56
            </ul>
57
            <p><a class="logged-errors-all pk-button" href="logged-errors/">{% trans "See all errors" context "studio" %}</a></p>
58
          {% else %}
59
            <p>{% trans "No errors, congratulations!" %}</p>
60
          {% endif %}
61
        </div>
62
        <div>
63
          <p><a class="button button-paragraph" href="deprecations/">{% trans "Deprecations Report" %}</a></p>
64
        </div>
65
      </div>
65 66
    </div>
66 67
  </div>
67
</div>
68 68
{% endblock %}
wcs/templates/wcs/backoffice/workflow-fullscreen-schema.html
11 11
    {{script|safe}}
12 12
  </html>
13 13
  <body>
14
<div id="workflow-fullscreen-schema">
15
{{ view.graphviz|safe }}
16
<div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a></div>
17
</div>
14
    <div id="workflow-fullscreen-schema">
15
      {{ view.graphviz|safe }}
16
      <div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a></div>
17
    </div>
18 18
  </body>
19 19
</html>
wcs/templates/wcs/backoffice/workflow-inspect.html
5 5

  
6 6
{% block content %}
7 7

  
8
<div class="pk-tabs inspect-tabs inspect-workflow-tabs">
9
 <div class="pk-tabs--tab-list" role="tablist">
10
  <button role="tab" aria-selected="true" aria-controls="inspect-statuses" id="tab-statuses" tabindex="0">{% trans "Statuses" %}</button>
11
  {% if workflow.global_actions %}
12
  <button role="tab" aria-selected="false" aria-controls="inspect-global-actions" id="tab-global-actions" tabindex="-1">{% trans "Global Actions" %}</button>
13
  {% endif %}
14
  <button role="tab" aria-selected="false" aria-controls="inspect-functions" id="tab-functions" tabindex="-1">{% trans "Functions" %}</button>
15
  {% if workflow.variables_formdef %}
16
  <button role="tab" aria-selected="false" aria-controls="inspect-variables" id="tab-variables" tabindex="-1">{% trans "Workflow Variables" %}</button>
17
  {% endif %}
18
  {% if workflow.backoffice_fields_formdef %}
19
  <button role="tab" aria-selected="false" aria-controls="inspect-fields" id="tab-fields" tabindex="-1">{% trans "Backoffice Fields" %}</button>
20
  {% endif %}
21
  {% if workflow.criticality_levels %}
22
  <button role="tab" aria-selected="false" aria-controls="inspect-criticality" id="tab-criticality" tabindex="-1">{% trans "Criticality Levels" %}</button>
23
  {% endif %}
24
 </div>
25
 <div class="pk-tabs--container">
8
  <div class="pk-tabs inspect-tabs inspect-workflow-tabs">
9
    <div class="pk-tabs--tab-list" role="tablist">
10
      <button role="tab" aria-selected="true" aria-controls="inspect-statuses" id="tab-statuses" tabindex="0">{% trans "Statuses" %}</button>
11
      {% if workflow.global_actions %}
12
        <button role="tab" aria-selected="false" aria-controls="inspect-global-actions" id="tab-global-actions" tabindex="-1">{% trans "Global Actions" %}</button>
13
      {% endif %}
14
      <button role="tab" aria-selected="false" aria-controls="inspect-functions" id="tab-functions" tabindex="-1">{% trans "Functions" %}</button>
15
      {% if workflow.variables_formdef %}
16
        <button role="tab" aria-selected="false" aria-controls="inspect-variables" id="tab-variables" tabindex="-1">{% trans "Workflow Variables" %}</button>
17
      {% endif %}
18
      {% if workflow.backoffice_fields_formdef %}
19
        <button role="tab" aria-selected="false" aria-controls="inspect-fields" id="tab-fields" tabindex="-1">{% trans "Backoffice Fields" %}</button>
20
      {% endif %}
21
      {% if workflow.criticality_levels %}
22
        <button role="tab" aria-selected="false" aria-controls="inspect-criticality" id="tab-criticality" tabindex="-1">{% trans "Criticality Levels" %}</button>
23
      {% endif %}
24
    </div>
25
    <div class="pk-tabs--container">
26 26

  
27
<div id="inspect-statuses" role="tabpanel" tabindex="0" aria-labelledby="tab-statuses">
28
<div class="pk-information"><p>
29
{% blocktrans count status_count=workflow.possible_status|count %}{{ status_count }} status{% plural %}{{ status_count }} statuses{% endblocktrans %}.
30
</p></div>
31
<nav class="inspect--quicknav"><span class="inspect--jumpto">{% trans "Jump to:" %}</span><ul class="inspect--quicklinks">
32
{% for status in workflow.possible_status %}
33
<li><a class="button" href="#status-{{ status.id }}">{{ status.name }}</a></li>
34
{% endfor %}
35
</ul></nav>
36
<div class="expanded-statuses">
37
{% for status in workflow.possible_status %}
38
<div class="section status">
39
<h3 id="status-{{ status.id }}"
40
    ><a href="{{ workflow.get_admin_url }}status/{{ status.id }}/" class="inspect-status--link">
41
    <span class="inspect-status--colour" style="background-color: #{{ status.colour|default:"fff" }}"></span>
42
    {{ status.name }}</a></h3>
43
{% if status.backoffice_info_text %}<div>{{ status.backoffice_info_text|safe }}</div>{% endif %}
44
{% for item in status.items %}
45
<h4><a href="{{ workflow.get_admin_url }}status/{{ status.id }}/items/{{ item.id }}/">{{ item.description }}</a></h4>
46
{{ item.get_parameters_view|safe }}
47
{% empty %}
48
<p>{% trans "No actions in this status." %}</p>
49
{% endfor %}
50
</div>
51
{% endfor %}
52
</div>
53
</div>
27
      <div id="inspect-statuses" role="tabpanel" tabindex="0" aria-labelledby="tab-statuses">
28
        <div class="pk-information"><p>
29
          {% blocktrans count status_count=workflow.possible_status|count %}{{ status_count }} status{% plural %}{{ status_count }} statuses{% endblocktrans %}.
30
        </p></div>
31
        <nav class="inspect--quicknav"><span class="inspect--jumpto">{% trans "Jump to:" %}</span><ul class="inspect--quicklinks">
32
          {% for status in workflow.possible_status %}
33
            <li><a class="button" href="#status-{{ status.id }}">{{ status.name }}</a></li>
34
          {% endfor %}
35
        </ul></nav>
36
        <div class="expanded-statuses">
37
          {% for status in workflow.possible_status %}
38
            <div class="section status">
39
              <h3 id="status-{{ status.id }}"
40
              ><a href="{{ workflow.get_admin_url }}status/{{ status.id }}/" class="inspect-status--link">
41
                <span class="inspect-status--colour" style="background-color: #{{ status.colour|default:"fff" }}"></span>
42
                {{ status.name }}</a></h3>
43
              {% if status.backoffice_info_text %}<div>{{ status.backoffice_info_text|safe }}</div>{% endif %}
44
              {% for item in status.items %}
45
                <h4><a href="{{ workflow.get_admin_url }}status/{{ status.id }}/items/{{ item.id }}/">{{ item.description }}</a></h4>
46
                {{ item.get_parameters_view|safe }}
47
              {% empty %}
48
                <p>{% trans "No actions in this status." %}</p>
49
              {% endfor %}
50
            </div>
51
          {% endfor %}
52
        </div>
53
      </div>
54 54

  
55
<div id="inspect-global-actions" role="tabpanel" tabindex="0" aria-labelledby="tab-global-actions" hidden>
56
<nav class="inspect--quicknav"><span class="inspect--jumpto">{% trans "Jump to:" %}</span><ul class="inspect--quicklinks">
57
{% for action in workflow.global_actions %}
58
<li><a class="button" href="#action-{{ action.id }}">{{ action.name }}</a></li>
59
{% endfor %}
60
</ul></nav>
61
<div class="expanded-statuses">
62
{% for action in workflow.global_actions %}
63
<div class="section global-action">
64
<h3><a id="action-{{ action.id }}" href="{{ workflow.get_admin_url }}global-actions/{{ action.id }}/">{{ action.name }}</a></h3>
65
<h4>{% trans "Triggers" %}</h4>
66
<ul>{% for trigger in action.triggers %}<li>{{ trigger.render_as_line }}</li>{% endfor %}</ul>
67
{% for item in action.items %}
68
<h4><a href="{{ workflow.get_admin_url }}global-actions/{{ action.id }}/items/{{ item.id }}/">{{ item.description }}</a></h4>
69
{{ item.get_parameters_view|safe }}
70
{% endfor %}
71
</div>
72
{% endfor %}
73
</div>
74
</div>
55
      <div id="inspect-global-actions" role="tabpanel" tabindex="0" aria-labelledby="tab-global-actions" hidden>
56
        <nav class="inspect--quicknav"><span class="inspect--jumpto">{% trans "Jump to:" %}</span><ul class="inspect--quicklinks">
57
          {% for action in workflow.global_actions %}
58
            <li><a class="button" href="#action-{{ action.id }}">{{ action.name }}</a></li>
59
          {% endfor %}
60
        </ul></nav>
61
        <div class="expanded-statuses">
62
          {% for action in workflow.global_actions %}
63
            <div class="section global-action">
64
              <h3><a id="action-{{ action.id }}" href="{{ workflow.get_admin_url }}global-actions/{{ action.id }}/">{{ action.name }}</a></h3>
65
              <h4>{% trans "Triggers" %}</h4>
66
              <ul>{% for trigger in action.triggers %}<li>{{ trigger.render_as_line }}</li>{% endfor %}</ul>
67
              {% for item in action.items %}
68
                <h4><a href="{{ workflow.get_admin_url }}global-actions/{{ action.id }}/items/{{ item.id }}/">{{ item.description }}</a></h4>
69
                {{ item.get_parameters_view|safe }}
70
              {% endfor %}
71
            </div>
72
          {% endfor %}
73
        </div>
74
      </div>
75 75

  
76
<div id="inspect-functions" role="tabpanel" tabindex="0" aria-labelledby="tab-functions" hidden>
77
<ul>
78
{% for label in workflow.roles.values %}
79
<li>{{ label }}</li>
80
{% endfor %}
81
</ul>
82
</div>
76
      <div id="inspect-functions" role="tabpanel" tabindex="0" aria-labelledby="tab-functions" hidden>
77
        <ul>
78
          {% for label in workflow.roles.values %}
79
            <li>{{ label }}</li>
80
          {% endfor %}
81
        </ul>
82
      </div>
83 83

  
84
<div id="inspect-variables" role="tabpanel" tabindex="0" aria-labelledby="tab-variables" hidden>
85
{% for field in workflow.variables_formdef.fields %}
86
{% include "wcs/backoffice/includes/inspect-field.html" with path=workflow.get_admin_url|add:"variables/fields/" %}
87
{% endfor %}
88
</div>
84
      <div id="inspect-variables" role="tabpanel" tabindex="0" aria-labelledby="tab-variables" hidden>
85
        {% for field in workflow.variables_formdef.fields %}
86
          {% include "wcs/backoffice/includes/inspect-field.html" with path=workflow.get_admin_url|add:"variables/fields/" %}
87
        {% endfor %}
88
      </div>
89 89

  
90
<div id="inspect-fields" role="tabpanel" tabindex="0" aria-labelledby="tab-fields" hidden>
91
{% for field in workflow.backoffice_fields_formdef.fields %}
92
{% include "wcs/backoffice/includes/inspect-field.html" with path=workflow.get_admin_url|add:"backoffice-fields/fields/" %}
93
{% endfor %}
94
</div>
90
      <div id="inspect-fields" role="tabpanel" tabindex="0" aria-labelledby="tab-fields" hidden>
91
        {% for field in workflow.backoffice_fields_formdef.fields %}
92
          {% include "wcs/backoffice/includes/inspect-field.html" with path=workflow.get_admin_url|add:"backoffice-fields/fields/" %}
93
        {% endfor %}
94
      </div>
95 95

  
96
<div id="inspect-criticality" role="tabpanel" tabindex="0" aria-labelledby="tab-criticality" hidden>
97
<ul>
98
{% for level in workflow.criticality_levels %}<li>{{ level.name }}</li>{% endfor %}
99
</ul>
100
</div>
96
      <div id="inspect-criticality" role="tabpanel" tabindex="0" aria-labelledby="tab-criticality" hidden>
97
        <ul>
98
          {% for level in workflow.criticality_levels %}<li>{{ level.name }}</li>{% endfor %}
99
        </ul>
100
      </div>
101 101

  
102
</div> <!-- pk-tabs-container -->
103
 </div> <!-- pk-tabs -->
102
    </div> <!-- pk-tabs-container -->
103
  </div> <!-- pk-tabs -->
104 104
{% endblock %}
wcs/templates/wcs/backoffice/workflow-status.html
4 4
{% block appbar-title %}{{ status.name }}{% endblock %}
5 5

  
6 6
{% block content %}
7
{{ block.super }}
7
  {{ block.super }}
8 8

  
9
{% if status.get_visibility_restricted_roles %}
10
<div class="bo-block">
11
{% trans "This status is hidden from the user." %}
12
{% if not workflow.is_readonly %}
13
(<a href="display" rel="popup">{% trans "change" %}</a>)
14
{% endif %}
15
</div>
16
{% endif %}
9
  {% if status.get_visibility_restricted_roles %}
10
    <div class="bo-block">
11
      {% trans "This status is hidden from the user." %}
12
      {% if not workflow.is_readonly %}
13
        (<a href="display" rel="popup">{% trans "change" %}</a>)
14
      {% endif %}
15
    </div>
16
  {% endif %}
17 17

  
18
{% if not status.items %}
19
<div class="infonotice">
20
{% trans "There are not yet any items in this status." %}
21
</div>
22
{% else %}
23
{% spaceless %}
24
<div class="bo-block">
25
  {% if workflow.is_readonly %}
26
  <ul id="items-list" class="biglist sortable readonly">
18
  {% if not status.items %}
19
    <div class="infonotice">
20
      {% trans "There are not yet any items in this status." %}
21
    </div>
27 22
  {% else %}
28
  <p class="hint">{% trans "Use drag and drop with the handles to reorder items." %}</p>
29
  <ul id="items-list" class="biglist sortable">
30
  {% endif %}
31
  {% for item in status.items %}
32
  <li class="biglistitem" id="itemId_{{ item.id }}">
33
    <a href="items/{{ item.id }}/">{{ item.render_as_line }}</a>
34
  <p class="commands">
35
  {% with item.get_target_status_url as url %}
36
  {% if url %}<span class="jump"><a href="{{ url }}" title="{% trans "Go to Target" %}">{% trans "Go to Target" %}</a></span>{% endif %}
37
  {% endwith %}
38
  {% if not workflow.is_readonly %}
39
  <span class="edit"><a href="items/{{ item.id }}/" title="{% trans "Edit" %}">{% trans "Edit" %}</a></span>
40
  <span class="copy"><a href="items/{{ item.id }}/copy" rel="popup" title="{% trans "Copy" %}">{% trans "Copy" %}</a></span>
41
  <span class="remove"><a href="items/{{ item.id }}/delete" rel="popup" title="{% trans "Delete" %}">{% trans "Delete" %}</a></span>
23
    {% spaceless %}
24
      <div class="bo-block">
25
        {% if workflow.is_readonly %}
26
          <ul id="items-list" class="biglist sortable readonly">
27
        {% else %}
28
          <p class="hint">{% trans "Use drag and drop with the handles to reorder items." %}</p>
29
          <ul id="items-list" class="biglist sortable">
30
        {% endif %}
31
        {% for item in status.items %}
32
          <li class="biglistitem" id="itemId_{{ item.id }}">
33
            <a href="items/{{ item.id }}/">{{ item.render_as_line }}</a>
34
            <p class="commands">
35
              {% with item.get_target_status_url as url %}
36
                {% if url %}<span class="jump"><a href="{{ url }}" title="{% trans "Go to Target" %}">{% trans "Go to Target" %}</a></span>{% endif %}
37
              {% endwith %}
38
              {% if not workflow.is_readonly %}
39
                <span class="edit"><a href="items/{{ item.id }}/" title="{% trans "Edit" %}">{% trans "Edit" %}</a></span>
40
                <span class="copy"><a href="items/{{ item.id }}/copy" rel="popup" title="{% trans "Copy" %}">{% trans "Copy" %}</a></span>
41
                <span class="remove"><a href="items/{{ item.id }}/delete" rel="popup" title="{% trans "Delete" %}">{% trans "Delete" %}</a></span>
42
              {% endif %}
43
            </p>
44
          </li>
45
        {% endfor %}
46
      </ul>
47
      </div>
48
    {% endspaceless %}
42 49
  {% endif %}
43
  </p>
44
  </li>
45
  {% endfor %}
46
 </ul>
47
</div>
48
{% endspaceless %}
49
{% endif %}
50 50

  
51
{% with source_statuses=view.get_source_statuses %}
52
 {% if source_statuses %}
53
 <div class="bo-block">
54
 <h3>{% trans "Jumps" %}</h3>
55
 <p>{% trans "This status is reachable from the following status:" %}
56
 {% for source in source_statuses %}
57
 <a href="../{{ source.id }}/">{{ source.name }}</a>{% if not forloop.last %}, {% endif %}
58
 {% endfor %}
59
 </p>
60
 </div>
61
 {% endif %}
62
{% endwith %}
51
  {% with source_statuses=view.get_source_statuses %}
52
    {% if source_statuses %}
53
      <div class="bo-block">
54
        <h3>{% trans "Jumps" %}</h3>
55
        <p>{% trans "This status is reachable from the following status:" %}
56
          {% for source in source_statuses %}
57
            <a href="../{{ source.id }}/">{{ source.name }}</a>{% if not forloop.last %}, {% endif %}
58
          {% endfor %}
59
        </p>
60
      </div>
61
    {% endif %}
62
  {% endwith %}
63 63

  
64
<p><a href="../../">{% trans "Back to workflow main page" %}</a></p>
64
  <p><a href="../../">{% trans "Back to workflow main page" %}</a></p>
65 65

  
66
<div class="bo-block">
67
{{ view.graphviz|safe }}
68
<div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a> -
69
        <a href="fullscreen">{% trans "Full Screen" %}</a></div>
70
</div>
66
  <div class="bo-block">
67
    {{ view.graphviz|safe }}
68
    <div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a> -
69
      <a href="fullscreen">{% trans "Full Screen" %}</a></div>
70
  </div>
71 71

  
72 72
{% endblock %}
73 73

  
74 74
{% block sidebar-content %}
75
{% if workflow.is_default %}
76
<p>
77
{% blocktrans %}
78
This is the default workflow, you cannot edit it but you can
79
duplicate it to base your own workflow on it.
80
{% endblocktrans %}
81
</p>
82
{% elif workflow.is_readonly %}
83
<div class="infonotice"><p>{% trans "This workflow is readonly." %}</p></div>
84
{% else %}
75
  {% if workflow.is_default %}
76
    <p>
77
      {% blocktrans %}
78
        This is the default workflow, you cannot edit it but you can
79
        duplicate it to base your own workflow on it.
80
      {% endblocktrans %}
81
    </p>
82
  {% elif workflow.is_readonly %}
83
    <div class="infonotice"><p>{% trans "This workflow is readonly." %}</p></div>
84
  {% else %}
85 85

  
86
{% if status.is_endpoint %}
87
<div class="infonotice">
88
<p>
89
{% if status.forced_endpoint %}
90
{% trans "This status has been manually set to be considered as terminal." %}
91
<br><a href="endpoint" rel="popup">{% trans "Unforce Terminal Status" %}</a>
92
{% elif status.is_endpoint %}
93
{% trans "This status has been automatically evaluated as being terminal." %}
94
{% endif %}
95
</p>
96
</div>
97
{% endif %}
86
    {% if status.is_endpoint %}
87
      <div class="infonotice">
88
        <p>
89
          {% if status.forced_endpoint %}
90
            {% trans "This status has been manually set to be considered as terminal." %}
91
            <br><a href="endpoint" rel="popup">{% trans "Unforce Terminal Status" %}</a>
92
          {% elif status.is_endpoint %}
93
            {% trans "This status has been automatically evaluated as being terminal." %}
94
          {% endif %}
95
        </p>
96
      </div>
97
    {% endif %}
98 98

  
99
<ul id="sidebar-actions">
100
<li><a href="edit" rel="popup">{% trans "Change Status Name" %}</a></li>
101
<li><a href="display" rel="popup">{% trans "Change Display Settings" %}</a></li>
102
{% if not status.forced_endpoint %}
103
<li><a href="endpoint" rel="popup">{% trans "Force Terminal Status" %}</a></li>
104
{% endif %}
105
<li><a href="backoffice-info-text" rel="popup">{% trans "Change Backoffice Information Text" %}</a></li>
106
<li><a href="delete" rel="popup">{% trans "Delete" %}</a></li>
107
</ul>
108
<div id="new-field">
109
<h3>{% trans "New Action" %}</h3>
110
{{ view.get_new_item_form.render|safe }}
111
</div>
112
{% endif %}
99
    <ul id="sidebar-actions">
100
      <li><a href="edit" rel="popup">{% trans "Change Status Name" %}</a></li>
101
      <li><a href="display" rel="popup">{% trans "Change Display Settings" %}</a></li>
102
      {% if not status.forced_endpoint %}
103
        <li><a href="endpoint" rel="popup">{% trans "Force Terminal Status" %}</a></li>
104
      {% endif %}
105
      <li><a href="backoffice-info-text" rel="popup">{% trans "Change Backoffice Information Text" %}</a></li>
106
      <li><a href="delete" rel="popup">{% trans "Delete" %}</a></li>
107
    </ul>
108
    <div id="new-field">
109
      <h3>{% trans "New Action" %}</h3>
110
      {{ view.get_new_item_form.render|safe }}
111
    </div>
112
  {% endif %}
113 113

  
114 114
{% endblock %}
wcs/templates/wcs/backoffice/workflow.html
4 4
{% block appbar-title %}{{ workflow.name }}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
{% if not workflow.is_readonly %}
8
<a rel="popup" href="category">{% trans "change category" %}</a>
9
<a rel="popup" href="edit">{% trans "change title" %}</a>
10
{% endif %}
7
  {% if not workflow.is_readonly %}
8
    <a rel="popup" href="category">{% trans "change category" %}</a>
9
    <a rel="popup" href="edit">{% trans "change title" %}</a>
10
  {% endif %}
11 11
{% endblock %}
12 12

  
13 13
{% block content %}
14
{{ view.last_modification_block|safe }}
14
  {{ view.last_modification_block|safe }}
15 15

  
16
<div class="splitcontent-left">
17
 <div class="bo-block">
18
  <h3>{% trans "Possible Status" %}</h3>
19
  {% if not workflow.possible_status %}
20
   <p>{% trans "There are not yet any status defined in this workflow." %}</p>
21
  {% else %}
22
   {% if workflow.is_readonly %}
23
     <ul id="status-list" class="biglist">
24
   {% else %}
25
     <p class="hint">{% trans "Use drag and drop with the handles to reorder status." %}</p>
26
     <ul id="status-list" class="biglist sortable">
27
   {% endif %}
28
   {% spaceless %}
29
   {% for status in workflow.possible_status %}
30
    <li class="biglistitem {% if status.get_visibility_restricted_roles %}hidden-status{% endif %}"
31
        id="itemId_{{ status.id }}">
32
            <a href="status/{{ status.id }}/" {% if status.colour %}style="border-color: #{{status.colour}}"{% endif %}
33
               >{{ status.name }}</a></li>
34
   {% endfor %}
35
   {% endspaceless %}
36
   </ul>
37
  {% endif %}
38
 </div>
39
</div>
16
  <div class="splitcontent-left">
17
    <div class="bo-block">
18
      <h3>{% trans "Possible Status" %}</h3>
19
      {% if not workflow.possible_status %}
20
        <p>{% trans "There are not yet any status defined in this workflow." %}</p>
21
      {% else %}
22
        {% if workflow.is_readonly %}
23
          <ul id="status-list" class="biglist">
24
        {% else %}
25
          <p class="hint">{% trans "Use drag and drop with the handles to reorder status." %}</p>
26
          <ul id="status-list" class="biglist sortable">
27
        {% endif %}
28
        {% spaceless %}
29
          {% for status in workflow.possible_status %}
30
            <li class="biglistitem {% if status.get_visibility_restricted_roles %}hidden-status{% endif %}"
31
              id="itemId_{{ status.id }}">
32
              <a href="status/{{ status.id }}/" {% if status.colour %}style="border-color: #{{status.colour}}"{% endif %}
33
              >{{ status.name }}</a></li>
34
          {% endfor %}
35
        {% endspaceless %}
36
        </ul>
37
      {% endif %}
38
    </div>
39
  </div>
40 40

  
41
<div class="splitcontent-right">
42
 <div class="bo-block">
43
  <h3>{% trans "Workflow Functions" %}
44
  {% if not workflow.is_readonly %}
45
  <span class="change">(<a rel="popup" href="functions/new">{% trans "add function" %}</a>)</span>
46
  {% endif %}
47
  </h3>
48
  <ul id="roles-list" class="biglist">
49
   {% for workflow_role in view.workflow.get_sorted_functions %}
50
    <li class="biglistitem">
51
    {% if not workflow.is_readonly %}
52
    <a rel="popup" href="functions/{{ workflow_role.0|slice:"1:" }}">{{ workflow_role.1 }}</a>
53
    {% else %}
54
    <a>{{ workflow_role.1 }}</a>
55
    {% endif %}
56
    </li>
57
   {% endfor %}
58
  </ul>
59
 </div>
41
  <div class="splitcontent-right">
42
    <div class="bo-block">
43
      <h3>{% trans "Workflow Functions" %}
44
        {% if not workflow.is_readonly %}
45
          <span class="change">(<a rel="popup" href="functions/new">{% trans "add function" %}</a>)</span>
46
        {% endif %}
47
      </h3>
48
      <ul id="roles-list" class="biglist">
49
        {% for workflow_role in view.workflow.get_sorted_functions %}
50
          <li class="biglistitem">
51
            {% if not workflow.is_readonly %}
52
              <a rel="popup" href="functions/{{ workflow_role.0|slice:"1:" }}">{{ workflow_role.1 }}</a>
53
            {% else %}
54
              <a>{{ workflow_role.1 }}</a>
55
            {% endif %}
56
          </li>
57
        {% endfor %}
58
      </ul>
59
    </div>
60 60

  
61
 {% if not workflow.is_default %}
62
 <div class="bo-block variables-fields">
63
  <h3>{% trans "Workflow Variables" %}
64
  {% if not workflow.is_readonly %}
65
  <span class="change">(<a href="variables/">{% trans "change" %}</a>)</span>
66
  {% endif %}
67
  </h3>
68
  {% if workflow.variables_formdef %}
69
   <ul class="biglist">
70
   {% for field in workflow.variables_formdef.fields %}
71
     {% if field.varname %}
72
      <li><a href="variables/fields/{{ field.id }}">{{ field.ellipsized_label }}
73
       {% if '*' not in field.varname %}
74
       <code class="varname">{{ "{{" }} form_option_{{ field.varname }} }}</code>
75
       {% endif %}
76
       </a></li>
77
     {% endif %}
78
   {% endfor %}
79
   </ul>
80
  {% endif %}
81
 </div>
61
    {% if not workflow.is_default %}
62
      <div class="bo-block variables-fields">
63
        <h3>{% trans "Workflow Variables" %}
64
          {% if not workflow.is_readonly %}
65
            <span class="change">(<a href="variables/">{% trans "change" %}</a>)</span>
66
          {% endif %}
67
        </h3>
68
        {% if workflow.variables_formdef %}
69
          <ul class="biglist">
70
            {% for field in workflow.variables_formdef.fields %}
71
              {% if field.varname %}
72
                <li><a href="variables/fields/{{ field.id }}">{{ field.ellipsized_label }}
73
                  {% if '*' not in field.varname %}
74
                    <code class="varname">{{ "{{" }} form_option_{{ field.varname }} }}</code>
75
                  {% endif %}
76
                </a></li>
77
              {% endif %}
78
            {% endfor %}
79
          </ul>
80
        {% endif %}
81
      </div>
82 82

  
83
 <div class="bo-block">
84
  <h3>{% trans "Global Actions" %}
85
  {% if not workflow.is_readonly %}
86
  <span class="change">(<a rel="popup" href="global-actions/new">{% trans "add global action" %}</a>)</span>
87
  {% endif %}
88
  </h3>
89
  {% if workflow.is_readonly %}
90
   <ul class="biglist">
91
  {% else %}
92
   <ul id="status-list" class="biglist sortable" data-order-function="update_actions_order">
93
  {% endif %}
94
  {% for action in workflow.global_actions %}
95
   <li class="biglistitem" id="itemId_{{ action.id }}"><a href="global-actions/{{ action.id }}/">{{ action.name }}</a></li>
96
  {% endfor %}
97
  </ul>
98
 </div>
83
      <div class="bo-block">
84
        <h3>{% trans "Global Actions" %}
85
          {% if not workflow.is_readonly %}
86
            <span class="change">(<a rel="popup" href="global-actions/new">{% trans "add global action" %}</a>)</span>
87
          {% endif %}
88
        </h3>
89
        {% if workflow.is_readonly %}
90
          <ul class="biglist">
91
        {% else %}
92
          <ul id="status-list" class="biglist sortable" data-order-function="update_actions_order">
93
        {% endif %}
94
        {% for action in workflow.global_actions %}
95
          <li class="biglistitem" id="itemId_{{ action.id }}"><a href="global-actions/{{ action.id }}/">{{ action.name }}</a></li>
96
        {% endfor %}
97
      </ul>
98
      </div>
99 99

  
100
 <div class="bo-block">
101
  <h3>{% trans "Criticality Levels" %}
102
  {% if not workflow.is_readonly %}
103
  <span class="change">(<a rel="popup" href="criticality-levels/new">{% trans "add criticality level" %}</a>)</span>
104
  {% endif %}
105
  </h3>
106
  {% if workflow.is_readonly %}
107
   <ul class="biglist">
108
  {% else %}
109
   <ul class="biglist sortable criticality-levels" data-order-function="update_criticality_levels_order">
110
  {% endif %}
111
  {% spaceless %}
112
  {% for level in workflow.criticality_levels %}
113
   <li class="biglistitem" id="itemId_{{ level.id }}"
114
     {% if level.colour %}style="border-left-color: #{{ level.colour }}"{% endif %}>
115
     <a rel="popup" href="criticality-levels/{{ level.id }}">{{ level.name }}</a>
116
   </li>
117
   {% endfor %}
118
  {% endspaceless %}
119
  </ul>
120
 </div>
100
      <div class="bo-block">
101
        <h3>{% trans "Criticality Levels" %}
102
          {% if not workflow.is_readonly %}
103
            <span class="change">(<a rel="popup" href="criticality-levels/new">{% trans "add criticality level" %}</a>)</span>
104
          {% endif %}
105
        </h3>
106
        {% if workflow.is_readonly %}
107
          <ul class="biglist">
108
        {% else %}
109
          <ul class="biglist sortable criticality-levels" data-order-function="update_criticality_levels_order">
110
        {% endif %}
111
        {% spaceless %}
112
          {% for level in workflow.criticality_levels %}
113
            <li class="biglistitem" id="itemId_{{ level.id }}"
114
              {% if level.colour %}style="border-left-color: #{{ level.colour }}"{% endif %}>
115
              <a rel="popup" href="criticality-levels/{{ level.id }}">{{ level.name }}</a>
116
            </li>
117
          {% endfor %}
118
        {% endspaceless %}
119
      </ul>
120
      </div>
121 121

  
122
 <div class="bo-block backoffice-fields">
123
  <h3>{% trans "Backoffice Fields" %}
124
  {% if not workflow.is_readonly %}
125
  <span class="change">(<a href="backoffice-fields/">{% trans "change" %}</a>)</span>
126
  {% endif %}
127
  </h3>
128
  {% if workflow.backoffice_fields_formdef %}
129
   <ul class="biglist">
130
   {% for field in workflow.backoffice_fields_formdef.fields %}
131
      <li><a href="backoffice-fields/fields/{{ field.id }}">{{ field.ellipsized_label }}
132
       {% if field.varname %}
133
       <code class="varname">{{ "{{" }} form_var_{{ field.varname }} }}</code>
134
       {% endif %}
135
       </a></li>
136
   {% endfor %}
137
   </ul>
138
  {% endif %}
139
 </div>
140
 {% endif %} {# not workflow.is_default #}
141
</div>
122
      <div class="bo-block backoffice-fields">
123
        <h3>{% trans "Backoffice Fields" %}
124
          {% if not workflow.is_readonly %}
125
            <span class="change">(<a href="backoffice-fields/">{% trans "change" %}</a>)</span>
126
          {% endif %}
127
        </h3>
128
        {% if workflow.backoffice_fields_formdef %}
129
          <ul class="biglist">
130
            {% for field in workflow.backoffice_fields_formdef.fields %}
131
              <li><a href="backoffice-fields/fields/{{ field.id }}">{{ field.ellipsized_label }}
132
                {% if field.varname %}
133
                  <code class="varname">{{ "{{" }} form_var_{{ field.varname }} }}</code>
134
                {% endif %}
135
              </a></li>
136
            {% endfor %}
137
          </ul>
138
        {% endif %}
139
      </div>
140
    {% endif %} {# not workflow.is_default #}
141
  </div>
142 142

  
143
<br style="clear:both;"/>
143
  <br style="clear:both;"/>
144 144

  
145
{% if workflow.possible_status %}
146
<div class="bo-block">
147
{{ view.graphviz|safe }}
148
<div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a> -
145
  {% if workflow.possible_status %}
146
    <div class="bo-block">
147
      {{ view.graphviz|safe }}
148
      <div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a> -
149 149
        <a href="fullscreen">{% trans "Full Screen" %}</a></div>
150
</div>
151
{% endif %}
150
    </div>
151
  {% endif %}
152 152

  
153
{% with formdefs=workflow.formdefs carddefs=workflow.carddefs mail_templates=workflow.mail_templates %}
154
{% if formdefs or carddefs or mail_templates %}
155
<div class="section">
156
<h3>{% trans "Usage" %}</h3>
157
<div>
158
{% if formdefs %}
159
<p>{% trans "This workflow is used for the following forms:" %}
160
<ul class="objects-list single-links">
161
{% for formdef in formdefs %}
162
<li><a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a></li>
163
{% endfor %}
164
</ul>
165
{% endif %}
166
{% if carddefs %}
167
<p>{% trans "This workflow is used for the following card models:" %}
168
<ul class="objects-list single-links">
169
{% for carddef in carddefs %}
170
<li><a href="{{ carddef.get_admin_url }}">{{ carddef.name }}</a></li>
171
{% endfor %}
172
</ul>
173
{% endif %}
174
{% if mail_templates %}
175
<p>{% trans "The following mail templates are used in this workflow:" %}
176
<ul class="objects-list single-links">
177
{% for mail_template in mail_templates %}
178
<li><a href="{{ mail_template.get_admin_url }}">{{ mail_template.name }}</a></li>
179
{% endfor %}
180
</ul>
181
{% endif %}
182
</div>
183
</div>
184
{% endif %}
185
{% endwith %}
153
  {% with formdefs=workflow.formdefs carddefs=workflow.carddefs mail_templates=workflow.mail_templates %}
154
    {% if formdefs or carddefs or mail_templates %}
155
      <div class="section">
156
        <h3>{% trans "Usage" %}</h3>
157
        <div>
158
          {% if formdefs %}
159
            <p>{% trans "This workflow is used for the following forms:" %}
160
              <ul class="objects-list single-links">
161
                {% for formdef in formdefs %}
162
                  <li><a href="{{ formdef.get_admin_url }}">{{ formdef.name }}</a></li>
163
                {% endfor %}
164
              </ul>
165
          {% endif %}
166
          {% if carddefs %}
167
            <p>{% trans "This workflow is used for the following card models:" %}
168
              <ul class="objects-list single-links">
169
                {% for carddef in carddefs %}
170
                  <li><a href="{{ carddef.get_admin_url }}">{{ carddef.name }}</a></li>
171
                {% endfor %}
172
              </ul>
173
          {% endif %}
174
          {% if mail_templates %}
175
            <p>{% trans "The following mail templates are used in this workflow:" %}
176
              <ul class="objects-list single-links">
177
                {% for mail_template in mail_templates %}
178
                  <li><a href="{{ mail_template.get_admin_url }}">{{ mail_template.name }}</a></li>
179
                {% endfor %}
180
              </ul>
181
          {% endif %}
182
        </div>
183
      </div>
184
    {% endif %}
185
  {% endwith %}
186 186

  
187 187
{% endblock %}
wcs/templates/wcs/backoffice/wscall.html
1 1
{% load i18n %}
2 2

  
3 3
{% block body %}
4
<div id="appbar">
5
<h2>{% trans "Webservice Call" %} - {{ wscall.name }}</h2>
6
{% if not wscall.is_readonly %}
7
<span class="actions">
8
  <a href="edit">{% trans "Edit" %}</a>
9
</span>
10
{% endif %}
11
</div>
4
  <div id="appbar">
5
    <h2>{% trans "Webservice Call" %} - {{ wscall.name }}</h2>
6
    {% if not wscall.is_readonly %}
7
      <span class="actions">
8
        <a href="edit">{% trans "Edit" %}</a>
9
      </span>
10
    {% endif %}
11
  </div>
12 12

  
13
{% if wscall.description %}
14
<div class="bo-block">{{ wscall.description }}</div>
15
{% endif %}
16

  
17
<div class="bo-block">
18
<h3>{% trans "Parameters" %}</h3>
19
<ul>
20
  {% if wscall.request.url %}<li>{% trans "URL:" %} {{ wscall.request.url }}</li>{% endif %}
21
  {% if wscall.request.request_signature_key %}<li>{% trans "Request Signature Key:" %} {{ wscall.request.request_signature_key }}</li>{% endif %}
22
  {% if wscall.request.qs_data %}
23
  <li>{% trans "Query string data:" %}
24
      <ul>
25
        {% for k, v in wscall.request.qs_data.items %}
26
          <li>{% blocktrans %}{{ k }}:{% endblocktrans %} {{ v }}</li>
27
        {% endfor %}
28
      </ul>
29
    </li>
30
  {% endif %}
31
  <li>{% trans "Method:" %} {% if wscall.request.method == 'POST' %}POST{% else %}GET{% endif %}</li>
32
  {% if wscall.request.timeout %}
33
  <li>{% trans "Timeout:" %} {{ wscall.request.timeout }}s</li>
13
  {% if wscall.description %}
14
    <div class="bo-block">{{ wscall.description }}</div>
34 15
  {% endif %}
35
</ul>
36
</div>
37 16

  
38
<div class="bo-block">
39
<ul>
40
  <li>{% trans "Notify on errors:" %} {{ wscall.notify_on_errors|yesno }}</li>
41
  <li>{% trans "Record on errors:" %} {{ wscall.record_on_errors|yesno }}</li>
42
</ul>
43
</div>
17
  <div class="bo-block">
18
    <h3>{% trans "Parameters" %}</h3>
19
    <ul>
20
      {% if wscall.request.url %}<li>{% trans "URL:" %} {{ wscall.request.url }}</li>{% endif %}
21
      {% if wscall.request.request_signature_key %}<li>{% trans "Request Signature Key:" %} {{ wscall.request.request_signature_key }}</li>{% endif %}
22
      {% if wscall.request.qs_data %}
23
        <li>{% trans "Query string data:" %}
24
          <ul>
25
            {% for k, v in wscall.request.qs_data.items %}
26
              <li>{% blocktrans %}{{ k }}:{% endblocktrans %} {{ v }}</li>
27
            {% endfor %}
28
          </ul>
29
        </li>
30
      {% endif %}
31
      <li>{% trans "Method:" %} {% if wscall.request.method == 'POST' %}POST{% else %}GET{% endif %}</li>
32
      {% if wscall.request.timeout %}
33
        <li>{% trans "Timeout:" %} {{ wscall.request.timeout }}s</li>
34
      {% endif %}
35
    </ul>
36
  </div>
37

  
38
  <div class="bo-block">
39
    <ul>
40
      <li>{% trans "Notify on errors:" %} {{ wscall.notify_on_errors|yesno }}</li>
41
      <li>{% trans "Record on errors:" %} {{ wscall.record_on_errors|yesno }}</li>
42
    </ul>
43
  </div>
44 44
{% endblock %}
wcs/templates/wcs/backoffice/wscalls.html
4 4
{% block appbar-title %}{% trans "Webservice Calls" %}{% endblock %}
5 5

  
6 6
{% block appbar-actions %}
7
<a rel="popup" href="import">{% trans "Import" %}</a>
8
<a href="new">{% trans "New webservice call" %}</a>
7
  <a rel="popup" href="import">{% trans "Import" %}</a>
8
  <a href="new">{% trans "New webservice call" %}</a>
9 9
{% endblock %}
10 10

  
11 11
{% block content %}
12
{% if wscalls %}
13
<ul class="objects-list single-links">
14
  {% for wscall in wscalls %}
15
  <li><a href="{{ wscall.id }}/">{{ wscall.name }} ({{ wscall.slug }})</a></li>
16
  {% endfor %}
17
</ul>
18
{% else %}
19
<div class="infonotice">
20
{% trans "There are no webservice calls defined." %}
21
</div>
22
{% endif %}
12
  {% if wscalls %}
13
    <ul class="objects-list single-links">
14
      {% for wscall in wscalls %}
15
        <li><a href="{{ wscall.id }}/">{{ wscall.name }} ({{ wscall.slug }})</a></li>
16
      {% endfor %}
17
    </ul>
18
  {% else %}
19
    <div class="infonotice">
20
      {% trans "There are no webservice calls defined." %}
21
    </div>
22
  {% endif %}
23 23
{% endblock %}
wcs/templates/wcs/formdata_filling.html
3 3

  
4 4
{% block body %}
5 5

  
6
{% block form-side %}
7
{{ form_side|default:"" }}
8
{{ publisher.get_request.session.display_message|safe }}
9
{% endblock %}
6
  {% block form-side %}
7
    {{ form_side|default:"" }}
8
    {{ publisher.get_request.session.display_message|safe }}
9
  {% endblock %}
10 10

  
11
{% block form-main %}
11
  {% block form-main %}
12 12

  
13
{% block drafts-recall %}{% include "wcs/includes/drafts-recall.html" %}{% endblock %}
13
    {% block drafts-recall %}{% include "wcs/includes/drafts-recall.html" %}{% endblock %}
14 14

  
15
{% block backoffice-only-one-info %}
16
{% if not view.edit_mode and page_no == 1 and publisher.get_request.is_in_backoffice and user_has_already_one_such_form %}
17
<div class="warningnotice">
18
{% blocktrans %}
19
This form is limited to one per user and the associated user has already one.
20
{% endblocktrans %}
21
</div>
22
{% endif %}
23
{% endblock %}
15
    {% block backoffice-only-one-info %}
16
      {% if not view.edit_mode and page_no == 1 and publisher.get_request.is_in_backoffice and user_has_already_one_such_form %}
17
        <div class="warningnotice">
18
          {% blocktrans %}
19
            This form is limited to one per user and the associated user has already one.
20
          {% endblocktrans %}
21
        </div>
22
      {% endif %}
23
    {% endblock %}
24 24

  
25
{{ html_form.render|safe }}
26
{% endblock %}
25
    {{ html_form.render|safe }}
26
  {% endblock %}
27 27

  
28 28
{% endblock %}
wcs/templates/wcs/formdata_history.html
1 1
{% load i18n %}
2 2
<div class="section foldable {% if view.should_fold_history %}folded{% endif %}" id="evolution-log">
3
 {% block log-section-title %}
4
 <h2>{% trans "Log" %}</h2>
5
 {% endblock %}
6
 <div>
7
 <ul id="evolutions">
8
  {% for evolution in formdata.get_visible_evolution_parts %}
9
    {% with status=evolution.get_status display_parts=evolution.display_parts %}
10
    <li class="{% if evolution.who == '_submitter' %}msg-in{% elif evolution.who %}msg-out{% else %}msg-system{% endif %}
11
               {% if status.is_endpoint %}endpoint{% endif %}
12
               {{ status.extra_css_class|default:"" }}">
13
      <span class="item {% if not evolution.status %}no-status-change{% endif %}" style="background: #{{ status.colour }}; color: {{ status.get_contrast_color}}"></span>
14
      <div>
15
       {% if evolution.status %}
16
         <div class="evolution-metadata">
17
           <span class="status">{{evolution.get_status_label}}
18
             {% if status.get_visibility_restricted_roles %}
19
             <span title="{% trans "This status is not visible to users" %}" class="visibility-off"></span>
20
             {% endif %}
21
           </span>
22
           <span class="time">{{evolution.datetime}}
23
             {% if evolution.last_jump_datetime and user.is_admin %}
24
             <span class="last-jump">({% trans "last check:" %} {{ evolution.last_jump_datetime }})</span>
25
             {% endif %}
26
           </span>
27
         </div>
28
       {% endif %}
29
       <div class="msg">
30
         {% if evolution.who and include_authors %}
31
         <span class="user">{{evolution.get_author_name|default_if_none:""}}
32
                 <span>{% if evolution.get_author_qualification %}({{evolution.get_author_qualification}}){% endif %}</span>
33
         </span>
34
         {% endif %}
35
         {% if not evolution.status %}
36
           <span class="time">{{evolution.datetime}}</span>
37
         {% endif %}
38
         {% if evolution.comment %}
39
         <div class="comment">
40
           {{evolution.comment|linebreaks}}
41
         </div>
42
         {% endif %}
43
         {% for part in display_parts %}
44
           {{part|safe}}
45
         {% endfor %}
46
       </div>
47
      </div>
48
    </li>
49
    {% endwith %}
50
  {% endfor %}
51
 </ul>
52
 </div>
3
  {% block log-section-title %}
4
    <h2>{% trans "Log" %}</h2>
5
  {% endblock %}
6
  <div>
7
    <ul id="evolutions">
8
      {% for evolution in formdata.get_visible_evolution_parts %}
9
        {% with status=evolution.get_status display_parts=evolution.display_parts %}
10
          <li class="{% if evolution.who == '_submitter' %}msg-in{% elif evolution.who %}msg-out{% else %}msg-system{% endif %}
11
            {% if status.is_endpoint %}endpoint{% endif %}
12
            {{ status.extra_css_class|default:"" }}">
13
            <span class="item {% if not evolution.status %}no-status-change{% endif %}" style="background: #{{ status.colour }}; color: {{ status.get_contrast_color}}"></span>
14
            <div>
15
              {% if evolution.status %}
16
                <div class="evolution-metadata">
17
                  <span class="status">{{evolution.get_status_label}}
18
                    {% if status.get_visibility_restricted_roles %}
19
                      <span title="{% trans "This status is not visible to users" %}" class="visibility-off"></span>
20
                    {% endif %}
21
                  </span>
22
                  <span class="time">{{evolution.datetime}}
23
                    {% if evolution.last_jump_datetime and user.is_admin %}
24
                      <span class="last-jump">({% trans "last check:" %} {{ evolution.last_jump_datetime }})</span>
25
                    {% endif %}
26
                  </span>
27
                </div>
28
              {% endif %}
29
              <div class="msg">
30
                {% if evolution.who and include_authors %}
31
                  <span class="user">{{evolution.get_author_name|default_if_none:""}}
32
                    <span>{% if evolution.get_author_qualification %}({{evolution.get_author_qualification}}){% endif %}</span>
33
                  </span>
34
                {% endif %}
35
                {% if not evolution.status %}
36
                  <span class="time">{{evolution.datetime}}</span>
37
                {% endif %}
38
                {% if evolution.comment %}
39
                  <div class="comment">
40
                    {{evolution.comment|linebreaks}}
41
                  </div>
42
                {% endif %}
43
                {% for part in display_parts %}
44
                  {{part|safe}}
45
                {% endfor %}
46
              </div>
47
            </div>
48
          </li>
49
        {% endwith %}
50
      {% endfor %}
51
    </ul>
52
  </div>
53 53
</div>
wcs/templates/wcs/formdata_popup_filling.html
6 6
{% block sidepage %}{% endblock %}
7 7

  
8 8
{% block main-content %}
9
{% block form-side %}
10
{{ form_side|default:"" }}
11
{{ publisher.get_request.session.display_message|safe }}
12
{% endblock %}
9
  {% block form-side %}
10
    {{ form_side|default:"" }}
11
    {{ publisher.get_request.session.display_message|safe }}
12
  {% endblock %}
13 13

  
14
{{ html_form.render|safe }}
14
  {{ html_form.render|safe }}
15 15
{% endblock %}
16 16

  
17 17
{% block footer %}{% endblock %}
wcs/templates/wcs/formdata_sidebox.html
1 1
{% load i18n %}
2 2
<div id="side">
3
{% if view.has_draft_support and data %}
4
{# display tracking code box if they are enabled and there's some data #}
5
{# (e.g. the user is not on a insufficient authenticiation context page). #}
3
  {% if view.has_draft_support and data %}
4
    {# display tracking code box if they are enabled and there's some data #}
5
    {# (e.g. the user is not on a insufficient authenticiation context page). #}
6 6

  
7
{% block tracking-code-box %}
8
{% with get_tracking_code as tracking_code %}
9
  {% if tracking_code or is_recalled_draft %}
10
  <div id="tracking-code" {% if is_recalled_draft %}class="has-discard-button"{% endif %}>
11
  {% if view.formdef.enable_tracking_codes %}
12
  {% add_javascript "popup.js" %}
13
  {% block tracking-code %}
14
    <div class="tracking-code-part">
15
    <h3>{% trans "Tracking code" %}</h3>
16
    <a data-popup href="code/{{ tracking_code }}/">{{ tracking_code }}</a>
17
    {% standard_text "tracking-code-short-text" %}
18
    </div>
19
  {% endblock %}
20
  {% endif %}
7
    {% block tracking-code-box %}
8
      {% with get_tracking_code as tracking_code %}
9
        {% if tracking_code or is_recalled_draft %}
10
          <div id="tracking-code" {% if is_recalled_draft %}class="has-discard-button"{% endif %}>
11
            {% if view.formdef.enable_tracking_codes %}
12
              {% add_javascript "popup.js" %}
13
              {% block tracking-code %}
14
                <div class="tracking-code-part">
15
                  <h3>{% trans "Tracking code" %}</h3>
16
                  <a data-popup href="code/{{ tracking_code }}/">{{ tracking_code }}</a>
17
                  {% standard_text "tracking-code-short-text" %}
18
                </div>
19
              {% endblock %}
20
            {% endif %}
21 21

  
22
  {% if is_recalled_draft %}
23
  {% block recalled-draft %}
24
    <form action="removedraft" method="POST">
25
    <input type="hidden" name="magictoken" value="{{ magictoken }}">
26
    <button class="form-discard-draft">{% trans "Discard Draft" %}</button>
27
  </form>
28
  {% endblock %}
29
  {% endif %}
22
            {% if is_recalled_draft %}
23
              {% block recalled-draft %}
24
                <form action="removedraft" method="POST">
25
                  <input type="hidden" name="magictoken" value="{{ magictoken }}">
26
                  <button class="form-discard-draft">{% trans "Discard Draft" %}</button>
27
                </form>
28
              {% endblock %}
29
            {% endif %}
30 30

  
31
  </div>
31
          </div>
32
        {% endif %}
33
      {% endwith %}
34
    {% endblock %} {# tracking-code-box #}
32 35
  {% endif %}
33
{% endwith %}
34
{% endblock %} {# tracking-code-box #}
35
{% endif %}
36 36

  
37
{% block steps %}
38
{{ step }}
39
{% endblock %}
37
  {% block steps %}
38
    {{ step }}
39
  {% endblock %}
40 40

  
41 41
</div> <!-- #side -->
wcs/templates/wcs/formdata_status.html
2 2
{% load i18n %}
3 3

  
4 4
{% block body %}
5
{% block session-message %}
6
{{session_message|safe}}
7
{% endblock %}
5
  {% block session-message %}
6
    {{session_message|safe}}
7
  {% endblock %}
8 8

  
9
{% with workflow_messages=view.workflow_messages %}
10
  {% if workflow_messages %}
11
    {{ workflow_messages|safe }}
12
  {% else %}
13
    <div id="receipt-intro">
14
      {{ view.recorded_message|safe }}
15
      {% if mine %}
16
        {{ view.get_handling_role_info_text|safe }}
17
      {% endif %}
18
      {% if mine and formdata.formdef.enable_tracking_codes and formdata.tracking_code %}
19
        <p id="tracking-code">
20
        {% trans "You can get back to this page using the following tracking code:" %}
21
        <a href="../code/{{ formdata.tracking_code }}/" data-popup>{{ formdata.tracking_code }}</a>
22
        </p>
23
      {% endif %}
24
    </div>
25
  {% endif %}
26
{% endwith %}
9
  {% with workflow_messages=view.workflow_messages %}
10
    {% if workflow_messages %}
11
      {{ workflow_messages|safe }}
12
    {% else %}
13
      <div id="receipt-intro">
14
        {{ view.recorded_message|safe }}
15
        {% if mine %}
16
          {{ view.get_handling_role_info_text|safe }}
17
        {% endif %}
18
        {% if mine and formdata.formdef.enable_tracking_codes and formdata.tracking_code %}
19
          <p id="tracking-code">
20
            {% trans "You can get back to this page using the following tracking code:" %}
21
            <a href="../code/{{ formdata.tracking_code }}/" data-popup>{{ formdata.tracking_code }}</a>
22
          </p>
23
        {% endif %}
24
      </div>
25
    {% endif %}
26
  {% endwith %}
27 27

  
28
{{ view.receipt|safe }}
29
{{ view.history|safe }}
28
  {{ view.receipt|safe }}
29
  {{ view.history|safe }}
30 30

  
31
{% with workflow_messages=view.bottom_workflow_messages %}
32
{% if workflow_messages or workflow_form %}<span id="action-zone"></span>{% endif %}
33
  {{ workflow_messages|safe }}
34
{% endwith %}
35
{% if workflow_form %}
36
  {{ view.actions_workflow_messages|safe }}
37
  {{ workflow_form.render|safe }}
38
{% endif %}
31
  {% with workflow_messages=view.bottom_workflow_messages %}
32
    {% if workflow_messages or workflow_form %}<span id="action-zone"></span>{% endif %}
33
    {{ workflow_messages|safe }}
34
  {% endwith %}
35
  {% if workflow_form %}
36
    {{ view.actions_workflow_messages|safe }}
37
    {{ workflow_form.render|safe }}
38
  {% endif %}
39 39

  
40 40
  <div class="back-home-button">
41 41
    <a href="{{ publisher.get_root_url }}">{% trans "Back Home" %}</a>
wcs/templates/wcs/formdata_steps.html
1 1
<div id="steps" class="steps-{{page_labels|length}}">
2
<ol>
3
{% for page_label in page_labels %}
4
{% spaceless %}
5
<li class="{% if forloop.first %}first{% endif %}
6
           {% if forloop.last %}last{% endif %}
7
           {% if forloop.counter == current_page_no %}current{% endif %}
8
           {% if forloop.counter < current_page_no %}step-before{% endif %}
9
           {% if forloop.counter > current_page_no %}step-after{% endif %}" >
10
  <span class="marker">{{ forloop.counter }}</span>
11
  <span class="label">{{ page_label }}</span>
12
</li>
13
{% endspaceless %}
14
{% endfor %}
15
</ol>
2
  <ol>
3
    {% for page_label in page_labels %}
4
      {% spaceless %}
5
        <li class="{% if forloop.first %}first{% endif %}
6
          {% if forloop.last %}last{% endif %}
7
          {% if forloop.counter == current_page_no %}current{% endif %}
8
          {% if forloop.counter < current_page_no %}step-before{% endif %}
9
          {% if forloop.counter > current_page_no %}step-after{% endif %}" >
10
          <span class="marker">{{ forloop.counter }}</span>
11
          <span class="label">{{ page_label }}</span>
12
        </li>
13
      {% endspaceless %}
14
    {% endfor %}
15
  </ol>
16 16
</div>
wcs/templates/wcs/formdata_validation.html
1 1
{% extends template_base %}
2 2

  
3 3
{% block body %}
4
<div class="form-validation">
5
 {{ form_side|default:"" }}
6
 <div class="infonotice">
7
 {% standard_text "check-before-submit" %}
8
 </div>
9
 {{ html_form.render|safe }}
10
</div>
4
  <div class="form-validation">
5
    {{ form_side|default:"" }}
6
    <div class="infonotice">
7
      {% standard_text "check-before-submit" %}
8
    </div>
9
    {{ html_form.render|safe }}
10
  </div>
11 11
{% endblock %}
wcs/templates/wcs/includes/drafts-recall.html
2 2
{% if not view.preview_mode and view.initial_drafts %}
3 3
  {% with view.initial_drafts|length as drafts_length %}
4 4
    <div class="drafts-recall">
5
     <p>
6
       {% blocktrans %}
7
       You already started to fill this form. You can continue it or submit a new
8
       one.
9
       {% endblocktrans %}
10
     </p>
11
     {% if drafts_length == 1 %}
12
       <p><a class="pk-button" href="{{view.initial_drafts.0.internal_id}}/">{% trans "Continue with draft" %}</a></p>
13
     {% elif drafts_length > 1 %}
14
     <ul>
15
     {% for draft in view.initial_drafts %}
16
     <li><a href="{{draft.internal_id}}/">{% trans "continue with draft from " %} {{draft.receipt_date}}
17
                     {{draft.receipt_time}}</a>, {% blocktrans with page_no=draft.page_no|add:1 %}on page {{page_no}}{% endblocktrans %}</li>
18
     {% endfor %}
19
     </ul>
20
     {% endif %}
5
      <p>
6
        {% blocktrans %}
7
          You already started to fill this form. You can continue it or submit a new
8
          one.
9
        {% endblocktrans %}
10
      </p>
11
      {% if drafts_length == 1 %}
12
        <p><a class="pk-button" href="{{view.initial_drafts.0.internal_id}}/">{% trans "Continue with draft" %}</a></p>
13
      {% elif drafts_length > 1 %}
14
        <ul>
15
          {% for draft in view.initial_drafts %}
16
            <li><a href="{{draft.internal_id}}/">{% trans "continue with draft from " %} {{draft.receipt_date}}
17
              {{draft.receipt_time}}</a>, {% blocktrans with page_no=draft.page_no|add:1 %}on page {{page_no}}{% endblocktrans %}</li>
18
          {% endfor %}
19
        </ul>
20
      {% endif %}
21 21
    </div>
22 22
  {% endwith %}
23 23
{% endif %}
24
-