Mercurial > hg > ltpdarepo
changeset 170:e90a806a3116
Replace ugly markup with definition lists.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Sun, 06 Nov 2011 18:07:07 +0100 |
parents | a30a7e9186a9 |
children | f1cc11dc09b7 |
files | src/ltpdarepo/static/style.css src/ltpdarepo/templates/databases/view.html src/ltpdarepo/templates/forms.html src/ltpdarepo/templates/queries/view.html src/ltpdarepo/templates/user.html src/ltpdarepo/templates/users/view.html |
diffstat | 6 files changed, 62 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ltpdarepo/static/style.css Sun Nov 06 18:05:43 2011 +0100 +++ b/src/ltpdarepo/static/style.css Sun Nov 06 18:07:07 2011 +0100 @@ -150,6 +150,39 @@ border-bottom: 1px solid black; } +/** definition lists **/ + +.data { + line-height: 1.4em; + margin: 0.5em 0; + width: 100%; +} + +.data:after { + clear: both; + content: " "; + display: block; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.data dt { + clear: both; + color: #888; + float: left; + padding: 0 0.5em 0 0; +} + +.data dt:after { + content: ":"; +} + +.data dd { + float: left; + margin: 0; +} + /** messages **/ .flash {
--- a/src/ltpdarepo/templates/databases/view.html Sun Nov 06 18:05:43 2011 +0100 +++ b/src/ltpdarepo/templates/databases/view.html Sun Nov 06 18:07:07 2011 +0100 @@ -2,8 +2,10 @@ {% block title %}{{ database.id }}{% endblock %} {% block body %} <h2>Database «{{ database.id }}»</h2> -<p class="field"><span class="label">Name:</span> {{database.name }}</p> -<p class="field"><span class="label">Description:</span> {{ database.description }}</p> +<dl class="data"> + <dt>Name</dt><dd>{{database.name }}</dd> + <dt>Description</dt><dd>{{ database.description }}</dd> +</dl> <ul class="actions"> <li><a href="{{ url_for('manage.databases.edit', database=database.id) }}">Edit</a></li> <li><a href="{{ url_for('manage.databases.permissions', database=database.id) }}">Permissions</a></li>
--- a/src/ltpdarepo/templates/forms.html Sun Nov 06 18:05:43 2011 +0100 +++ b/src/ltpdarepo/templates/forms.html Sun Nov 06 18:07:07 2011 +0100 @@ -35,9 +35,11 @@ {% endmacro %} {% macro view(form) -%} - {% for field in form %} - {% if field.type not in ('HiddenField', 'SubmitField', 'PasswordField') %} - <p class="field"><span class="label">{{ field.label }}:</span> {{ field.data }}</p> - {% endif %} - {% endfor %} +<dl class="data"> + {% for field in form %} + {% if field.type not in ('HiddenField', 'SubmitField', 'PasswordField') %} + <dt>{{ field.label }}</dt><dd>{{ field.data }}</dd> + {% endif %} + {% endfor %} +</dl> {%- endmacro %}
--- a/src/ltpdarepo/templates/queries/view.html Sun Nov 06 18:05:43 2011 +0100 +++ b/src/ltpdarepo/templates/queries/view.html Sun Nov 06 18:07:07 2011 +0100 @@ -2,8 +2,10 @@ {% block title %}Query {{ query.title }}{% endblock %} {% block body %} <h2>Query «{{ query.title }}»</h2> -<p class="field"><span class="label">Database:</span> <tt>{{ query.db }}</tt></p> -<p class="field"><span class="label">Query:</span> <tt>{{ query.tostring() }}</tt></p> +<dl class="data"> + <dt>Database</dt><dd><tt>{{ query.db }}</tt></dd> + <dt>Query</dt><dd><tt>{{ query.tostring() }}</tt></dd> +</dl> <ul class="actions"> <li><a href="{{ url_for('manage.queries.edit', id=query.id) }}">Edit</a></li> <li><a href="{{ url_for('manage.queries.drop', id=query.id) }}">Drop</a></li>
--- a/src/ltpdarepo/templates/user.html Sun Nov 06 18:05:43 2011 +0100 +++ b/src/ltpdarepo/templates/user.html Sun Nov 06 18:07:07 2011 +0100 @@ -2,10 +2,12 @@ {% block title %}{{ session.username }}{% endblock %} {% block body %} <h2>User «{{ session.username }}»</h2> -<p class="field"><span class="label">Name:</span>{{ user.name }} {{ user.surname }}</p> -<p class="field"><span class="label">Email:</span>{{ user.email }}</p> -<p class="field"><span class="label">Institution:</span>{{ user.institution }}</p> -<p class="field"><span class="label">Telephone:</span>{{ user.telephone }}</p> +<dl class="data"> + <dt>Name</dt><dd>{{ user.name }} {{ user.surname }}</dd> + <dt>Email</dt><dd>{{ user.email }}</dd> + <dt>Institution</dt><dd>{{ user.institution }}</dd> + <dt>Telephone</dt><dd>{{ user.telephone }}</dd> +</dl> <ul class="actions"> <li><a href="{{ url_for('user.edit', username=session.username) }}">Edit profile</a></li> <li><a href="{{ url_for('user.password', username=session.username) }}">Change password</a></li>
--- a/src/ltpdarepo/templates/users/view.html Sun Nov 06 18:05:43 2011 +0100 +++ b/src/ltpdarepo/templates/users/view.html Sun Nov 06 18:07:07 2011 +0100 @@ -19,8 +19,14 @@ {% block title %}User {{ username }}{% endblock %} {% block body %} <h2>User «{{ username }}»</h2> -{{ forms.view(form) }} -<p class="field"><span class="label">Permissions:</span> <a class="toggle" href="">show</a></p> +<dl class="data"> + {% for field in form %} + {% if field.type not in ('HiddenField', 'SubmitField', 'PasswordField') %} + <dt>{{ field.label }}</dt><dd>{{ field.data }}</dd> + {% endif %} + {% endfor %} + <dt>Permissions</dt><dd><a class="toggle" href="">show</a></dd> +</dl> <table id="permissions" class="permissions" style="display: none;"> <tr><th></th><th>select</th><th>insert</th><th>update</th><th>delete</th></tr> {% for db, p in permissions.iteritems() %}