Skip to content

Commit

Permalink
Admin: straighten admin-header blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurClemens committed Aug 30, 2015
1 parent 92eff31 commit 0127b6c
Show file tree
Hide file tree
Showing 22 changed files with 349 additions and 340 deletions.
32 changes: 15 additions & 17 deletions modules/mod_acl_simple_roles/templates/admin_acl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,24 @@
{% with m.acl.is_admin as editable %}

<div class="admin-header">

<h2>{_ Access Control - Roles Overview _}</h2>

<p>{_ Access control controls what an user is allowed to do and see. The roles define different groups of rights. Users can be made member of multiple roles. _}</p>

{% if editable %}
<div class="well">
{% button
class="btn btn-primary"
text=_"Make new ACL role"
action={
dialog_new_rsc
cat="acl_role"
nocatselect
tabs_enabled=["new"]
}
%}
</div>
{% endif %}
</div>

{% if editable %}
<div class="well">
{% button
class="btn btn-primary"
text=_"Make new ACL role"
action={
dialog_new_rsc
cat="acl_role"
nocatselect
tabs_enabled=["new"]
}
%}
</div>
{% endif %}

<div>
<h3>{_ ACL role overview _}</h3>
Expand Down
3 changes: 3 additions & 0 deletions modules/mod_admin/lib/css/zotonic-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ p .z-btn-help {
h3 {
margin: 1.25em 0 .75em 0;
}
pre:empty {
display: none;
}
.text-muted {
color: #999999;
}
Expand Down
4 changes: 4 additions & 0 deletions modules/mod_admin/lib/less/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,8 @@ p .z-btn-help {

h3 {
margin: 1.25em 0 .75em 0;
}

pre:empty {
display: none;
}
146 changes: 74 additions & 72 deletions modules/mod_admin/templates/admin_media.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,83 +12,85 @@
{_ Media encompasses all uploaded images, movies and documents. Media can be attached to pages. _}
{_ And media can also be viewed on their own page. _}
</p>
</div>

<div class="well z-button-row">
<a name="content-pager"></a>
{% button
class="btn btn-primary"
text=_"Make a new media item"
action={dialog_media_upload}
%}
<a class="btn btn-default" href="{% url admin_overview_rsc %}">{_ All pages _}</a>
<a class="btn btn-default{% if not q.qcat %} disabled{% endif %}" href="{% url admin_media %}">{_ All media _}</a>
</div>
<div class="well z-button-row">
<a name="content-pager"></a>
{% button
class="btn btn-primary"
text=_"Make a new media item"
action={dialog_media_upload}
%}
<a class="btn btn-default" href="{% url admin_overview_rsc %}">{_ All pages _}</a>
<a class="btn btn-default{% if not q.qcat %} disabled{% endif %}" href="{% url admin_media %}">{_ All media _}</a>
</div>

{% with q.qsort|default:"-created" as qsort %}
{% with m.search.paged[{query cat="media" text=q.qs page=q.page sort=qsort}] as result %}
<div>
{% with q.qsort|default:"-created" as qsort %}
{% with m.search.paged[{query cat="media" text=q.qs page=q.page sort=qsort}] as result %}

<table class="table table-striped do_adminLinkedTable">
<thead>
<tr>
<th width="10%">{_ Preview _}</th>
<th width="35%">{% include "_admin_sort_header.tpl" field="pivot_title" caption=_"Title" qsort=qsort %}</th>
<th width="25%">{_ Info _}</th>
<th width="30%">{% include "_admin_sort_header.tpl" field="created" caption=_"Uploaded" type="date" qsort=qsort %}</th>
</tr>
</thead>
<table class="table table-striped do_adminLinkedTable">
<thead>
<tr>
<th width="10%">{_ Preview _}</th>
<th width="35%">{% include "_admin_sort_header.tpl" field="pivot_title" caption=_"Title" qsort=qsort %}</th>
<th width="25%">{_ Info _}</th>
<th width="30%">{% include "_admin_sort_header.tpl" field="created" caption=_"Uploaded" type="date" qsort=qsort %}</th>
</tr>
</thead>

<tbody>
{% for id in result %}
{% if m.rsc[id].is_visible %}
{% with m.rsc[id] as r %}
{% with r.medium as medium %}
<tr id="{{ #li.id }}" {% if not m.rsc[id].is_published %}class="unpublished" {% endif %} data-href="{% url admin_edit_rsc id=id %}">
<td>{% image medium mediaclass="admin-list-overview" class="thumb" %}</td>
<td>
<strong>{{ r.title|striptags|default:"<em>untitled</em>" }}</strong><br />
<span class="text-muted">{{ medium.filename|default:"-" }}</span>
</td>
<td>
<p class="help-block">
{{ medium.mime|default:"&nbsp;" }}<br />
{{ medium.width }}&times;{{ medium.height }}
</p>
</td>
<td>
{{ medium.created|date:"M d, H:i"|default:"&nbsp;" }}
<div class="pull-right buttons">
{% button
class="btn btn-default btn-xs"
text=_"delete"
disabled=r.is_protected
action={
dialog_delete_rsc
id=id
on_success={
slide_fade_out
target=#li.id
}
<tbody>
{% for id in result %}
{% if m.rsc[id].is_visible %}
{% with m.rsc[id] as r %}
{% with r.medium as medium %}
<tr id="{{ #li.id }}" {% if not m.rsc[id].is_published %}class="unpublished" {% endif %} data-href="{% url admin_edit_rsc id=id %}">
<td>{% image medium mediaclass="admin-list-overview" class="thumb" %}</td>
<td>
<strong>{{ r.title|striptags|default:"<em>untitled</em>" }}</strong><br />
<span class="text-muted">{{ medium.filename|default:"-" }}</span>
</td>
<td>
<p class="help-block">
{{ medium.mime|default:"&nbsp;" }}<br />
{{ medium.width }}&times;{{ medium.height }}
</p>
</td>
<td>
{{ medium.created|date:"M d, H:i"|default:"&nbsp;" }}
<div class="pull-right buttons">
{% button
class="btn btn-default btn-xs"
text=_"delete"
disabled=r.is_protected
action={
dialog_delete_rsc
id=id
on_success={
slide_fade_out
target=#li.id
}
%}
<a href="{% url admin_edit_rsc id=id %}" class="btn btn-default btn-xs">{_ edit _}</a>
</div>
</td>
</tr>
{% endwith %}
{% endwith %}
{% endif %}
{% empty %}
<tr>
<td colspan="6">
{_ No media found. _}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% pager result=result dispatch="admin_media" qargs hide_single_page %}
{% endwith %}
{% endwith %}
}
%}
<a href="{% url admin_edit_rsc id=id %}" class="btn btn-default btn-xs">{_ edit _}</a>
</div>
</td>
</tr>
{% endwith %}
{% endwith %}
{% endif %}
{% empty %}
<tr>
<td colspan="6">
{_ No media found. _}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% pager result=result dispatch="admin_media" qargs hide_single_page %}
{% endwith %}
{% endwith %}
</div>

{% endblock %}
90 changes: 46 additions & 44 deletions modules/mod_admin/templates/admin_referrers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,55 @@
{% block title %}{_ Referrers to _} {{ m.rsc[q.id].title }}{% endblock %}

{% block content %}
{% with m.search.paged[{referrers id=q.id page=q.page}] as result %}
<div class="admin-header">
<h2 id="content-pager">{_ Referrers to _} <a href="{% url admin_edit_rsc id=q.id|to_integer %}">{{ m.rsc[q.id].title }}</a></h2>

{% with m.search.paged[{referrers id=q.id page=q.page}] as result %}
{% ifequal result.total 0 %}
<p>{_ There are no pages with a connection to the page _}{{ m.rsc[q.id].title }}”</p>
{% endifequal %}
{% ifequal result.total 0 %}
<p>{_ There are no pages with a connection to the page _}{{ m.rsc[q.id].title }}”</p>
{% endifequal %}
</div>

{% ifnotequal result.total 0 %}
<table class="table table-striped do_adminLinkedTable">
<thead>
<tr>
<th width="30%">{_ Title _}</th>
<th width="15%">{_ Category _}</th>
<th width="15%">{_ Predicate _}</th>
<th width="15%">{_ Modified on _}</th>
<th width="25%">{_ Modified by _}</th>
</tr>
</thead>
<tbody>
{% for id, pred_id in result %}
{% if id.is_visible %}
<tr id="{{ #tr.id }}" class="{% if not m.rsc[id].is_published %}unpublished{% endif %}" data-href="{% url admin_edit_rsc id=id %}">
<td><span {% include "_language_attrs.tpl" %}>{{ m.rsc[id].title|striptags|default:"<em>untitled</em>" }}</span></td>
<td>{{ m.rsc[m.rsc[id].category_id].title }}</td>
<td>{{ m.rsc[pred_id].title }}</td>
<td>{{ m.rsc[id].modified|date:_"d M Y, H:i" }}</td>
<td>
{{ m.rsc[m.rsc[id].modifier_id].title|default:"-" }}
<span class="pull-right buttons">
{% if id.page_url %}<a href="{{ id.page_url }}" class="btn btn-default btn-xs">{_ view _}</a>{% endif %}
<a href="{% url admin_edit_rsc id=id %}" class="btn btn-default btn-xs">{_ edit _}</a>
</span>
</td>
</tr>
{% endif %}
{% empty %}
<tr>
<td colspan="5">
{_ No pages found. _}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% pager result=result dispatch="admin_referrers" hide_single_page=1 id=q.id qargs %}
{% endifnotequal %}
{% endwith %}
<div>
{% ifnotequal result.total 0 %}
<table class="table table-striped do_adminLinkedTable">
<thead>
<tr>
<th width="30%">{_ Title _}</th>
<th width="15%">{_ Category _}</th>
<th width="15%">{_ Predicate _}</th>
<th width="15%">{_ Modified on _}</th>
<th width="25%">{_ Modified by _}</th>
</tr>
</thead>
<tbody>
{% for id, pred_id in result %}
{% if id.is_visible %}
<tr id="{{ #tr.id }}" class="{% if not m.rsc[id].is_published %}unpublished{% endif %}" data-href="{% url admin_edit_rsc id=id %}">
<td><span {% include "_language_attrs.tpl" %}>{{ m.rsc[id].title|striptags|default:"<em>untitled</em>" }}</span></td>
<td>{{ m.rsc[m.rsc[id].category_id].title }}</td>
<td>{{ m.rsc[pred_id].title }}</td>
<td>{{ m.rsc[id].modified|date:_"d M Y, H:i" }}</td>
<td>
{{ m.rsc[m.rsc[id].modifier_id].title|default:"-" }}
<span class="pull-right buttons">
{% if id.page_url %}<a href="{{ id.page_url }}" class="btn btn-default btn-xs">{_ view _}</a>{% endif %}
<a href="{% url admin_edit_rsc id=id %}" class="btn btn-default btn-xs">{_ edit _}</a>
</span>
</td>
</tr>
{% endif %}
{% empty %}
<tr>
<td colspan="5">
{_ No pages found. _}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% pager result=result dispatch="admin_referrers" hide_single_page=1 id=q.id qargs %}
{% endifnotequal %}
</div>
{% endwith %}
{% endblock %}
8 changes: 4 additions & 4 deletions modules/mod_admin_config/templates/admin_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<div class="admin-header">
<h2>{_ System Configuration _}</h2>
</div>

<div class="well">
{% button class="btn btn-primary" text=_"Make a new config setting" action={dialog_config_new on_success={reload}} %}
</div>

<div class="well">
{% button class="btn btn-primary" text=_"Make a new config setting" action={dialog_config_new on_success={reload}} %}
</div>

<div>
<table class="table table-striped do_adminLinkedTable">
<thead>
Expand Down
41 changes: 19 additions & 22 deletions modules/mod_admin_identity/templates/admin_users.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,26 @@
{% block content %}
{% with m.acl.is_admin as is_users_editable %}


<div class="admin-header">

<h2>
{_ Users _}{% if q.qs %},
{_ matching _}{{ q.qs|escape }}”
{% else %} {_ overview _}{% endif %}
</h2>

<p>
{_ Every page/person can be made into a user on the edit page.
The difference between a user and a normal page is only
that the former has logon credentials attached to its page record. _}
</p>

{% if is_users_editable %}
<div class="well">
{% button class="btn btn-primary" text=_"Make a new user" action={dialog_user_add on_success={reload}} %}
</div>
{% else %}
<div class="alert alert-info">{_ You need to be an administrator to add users. _}</div>
{% endif %}
<div class="admin-header">
<h2>
{_ Users _}{% if q.qs %},
{_ matching _}{{ q.qs|escape }}”
{% else %} {_ overview _}{% endif %}
</h2>
<p>
{_ Every page/person can be made into a user on the edit page.
The difference between a user and a normal page is only
that the former has logon credentials attached to its page record. _}
</p>
</div>

{% if is_users_editable %}
<div class="well">
{% button class="btn btn-primary" text=_"Make a new user" action={dialog_user_add on_success={reload}} %}
</div>
{% else %}
<div class="alert alert-info">{_ You need to be an administrator to add users. _}</div>
{% endif %}

<div>
{% with m.acl.user as me %}
Expand Down
Loading

0 comments on commit 0127b6c

Please sign in to comment.