diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-04-19 21:06:25 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-04-19 21:11:13 +0200 | 
| commit | cb4c402417f7ae6a69c0ab92673a0863318a6dce (patch) | |
| tree | 9e33c15a987ea8b3928fa746acc008f65f35f87f | |
| parent | 3a19d84d3e197a12239a597a7d771383111ce211 (diff) | |
| download | Chimère-cb4c402417f7ae6a69c0ab92673a0863318a6dce.tar.bz2 Chimère-cb4c402417f7ae6a69c0ab92673a0863318a6dce.zip | |
Evolution on public form submission (closes #336)
* Add a 3 actions pop-up after submission: edit the submited item,
  add a new item, return to the map.
| -rw-r--r-- | chimere/static/chimere/css/styles.css | 10 | ||||
| -rw-r--r-- | chimere/templates/chimere/blocks/inline_formset.html | 2 | ||||
| -rw-r--r-- | chimere/templates/chimere/blocks/submited.html | 29 | ||||
| -rw-r--r-- | chimere/templatetags/chimere_tags.py | 3 | 
4 files changed, 37 insertions, 7 deletions
| diff --git a/chimere/static/chimere/css/styles.css b/chimere/static/chimere/css/styles.css index a4ae9b8..c59702d 100644 --- a/chimere/static/chimere/css/styles.css +++ b/chimere/static/chimere/css/styles.css @@ -172,6 +172,10 @@ fieldset{      margin-top:8px;  } +.ui-dialog-buttonset{ +    text-align:center; +} +  .edit label{      display:block;  } @@ -514,7 +518,6 @@ a#welcome_button{  /* forms */  table.inline-table{ -    width:100%;  }  table.inline-table td{ @@ -529,6 +532,11 @@ table.inline-table td input[type=checkbox]{      margin-right:auto;  } +table.inline-table td input[type=text], +table.inline-table td input[type=file]{ +    width:260px; +} +  #live_lonlat p{      display:inline-table;  } diff --git a/chimere/templates/chimere/blocks/inline_formset.html b/chimere/templates/chimere/blocks/inline_formset.html index af0a866..139ad70 100644 --- a/chimere/templates/chimere/blocks/inline_formset.html +++ b/chimere/templates/chimere/blocks/inline_formset.html @@ -10,7 +10,7 @@      <tr>{% for field in frm.visible_fields %}          <td>{# Include the hidden fields in the form #}          {% if forloop.first %} -          {% for hidden in form.hidden_fields %} +          {% for hidden in frm.hidden_fields %}            {{ hidden }}            {% endfor %}          {% endif %} diff --git a/chimere/templates/chimere/blocks/submited.html b/chimere/templates/chimere/blocks/submited.html index 0def505..ad264f8 100644 --- a/chimere/templates/chimere/blocks/submited.html +++ b/chimere/templates/chimere/blocks/submited.html @@ -1,5 +1,26 @@  {% load i18n %} -    <fieldset class='edit'> -        <legend>{% trans "Thank you" %}</legend> -        <p>{% trans "Your proposition has been submited. A moderator will treat your submission shortly. Thanks!" %}</p> -    </fieldset> +    <div class='edit' id='submited-window'> +        <p>{% trans "Your new proposition/modification has been submited. A moderator will treat your submission shortly. Thanks!" %}</p> +    </div> +    <script type='text/javascript'> +        $(function(){ +            $("#submited-window").dialog({ +                    title:"{% trans "Thank you" %}", +                    modal: true, +                    buttons:{ +                        "{% trans "Add a new item" %}": +                            function() { +                                window.location = "{{edit_url}}"; +                            }, +                        "{% trans "Continue edition of this item" %}": +                            function() { +                                $(this).dialog("close"); +                            }, +                        "{% trans "Return to the map" %}": +                            function() { +                                window.location = "{{index_url}}"; +                            } +                        } +                    }); +        }); +    </script> diff --git a/chimere/templatetags/chimere_tags.py b/chimere/templatetags/chimere_tags.py index 5346cf3..a0ce607 100644 --- a/chimere/templatetags/chimere_tags.py +++ b/chimere/templatetags/chimere_tags.py @@ -27,7 +27,8 @@ def submited(context):      """      Submited message.      """ -    return {} +    return {"edit_url":reverse('chimere:edit'), +            "index_url":reverse('chimere:index')}  @register.inclusion_tag('chimere/blocks/welcome.html', takes_context=True)  def display_news(context, display=False): | 
