Skip to content

Commit

Permalink
Add RSS field in edit user page
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Moura <[email protected]>
  • Loading branch information
phsmoura committed Apr 20, 2023
1 parent e617561 commit f191e87
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
Empty file added news/1155.dev
Empty file.
Empty file added news/pmoura.author
Empty file.
8 changes: 8 additions & 0 deletions noggin/form/edit_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ class UserSettingsProfileForm(BaseForm):
validators=[Optional(), URL(message=_('Valid URL required'))],
)

rss_url = FieldList(
URLField(
validators=[Optional(), URL(message=_('Valid URL required'))],
),
label=_('RSS Feed URL'),
min_entries=5
)

is_private = BooleanField(
_('Private'),
description=_(
Expand Down
2 changes: 2 additions & 0 deletions noggin/representation/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class User(Representation):
"gitlab": "fasgitlabusername",
"rhbz_mail": "fasrhbzemail",
"website_url": "faswebsiteurl",
"rss_url": "fasrssurl",
"status_note": "fasstatusnote",
"creation_time": "fascreationtime",
"is_private": "fasisprivate",
Expand All @@ -31,6 +32,7 @@ class User(Representation):
attr_types = {
"sshpubkeys": "list",
"ircnick": "list",
"rss_url": "list",
"gpgkeys": "list",
"groups": "list",
"agreements": "list",
Expand Down
1 change: 1 addition & 0 deletions noggin/templates/user-settings-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<div class="form-group">{{ macros.with_errors(form.locale, class="custom-select") }}</div>
<div class="form-group">{{ macros.with_errors(form.timezone, class="custom-select") }}</div>
<div class="form-group">{{ macros.with_errors(form.website_url) }}</div>
<div class="form-group">{{ macros.with_errors(form.rss_url) }}</div>
<div class="form-group mb-4">
<p class="m-0">{{ form.ircnick.label(class_="mt-2") }}</p>
<p class="m-0">
Expand Down
12 changes: 12 additions & 0 deletions noggin/templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ <h5 class="mb-3" id="user_mail"><a href="mailto:{{ user.mail }}">{{ user.mail }}
<a href="{{ user.website_url }}" target="_blank">{{ user.website_url }}</a>
</li>
{% endif %}
{% if user.rss_url %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<strong title='{{_("RSS Feed URL")}}'>
<i class="fa fa-fw fa-link" aria-hidden="true"></i> {{_("RSS Feed URL")}}
</strong>
<div class="text-right">
{% for rss_url in user.rss_url %}
<a href="{{ rss_url }}" target="_blank">{{ rss_url }}</a>
{% endfor %}
</div>
</li>
{% endif %}
{% if user.rhbz_mail %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<strong title='{{_("RHBZ")}}'><i class="fa fa-fw fa-bug"></i> {{_("RHBZ")}}</strong>
Expand Down

0 comments on commit f191e87

Please sign in to comment.