diff options
author | Jelle van der Waa <jelle@archlinux.org> | 2019-06-15 18:02:54 +0200 |
---|---|---|
committer | Jelle van der Waa <jelle@archlinux.org> | 2019-06-15 18:02:54 +0200 |
commit | 3b432bc1247a0597c6284999bb2963ac204ad6a7 (patch) | |
tree | fcb8cece14494da29576a26db9554a5d9af91522 | |
parent | 555beff6f547da9371924e8676ddfff25305558d (diff) | |
download | archweb-3b432bc1247a0597c6284999bb2963ac204ad6a7.tar.gz archweb-3b432bc1247a0597c6284999bb2963ac204ad6a7.zip |
templates: redo even/odd CSS with nth-childrelease_2019-06-15
Instead of adding odd and even classes on every td use a more modern CSS
solution with nth-child(even) and odd.
Closes: #206
Signed-off-by: Jelle van der Waa <jelle@archlinux.org>
-rw-r--r-- | sitestatic/archweb.css | 18 | ||||
-rw-r--r-- | templates/devel/clock.html | 2 | ||||
-rw-r--r-- | templates/devel/index.html | 8 | ||||
-rw-r--r-- | templates/devel/stats.html | 6 | ||||
-rw-r--r-- | templates/mirrors/error_table.html | 2 | ||||
-rw-r--r-- | templates/mirrors/mirror_details_urls.html | 2 | ||||
-rw-r--r-- | templates/mirrors/mirrors.html | 2 | ||||
-rw-r--r-- | templates/mirrors/status_table.html | 2 | ||||
-rw-r--r-- | templates/mirrors/url_details_logs.html | 2 | ||||
-rw-r--r-- | templates/news/list.html | 2 | ||||
-rw-r--r-- | templates/packages/differences.html | 2 | ||||
-rw-r--r-- | templates/packages/groups.html | 2 | ||||
-rw-r--r-- | templates/packages/packages_list.html | 2 | ||||
-rw-r--r-- | templates/packages/search.html | 4 | ||||
-rw-r--r-- | templates/packages/signoffs.html | 2 | ||||
-rw-r--r-- | templates/packages/stale_relations.html | 6 | ||||
-rw-r--r-- | templates/releng/release_list.html | 2 | ||||
-rw-r--r-- | templates/todolists/list.html | 2 | ||||
-rw-r--r-- | templates/todolists/view.html | 2 |
19 files changed, 36 insertions, 34 deletions
diff --git a/sitestatic/archweb.css b/sitestatic/archweb.css index 2dc5be15..f95e3843 100644 --- a/sitestatic/archweb.css +++ b/sitestatic/archweb.css @@ -687,14 +687,6 @@ table.results { padding: .3em 1em .3em 3px; } - .results tr.odd { - background: #fff; - } - - .results tr.even { - background: #e4eeff; - } - .results .flagged { color: red; } @@ -977,6 +969,16 @@ table td.country { background: #ffd; } +.results tr:nth-child(even), +#article-list tr:nth-child(even) { + background: #e4eeff; +} + +.results tr:nth-child(odd), +#article-list tr:nth-child(odd) { + background: #fff; +} + /* dev dashboard: */ table.dash-stats .key { width: 50%; diff --git a/templates/devel/clock.html b/templates/devel/clock.html index 57279cc8..08163407 100644 --- a/templates/devel/clock.html +++ b/templates/devel/clock.html @@ -43,7 +43,7 @@ </thead> <tbody> {% for dev in developers %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td><a href="mailto:{{ dev.email }}">{{ dev.get_full_name }}</a></td> <td>{{ dev.username }}</td> <td>{{ dev.userprofile.alias }}</td> diff --git a/templates/devel/index.html b/templates/devel/index.html index 89799602..999299f5 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -27,7 +27,7 @@ </thead> <tbody> {% for pkg in flagged %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{% pkg_details_link pkg %}</td> <td>{{ pkg.full_version }}</td> <td>{% with pkg.in_testing as tp %}{% if tp %} @@ -59,7 +59,7 @@ </thead> <tbody> {% for todopkg in todopkgs %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td><a href="{{ todopkg.todolist.get_absolute_url }}" title="View todo list: {{ todopkg.todolist.name }}">{{ todopkg.todolist.name }}</a></td> <td>{% todopkg_details_link todopkg %}</td> @@ -88,7 +88,7 @@ </thead> <tbody> {% for todo in todos %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td><a href="{{ todo.get_absolute_url }}" title="View todo list: {{ todo.name }}">{{ todo.name }}</a></td> <td>{{ todo.created|date }}</td> @@ -121,7 +121,7 @@ </thead> <tbody> {% for group in signoffs %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{% pkg_details_link group.package %}</td> <td>{{ group.version }}</td> <td>{{ group.arch.name }}</td> diff --git a/templates/devel/stats.html b/templates/devel/stats.html index 2dbe4755..ca97de81 100644 --- a/templates/devel/stats.html +++ b/templates/devel/stats.html @@ -15,7 +15,7 @@ </thead> <tbody> {% for arch in arches %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{{ arch.name }}</td> <td><a href="/packages/?arch={{ arch.name }}" title="View all packages for the {{ arch.name }} architecture"> @@ -46,7 +46,7 @@ </thead> <tbody> {% for repo in repos %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{{ repo.name }}</td> <td><a href="/packages/?repo={{ repo.name }}" title="View all packages in the {{ repo.name }} repository"> @@ -98,7 +98,7 @@ </thead> <tbody> {% for maint in maintainers %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{{ maint.get_full_name }}</td> <td><a href="/packages/?maintainer={{ maint.username }}" title="View all packages maintained by {{ maint.get_full_name }}"> diff --git a/templates/mirrors/error_table.html b/templates/mirrors/error_table.html index 479a0117..e22739a1 100644 --- a/templates/mirrors/error_table.html +++ b/templates/mirrors/error_table.html @@ -14,7 +14,7 @@ </tr> </thead> <tbody> - {% for log in error_logs %}<tr class="{% cycle 'odd' 'even' %}"> + {% for log in error_logs %}<tr> <td>{{ log.url.url }}</td> <td>{{ log.url.protocol.protocol }}</td> <td class="country">{% country_flag log.url.country %}{{ log.url.country.name }}</td> diff --git a/templates/mirrors/mirror_details_urls.html b/templates/mirrors/mirror_details_urls.html index 0f88b06c..148cac05 100644 --- a/templates/mirrors/mirror_details_urls.html +++ b/templates/mirrors/mirror_details_urls.html @@ -20,7 +20,7 @@ </thead> <tbody> {% for m_url in urls %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{% if m_url.protocol.is_download %}<a href="{{ m_url.url }}">{{ m_url.url }}</a>{% else %}{{ m_url.url }}{% endif %}</td> <td>{{ m_url.protocol }}</td> <td class="country">{% country_flag m_url.country %}{{ m_url.country.name }}</td> diff --git a/templates/mirrors/mirrors.html b/templates/mirrors/mirrors.html index d6b93f92..56be6adc 100644 --- a/templates/mirrors/mirrors.html +++ b/templates/mirrors/mirrors.html @@ -27,7 +27,7 @@ </thead> <tbody> {% for mirror in mirror_list %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td><a href="{{ mirror.get_absolute_url }}" title="Mirror details for {{ mirror.name }}">{{ mirror.name }}</a></td> <td class="country">{% if mirror.country %}{% country_flag mirror.country %}{{ mirror.country.name }}{% else %}Various{% endif %}</td> diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html index 30b60452..286da094 100644 --- a/templates/mirrors/status_table.html +++ b/templates/mirrors/status_table.html @@ -15,7 +15,7 @@ </tr> </thead> <tbody> - {% for m_url in urls %}<tr class="{% cycle 'odd' 'even' %}"> + {% for m_url in urls %}<tr> <td>{{ m_url.url }}</td> <td>{{ m_url.protocol }}</td> <td class="country">{% country_flag m_url.country %}{{ m_url.country.name }}</td> diff --git a/templates/mirrors/url_details_logs.html b/templates/mirrors/url_details_logs.html index 19e530ab..2d139918 100644 --- a/templates/mirrors/url_details_logs.html +++ b/templates/mirrors/url_details_logs.html @@ -15,7 +15,7 @@ </tr> </thead> <tbody> - {% for log in logs %}<tr class="{% cycle 'odd' 'even' %}"> + {% for log in logs %}<tr> <td>{{ log.check_time|date:'Y-m-d H:i' }}</td> <td class="country">{% if log.location %}{% country_flag log.location.country %}{{ log.location.country.name }}{% else %}Unknown{% endif %}</td> <td>{% if log.location %}{{ log.location.source_ip }}{% else %}Unknown{% endif %}</td> diff --git a/templates/news/list.html b/templates/news/list.html index 366c9f37..da3a4137 100644 --- a/templates/news/list.html +++ b/templates/news/list.html @@ -32,7 +32,7 @@ </thead> <tbody> {% for item in news_list %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{{ item.postdate|date }}</td> <td class="wrap"><a href="{{ item.get_absolute_url }}" title="View: {{ item.title }}">{{ item.title }}</a></td> diff --git a/templates/packages/differences.html b/templates/packages/differences.html index c650c6e8..ec82ea4a 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -23,7 +23,7 @@ </thead> <tbody> {% for pkg1, pkg2 in multilib_differences %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{% pkg_details_link pkg1 %}</td> <td><span{% if pkg1.flag_date %} class="flagged"{% endif %}>{{ pkg1.full_version }}</span></td> <td><span{% if pkg2.flag_date %} class="flagged"{% endif %}>{{ pkg2.full_version }}</span></td> diff --git a/templates/packages/groups.html b/templates/packages/groups.html index 9f9fef35..b7b6419d 100644 --- a/templates/packages/groups.html +++ b/templates/packages/groups.html @@ -18,7 +18,7 @@ </thead> <tbody> {% for grp in groups %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{{ grp.arch }}</td> <td><a href="/groups/{{ grp.arch }}/{{ grp.name }}/" title="Group details for {{ grp.name }}">{{ grp.name }}</a></td> diff --git a/templates/packages/packages_list.html b/templates/packages/packages_list.html index 72311235..cc5077f5 100644 --- a/templates/packages/packages_list.html +++ b/templates/packages/packages_list.html @@ -23,7 +23,7 @@ </thead> <tbody> {% for pkg in packages %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{{ pkg.arch.name }}</td> <td>{{ pkg.repo.name|capfirst }}</td> <td>{% pkg_details_link pkg %}</td> diff --git a/templates/packages/search.html b/templates/packages/search.html index a42cadf1..0ee8dd85 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -58,7 +58,7 @@ </thead> <tbody> {% for pkg in exact_matches %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{{ pkg.arch.name }}</td> <td>{{ pkg.repo.name|capfirst }}</td> <td>{% pkg_details_link pkg %}</td> @@ -102,7 +102,7 @@ </thead> <tbody> {% for pkg in package_list %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> {% if perms.main.change_package %} <td><input type="checkbox" name="pkgid" value="{{ pkg.id }}" /></td> {% endif %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index e2214845..c23ad95f 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -50,7 +50,7 @@ </tr> </thead> <tbody id="tbody_signoffs"> - {% for group in signoff_groups %}<tr class="{% cycle 'odd' 'even' %} {{ group.arch.name }} {{ group.target_repo|lower }}"> + {% for group in signoff_groups %}<tr {{ group.arch.name }} {{ group.target_repo|lower }}"> <td>{% pkg_details_link group.package %} {{ group.version }}</td> <td>{{ group.arch.name }}</td> <td>{{ group.target_repo }}</td> diff --git a/templates/packages/stale_relations.html b/templates/packages/stale_relations.html index 8aec424d..976d886e 100644 --- a/templates/packages/stale_relations.html +++ b/templates/packages/stale_relations.html @@ -24,7 +24,7 @@ </thead> <tbody> {% for relation in inactive_user %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td><input type="checkbox" class="relation-checkbox" name="relation_id" value="{{ relation.id }}" /></td> <td>{{ relation.pkgbase }}</td> <td class="wrap">{% for pkg in relation.get_associated_packages %} @@ -56,7 +56,7 @@ </thead> <tbody> {% for relation in missing_pkgbase %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td><input type="checkbox" class="relation-checkbox" name="relation_id" value="{{ relation.id }}" /></td> <td>{{ relation.pkgbase }}</td> <td>{{ relation.user.get_full_name }}</td> @@ -86,7 +86,7 @@ </thead> <tbody> {% for relation in wrong_permissions %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td><input type="checkbox" class="relation-checkbox" name="relation_id" value="{{ relation.id }}" /></td> <td>{{ relation.pkgbase }}</td> <td class="wrap">{% for pkg in relation.get_associated_packages %} diff --git a/templates/releng/release_list.html b/templates/releng/release_list.html index 138b9ac8..80a443c8 100644 --- a/templates/releng/release_list.html +++ b/templates/releng/release_list.html @@ -34,7 +34,7 @@ </thead> <tbody> {% for item in release_list %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td>{% if item.torrent_data %} <a href="{% url 'releng-release-torrent' item.version %}" title="Download torrent for {{ item.version }}"><img width="12" height="12" src="{% static "download.png" %}" alt="Torrent"/></a> diff --git a/templates/todolists/list.html b/templates/todolists/list.html index 042ff602..9f3cc635 100644 --- a/templates/todolists/list.html +++ b/templates/todolists/list.html @@ -34,7 +34,7 @@ </thead> <tbody> {% for list in lists %} - <tr class="{% cycle 'odd' 'even' %}"> + <tr> <td><a href="{{ list.get_absolute_url }}" title="View todo list: {{ list.name }}">{{ list.name }}</a></td> <td>{{ list.created|date }}</td> diff --git a/templates/todolists/view.html b/templates/todolists/view.html index b5d69459..4f78e523 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -78,7 +78,7 @@ </thead> <tbody> {% for pkg in list.packages %} - <tr class="{% cycle 'odd' 'even' %}{% if user in pkg.maintainers %} mine{% endif %} {{ pkg.arch.name }} {{ pkg.repo.name|lower }}"> + <tr{% if user in pkg.maintainers %} mine{% endif %} {{ pkg.arch.name }} {{ pkg.repo.name|lower }}"> <td>{{ pkg.arch.name }}</td> <td>{{ pkg.repo.name|capfirst }}</td> <td>{% todopkg_details_link pkg %}</td> |