changeset 1117:f2d8c602dbb6

Improved table style to be more consistent. Fixes #13.
author Julian Brost <julian.brost@googlemail.com>
date Sun, 04 Dec 2011 00:42:48 +0100
parents d56ce46d3e16
children 505ad860856a
files MoinMoin/apps/admin/templates/admin/userbrowser.html MoinMoin/apps/admin/templates/admin/wikiconfig.html MoinMoin/apps/admin/templates/admin/wikiconfighelp.html MoinMoin/templates/global_history.html MoinMoin/templates/history.html MoinMoin/templates/modify_show_type_selection.html MoinMoin/templates/utils.html MoinMoin/themes/modernized/static/css/common.css
diffstat 8 files changed, 80 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/admin/templates/admin/userbrowser.html	Sat Dec 03 23:50:40 2011 +0100
+++ b/MoinMoin/apps/admin/templates/admin/userbrowser.html	Sun Dec 04 00:42:48 2011 +0100
@@ -1,6 +1,6 @@
 {% extends theme("layout.html") %}
 {% block content %}
-    <table>
+    <table class="zebra">
     <tr>
         <th>{{ _("User name") }}</th>
         <th>{{ _("Member of Groups") }}</th>
--- a/MoinMoin/apps/admin/templates/admin/wikiconfig.html	Sat Dec 03 23:50:40 2011 +0100
+++ b/MoinMoin/apps/admin/templates/admin/wikiconfig.html	Sun Dec 04 00:42:48 2011 +0100
@@ -8,11 +8,11 @@
      "were removed from Moin.")
 }}
 </p>
-<table>
+<table class="zebra">
 <thead>
 <tr>
-<td><strong>{{ _('Variable name') }}</strong></td>
-<td><strong>{{ _('Setting') }}</strong></td>
+<th>{{ _('Variable name') }}</th>
+<th>{{ _('Setting') }}</th>
 </tr>
 </thead>
 <tbody>
--- a/MoinMoin/apps/admin/templates/admin/wikiconfighelp.html	Sat Dec 03 23:50:40 2011 +0100
+++ b/MoinMoin/apps/admin/templates/admin/wikiconfighelp.html	Sun Dec 04 00:42:48 2011 +0100
@@ -6,12 +6,12 @@
     {% if desc %}
         <p>{{ desc }}</p>
     {% endif %}
-    <table>
+    <table class="zebra">
     <thead>
     <tr>
-        <td><strong>{{ _('Variable name') }}</strong></td>
-        <td><strong>{{ _('Default') }}</strong></td>
-        <td><strong>{{ _('Description') }}</strong></td>
+        <th>{{ _('Variable name') }}</th>
+        <th>{{ _('Default') }}</th>
+        <th>{{ _('Description') }}</th>
     </tr>
     </thead>
     <tbody>
--- a/MoinMoin/templates/global_history.html	Sat Dec 03 23:50:40 2011 +0100
+++ b/MoinMoin/templates/global_history.html	Sun Dec 04 00:42:48 2011 +0100
@@ -14,15 +14,13 @@
            {% set latest_timestamp = revs[0].meta['mtime'] %}
             <div class="moin-history-container"> 
                 <div class="moin-history-container-header">
-                    <span>
-                        <h2>{{ day }}</h2>
-                        {% if user.valid %}
-                        <a class="bookmark-link" href="{{ url_for('frontend.bookmark', time=latest_timestamp+1) }}">{{ _("Set bookmark") }}</a>
-                        {% endif %}
-                   </span>
+                    <h2>{{ day }}</h2>
+                    {% if user.valid %}
+                    <a class="bookmark-link" href="{{ url_for('frontend.bookmark', time=latest_timestamp+1) }}">{{ _("Set bookmark") }}</a>
+                    {% endif %}
                 </div>
                 <div class="moin-history-container-body">
-                    <table>
+                    <table class="zebra">
                     {% for rev in revs %}
                         {% set meta = rev.meta %}
                         <tr>
--- a/MoinMoin/templates/history.html	Sat Dec 03 23:50:40 2011 +0100
+++ b/MoinMoin/templates/history.html	Sun Dec 04 00:42:48 2011 +0100
@@ -15,51 +15,57 @@
     <div class="moin-clr"></div>
     <form action="{{ url_for('frontend.diff', item_name=item_name) }}" method="GET">
         <div id="moin-page-history">
-        <table>
-            <tr>
-                <th>{{ _("Name") }}</th>
-                <th>{{ _("Rev.") }}</th>
-                <th>{{ _("Timestamp") }}</th>
-                <th>{{ _("Size") }}</th>
-                <th><input type="submit" value="Diff" /></th>
-                <th>{{ _("Editor") }}</th>
-                <th>{{ _("Content-Type") }}</th>
-                <th>{{ _("Comment") }}</th>
-                <th colspan="6">{{ _("Actions") }}</th>
-            </tr>
-            {% for doc in history %}
-            <tr>
-                <td class="moin-wordbreak">{{ doc.name }}</td>
-                <td class="moin-integer"><tt>{{ doc.revid | shorten_id }}</tt></td>
-                <td>{{ doc.mtime|datetimeformat }}</td>
-                <td class="moin-integer">{{ doc.size }}</td>
-                <td>
-                    <div class="moin-hist-rev">
-                        <input type="radio" name="rev1" value="{{ doc.revid }}" />
-                        <input type="radio" name="rev2" value="{{ doc.revid }}" />
-                    </div>
-                </td>
-                <td class="moin-wordbreak">{{ utils.editor_info(doc) }}</td>
-                <td class="moin-wordbreak">{{ doc.contenttype }}</td>
-                <td class="moin-wordbreak">{{ doc.comment }}</td>
-                <td><a href="{{ url_for('frontend.show_item', item_name=doc.name, rev=doc.revid) }}">{{ _('show') }}</a></td>
-                <td><a href="{{ url_for('frontend.show_item_meta', item_name=doc.name, rev=doc.revid) }}">{{ _('meta') }}</a></td>
-                <td><a href="{{ url_for('frontend.download_item', item_name=doc.name, rev=doc.revid) }}">{{ _('download') }}</a></td>
-                <td><a href="{{ url_for('frontend.highlight_item', item_name=doc.name, rev=doc.revid) }}">{{ _('highlight') }}</a></td>
-                {% if user.may.write(item_name) -%}
-                <td><a href="{{ url_for('frontend.revert_item', item_name=doc.name, rev=doc.revid) }}">{{ _('revert') }}</a></td>
-                {%- endif %}
-                {% if user.may.destroy(item_name) -%}
-                <td><a href="{{ url_for('frontend.destroy_item', item_name=doc.name, rev=doc.revid) }}">{{ _('destroy') }}</a></td>
-                {%- endif %}
-            </tr>
-            {% endfor %}
+        <table class="zebra">
+            <thead>
+                <tr>
+                    <th>{{ _("Name") }}</th>
+                    <th>{{ _("Rev.") }}</th>
+                    <th>{{ _("Timestamp") }}</th>
+                    <th>{{ _("Size") }}</th>
+                    <th><input type="submit" value="Diff" /></th>
+                    <th>{{ _("Editor") }}</th>
+                    <th>{{ _("Content-Type") }}</th>
+                    <th>{{ _("Comment") }}</th>
+                    <th colspan="6">{{ _("Actions") }}</th>
+                </tr>
+            </thead>
+            <tbody>
+                {% for doc in history %}
+                <tr>
+                    <td class="moin-wordbreak">{{ doc.name }}</td>
+                    <td class="moin-integer"><tt>{{ doc.revid | shorten_id }}</tt></td>
+                    <td>{{ doc.mtime|datetimeformat }}</td>
+                    <td class="moin-integer">{{ doc.size }}</td>
+                    <td>
+                        <div class="moin-hist-rev">
+                            <input type="radio" name="rev1" value="{{ doc.revid }}" />
+                            <input type="radio" name="rev2" value="{{ doc.revid }}" />
+                        </div>
+                    </td>
+                    <td class="moin-wordbreak">{{ utils.editor_info(doc) }}</td>
+                    <td class="moin-wordbreak">{{ doc.contenttype }}</td>
+                    <td class="moin-wordbreak">{{ doc.comment }}</td>
+                    <td><a href="{{ url_for('frontend.show_item', item_name=doc.name, rev=doc.revid) }}">{{ _('show') }}</a></td>
+                    <td><a href="{{ url_for('frontend.show_item_meta', item_name=doc.name, rev=doc.revid) }}">{{ _('meta') }}</a></td>
+                    <td><a href="{{ url_for('frontend.download_item', item_name=doc.name, rev=doc.revid) }}">{{ _('download') }}</a></td>
+                    <td><a href="{{ url_for('frontend.highlight_item', item_name=doc.name, rev=doc.revid) }}">{{ _('highlight') }}</a></td>
+                    {% if user.may.write(item_name) -%}
+                    <td><a href="{{ url_for('frontend.revert_item', item_name=doc.name, rev=doc.revid) }}">{{ _('revert') }}</a></td>
+                    {%- endif %}
+                    {% if user.may.destroy(item_name) -%}
+                    <td><a href="{{ url_for('frontend.destroy_item', item_name=doc.name, rev=doc.revid) }}">{{ _('destroy') }}</a></td>
+                    {%- endif %}
+                </tr>
+                {% endfor %}
+            </tbody>
             {% if bookmark_time %}
-            <tr> 
-                <td colspan="2">Bookmark is set to</td>
-                <td>{{ bookmark_time|datetimeformat }}</td>
-                <td colspan="11"></td>
-            </tr>
+            <tfoot>
+                <tr>
+                    <td colspan="2">Bookmark is set to</td>
+                    <td>{{ bookmark_time|datetimeformat }}</td>
+                    <td colspan="11"></td>
+                </tr>
+            </tfoot>
             {% endif %}
         </table>
         </div>
--- a/MoinMoin/templates/modify_show_type_selection.html	Sat Dec 03 23:50:40 2011 +0100
+++ b/MoinMoin/templates/modify_show_type_selection.html	Sun Dec 04 00:42:48 2011 +0100
@@ -4,10 +4,10 @@
 <p>
 {{ _("This item does not exist (yet), but you can try creating it now. Please select the type of the item you want to create.") }}
 </p>
-<table>
+<table class="zebra">
     {% for gname, contenttypes in contenttype_groups %}
     <tr>
-        <td class="green">{{ gname }}</td>
+        <th>{{ gname }}</th>
     </tr>
     <tr>
         <td>
--- a/MoinMoin/templates/utils.html	Sat Dec 03 23:50:40 2011 +0100
+++ b/MoinMoin/templates/utils.html	Sun Dec 04 00:42:48 2011 +0100
@@ -22,11 +22,11 @@
 
 
 {% macro table(headings, rows) %}
-<table>
+<table class="zebra">
 <thead>
     <tr>
         {% for heading in headings %}
-        <td><strong>{{ heading }}</strong></td>
+        <th>{{ heading }}</th>
         {% endfor %}
     </tr>
 </thead>
--- a/MoinMoin/themes/modernized/static/css/common.css	Sat Dec 03 23:50:40 2011 +0100
+++ b/MoinMoin/themes/modernized/static/css/common.css	Sun Dec 04 00:42:48 2011 +0100
@@ -113,8 +113,16 @@
 
 /* tables */
 table { margin: 0.5em; border-collapse: collapse; }
-th, td { padding: 0.25em 0.5em 0.25em 0.5em; border: 1px solid #ADB9CC; vertical-align: middle; }
+th, td { padding: 0.3em 0.4em; vertical-align: middle; text-align: left; }
+th { border: 1px solid #4D7DA9; background-color: #81BBF2; }
+td { border: 1px solid #ADB9CC; }
 td p { margin: 0; padding: 0; }
+table.zebra { border: none; border-collapse: separate; border-spacing: 1px; }
+.zebra thead { background-color: #81BBF2; }
+.zebra tfoot { background-color: #C4D9FF; }
+.zebra th, .zebra td { border: none; }
+.zebra tbody tr, .zebra > tr { background-color: #EEF1F5; }
+.zebra tbody tr:nth-child(odd), .zebra > tr:nth-child(odd) { background-color: #D9DFE8; }
 
 /* TableOfContents macro */
 div.moin-table-of-contents { border: 1px solid #BBB; color: black; background: #fff;
@@ -211,11 +219,6 @@
 .moin-hist-rev { margin: 0; }
 #moin-global-history,
 #moin-page-history { font-size: 75%; }
-#moin-page-history tr { border: 1px solid #4D7DA9; } 
-#moin-global-history th,
-#moin-page-history th { background-color: #81BBF2; border: 0px; font-size: 1.12em; padding: 6px .5em; text-align: left; }
-#moin-global-history td {  border: 0px; vertical-align: top;text-align: left; padding: 0.4em 0.3em; }
-#moin-page-history td { background-color: #E6EAF0; border: 0px; vertical-align: top; }
 .moin-wordbreak { word-break: break-all;  word-wrap: break-word; } /* Firefox needs javascript assistance within tables */
 .moin-history-time { width: 10%; }
 .moin-history-contenttype { width: 18%; }
@@ -223,11 +226,12 @@
 .moin-history-comment { width: 30%; }
 .moin-action { width: 2%; }
 .moin-action a:hover { text-decoration: none; }
-.moin-history-container { border: 1px solid #4D7DA9; }
+.moin-history-container { border: 1px solid #4D7DA9; margin: 2em 0; }
 .moin-history-container-header { background: #81BBF2; margin: 0px; padding: 4px; color: #3b3131; border-bottom: 1px solid #4D7DA9; }
-.moin-history-container-header h2 { display: inline; }
+.moin-history-container-header h2 { display: inline; border: none; }
 .moin-history-container-header a.bookmark-link { margin-left: 10px; color: #3b3131; }
-.moin-history-container-body { padding: 4px; font-size: 14px; }
+.moin-history-container-body { margin: 0; padding: 0; font-size: 14px; }
+.moin-history-container-body table { margin: 0; }
 .moin-history-save:before { content: url('../img/moin-edit.png'); }
 .moin-history-trash:before { content: url('../img/moin-deleted.png'); }
 .moin-history-rename:before { content: url('../img/moin-renamed.png'); }