forked from zer.ooo/web
add profile page and other stuff
This commit is contained in:
parent
45ee7b2ebc
commit
797c829510
9 changed files with 52 additions and 7 deletions
|
@ -18,6 +18,9 @@ routes:
|
||||||
/crl: CRL
|
/crl: CRL
|
||||||
/panel:
|
/panel:
|
||||||
get: Panel
|
get: Panel
|
||||||
|
/profile:
|
||||||
|
get: Panel\Profile\Show
|
||||||
|
post: Panel\Profile\Action
|
||||||
/certificates:
|
/certificates:
|
||||||
get: Panel\Certificates
|
get: Panel\Certificates
|
||||||
/new:
|
/new:
|
||||||
|
|
|
@ -371,6 +371,10 @@ button {
|
||||||
.row input[type=checkbox] {
|
.row input[type=checkbox] {
|
||||||
margin: 5px; }
|
margin: 5px; }
|
||||||
|
|
||||||
|
.row kbd {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 5px; }
|
||||||
|
|
||||||
.row label {
|
.row label {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
float: left;
|
float: left;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -26,4 +26,4 @@
|
||||||
@import "vendors/font-awesome.min.css";
|
@import "vendors/font-awesome.min.css";
|
||||||
|
|
||||||
// pages
|
// pages
|
||||||
@import "pages/certificates/new";
|
@import "pages/certificates/new";
|
|
@ -26,6 +26,10 @@ button
|
||||||
.row input[type=checkbox]
|
.row input[type=checkbox]
|
||||||
margin: 5px
|
margin: 5px
|
||||||
|
|
||||||
|
.row kbd
|
||||||
|
display: inline-block
|
||||||
|
padding: 5px
|
||||||
|
|
||||||
.row label
|
.row label
|
||||||
width: 200px
|
width: 200px
|
||||||
float: left
|
float: left
|
||||||
|
|
15
src/Handler/Panel/Profile/Show.php
Normal file
15
src/Handler/Panel/Profile/Show.php
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace Eater\Glim\Handler\Panel\Profile;
|
||||||
|
|
||||||
|
|
||||||
|
use Eater\Glim\Handler\Panel;
|
||||||
|
|
||||||
|
class Show extends Panel
|
||||||
|
{
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
return $this->render('panel/profile.html.twig');
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,4 +23,8 @@ class User extends BaseUser
|
||||||
->filterByRevoked(false)
|
->filterByRevoked(false)
|
||||||
->find();
|
->find();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPlainEmailAddress() {
|
||||||
|
return $this->getEmailAddressRelatedByEmail()->getAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
15
views/panel/profile.html.twig
Normal file
15
views/panel/profile.html.twig
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{% extends "panel.html.twig" %}
|
||||||
|
|
||||||
|
{% block panel_contents %}
|
||||||
|
<h1 class="title">{{ user.getUsername() }}</h1>
|
||||||
|
<div class="form">
|
||||||
|
<div class="row">
|
||||||
|
<label>Email address</label>
|
||||||
|
<kbd>{{ user.getPlainEmailAddress() }}</kbd>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<label>Amount certificates</label>
|
||||||
|
<kbd>{{ user.getMaxKeys() }}</kbd>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
|
@ -3,12 +3,12 @@
|
||||||
{% block head %}
|
{% block head %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
|
|
||||||
<script src="/js/edit_server.js"></script>
|
<script src="/js/pages/servers/edit.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block panel_contents %}
|
{% block panel_contents %}
|
||||||
<h1>Editing server '{{ server.getFqdn() }}'</h1>
|
<h1 class="title">Editing server '{{ server.getFqdn() }}'</h1>
|
||||||
<div class="server-form">
|
<div class="server-form" data-fingerprint="{{ server.getFingerprint() }}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="fqdn">Hostname</label>
|
<label for="fqdn">Hostname</label>
|
||||||
<input name="fqdn" id="fqdn" type="text" value="{{ server.getFqdn() }}">
|
<input name="fqdn" id="fqdn" type="text" value="{{ server.getFqdn() }}">
|
||||||
|
@ -57,9 +57,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button type="button">Save</button>
|
<button class="save" type="button">Save</button>
|
||||||
{% if server.getStatus() == 'registered' %}
|
{% if server.getStatus() == 'registered' %}
|
||||||
<button type="button">Sign and save</button>
|
<button class="save-and-sign" type="button">Sign and save</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in a new issue