Projet

Général

Profil

Télécharger (2,07 ko) Statistiques
| Branche: | Tag: | Révision:

organization_api / ckanext / ozwillo_organization_api / templates / organization / snippets / organization_form.html @ 3c33f2ff

1
{% import 'macros/form.html' as form %}
2

    
3
<form class="dataset-form form-horizontal" method="post" data-module="basic-form" enctype="multipart/form-data">
4
  {% block error_summary %}
5
    {{ form.errors(error_summary) }}
6
  {% endblock %}
7

    
8
  {% block basic_fields %}
9
    {% set attrs = {'data-module': 'slug-preview-target'} %}
10

    
11
    {# Perhaps these should be moved into the controller? #}
12
    {% set prefix = h.url_for(controller='organization', action='read', id='') %}
13
    {% set domain = h.url_for(controller='organization', action='read', id='', qualified=true) %}
14
    {% set domain = domain|replace("http://", "")|replace("https://", "") %}
15
    {% set attrs = {'data-module': 'slug-preview-slug', 'data-module-prefix': domain, 'data-module-placeholder': '<organization>'} %}
16

    
17
    {{ form.markdown('description', label=_('Description'), id='field-description', placeholder=_('A little information about my organization...'), value=data.description, error=errors.description) }}
18

    
19
    {% set is_upload = data.image_url and not data.image_url.startswith('http') %}
20
    {% set is_url = data.image_url and data.image_url.startswith('http') %}
21

    
22
    {{ form.image_upload(data, errors, is_upload_enabled=h.uploads_enabled(), is_url=is_url, is_upload=is_upload) }}
23

    
24
    {% endblock %}
25
    {% block custom_fields %}
26
    {% endblock %}
27

    
28
  {{ form.required_message() }}
29

    
30
  <div class="form-actions">
31
    {% block delete_button %}
32
      {% if h.check_access('organization_delete', {'id': data.id})  %}
33
        {% set locale = h.dump_json({'content': _('Are you sure you want to delete this Organization? This will delete all the public and private datasets belonging to this organization.')}) %}
34
        <a class="btn btn-danger pull-left" href="{% url_for controller='organization', action='delete', id=data.id %}" data-module="confirm-action" data-module-i18n="{{ locale }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a>
35
      {% endif %}
36
    {% endblock %}
37
    <button class="btn btn-primary" name="save" type="submit">{% block save_text %}{{ _('Save Organization') }}{% endblock %}</button>
38
  </div>
39
</form>
    (1-1/1)