From 372bc920ccc821b6b9a1630471c32992b3058cb5 Mon Sep 17 00:00:00 2001 From: Pedro Moura Date: Thu, 10 Aug 2023 15:34:57 -0300 Subject: [PATCH 1/2] 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")}} From 2803d9e953844c452a3fbae12f4aec2efe2abbfc Mon Sep 17 00:00:00 2001 From: Pedro Moura Date: Tue, 12 Sep 2023 10:31:02 -0300 Subject: [PATCH 2/2] Add news fragment. Fixes: #1155 Signed-off-by: Pedro Moura --- news/1216.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/1216.feature diff --git a/news/1216.feature b/news/1216.feature new file mode 100644 index 000000000..b49f33aa3 --- /dev/null +++ b/news/1216.feature @@ -0,0 +1 @@ +Add the RSS URL to the user profile