From ba1efcf64b1af878d19f635849c41312409492ef Mon Sep 17 00:00:00 2001 From: Pedro Moura Date: Thu, 10 Aug 2023 15:34:57 -0300 Subject: [PATCH] Add RSS field in edit user page. Fixes: #1155 Signed-off-by: Pedro Moura --- noggin/form/edit_user.py | 5 +++++ noggin/representation/user.py | 1 + noggin/templates/user-settings-profile.html | 1 + noggin/templates/user.html | 6 ++++++ 4 files changed, 13 insertions(+) diff --git a/noggin/form/edit_user.py b/noggin/form/edit_user.py index 03a25e259..3d48567ff 100644 --- a/noggin/form/edit_user.py +++ b/noggin/form/edit_user.py @@ -126,6 +126,11 @@ class UserSettingsProfileForm(BaseForm): validators=[Optional(), URL(message=_('Valid URL required'))], ) + rss_url = URLField( + _('RSS URL'), + validators=[Optional(), URL(message=_('Valid URL required'))], + ) + is_private = BooleanField( _('Private'), description=_( diff --git a/noggin/representation/user.py b/noggin/representation/user.py index cbb000d6a..ffa4ead6b 100644 --- a/noggin/representation/user.py +++ b/noggin/representation/user.py @@ -27,6 +27,7 @@ class User(Representation): "pronouns": "faspronoun", "krbname": "krbcanonicalname", "roles": "memberof_role", + "rss_url": "fasrssurl", } attr_types = { "sshpubkeys": "list", diff --git a/noggin/templates/user-settings-profile.html b/noggin/templates/user-settings-profile.html index e0d30d360..dd50282b2 100644 --- a/noggin/templates/user-settings-profile.html +++ b/noggin/templates/user-settings-profile.html @@ -30,6 +30,7 @@
{{ macros.with_errors(form.locale, class="custom-select") }}
{{ macros.with_errors(form.timezone, class="custom-select") }}
{{ macros.with_errors(form.website_url) }}
+
{{ macros.with_errors(form.rss_url) }}

{{ form.ircnick.label(class_="mt-2") }}

diff --git a/noggin/templates/user.html b/noggin/templates/user.html index d74defaff..6c02ff88f 100644 --- a/noggin/templates/user.html +++ b/noggin/templates/user.html @@ -89,6 +89,12 @@

{{ user.mail }} {{ user.website_url }} {% endif %} + {% if user.rss_url %} +
  • + {{_("RSS URL")}} + {{ user.rss_url }} +
  • + {% endif %} {% if user.rhbz_mail %}
  • {{_("RHBZ")}}