Archived
1
0
Fork 0

Make the application modular to have a "main" and "backend" part.

This commit is contained in:
Henrik Hautakoski 2018-10-09 22:26:01 +02:00
parent 884f721002
commit e5b0e1fcfd
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA
28 changed files with 112 additions and 7 deletions

View file

@ -0,0 +1,31 @@
<div class="section">
<h3>Activity Log</h3>
<table class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Date</th>
<th>Ip</th>
<th>Message</th>
</tr>
</thead>
<tbody>
{% for item in page.items %}
<tr>
<td>{{ item.getTimestamp() }}</td>
<td>{{ item.getIp() }}</td>
<td>{{ item.getMessage() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<nav class="text-center" aria-label="Page navigation">
{{ partial('pagination') }}
</nav>
</div>

View file

@ -0,0 +1,116 @@
{%
set social_links = [
'github' : [ 'connected': user.getGithubId() > 0 ],
'gitlab' : [ 'connected': user.getGitlabId() > 0, 'class': 'text-gitlab' ],
'google' : [ 'connected': user.getGoogleId() > 0, 'class': 'text-google' ],
'linkedin' : [ 'connected': user.getLinkedinId() | length, 'class': 'text-linkedin' ]
]
%}
<div class="section">
<form class="form-horizontal" method="post" action="">
<div class="form-group">
{{ form.renderDecorated('username', [ 'length': 7 ]) }}
{{ form.renderDecorated('id', [ 'length': 2, 'label-length' : 1 ]) }}
</div>
<div class="form-group">
{{ form.renderDecorated('name') }}
</div>
<div class="form-group">
{{ form.renderDecorated('email') }}
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<h4>Password</h4>
</div>
</div>
{% if form.has('passwordCurrent') %}
<div class="form-group">
{{ form.renderDecorated('passwordCurrent') }}
</div>
{% endif %}
<div class="form-group">
{{ form.renderDecorated('passwordNew') }}
</div>
<div class="form-group">
{{ form.renderDecorated('passwordConfirm') }}
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<h4>Social sign-in</h4>
<hr />
{% for name,info in social_links %}
<div class="col-sm-2 text-center">
{% set class = info['class'] | default(false) %}
<div{{ class ? ' class="%s"'|format(class) : '' }}>{{ icon('brand/' ~ name, [ '3x' ]) }}</div>
{% if info['connected'] %}
<a href="{{ url(['for': 'oauth-disconnect', 'provider': name]) }}">Disconnect</a>
{% else %}
<a href="{{ url(['for': 'oauth', 'strategy': name]) }}">Connect</a>
{% endif %}
</div>
{% endfor %}
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<hr />
{{ form.render('Save') }}
<button class="button button-danger pull-right" type="button" data-toggle="modal" data-target="#deleteModal">
Delete Account
</button>
</div>
</div>
</form>
</div>
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title pull-left" id="deleteModalLabel">Delete account</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form method="post" action="/user/delete">
<div class="modal-body">
<p>
Deleting your account is a non-reversible action.
All data associated with your account will be lost in the process.
</p>
{% if user.password|length > 0 %}
<p>Enter your <kbd>password</kbd> to confirm:</p>
<input type="password" name="currentpw" class="form-control" />
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="button button-default" data-dismiss="modal">Close</button>
<input type="submit" name="deleteAcc" class="button button-danger" value="Delete account">
</div>
</form>
</div>
</div>
</div>