Skip to content

Commit

Permalink
Improved admin forms, finished User part of admin page.
Browse files Browse the repository at this point in the history
  • Loading branch information
vjekoart committed Jul 30, 2015
1 parent 4f1c658 commit 4c4aba6
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 20 deletions.
45 changes: 42 additions & 3 deletions Resources/public/css/admin.css
Expand Up @@ -7,11 +7,20 @@
position: relative;
}

div#main {
padding-bottom: 6em;
}

.admin-heading {
margin-top: 2em;
}

.margin-top {
margin-top: 1.5em !important;
}

ol, ol li {
line-height: 2em;
color: #404041;
}

Expand Down Expand Up @@ -39,6 +48,18 @@ h2 {
margin: 0.8em 0;
}

.btn {
margin: 0.5714em 0;
margin-right: 0.5714em;
}

@media (max-width: 767px) {
.btn {
width: 100%;
margin-right: 0;
}
}

/**
* Admin header & footer
*/
Expand Down Expand Up @@ -66,7 +87,7 @@ h2 {
}

.secondary-footer {
margin-top: 1em;
margin-top: 1.5em;
}

.secondary-footer i {
Expand Down Expand Up @@ -102,14 +123,23 @@ h2 {
}


/**
* Tables
*/
table.table {}


/**
* Forms
*/
form {
display: block;
color: #404041;
width: initial !important;
margin-left: 0px !important;
padding: 0 1.5em;
border: 1px solid #dddddd;
color: #404041;
background-color: #ffffff;
}

form div {
Expand All @@ -122,7 +152,7 @@ form div > div > div {

form label {
display: inline-block;
margin: 1em 0 0 0;
margin: 1.5em 0 0 0;
font-size: 1em;
font-weight: 600;
line-height: 1.5em;
Expand All @@ -133,6 +163,15 @@ form select, form input[type="text"], form input[type="email"] {
width: 100%;
}

form input[type="text"], form input[type="email"] {
padding: 0.1428em 1em;
font-size: 0.875em;
line-height: 1.8571em;
border: 1px solid #dddddd;
border-radius: 0;
background-color: #ffffff;
}

form input[type="checkbox"] {
display: inline-block;
float: right;
Expand Down
5 changes: 2 additions & 3 deletions Resources/views/Index/admin.html.twig
Expand Up @@ -6,10 +6,9 @@

{% block body %}
<div class="row">
<div class="col-xs-12">
<div class="col-xs-12 margin-top">
<p>We trust you have received the usual lecture from the local Organizator. It usually boils down to these three things:</p>

<ol>
<ol class="margin-top">
<li>Respect the privacy of others.</li>
<li>Think before you type.</li>
<li>With great power comes great responsibility.</li>
Expand Down
3 changes: 2 additions & 1 deletion Resources/views/Security/adminlogin.html.twig
Expand Up @@ -2,7 +2,8 @@

{% block title %}AdminLogin|LiveVoting{% endblock %}

{% block mainHeading %}<h1 class="text-center">Netgen LiveVoting</h1>{% endblock %}
{% block headingSpecialClass %}class="text-center"{% endblock %}
{% block mainHeading %}Netgen LiveVoting{% endblock %}

{% block body %}
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/User/edit.html.twig
Expand Up @@ -6,7 +6,7 @@

{% block body %}
<div class="row">
<div class="col-xs-12 col-sm-4 col-lg-3">
<div class="col-xs-12 col-sm-4 margin-top">
{{ form(edit_form, {'attr':{'class':'form-horizontal'}}) }}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions Resources/views/User/importcsv.html.twig
Expand Up @@ -4,16 +4,16 @@

{% block mainHeading %}Import CSV{% endblock %}

{% block body -%}
{% block body %}
<div class="row">
<div class="col-xs-12 col-sm-4 col-lg-3">
<div class="col-xs-12 col-sm-4 margin-top">
{{ form(form) }}
</div>
</div>

<div class="row secondary-footer">
<div class="col-xs-12">
<a href="{{path('admin_user')}}"><button type="button" class="btn"><i class="fa fa-chevron-left"></i> Back</button></a>
<a href="{{path('admin_user')}}"><button type="button" class="btn">Back</button></a>
</div>
</div>
{% endblock %}
14 changes: 8 additions & 6 deletions Resources/views/User/index.html.twig
Expand Up @@ -6,17 +6,19 @@

{% block body %}
{% for flashMessage in app.Session.flashbag.get('message') %}
<div class="alert alert-danger">{{flashMessage}}</div>
<div class="alert alert-danger">
<div class="text">{{flashMessage}}</div>
</div>
{% endfor %}

<div class="row">
<div class="col-xs-12">
<table class="records_list table">
<table class="records_list table margin-top">
<thead>
<tr>
<th>User email</th>
<th class="text-center">User enabled</th>
<th>Edit user</th>
<th>Email</th>
<th class="text-center">Enabled</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
Expand All @@ -36,7 +38,7 @@

<div class="row secondary-footer">
<div class="col-xs-12">
<a href="{{ path('admin_user_new') }}"><button type="button" class="btn"><i class="fa fa-plus"></i> New user</button></a>
<a href="{{ path('admin_user_new') }}"><button type="button" class="btn"><i class="fa fa-plus"></i> Add user</button></a>
<a href="{{ path('csv_export') }}"><button type="button" class="btn"><i class="fa fa-sign-out"></i> Export CSV</button></a>
<a href="{{ path('user_csv_import') }}"><button type="button" class="btn"><i class="fa fa-sign-in"></i> Import CSV</button></a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/User/new.html.twig
Expand Up @@ -6,14 +6,14 @@

{% block body %}
<div class="row">
<div class="col-xs-12 col-sm-4 col-lg-3">
<div class="col-xs-12 col-sm-4 margin-top">
{{ form(form) }}
</div>
</div>

<div class="row secondary-footer">
<div class="col-xs-12">
<a href="{{path('admin_user')}}"><button type="button" class="btn"><i class="fa fa-chevron-left"></i> Back</button></a>
<a href="{{path('admin_user')}}"><button type="button" class="btn">Back</button></a>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion Resources/views/baseAdmin.html.twig
Expand Up @@ -39,7 +39,7 @@
<div id="main" class="container">
<div class="row admin-heading">
<div class="col-xs-12">
<h1>{% block mainHeading %}{% endblock %}</h1>
<h1 {% block headingSpecialClass %}{% endblock %}>{% block mainHeading %}{% endblock %}</h1>
</div>
</div>
{% block body %}{% endblock %}
Expand Down

0 comments on commit 4c4aba6

Please sign in to comment.