youyesyet/resources/templates/auto/form-followupactions-Followupaction.html

301 lines
9.4 KiB
HTML

{% extends "base.html" %}
<!-- File form-followupactions-Followupaction.html generated 2018-07-10T15:25:24.218Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->
{% block extra-head %}
{% script "js/lib/node_modules/simplemde/dist/simplemde.min.js" %}
{% style "js/lib/node_modules/simplemde/dist/simplemde.min.css" %}
{% script "/js/lib/node_modules/selectize/dist/js/standalone/selectize.min.js" %}
{% style "/js/lib/node_modules/selectize/dist/css/selectize.css" %}
{% endblock %}
{% block content %}
<div id='content' class='edit'>
<form action='{{servlet-context}}/form-followupactions-Followupaction' method='POST'>
{% csrf-field %}
<input id='id' name='id' type='hidden' value='{{record.id}}'/>
<p class='widget'>
<label for='request_id'>
Request_id
</label>
{% if {{record.request_id}} %}
{% ifmemberof admin %}
<select id='request_id' name='request_id'>
{% for option in request_id %}<option value='{{option.id}}' {% ifequal record.request_id option.id%}selected{% endifequal %}>{{option.elector_id}} {{option.visit_id}} {{option.issue_id}}</option>{% endfor %}
</select>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='request_id' name='request_id' class='pseudo-widget disabled'>
{{record.request_id}}
</span>
{% else %}
<span id='request_id' name='request_id' class='pseudo-widget not-authorised'>
You are not permitted to view request_id of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% else %}
{% ifmemberof admin %}
<select id='request_id' name='request_id'>
{% for option in request_id %}<option value='{{option.id}}' {% ifequal record.request_id option.id%}selected{% endifequal %}>{{option.elector_id}} {{option.visit_id}} {{option.issue_id}}</option>{% endfor %}
</select>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='request_id' name='request_id' class='pseudo-widget disabled'>
{{record.request_id}}
</span>
{% else %}
<span id='request_id' name='request_id' class='pseudo-widget not-authorised'>
You are not permitted to view request_id of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% endif %}
</p>
<p class='widget'>
<label for='actor'>
Actor
</label>
{% if {{record.actor}} %}
{% ifmemberof admin %}
<select id='actor' name='actor'>
{% for option in actor %}<option value='{{option.id}}' {% ifequal record.actor option.id%}selected{% endifequal %}>{{option.username}} {{option.fullname}} {{option.address_id}} {{option.phone}} {{option.email}}</option>{% endfor %}
</select>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='actor' name='actor' class='pseudo-widget disabled'>
{{record.actor}}
</span>
{% else %}
<span id='actor' name='actor' class='pseudo-widget not-authorised'>
You are not permitted to view actor of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% else %}
{% ifmemberof admin %}
<select id='actor' name='actor'>
{% for option in actor %}<option value='{{option.id}}' {% ifequal record.actor option.id%}selected{% endifequal %}>{{option.username}} {{option.fullname}} {{option.address_id}} {{option.phone}} {{option.email}}</option>{% endfor %}
</select>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='actor' name='actor' class='pseudo-widget disabled'>
{{record.actor}}
</span>
{% else %}
<span id='actor' name='actor' class='pseudo-widget not-authorised'>
You are not permitted to view actor of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% endif %}
</p>
<p class='widget'>
<label for='date'>
Date
</label>
{% if {{record.date}} %}
{% ifmemberof admin %}
<input id='date' name='date' type='string' value='{{record.date}}' maxlength='' size='16'/>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='date' name='date' class='pseudo-widget disabled'>
{{record.date}}
</span>
{% else %}
<span id='date' name='date' class='pseudo-widget not-authorised'>
You are not permitted to view date of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% else %}
{% ifmemberof admin %}
<input id='date' name='date' type='string' value='{{record.date}}' maxlength='' size='16'/>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='date' name='date' class='pseudo-widget disabled'>
{{record.date}}
</span>
{% else %}
<span id='date' name='date' class='pseudo-widget not-authorised'>
You are not permitted to view date of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% endif %}
</p>
<p class='widget'>
<label for='notes'>
Notes
</label>
{% if {{record.notes}} %}
{% ifmemberof admin %}
<textarea rows='8' cols='60' id='notes' name='notes'>
{{record.notes}}
</textarea>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='notes' name='notes' class='pseudo-widget disabled'>
{{record.notes}}
</span>
{% else %}
<span id='notes' name='notes' class='pseudo-widget not-authorised'>
You are not permitted to view notes of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% else %}
{% ifmemberof admin %}
<textarea rows='8' cols='60' id='notes' name='notes'>
{{record.notes}}
</textarea>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='notes' name='notes' class='pseudo-widget disabled'>
{{record.notes}}
</span>
{% else %}
<span id='notes' name='notes' class='pseudo-widget not-authorised'>
You are not permitted to view notes of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% endif %}
</p>
<p class='widget'>
<label for='closed'>
Closed
</label>
{% if {{record.closed}} %}
{% ifmemberof admin %}
<input id='closed' name='closed' type='checkbox' value='{{record.closed}}' maxlength='' size='16'/>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='closed' name='closed' class='pseudo-widget disabled'>
{{record.closed}}
</span>
{% else %}
<span id='closed' name='closed' class='pseudo-widget not-authorised'>
You are not permitted to view closed of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% else %}
{% ifmemberof admin %}
<input id='closed' name='closed' type='checkbox' value='{{record.closed}}' maxlength='' size='16'/>
{% else %}
{% ifmemberof issueexperts canvassers analysts issueeditors admin %}
<span id='closed' name='closed' class='pseudo-widget disabled'>
{{record.closed}}
</span>
{% else %}
<span id='closed' name='closed' class='pseudo-widget not-authorised'>
You are not permitted to view closed of followupactions
</span>
{% endifmemberof %}
{% endifmemberof %}
{% endif %}
</p>
{% ifmemberof admin %}
<p class='widget action-safe'>
<label for='save-button' class='action-safe'>
To save this followupactions record
</label>
<input id='save-button' name='save-button' class='action-safe' type='submit' value='Save!'/>
</p>
{% endifmemberof %}
{% ifmemberof admin %}
<p class='widget action-dangerous'>
<label for='delete-button' class='action-dangerous'>
To delete this followupactions record
</label>
<input id='delete-button' name='delete-button' class='action-dangerous' type='submit' value='Delete!'/>
</p>
{% endifmemberof %}
</form>
</div>
{% endblock %}
{% block extra-tail %}
<script type='text/javascript'>
/**
* selectize one select widget. Substitute the actual id of the widget for `request_id`.
*/
$('#request_id').selectize({
valueField: 'id',
labelField: 'name',
searchField: 'name',
options: [],
create: false,
load: function(query, callback) {
console.log('Desperately seeking ' + query);
if (query === null || !query.length) return callback();
$.ajax({
url: '/json/auto/search-strings-electors?name=' + query,
type: 'GET',
dataType: 'jsonp',
error: function() {
console.log( 'Query ' + query + ' failed.');
callback();
},
success: function(res) {
console.log('Received ' + res + ' records for ' + query);
callback(res);
}
});
}
});
/**
* selectize one select widget. Substitute the actual id of the widget for `actor`.
*/
$('#actor').selectize({
valueField: 'id',
labelField: 'name',
searchField: 'name',
options: [],
create: false,
load: function(query, callback) {
console.log('Desperately seeking ' + query);
if (query === null || !query.length) return callback();
$.ajax({
url: '/json/auto/search-strings-electors?name=' + query,
type: 'GET',
dataType: 'jsonp',
error: function() {
console.log( 'Query ' + query + ' failed.');
callback();
},
success: function(res) {
console.log('Received ' + res + ' records for ' + query);
callback(res);
}
});
}
});
var simplemde = new SimpleMDE({
autosave: {
enabled: true,
uniqueId: "Smeagol-{{page}}",
delay: 1000,
},
indentWithTabs: true,
insertTexts: {
horizontalRule: ["", "\n\n-----\n\n"],
image: ["![](http://", ")"],
link: ["[", "](http://)"],
table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],
},
showIcons: ["code"], //, "table"], - sadly, markdown-clj does not support tables
spellChecker: true,
status: ["autosave", "lines", "words", "cursor"]
});
</script>
{% endblock %}