PageRenderTime 3ms CodeModel.GetById 2ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 0ms

/main/templates/show.html

https://github.com/zoulema/formhub
HTML | 661 lines | 632 code | 27 blank | 2 comment | 0 complexity | 47fe9cd90b0ecef3402e2cc2cd032613 MD5 | raw file
  1{% extends 'base.html' %}
  2{% load humanize %}
  3{% block content %}
  4{% load i18n %}
  5
  6  <section id="profile">
  7    <div class="page-header">
  8      <!-- <img src='{{ content_user.profile.gravatar }}' alt='gravatar' width='40' height='40' style='float:left; padding-right:10px;' /> -->
  9    <div id="mfeedback">&nbsp;</div>
 10	<h3>
 11	  <div style='vertical-align: middle'>
 12	  <img src='{{ content_user.profile.gravatar }}' alt='gravatar' width='20' height='20' />
 13	  <a href="{% url "user_profile" content_user.username %}">{{ content_user.username }}</a> ({% trans "Owner" %}) /
 14	  </div>
 15	</h3>
 16        <div class="clearfix">
 17            <div class="input">
 18            <form>
 19                {% csrf_token %}
 20                <input type="text" id="title"class="input-xxlarge present header" disabled="" rows="3" value="{{ xform.title }}" />
 21                {% if can_edit %}
 22                    <a id="title_edit" data-id="title" href="" class="btn small bind-edit">{% trans "edit" %}</a>
 23                    <a id="title_save" data-id="title" style="display:none" href="" class="btn small btn-primary bind-save" data-url="{% url "main.views.edit" content_user.username xform.id_string %}">{% trans "save" %}</a>
 24                {% endif %}
 25            </form>
 26            </div>
 27        </div>
 28    </div>
 29    <div class="row">
 30      <div class="span8">
 31        {% if can_edit %}
 32            <h4>{% trans "Form ID:" %} {{ xform.id_string }}</h4>
 33        {% endif %}
 34        <h3>{% trans "Description" %}</h3>
 35        <div class="clearfix">
 36            <div class="input">
 37            <form>
 38                {% csrf_token %}
 39                <textarea id="description" class="input-xxlarge present" disabled="" rows="3" name="textarea">{% if xform.description %}{{ xform.description }}{% else %}{% trans "None" %}{% endif %}</textarea>
 40                {% if can_edit %}
 41                    <a id="description_edit" data-id="description" href="" class="btn small bind-edit">{% trans "edit" %}</a>
 42                    <a id="description_save" data-id="description" style="display:none" href="" class="btn small btn-primary bind-save" data-url="{% url "main.views.edit" content_user.username xform.id_string %}">{% trans "save" %}</a>
 43                {% endif %}
 44            </form>
 45            </div>
 46        </div>
 47      <div class="bordered">
 48        <h3>
 49            {% trans "XLSForm" %}
 50            <span id="form-shared-public" class="label label-info">{% trans "PUBLIC" %}</span>
 51            <span id="form-shared-private" class="label label-warning">{% trans "PRIVATE" %}</span>
 52            <span id="form-encrypted" class="label label-important icon-lock label-encrypted">&nbsp;&nbsp;{% trans "ENCRYPTED" %}</span>
 53        </h3>
 54        <br/>
 55        <div class="btn-toolbar" style="margin-bottom: 9px">
 56          <div class="btn-group">
 57            <a class="btn btn-success" href="{% url "download_xlsform" content_user.username xform.id_string %}"><i class="icon-th icon-white"></i><font color=#FFF> {% trans "XLSForm" %}</font></a>
 58            <button class="btn dropdown-toggle btn-success" data-toggle="dropdown">
 59              <span class="caret"></span>
 60            </button>
 61            <ul class="dropdown-menu">
 62              <li>
 63                <input class="input-xxlarge" type="text" size="16" value="{{ base_url }}{% url "download_xlsform" content_user.username xform.id_string %}"/>
 64              </li>
 65            </ul>
 66          </div>
 67          <div class="btn-group">
 68            <a class="btn" href="{% url "download_xform" content_user.username xform.id_string %}"><i class="icon-file"></i><font color=#000> {% trans "XForm" %}</font></a>
 69            <button class="btn dropdown-toggle" data-toggle="dropdown">
 70              <span class="caret"></span>
 71            </button>
 72            <ul class="dropdown-menu">
 73              <li>
 74                <input class="input-xxlarge" type="text" size="16" value="{{ base_url }}{% url "download_xform" content_user.username xform.id_string %}"/>
 75              </li>
 76            </ul>
 77          </div>
 78          <div class="btn-group">
 79            <a class="btn" href="{% url "download_jsonform" content_user.username xform.id_string %}"><i class="icon-file"></i><font color=#000> {% trans "JSONForm" %}</font></a>
 80            <button class="btn dropdown-toggle" data-toggle="dropdown">
 81              <span class="caret"></span>
 82            </button>
 83            <ul class="dropdown-menu">
 84              <li>
 85                <input class="input-xxlarge" type="text" size="16" value="{{ base_url }}{% url "download_jsonform" content_user.username xform.id_string %}"/>
 86              </li>
 87            </ul>
 88        </div>
 89    </div>
 90    <br>
 91        </ul>
 92        <p>
 93            {% trans "License" %}:
 94            {% if can_edit %}
 95                {% for field in form_license_form %}
 96                    {{ field }}
 97                {% endfor %}
 98                <a id="form-license_edit" data-id="form-license" href="" class="btn btn-small bind-edit">{% trans "edit" %}</a>
 99                <a id="form-license_save" data-id="form-license" style="display:none" href="" class="btn btn-small btn-primary bind-save" data-url="{% url "main.views.edit" content_user.username xform.id_string %}">{% trans "save" %}</a>
100            {% else %}
101                {{ form_license|default:'No license' }}
102            {% endif %}
103        </p>
104        <p><a id="form-license_info" style="display:none" href="">{% trans "License information" %}</a></p>
105        <br/>
106        <ul class="inline">
107        {% if user.is_authenticated and content_user.username != user.username and xform.xls|length > 0 and not cloned %}
108            <br/><br/>
109            <li>
110                <a href="" data-url="{% url "main.views.clone_xlsform" xform.user.username %}" data-username="{{ xform.user.username }}" data-id="{{ xform.id_string }}" class="clonexls btn small">{% trans "Clone" %}</a>
111            </li>
112        {% endif %}
113        </ul>
114      </div>
115      <br/>
116      <div class="clearfix bordered">
117        <h3>
118            {% trans "Form Data" %}
119            <span id="data-shared-public" class="label label-info">{% trans "PUBLIC" %}</span>
120            <span id="data-shared-private" class="label label-warning">{% trans "PRIVATE" %}</span>
121            <span id="data-encrypted" class="label label-important icon-lock label-encrypted">&nbsp;&nbsp;{% trans "ENCRYPTED" %}</span>
122        </h3>
123        {% if xform.shared_data or can_view %}
124        {% if not xform.encrypted and xform.submission_count > 0 %}
125        <br>
126        <div class="btn-toolbar" style="margin-bottom: 9px">
127          <div class="btn-group">
128            <a class="btn" href="{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'csv' %}" rel="tooltip" data-original-title="{% trans 'csv exports' %}"><i class="icon-download-alt"></i> <font color=#000>{% trans "csv" %}</font></a>
129            <button class="btn dropdown-toggle" data-toggle="dropdown">
130              <span class="caret"></span>
131            </button>
132            <ul class="dropdown-menu">
133              <li>
134                <input class="input-xxlarge" type="text" size="16" value="{{base_url}}{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'csv' %}"/>
135              </li>
136            </ul>
137          </div>
138          <div class="btn-group">
139            <a class="btn" href="{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'csv_zip' %}" rel="tooltip" data-original-title="{% trans 'csv zip exports' %}"><i class="icon-download-alt"></i> <font color=#000>{% trans "csv zip" %}</font></a>
140            <button class="btn dropdown-toggle" data-toggle="dropdown">
141              <span class="caret"></span>
142            </button>
143            <ul class="dropdown-menu">
144              <li>
145                <input class="input-xxlarge" type="text" size="16" value="{{base_url}}{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'csv_zip' %}"/>
146              </li>
147            </ul>
148          </div>
149          <div class="btn-group">
150            <a class="btn" href="{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'xls' %}" rel="tooltip" data-original-title="{% trans 'xls exports' %}"><i class="icon-download-alt"></i> <font color=#000>{% trans "xls" %}</font></a>
151            <button class="btn dropdown-toggle" data-toggle="dropdown">
152              <span class="caret"></span>
153            </button>
154            <ul class="dropdown-menu">
155              <li>
156                <input class="input-xxlarge" type="text" size="16" value="{{base_url}}{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'xls' %}"/>
157              </li>
158            </ul>
159          </div>
160          <div class="btn-group">
161            <a class="btn" href="{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'kml'%}" rel="tooltip" data-original-title="{% trans 'Export to kml File (Google Earth)' %}"><i class="icon-download-alt"></i> <font color=#000>{% trans "kml" %}</font></a>
162            <button class="btn dropdown-toggle" data-toggle="dropdown">
163              <span class="caret"></span>
164            </button>
165            <ul class="dropdown-menu">
166              <li>
167                <input class="input-xxlarge" type="text" size="16" value="{{base_url}}{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'kml' %}"/>
168              </li>
169            </ul>
170          </div>
171
172          <div class="btn-group">
173            <a class="btn" href="{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'zip' %}" rel="tooltip" data-original-title="{% trans 'Export a zip folder of attachments' %}"><i class="icon-download-alt"></i> <font color=#000>{% trans "zip" %}</font></a>
174            <button class="btn dropdown-toggle" data-toggle="dropdown">
175              <span class="caret"></span>
176            </button>
177            <ul class="dropdown-menu">
178              <li>
179                <input class="input-xxlarge" type="text" size="16" value="{{base_url}}{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'zip' %}"/>
180              </li>
181            </ul>
182          </div>
183          <div class="btn-group">
184            <a class="btn" href="{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'gdoc' %}" rel="tooltip" data-original-title="{% trans 'Export to google docs' %}" target="_blank"><i class="icon-download-alt"></i> <font color=#000>{% trans "gdocs" %}</font></a>
185            <button class="btn dropdown-toggle" data-toggle="dropdown">
186                <span class="caret"></span>
187            </button>
188            <ul class="dropdown-menu">
189                <li>
190                    <input class="input-xxlarge" type="text" size="16" value="{{base_url}}{% url "odk_viewer.views.export_list" content_user.username xform.id_string 'gdoc' %}"/>
191                </li>
192            </ul>
193          </div>
194        </div>
195        <h4>{% trans "Submissions:" %} {{ xform.submission_count|intcomma }}</h4>
196        <br>
197        <p>
198            {% trans "License:" %}
199            {% if can_edit %}
200                {% for field in data_license_form %}
201                    {{ field }}
202                {% endfor %}
203                <a id="data-license_edit" data-id="data-license" href="" class="btn btn-small bind-edit">{% trans "edit" %}</a>
204                <a id="data-license_save" data-id="data-license" style="display:none" href="" class="btn btn-small btn-primary bind-save" data-url="{% url "main.views.edit" content_user.username xform.id_string %}">{% trans "save" %}</a>
205            {% else %}
206                {{ data_license|default:'No license' }}
207            {% endif %}
208        </p>
209        <p><a id="data-license_info" style="display:none" href="">{% trans "License information" %}</a></p>
210	    <div class="btn-group" style="margin-bottom: 9px">
211				{% if xform.has_surveys_with_geopoints %}
212			<a class="btn btn-info" rel="tooltip" title="{% trans 'View Map' %}" href="{% url "odk_viewer.views.map_view" content_user.username xform.id_string %}">
213				<i class="icon-map-marker icon-white"></i> {% trans "Map" %}
214			</a>
215		        {% endif %}
216            <a class="btn btn-info" btn-info  rel="tooltip" title="{% trans "View Photos" %}" href="{% url "main.views.form_photos" content_user.username xform.id_string %}">
217              <i class="icon-camera icon-white"></i> {% trans "Photos" %}
218            </a>
219            <a class="btn btn-info" btn-info  rel="tooltip" title="{% trans "View Submitted Data" %}" href="{% url "odk_viewer.views.data_view" content_user.username xform.id_string %}">
220                <i class="icon-th-list icon-white"></i> {% trans "View Data" %}
221            </a>
222            <a class="btn btn-info" btn-info  rel="tooltip" title="{% trans "Browse Data (One by One)" %}" href="{% url "odk_viewer.views.instance" content_user.username xform.id_string %}">
223                <i class="icon-list-alt icon-white"></i> {% trans "Browse Data" %}
224            </a>
225        </div>
226        {% else %}
227            {% if can_edit %}
228
229            {% else %}
230                <span class="label label-warning">{% trans "NO DATA" %}</span>
231            {% endif %}
232		{% endif %}
233		{% endif %}
234
235          <div class="btn-toolbar" style="margin-bottom: 9px">
236              <span><!-- break the .btn-group + .btn-group rule that shows a margin before this group --></span>
237
238              <div class="btn-group" style="margin-bottom: 9px">
239                  {% if can_edit or xform.is_crowd_form %}
240                  <a class="btn btn-info" rel="tooltip" title="{% trans 'Webform' %}"
241                     href="{% url "odk_logger.views.enter_data" content_user.username xform.id_string %}">
242                      <i class="icon-edit icon-white"></i> {% trans "Enter Web Form" %}
243                  </a>
244                  <a data-toggle="modal" data-target="#popupmodal" class="showqr btn btn-info" href="{% url "get_qrcode" xform.user.username xform.id_string %}"><i class="icon-tablet"></i> {% trans "Mobile" %}</a>
245                  {% endif %}
246                  {% if can_edit or xform.is_crowd_form or xform.shared %}
247                  <a class="btn btn-info" rel="tooltip" title="{% trans 'Preview Form' %}" href="#preview-modal"
248                     data-toggle="modal">
249                      <i class="icon-check icon-white"></i> {% trans "Preview Form" %}
250                  </a>
251                  {% endif %}
252              </div>
253              {% if can_edit or xform.is_crowd_form or xform.shared %}
254              <div id="preview-modal" class="modal hide fade">
255                  <div class="modal-header">
256                      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
257                      <h3>{{ xform.title }} - {% trans "Preview" %}</h3>
258                  </div>
259                  <div class="modal-body">
260                      <iframe src="{% url "main.views.enketo_preview" content_user.username xform.id_string %}"></iframe>
261                  </div>
262                  <div class="modal-footer"></div>
263              </div>
264              {% endif %}
265          </div>
266        <br>
267      <div class="span4">
268      </div>
269    </div>
270      <br/>
271        <div class="clearfix bordered">
272                <h3 data-toggle="collapse" class="toggler" data-target="#source_tab">{% trans "Source" %}</h3>
273                <div id='source_tab' class="collapse">
274                <form action="{% url "main.views.edit" content_user.username xform.id_string %}" method="post" enctype="multipart/form-data">
275
276                {% if source.data_file %}
277                    <p><a href="{% url "main.views.download_metadata" content_user.username xform.id_string source.id %}">{{ source.data_file.name }}</p></a>
278                {% endif %}
279                {% csrf_token %}
280                <input type="text" id="source" class="input-xxlarge present" disabled="" rows="3" value="{{ source.data_value|default:"None provided" }}" />
281                {% if can_edit %}
282                    <a id="source_edit" data-id="source" href="" class="btn small bind-edit">{% trans "edit" %}</a>
283                    <a id="source_save" data-id="source" style="display:none" href="" class="btn small btn-primary bind-save" data-url="{% url "main.views.edit" content_user.username xform.id_string %}">{% trans "save" %}</a>
284                {% endif %}
285
286
287                {% if can_edit %}
288                    {% csrf_token %}
289                    <table>
290                    {{ source_form.as_table }}
291                    </table>
292                    <input type="submit" class="btn" value="{% trans 'Upload' %}" />
293                {% endif %}
294            </form>
295            </div>
296        </div>
297        <br/>
298        <div class="clearfix bordered">
299                <h3 data-toggle="collapse" class="toggler" data-target="#docs_tab">{% trans "Supporting Documents" %}</h3>
300                <div id='docs_tab' class="collapse">
301                {% for doc in supporting_docs %}
302                    <p><a href="{% url "main.views.download_metadata" content_user.username xform.id_string doc.id %}">{{ doc.data_value }}</a>
303                    {% if can_edit %}
304                    || <a href="{% url "main.views.delete_metadata" content_user.username xform.id_string doc.id %}?del=true"> {% trans "remove" %} </a>
305                    {% endif %}
306                    </p>
307                {% endfor %}
308                {% if can_edit %}
309                    <form action="{% url "main.views.edit" content_user.username xform.id_string %}" method="post" enctype="multipart/form-data">
310                        {% csrf_token %}
311                        <table>
312                            {{ doc_form.as_table }}
313                        </table>
314                        <input type="submit" class="btn" value="{% trans 'Upload' %}" />
315                    </form>
316                {% endif %}
317            </div>
318        </div>
319        {% if is_owner %}
320        <br/>
321        <div class="clearfix bordered">
322            <h3 data-toggle="collapse" class="toggler" data-target="#restservice_tab">{% trans "Rest Services" %}</h3>
323            <div id='restservice_tab' class="collapse">
324            </div>
325        </div>
326        {% endif %}
327        <br/>
328        <div class="clearfix bordered">
329            <h3 data-toggle="collapse" class="toggler" data-target="#media_tab">{% blocktrans %}Media &nbsp;<small>jpeg/png/mp3/wav/3gp allowed</small>{% endblocktrans %}</h3>
330            <div id='media_tab' class="collapse">
331            {% for media in media_upload %}
332              <p><a href="{% url "main.views.download_media_data" content_user.username xform.id_string media.id %}">{{ media.data_value }}</a>
333              {% if can_edit %}
334              &ndash;<a href="{% url "main.views.download_media_data" content_user.username xform.id_string media.id %}?del=true"> {% trans "remove" %} </a>
335              {% endif %}
336              </p>
337            {% endfor %}
338            {% if can_edit %}
339            <form action="{% url "main.views.edit" content_user.username xform.id_string %}" method="post" enctype="multipart/form-data">
340                {% csrf_token %}
341                <table>
342                <tbody><tr><th><label for="id_media">Media upload:</label></th><td><input type="file" multiple="" name="media" id="id_media"></td></tr>
343                </tbody>
344                </table>
345                <input type="submit" class="btn" value="{% trans 'Upload' %}" />
346            </form>
347            {% endif %}
348            </div>
349        </div>
350        <br/>
351        <div class="clearfix bordered">
352            <h3 data-toggle="collapse" class="toggler" data-target="#map_tab">{% trans "Mapbox Layer" %}</h3>
353            <div id='map_tab' class="collapse">
354            {% if mapbox_layer %}
355            <p><a href="{{ mapbox_layer.link }}" target="_blank">{{ mapbox_layer.map_name }}</a> &ndash;
356            {% trans "Attribution:" %} {{ mapbox_layer.attribution }}
357            {% if can_edit %}
358            &ndash;<a href="{% url "main.views.delete_metadata" content_user.username xform.id_string mapbox_layer.id %}?map_name_del=true"> {% trans "remove" %} </a></p>
359            {% endif %}
360            {% endif %}
361            {% if can_edit %}
362            <form action="{% url "main.views.edit" content_user.username xform.id_string %}" method="post">
363                {% csrf_token %}
364                <table>
365                {{ mapbox_layer_form.as_table }}
366                </table>
367                <input type="submit" class="btn" value="{% trans 'Upload' %}" />
368            </form>
369            {% endif %}
370            </div>
371        </div>
372        <br/>
373        <div class="clearfix bordered">
374                <h3 data-toggle="collapse" class="toggler" data-target="#sms_tab">{% trans "SMS Support" %} (<acronym title="SMS Support is in beta stage now. Please use carefully as API and IDs might change.">beta</acronym>)</h3>
375                <div id='sms_tab' class="collapse">
376                <form action="{% url "main.views.edit" content_user.username xform.id_string %}" method="post" enctype="multipart/form-data">
377
378                {% if xform.allows_sms %}
379                    <p>{% blocktrans %}This form has enabled SMS submissions.{% endblocktrans %} {% blocktrans with id_string=xform.sms_id_string %}Submit to this form using the “<em>{{ id_string }}</em>” identifier.{% endblocktrans %}</p>
380                {% endif %}
381                {% if can_edit %}
382                    {% csrf_token %}
383                    <input type="hidden" name="enable_sms_support_trigger" value="yes" />
384                    <table>
385                    {{ sms_support_form.as_table }}
386                    </table>
387                    <input type="submit" class="btn btn-primary" value="{% trans "Save Changes" %}" />
388                {% endif %}
389            	</form>
390            	{% autoescape off %}
391            	<div class="sms_autodoc">
392            	{% if xform.allows_sms %}
393            	<h4>{% trans "Expected Format:" %}</h4>
394            	<p class="sms_autodoc_line_names alert alert-info">{{ sms_support_doc.line_names }}</p>
395            	<ul class="sms_autodoc_helpers">
396            	{% for helper in sms_support_doc.helpers %}
397            		<li class="sms_autodoc_helper"><sup class="sms_autodoc_helper_indice">{{ forloop.counter0 }}</sup> <span class="sms_autodoc_helper_name">{{ helper.0 }}:</span> <span class="sms_autodoc_helper_text">{{helper.1}}</span></li>
398            	{% endfor %}
399            	</ul>
400            	<h4>{% trans "Example" %}</h4>
401        		<p class="sms_autodoc_line_example alert alert-success">{{ sms_support_doc.line_values }}</p>
402            	{% else %}
403            		<p class="alert {{ sms_compatible.type }}">{{ sms_compatible.text }}</p>
404            	{% endif %}
405            	<h4>{% trans "Usage" %}</h4>
406            	<p>Note that for each case, you can select either the simplest form of the URL (containing only your username) or the one including the <em>id_string</em> of the form.</p>
407            	<p>The latter works without specifyin the <em>SMS Keyword</em> in front of every message.</p>
408            	<p>You would use it when your SMS Setup/Provider is used for only one form.</p>
409            	<select id="sms_support_api"><option>{% trans "Select an SMS API" %}</option>{% for provider in sms_providers_doc %}<option value="{{ provider.id }}">{{ provider.name }}</option>{% endfor %}<option value="generic">{% trans "Generic SMS API" %}</option></select>
410            	<div style="display:none;" class="sms_support_api_doc" id="sms_support_api_doc_generic">
411            		<p>{% trans "Use the Generic SMS API to write your own wrapper around Formhub." %}</p>
412            		<ul>
413            			<p>{% trans "Single SMS Submission" %}<br />[<strong>GET</strong>] <span class="sms_autodoc_example">{{ url_root }}{% url "sms_submission" username=content_user.username %}</span><br />
414							[<strong>GET</strong>] <span class="sms_autodoc_example">{{ url_root }}{% url "sms_submission_form" username=content_user.username id_string=xform.id_string %}</span><br />
415            				{% trans "Params:" %} <span class="sms_autodoc_params">{"identity": "SENDER PHONE NUMBER", "text": "TEXT MESSAGE"}<br />
416            				{% trans "Returns:" %} <span class="sms_autodoc_params">{"status": "STATUS", "message": "MESSAGE", "id": "ID"}</p>
417            			<p>{% trans "Multiple SMS Submissions at once" %}<br />[<strong>POST</strong>] <span class="sms_autodoc_example">{{ url_root }}{% url "sms_submissions" username=content_user.username %}</span><br/>
418            				[<strong>POST</strong>] <span class="sms_autodoc_example">{{ url_root }}{% url "sms_submissions_form" username=content_user.username id_string=xform.id_string %}</span><br />
419            				{% trans "Params:" %} <span class="sms_autodoc_params">{"messages": [{"identity": "SENDER PHONE NUMBER", "text": "TEXT MESSAGE"}, ]<br />
420            				{% trans "Returns:" %} <span class="sms_autodoc_params">[{"status": "STATUS", "message": "MESSAGE", "id": "ID"}, ]</p>
421            		</ul>
422            		<p><span class="sms_autodoc_params">STATUS</span>: {% trans "One of" %} <span class="sms_autodoc_params">ACCEPTED, REJECTED, PARSING_FAILED</span><br />
423            		   <span class="sms_autodoc_params">MESSAGE</span>: {% trans "Either an error or success message. Suitable for end user." %}<br />
424            		   <span class="sms_autodoc_params">ID</span>: {% trans "Only if successful. A unique ID of the submission." %}</p>
425            	</div>
426            	{% for provider in sms_providers_doc %}<div style="display:none;" class="sms_support_api_doc" id="sms_support_api_doc_{{ provider.id }}">{{ provider.doc }}</div>{% endfor %}
427            	{% endautoescape %}
428            	</div>
429            </div>
430        </div>
431      </div>
432      <div class="span4">
433        {% if is_owner %}
434        <h3>{% trans "Settings" %}</h3>
435        <div class="clearfix">
436          <div class="input">
437          <label>{% trans "Form Shared" %}&nbsp;</label>
438            <input id="form-shared" type="checkbox"{% if xform.shared %} checked=""{% endif %} data-url="{% url "main.views.edit" content_user.username xform.id_string %}" />
439          </div>
440          <br/>
441          <label>{% trans "Data Shared" %}&nbsp;</label>
442          <div class="input">
443            <input id="data-shared" type="checkbox"{% if xform.shared_data %} checked=""{% endif %} data-url="{% url "main.views.edit" content_user.username xform.id_string %}" />
444          </div>
445          <br/>
446          <label>{% trans "Crowdform" %}&nbsp;</label>
447          <div class="input">
448            <input id="crowd-form" type="checkbox" {% if xform.is_crowd_form %}
449            checked="" {% endif %} data-url="{% url "main.views.edit" content_user.username xform.id_string  %}" />
450          </div>
451          <br/>
452          <label>{% trans "Form Active" %}&nbsp;</label>
453          <div class="input">
454            <input id="active-form" type="checkbox"{% if xform.downloadable %} checked=""{% endif %} data-url="{% url "main.views.edit" content_user.username xform.id_string %}" />
455          </div>
456          <br/>
457          <label>{% trans "Delete Form" %}&nbsp;</label>
458        <div class="input">
459          <!-- DELETE -->
460          <div id="delete-{{ xform.id_string }}" class="modal hide fade">
461              <form action="{% url "odk_logger.views.delete_xform" username=user.username id_string=xform.id_string %}" method="post">
462              {% csrf_token %}
463                  <div class="modal-header">
464                      <a data-dismiss="modal" class="close">&times;</a>
465                      <h3>{% trans "Delete Confirmation" %}</h3>
466                  </div>
467                  <div class="modal-body">
468                      <p>{% blocktrans with title=xform.title nb_sub=xform.submission_count|intcomma %}Are you sure you want to delete the form '{{ title }}'? This form has <strong>{{ nb_sub }}</strong> submissions associated with it that will also be deleted. If you are unsure about deleting this form press 'Cancel' and consider 'Archiving' the form instead.{% endblocktrans %}</p>
469                  </div>
470                  <div class="modal-footer">
471                      <button class="btn btn-primary form-submit">Delete</button>
472                      <a href="#" onclick="$('#delete-{{ xform.id_string }}').modal('hide');" class="btn secondary">{% trans "Cancel" %}</a>
473                  </div>
474              </form>
475          </div>
476          <a data-toggle="modal" href="#delete-{{ xform.id_string }}" data-backdrop="true" data-keyboard="true" class="btn btn-small btn-danger">
477              {% trans "Delete" %}
478          </a>
479        </div>
480        </div>
481        <br/>
482        <div>
483            <h3>{% trans "bamboo" %}</h3>
484            {% if xform.bamboo_dataset %}
485                {% blocktrans with dataset=xform.bamboo_dataset %}bamboo dataset: <strong><a href="http://bamboo.io/datasets/{{ dataset }}/info">{{ dataset }}</a></strong>{% endblocktrans %}
486            {% else %}
487                {% blocktrans %}bamboo link is <strong>not active</strong>{% endblocktrans %}
488            {% endif %}
489            {% if xform.submission_count = 0 %}
490                <br />{% trans "bamboo requires at least one submission." %}
491            {% else %}<form action="{% url "main.views.link_to_bamboo" content_user.username xform.id_string %}" method="post">
492                {% csrf_token %}
493                {% if xform.bamboo_dataset %}
494                    <input type="submit" class="btn" value="{% trans "Regenerate" %}" />
495                {% else %}
496                    <input type="submit" class="btn" value="{% trans "Activate" %}" />
497                {% endif %}
498                </form>
499            {% endif %}
500        </div>
501        <br />
502        <div>
503            <h3>{% trans "Sharing" %}</h3>
504            {% if public_link %}
505            {% url "main.views.show" xform.uuid as form_url %}
506            {% blocktrans %}Sharing by link is <strong>on with URL <a href="{{ form_url }}">{{ base_url }}{{ form_url }}</a></strong>{% endblocktrans %}
507            {% else %}
508            {% blocktrans %}Sharing by link is <strong>off</strong>{% endblocktrans %}
509            {% endif %}
510            </strong>
511            <br/>
512            <br/>
513            <form action="{% url "main.views.set_perm" content_user.username xform.id_string %}" method="post">
514                {% csrf_token %}
515                <input type="hidden" name="perm_type" value="link"/>
516                <input type="hidden" name="for_user" value="toggle"/>
517                <input type="submit" class="btn" value="{% if public_link %}{% trans "Turn off" %}{% else %}{% trans "Turn on" %}{% endif %}" />
518            </form>
519            {% if users_with_perms|length %}
520            <ul>
521                {% for user, perms in users_with_perms %}
522                <li>{{ user }}: {{ perms }}</li>
523                {% endfor %}
524            </ul>
525            {% endif %}
526            <form action="{% url "main.views.set_perm" content_user.username xform.id_string %}" method="post">
527                {% csrf_token %}
528                <table class="narrow-labels">
529                {{ permission_form.as_table }}
530                </table>
531                <input type="submit" class="btn" value="{% trans 'Submit' %}" />
532            </form>
533        </div>
534        {% endif %}
535      </div>
536    </div>
537    <br/>
538  </section>
539
540<div class="modal hide fade" id="popupmodal" style="width: auto; left:36%; margin-left: auto; margin-right: auto;" tabindex="-1" role="dialog">
541     <div class="modal-header">
542        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
543        <h3>{%  trans "Mobile Form" %}</h3>
544    </div>
545    <div class="modal-body" style="text-align: center;">
546         <div class="img_holder"/> </div>
547    </div>
548    <div class="modal-footer" style="text-align: center;">
549
550        {%  trans "DOWNLOAD " %}
551        <a class="btn" href="http://scan.me/apps/" target="_blank">
552            <i class="icon-qrcode"></i>
553        {%  trans " Scan - QR Reader" %}
554        </a>
555
556    </div>
557</div>
558{% endblock %}
559
560{% block styles %}
561{{ block.super }}
562 <link href="/static/css/iphone-btn-style.css" rel="stylesheet"/>
563{% endblock %}
564
565{% block javascript %}
566{{ block.super }}
567
568<script type="text/javascript" src="/static/js/iphone-style-checkboxes.js"></script>
569  {% if user.is_authenticated %}
570    <script type="text/javascript" src="/static/js/form_actions.js"></script>
571  {% endif %}
572
573<script type="text/javascript">
574
575$(document).ready(function() {
576
577        $('.btn').tooltip();
578
579		// SMS documentation switcher
580		$('#sms_support_api').change(function() {
581			$('.sms_support_api_doc').each(function (){
582				$(this).toggle(false);
583			});
584			var selected = $(this).val();
585			$('#sms_support_api_doc_' + selected).toggle(true);
586		});
587
588        // Typeahead, fetch usernames for permission assign
589        $('#autocomplete').typeahead(
590            {
591                source: function (query, process){
592                    return $.get('/typeahead_usernames/', {query: query}, function(data){
593                        return process(data);
594                    });
595                }
596            }
597        );
598        //-- end
599
600                $(document).on("click", ".showqr", function () {
601                  div_target = $(this).attr('data-target')
602                  url = $(this).attr('href')
603                  $(div_target+" .img_holder").load(url)
604
605                });
606
607              {% if xform.shared_data %}
608                $('#data-shared-private').hide();
609              {% else %}
610                $('#data-shared-public').hide();
611              {% endif %}
612              {% if xform.shared %}
613                $('#form-shared-private').hide();
614              {% else %}
615                $('#form-shared-public').hide();
616              {% endif %}
617              {% if not xform.encrypted %}
618                $('#form-encrypted').hide();
619                $('#data-encrypted').hide();
620              {% endif %}
621              $.each(['form-shared', 'data-shared', 'active-form', 'crowd-form'], function(inx, el) {
622                var cb = $('#' + el + ':checkbox');
623                cb.iphoneStyle({
624                  onChange: function() {
625                    // a callback func
626                    var c = function(){}
627                    // if crowdform is toggled, change data and form status
628                    // appropriately
629                    if(el == 'crowd-form' && $('#crowd-form').attr('checked') == 'checked'){
630                        if($('#form-shared:checkbox').attr('checked') == undefined)
631                            $('#form-shared:checkbox').click()
632                        if($('#data-shared:checkbox').attr('checked') == undefined)
633                            $('#data-shared:checkbox').click()
634                    }
635
636                    privacyEdit(cb.data('url'), el.split('-')[0]);
637                    $('#' + el + '-public').toggle();
638                    $('#' + el + '-private').toggle();
639
640                  }
641                });
642              });
643            {% if user.is_authenticated %}
644              // add click event to all public (x)forms
645              $('a.clonexls').click(function(){
646                el = $(this);
647                clone_xlsform(el.data('url'), el.data('username'), el.data('id'));
648                return false;
649              });
650            {% endif %}
651            });
652
653        // REST Service
654            $(document).ready(function() {
655                $.get('{% url "restservice.views.add_service" content_user.username xform.id_string %}', function(data){
656                    $('#restservice_tab').html(data);
657                });
658            });
659
660        </script>
661{% endblock %}