[PATCH] right align statistics values on dashboard page (fixes #190)
--- templates/partials/packages/statistics.html | 16 ++++++++-------- templates/partials/statistics.html | 4 ++-- web/html/css/aurweb.css | 4 ++++ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/templates/partials/packages/statistics.html b/templates/partials/packages/statistics.html index 8a6546b9..676b78d6 100644 --- a/templates/partials/packages/statistics.html +++ b/templates/partials/packages/statistics.html @@ -4,47 +4,47 @@ <table> <tr> <td class="stat-desc">{{ "Packages" | tr }}</td> - <td>{{ package_count }}</td> + <td class="stat-val">{{ package_count }}</td> </tr> <tr> <td class="stat-desc">{{ "Orphan Packages" | tr }}</td> - <td>{{ orphan_count }}</td> + <td class="stat-val">{{ orphan_count }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages added in the past 7 days" | tr }} </td> - <td>{{ seven_days_old_added }}</td> + <td class="stat-val">{{ seven_days_old_added }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages updated in the past 7 days" | tr }} </td> - <td>{{ seven_days_old_updated }}</td> + <td class="stat-val">{{ seven_days_old_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages updated in the past year" | tr }} </td> - <td>{{ year_old_updated }}</td> + <td class="stat-val">{{ year_old_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages never updated" | tr }} </td> - <td>{{ never_updated }}</td> + <td class="stat-val">{{ never_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Registered Users" | tr }} </td> - <td>{{ user_count }}</td> + <td class="stat-val">{{ user_count }}</td> </tr> <tr> <td class="stat-desc"> {{ "Trusted Users" | tr }} </td> - <td>{{ trusted_user_count }}</td> + <td class="stat-val">{{ trusted_user_count }}</td> </tr> </table> </div> diff --git a/templates/partials/statistics.html b/templates/partials/statistics.html index 0bf844b6..2a6f69db 100644 --- a/templates/partials/statistics.html +++ b/templates/partials/statistics.html @@ -10,7 +10,7 @@ {{ "Packages" | tr }} </a> </td> - <td>{{ bases.count() }}</td> + <td class="stat-val">{{ bases.count() }}</td> </tr> {% set out_of_date_packages = bases | out_of_date %} <tr> @@ -19,7 +19,7 @@ {{ "Out of Date" | tr }} </a> </td> - <td>{{ out_of_date_packages.count() }}</td> + <td class="stat-val">{{ out_of_date_packages.count() }}</td> </tr> </tbody> </table> diff --git a/web/html/css/aurweb.css b/web/html/css/aurweb.css index 22b5ac65..5c2c744d 100644 --- a/web/html/css/aurweb.css +++ b/web/html/css/aurweb.css @@ -23,6 +23,10 @@ white-space: normal; } +#pkg-stats td.stat-val { + text-align: right; +} + #actionlist form { margin: 0; padding: 0; -- 2.35.1
Hi Erik, are you sure these changes are not breaking the RTL alignment? On Mon, Feb 14, 2022, 11:13 Erik Bender via aur-dev < aur-dev@lists.archlinux.org> wrote:
--- templates/partials/packages/statistics.html | 16 ++++++++-------- templates/partials/statistics.html | 4 ++-- web/html/css/aurweb.css | 4 ++++ 3 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/templates/partials/packages/statistics.html b/templates/partials/packages/statistics.html index 8a6546b9..676b78d6 100644 --- a/templates/partials/packages/statistics.html +++ b/templates/partials/packages/statistics.html @@ -4,47 +4,47 @@ <table> <tr> <td class="stat-desc">{{ "Packages" | tr }}</td> - <td>{{ package_count }}</td> + <td class="stat-val">{{ package_count }}</td> </tr> <tr> <td class="stat-desc">{{ "Orphan Packages" | tr }}</td> - <td>{{ orphan_count }}</td> + <td class="stat-val">{{ orphan_count }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages added in the past 7 days" | tr }} </td> - <td>{{ seven_days_old_added }}</td> + <td class="stat-val">{{ seven_days_old_added }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages updated in the past 7 days" | tr }} </td> - <td>{{ seven_days_old_updated }}</td> + <td class="stat-val">{{ seven_days_old_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages updated in the past year" | tr }} </td> - <td>{{ year_old_updated }}</td> + <td class="stat-val">{{ year_old_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages never updated" | tr }} </td> - <td>{{ never_updated }}</td> + <td class="stat-val">{{ never_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Registered Users" | tr }} </td> - <td>{{ user_count }}</td> + <td class="stat-val">{{ user_count }}</td> </tr> <tr> <td class="stat-desc"> {{ "Trusted Users" | tr }} </td> - <td>{{ trusted_user_count }}</td> + <td class="stat-val">{{ trusted_user_count }}</td> </tr> </table> </div> diff --git a/templates/partials/statistics.html b/templates/partials/statistics.html index 0bf844b6..2a6f69db 100644 --- a/templates/partials/statistics.html +++ b/templates/partials/statistics.html @@ -10,7 +10,7 @@ {{ "Packages" | tr }} </a> </td> - <td>{{ bases.count() }}</td> + <td class="stat-val">{{ bases.count() }}</td> </tr> {% set out_of_date_packages = bases | out_of_date %} <tr> @@ -19,7 +19,7 @@ {{ "Out of Date" | tr }} </a> </td> - <td>{{ out_of_date_packages.count() }}</td> + <td class="stat-val">{{ out_of_date_packages.count() }}</td> </tr> </tbody> </table> diff --git a/web/html/css/aurweb.css b/web/html/css/aurweb.css index 22b5ac65..5c2c744d 100644 --- a/web/html/css/aurweb.css +++ b/web/html/css/aurweb.css @@ -23,6 +23,10 @@ white-space: normal; }
+#pkg-stats td.stat-val { + text-align: right; +} + #actionlist form { margin: 0; padding: 0; -- 2.35.1
--- Sorry, totally forgot about rtl. This should align correctly. templates/partials/packages/statistics.html | 16 ++++++++-------- templates/partials/statistics.html | 4 ++-- web/html/css/aurweb.css | 10 ++++++++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/templates/partials/packages/statistics.html b/templates/partials/packages/statistics.html index 8a6546b9..676b78d6 100644 --- a/templates/partials/packages/statistics.html +++ b/templates/partials/packages/statistics.html @@ -4,47 +4,47 @@ <table> <tr> <td class="stat-desc">{{ "Packages" | tr }}</td> - <td>{{ package_count }}</td> + <td class="stat-val">{{ package_count }}</td> </tr> <tr> <td class="stat-desc">{{ "Orphan Packages" | tr }}</td> - <td>{{ orphan_count }}</td> + <td class="stat-val">{{ orphan_count }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages added in the past 7 days" | tr }} </td> - <td>{{ seven_days_old_added }}</td> + <td class="stat-val">{{ seven_days_old_added }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages updated in the past 7 days" | tr }} </td> - <td>{{ seven_days_old_updated }}</td> + <td class="stat-val">{{ seven_days_old_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages updated in the past year" | tr }} </td> - <td>{{ year_old_updated }}</td> + <td class="stat-val">{{ year_old_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages never updated" | tr }} </td> - <td>{{ never_updated }}</td> + <td class="stat-val">{{ never_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Registered Users" | tr }} </td> - <td>{{ user_count }}</td> + <td class="stat-val">{{ user_count }}</td> </tr> <tr> <td class="stat-desc"> {{ "Trusted Users" | tr }} </td> - <td>{{ trusted_user_count }}</td> + <td class="stat-val">{{ trusted_user_count }}</td> </tr> </table> </div> diff --git a/templates/partials/statistics.html b/templates/partials/statistics.html index 0bf844b6..2a6f69db 100644 --- a/templates/partials/statistics.html +++ b/templates/partials/statistics.html @@ -10,7 +10,7 @@ {{ "Packages" | tr }} </a> </td> - <td>{{ bases.count() }}</td> + <td class="stat-val">{{ bases.count() }}</td> </tr> {% set out_of_date_packages = bases | out_of_date %} <tr> @@ -19,7 +19,7 @@ {{ "Out of Date" | tr }} </a> </td> - <td>{{ out_of_date_packages.count() }}</td> + <td class="stat-val">{{ out_of_date_packages.count() }}</td> </tr> </tbody> </table> diff --git a/web/html/css/aurweb.css b/web/html/css/aurweb.css index 22b5ac65..0511ef15 100644 --- a/web/html/css/aurweb.css +++ b/web/html/css/aurweb.css @@ -23,6 +23,16 @@ white-space: normal; } +#pkg-stats td.stat-val, +#my-stats td.stat-val { + text-align: right; +} + +[dir="rtl"] #pkg-stats td.stat-val, +[dir="rtl"] #my-stats td.stat-val { + text-align: left; +} + #actionlist form { margin: 0; padding: 0; -- 2.35.1
It's relatively new so it makes sense, thank you so much! Yaron Shahrabani <DevOps - Hebrew translator> On Mon, Feb 14, 2022 at 3:08 PM Erik Bender via aur-dev < aur-dev@lists.archlinux.org> wrote:
--- Sorry, totally forgot about rtl. This should align correctly.
templates/partials/packages/statistics.html | 16 ++++++++-------- templates/partials/statistics.html | 4 ++-- web/html/css/aurweb.css | 10 ++++++++++ 3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/templates/partials/packages/statistics.html b/templates/partials/packages/statistics.html index 8a6546b9..676b78d6 100644 --- a/templates/partials/packages/statistics.html +++ b/templates/partials/packages/statistics.html @@ -4,47 +4,47 @@ <table> <tr> <td class="stat-desc">{{ "Packages" | tr }}</td> - <td>{{ package_count }}</td> + <td class="stat-val">{{ package_count }}</td> </tr> <tr> <td class="stat-desc">{{ "Orphan Packages" | tr }}</td> - <td>{{ orphan_count }}</td> + <td class="stat-val">{{ orphan_count }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages added in the past 7 days" | tr }} </td> - <td>{{ seven_days_old_added }}</td> + <td class="stat-val">{{ seven_days_old_added }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages updated in the past 7 days" | tr }} </td> - <td>{{ seven_days_old_updated }}</td> + <td class="stat-val">{{ seven_days_old_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages updated in the past year" | tr }} </td> - <td>{{ year_old_updated }}</td> + <td class="stat-val">{{ year_old_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Packages never updated" | tr }} </td> - <td>{{ never_updated }}</td> + <td class="stat-val">{{ never_updated }}</td> </tr> <tr> <td class="stat-desc"> {{ "Registered Users" | tr }} </td> - <td>{{ user_count }}</td> + <td class="stat-val">{{ user_count }}</td> </tr> <tr> <td class="stat-desc"> {{ "Trusted Users" | tr }} </td> - <td>{{ trusted_user_count }}</td> + <td class="stat-val">{{ trusted_user_count }}</td> </tr> </table> </div> diff --git a/templates/partials/statistics.html b/templates/partials/statistics.html index 0bf844b6..2a6f69db 100644 --- a/templates/partials/statistics.html +++ b/templates/partials/statistics.html @@ -10,7 +10,7 @@ {{ "Packages" | tr }} </a> </td> - <td>{{ bases.count() }}</td> + <td class="stat-val">{{ bases.count() }}</td> </tr> {% set out_of_date_packages = bases | out_of_date %} <tr> @@ -19,7 +19,7 @@ {{ "Out of Date" | tr }} </a> </td> - <td>{{ out_of_date_packages.count() }}</td> + <td class="stat-val">{{ out_of_date_packages.count() }}</td> </tr> </tbody> </table> diff --git a/web/html/css/aurweb.css b/web/html/css/aurweb.css index 22b5ac65..0511ef15 100644 --- a/web/html/css/aurweb.css +++ b/web/html/css/aurweb.css @@ -23,6 +23,16 @@ white-space: normal; }
+#pkg-stats td.stat-val, +#my-stats td.stat-val { + text-align: right; +} + +[dir="rtl"] #pkg-stats td.stat-val, +[dir="rtl"] #my-stats td.stat-val { + text-align: left; +} + #actionlist form { margin: 0; padding: 0; -- 2.35.1
Hi Erik, Thanks a lot for the patch! Awesome community contributing awesome things. I'll check into this and verify things sometime today and get back with you if there are any issues. Otherwise, just keep notice on the master branch, it might just get merged in silently :) Best, Kevin -- Kevin Morris Software & Linux Enthusiast
participants (3)
-
Erik Bender
-
Kevin Morris
-
Yaron Shahrabani