Commit feed2260 authored by buttle's avatar buttle

jquery cosmetics

parent c3e74361
......@@ -27,6 +27,7 @@ pip install validate_email
pip install password_strength
pip install passlib
pip install gunicorn
pip install flask_wtf
......@@ -65,7 +66,7 @@ apt-get install supervisor
Edit /etc/supervisor/conf.d/GNGforms.conf
[program:GNGforms]
command = /opt/venv/bin/gunicorn -c /opt/gunicorn_gngforms.py almacen:app
command = /opt/venv/bin/gunicorn -c /opt/gunicorn_gngforms.py GNGforms:app
directory = /opt
user = www-data
......
......@@ -31,7 +31,7 @@ babel = Babel(app)
csrf = CSRFProtect()
csrf.init_app(app)
app.config['APP_VERSION'] = 22
app.config['APP_VERSION'] = 23
app.config['SCHEMA_VERSION'] = 11
app.config['RESERVED_SLUGS'] = ['static', 'admin', 'admins', 'user', 'users', 'form', 'forms', 'site', 'sites', 'update']
......
......@@ -47,7 +47,7 @@
<label>{%trans%}Password{%endtrans%}</label><br />
<input type="password" name="password" class="form-control" value="" />
</p>
<input class="btn-success btn" type="submit" value="{%trans%}Login{%endtrans%}" />
<input class="btn-success btn" type="submit" value="{%trans%}Login{%endtrans%}" {% if g.current_user %}disabled{%endif%} />
</form>
<br />
{% if g.current_user %}
......
......@@ -80,7 +80,7 @@
</div>
<hr />
<table id="forms" class="table table-striped table-condensed">
<table id="forms" style="display:none" class="table table-striped table-condensed">
<thead>
<tr>
<th>{%trans%}Name{%endtrans%}</th>
......@@ -119,7 +119,11 @@ $(document).ready(function() {
$('#forms').DataTable({
"language": {
"url": "/static/dataTables-languages/{{g.current_user.language}}.js"
}
},
"initComplete": function(settings, json) {
$("#forms").show();
},
"order": [[1, 'desc']]
});
});
document.getElementById('toggle_blocked').addEventListener('click', function(evt){
......
......@@ -37,7 +37,7 @@
<p>&nbsp;</p>
<table id="formEntries" class="table table-striped table-condensed">
<table id="formEntries" style="display:none" class="table table-striped table-condensed">
<thead>
<tr>
<th></th>
......@@ -88,6 +88,9 @@ $(document).ready(function() {
"language": {
"url": "/static/dataTables-languages/{{g.current_user.language}}.js"
},
"initComplete": function(settings, json) {
$("#formEntries").show();
},
"order": [[1, 'asc']],
"columnDefs": [
{ "orderable": false, "targets": 0 }
......
......@@ -13,29 +13,29 @@
</div>
<hr />
<table id="forms" class="table table-striped table-condensed">
<table id="forms" style="display:none" class="table table-striped table-condensed">
<thead>
<tr>
<th>{%trans%}Name{%endtrans%}</th>
{% if g.isRootUser %}
<th>{%trans%}Hostname{%endtrans%}</th>
{% endif %}
<th>{%trans%}Author{%endtrans%}</th>
<th>{%trans%}Created{%endtrans%}</th>
<th>{%trans%}Author{%endtrans%}</th>
<th>{%trans%}Public{%endtrans%}</th>
<th>{%trans%}Entries{%endtrans%}</th>
{% if g.isRootUser %}
<th>{%trans%}Hostname{%endtrans%}</th>
{% endif %}
</tr>
</thead>
{% for form in forms %}
<tr>
<td><a href="/forms/view/{{form._id}}">{{form.slug}}</a></td>
{% if g.isRootUser %}
<td>{{form.hostname}}</td>
{% endif %}
<td><a href="/admin/users/id/{{form.user._id}}">{{form.user.username}}</a></td>
<td>{{form.created}}</td>
<td><a href="/admin/users/id/{{form.user._id}}">{{form.user.username}}</a></td>
<td>{{form.isPublic()}}</td>
<td>{{form.entries|length}}</td>
{% if g.isRootUser %}
<td>{{form.hostname}}</td>
{% endif %}
</tr>
{% endfor %}
</table>
......@@ -48,7 +48,11 @@ $(document).ready(function() {
$('#forms').DataTable({
"language": {
"url": "/static/dataTables-languages/{{g.current_user.language}}.js"
}
},
"initComplete": function(settings, json) {
$("#forms").show();
},
"order": [[1, 'desc']]
});
} );
</script>
......
......@@ -12,7 +12,7 @@
</div>
<hr />
<table id="users" class="table table-striped table-condensed">
<table id="users" style="display:none" class="table table-striped table-condensed">
<thead>
<tr>
<th>{%trans%}Username{%endtrans%}</th>
......@@ -50,6 +50,9 @@ $(document).ready(function() {
$('#users').DataTable({
"language": {
"url": "/static/dataTables-languages/{{g.current_user.language}}.js"
},
"initComplete": function(settings, json) {
$("#users").show();
}
});
} );
......
......@@ -20,7 +20,7 @@
<div class="row col-md-12">
<hr />
<table id="forms" class="table table-striped table-condensed">
<table id="forms" style="display:none" class="table table-striped table-condensed">
<thead>
<tr>
<th>{%trans%}Name{%endtrans%}</th>
......@@ -51,7 +51,11 @@ $(document).ready(function() {
$('#forms').DataTable({
"language": {
"url": "/static/dataTables-languages/{{g.current_user.language}}.js"
}
},
"initComplete": function(settings, json) {
$("#forms").show();
},
"order": [[1, 'desc']]
});
} );
</script>
......
......@@ -116,8 +116,6 @@ def view_form(slug):
key=key.rstrip('[]') # remove tailing '[]' from the name attrib (appended by formbuilder)
entry[key]=value
#print("save entry: %s" % formData)
#queriedForm.saveEntry(entry)
queriedForm.entries.append(entry)
if not queriedForm.expired and queriedForm.hasExpired():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment