Skip to content

Commit

Permalink
Drop people's websites and bios
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Apr 19, 2024
1 parent 9d309e1 commit c7fe756
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
8 changes: 0 additions & 8 deletions tahrir/templates/admin.mak
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@
<td><label for="person-nickname">Nickname <span class="sublabel">Optional.</span></label></td>
<td><input name="person-nickname" placeholder="Badger"/></td>
</tr>
<tr>
<td><label for="person-website">Website <span class="sublabel">Optional.</span></label></td>
<td><input name="person-website" placeholder="asite.tld"/></td>
</tr>
<tr>
<td><label for="person-bio">Bio <span class="sublabel">Optional.</span></label></td>
<td><input name="person-bio" placeholder="Just badgin' around"/></td>
</tr>
<tr>
<td></td><td>
<input name="add-person" type="submit" value="Add Person" />
Expand Down
2 changes: 1 addition & 1 deletion tahrir/templates/explore.mak
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<label for="person-query">
Keyword
<span class="sublabel">
Search through person names and bios.</span>
Search through person names.</span>
</label>
</td>
<td><input name="person-query" required="required" /></td>
Expand Down
19 changes: 3 additions & 16 deletions tahrir/templates/user.mak
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
</div>
<span property="foaf:account" content="${user.nickname}${request.registry.settings['tahrir.email_domain']}" />

% if user.bio:
<div class="grid-100">
<p class="description">${user.bio}</p>
</div>
% endif
<div class="grid-100">
<p>Go to <a href="https://accounts.fedoraproject.org/user/${user.nickname}/">${user.nickname}'s Fedora Account</a>
</div>

<div class="metadata grid-60">
<p>Arrived on ${user.created_on.strftime('%Y-%m-%d')}.</p>
Expand All @@ -39,17 +37,6 @@
<p>Not ranked yet.</p>
% endif

% if user.website:
<p>
Website:
% if user.website.startswith('http'):
<a property="foaf:homepage" href="${user.website}">${user.website}</a>
% else:
<a property="foaf:homepage" href="http://${user.website}">${user.website}</a>
% endif
</p>
% endif

<p>
View user as:
<a href="${request.route_url('user_json', id=user.nickname or user.id)}">JSON</a>,
Expand Down
7 changes: 1 addition & 6 deletions tahrir/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ def admin(request):
request.db.add_person(
email,
nickname=request.POST.get("person-nickname"),
website=request.POST.get("person-website"),
bio=request.POST.get("person-bio"),
)
request.session.flash(
"You added a person with email %s" % request.POST.get("person-email")
Expand Down Expand Up @@ -612,10 +610,7 @@ def explore(request):
matching_results = (
request.db.get_all_persons()
.filter(
(
(m.Person.nickname.like("%" + search_query + "%"))
| (m.Person.bio.like("%" + search_query + "%"))
)
(m.Person.nickname.like("%" + search_query + "%"))
& (m.Person.opt_out.is_(False))
)
.all()
Expand Down

0 comments on commit c7fe756

Please sign in to comment.