From 6a48abafd77731a2ef1e4cf13b85bf4dc18fb6c2 Mon Sep 17 00:00:00 2001 From: Vinicius de Andrade Date: Tue, 30 May 2017 15:28:07 -0300 Subject: [PATCH] =?UTF-8?q?[oer]=20Revis=C3=A3o=20nos=20formul=C3=A1rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bireme/static/css/screen.css | 4 +- .../templates/oer/fieldset_relationship.html | 20 ++- bireme/templates/oer/oer_form.html | 159 ++++++++++-------- bireme/templates/oer/oer_list.html | 2 +- 4 files changed, 108 insertions(+), 77 deletions(-) diff --git a/bireme/static/css/screen.css b/bireme/static/css/screen.css index 67199e7f..3f65a20b 100644 --- a/bireme/static/css/screen.css +++ b/bireme/static/css/screen.css @@ -495,11 +495,11 @@ div.onlineresource div.check { } .preview #tab-descriptors { padding-bottom: 10px; } -#field_LILACS_indexed{ +#field_LILACS_indexed, #field_CVSP_resource{ margin-bottom: 10px; font-weight: bold; } -#field_LILACS_indexed input[type="checkbox"]{ +#field_LILACS_indexed input[type="checkbox"], #field_CVSP_resource input[type="checkbox"]{ width: 18px; height: 18px; margin-left: 5px; diff --git a/bireme/templates/oer/fieldset_relationship.html b/bireme/templates/oer/fieldset_relationship.html index d2df2798..59b50667 100644 --- a/bireme/templates/oer/fieldset_relationship.html +++ b/bireme/templates/oer/fieldset_relationship.html @@ -14,7 +14,9 @@ {% trans "Relation type" %} {% trans "Resource" %} - {% trans "Delete?" %} + {% if user_can_edit %} + {% trans "Delete?" %} + {% endif %} @@ -81,11 +83,21 @@ {% endfor %} {% else %} {% for form in formset_relation %} - {% for field in form %} + + {% if field.name == 'oer_referred' %} - {{ field }} + {{ form.instance.oer_referred }} - {% endfor %} + {% elif field.name == 'relation_type' %} + + {{ form.instance.relation_type.get_label_present }} + + {% else %} + + {{ field.value }} + + {% endif %} + {% endfor %} {% endif %} diff --git a/bireme/templates/oer/oer_form.html b/bireme/templates/oer/oer_form.html index 8d511f63..49b215bd 100644 --- a/bireme/templates/oer/oer_form.html +++ b/bireme/templates/oer/oer_form.html @@ -53,11 +53,15 @@

{% if not object %}{% trans "New Resource" %}{% els {% if field.value %}

{{ field.label }}

-

{% display_field field %}

+ {% if field.name == 'status' %} +

{{ field.value|display_status_label }}

+ {% else %} +

{% display_field field %}

+ {% endif %}

{% endif %} {% else %} - +
  • {% if field.name == 'status' and not user_can_change_status %}

    {{ field.label }} : {{ field.value|display_status_label }} @@ -101,7 +105,7 @@

    {% if not object %}{% trans "New Resource" %}{% els {% endif %} {% endif %} - +

  • {% endfor %} {% comment %}Display administrative information{% endcomment %} @@ -128,52 +132,59 @@

    {% if not object %}{% trans "New Resource" %}{% els - - {% if descriptor_list %} - {% for descriptor in descriptor_list %} + {% if user_can_edit %} + {{ formset_descriptor.management_form }} + + {% for form in formset_descriptor %} + + {% for hidden in form.hidden_fields %} + {{ hidden }} + {% endfor %} + {% for field in form.visible_fields %} + {% if field.name == 'status' %} + + {% elif field.name == 'code' %} + {{ field.as_hidden }} + {% elif field.name == 'text' %} + + {{ field.as_hidden }} +
    + {% spaceless %} + {% if field.value == None or field.value == '' %} + {% trans "Select by search" %} + {% else %} + {{ field.value}} + {% endif %} + {% endspaceless %} +
    + + {% elif field.name != 'DELETE' %} + + {{ field }} + {{ field.errors }} + + {% endif %} + {% endfor %} + + {% if form.instance.pk %}{{ form.DELETE }}{% endif %} + + + {% endfor %} + {% else %} + {% for form in formset_descriptor %} - {{ descriptor.text }} + {% if form.instance.id %} + {% for field in form %} + {% if field.name == 'text' or field.name == 'primary' %} + + {{field.value}} + + {% endif %} + {% endfor %} + {% endif %} {% endfor %} {% endif %} - - {{ formset_descriptor.management_form }} - - {% for form in formset_descriptor %} - - {% for hidden in form.hidden_fields %} - {{ hidden }} - {% endfor %} - {% for field in form.visible_fields %} - {% if field.name == 'status' %} - - {% elif field.name == 'code' %} - {{ field.as_hidden }} - {% elif field.name == 'text' %} - - {{ field.as_hidden }} -
    - {% spaceless %} - {% if field.value == None or field.value == '' %} - {% trans "Select by search" %} - {% else %} - {{ field.value}} - {% endif %} - {% endspaceless %} -
    - - {% elif field.name != 'DELETE' %} - - {{ field }} - {{ field.errors }} - - {% endif %} - {% endfor %} - - {% if form.instance.pk %}{{ form.DELETE }}{% endif %} - - - {% endfor %} @@ -208,39 +219,47 @@

    {% if not object %}{% trans "New Resource" %}{% els - + {% if user_can_edit %} + + {% endif %} - {% if thematic_list %} - {% for thematic in thematic_list %} - - - - {% endfor %} - {% endif %} - - {{ formset_thematic.management_form }} + {% if user_can_edit %} + {{ formset_thematic.management_form }} - {% for form in formset_thematic %} - {% for hidden in form.hidden_fields %} - {{ hidden }} + {% for form in formset_thematic %} + {% for hidden in form.hidden_fields %} + {{ hidden }} + {% endfor %} + + {% for field in form.visible_fields %} + {% if role == 'doc' and field.name == 'status' %} + + {% elif field.name != 'DELETE' %} + + {% endif %} + {% endfor %} + + {% endfor %} - - {% for field in form.visible_fields %} - {% if role == 'doc' and field.name == 'status' %} - - {% elif field.name != 'DELETE' %} + {% else %} + {% for form in formset_thematic %} + + {% for field in form %} + {% if field.name == 'thematic_area' %} {% endif %} {% endfor %} - - - {% endfor %} + + {% endfor %} + {% endif %}
    {% trans "Thematic area" %}{% trans "Delete?" %}{% trans "Delete?" %}
    {{ thematic }}
    + {{ field }} + {{ field.errors }} + + {% if form.instance.pk %}{{ form.DELETE }}{% endif %} +
    - {{ field }} - {{ field.errors }} + {{ form.instance.thematic_area }} - {% if form.instance.pk %}{{ form.DELETE }}{% endif %} -
    diff --git a/bireme/templates/oer/oer_list.html b/bireme/templates/oer/oer_list.html index a0a11e02..e5775738 100644 --- a/bireme/templates/oer/oer_list.html +++ b/bireme/templates/oer/oer_list.html @@ -136,7 +136,7 @@

    {% trans "Educational resources" %}

    {{ oer.status|display_status_label }} - {% if oer.created_by_id = user.id %} + {% if oer.created_by_id = user.id and oer.status < 1 %} {% endif %}