community breadcrumb

This commit is contained in:
rimu 2024-01-06 15:30:50 +13:00
parent 396a5bae4c
commit 9d7c3976c2
2 changed files with 11 additions and 4 deletions

View file

@ -121,12 +121,12 @@ def reset_password_request():
if form.validate_on_submit(): if form.validate_on_submit():
if form.email.data.lower().startswith('postmaster@') or form.email.data.lower().startswith('abuse@') or \ if form.email.data.lower().startswith('postmaster@') or form.email.data.lower().startswith('abuse@') or \
form.email.data.lower().startswith('noc@'): form.email.data.lower().startswith('noc@'):
flash(_('Sorry, you cannot use that email address'), 'error') flash(_('Sorry, you cannot use that email address.'), 'error')
else: else:
user = User.query.filter_by(email=form.email.data).first() user = User.query.filter_by(email=form.email.data).first()
if user: if user:
send_password_reset_email(user) send_password_reset_email(user)
flash(_('Check your email for the instructions to reset your password')) flash(_('Check your email for a link to reset your password.'))
return redirect(url_for('auth.login')) return redirect(url_for('auth.login'))
else: else:
flash(_('No account with that email address exists'), 'warning') flash(_('No account with that email address exists'), 'warning')
@ -145,7 +145,7 @@ def reset_password(token):
if form.validate_on_submit(): if form.validate_on_submit():
user.set_password(form.password.data) user.set_password(form.password.data)
db.session.commit() db.session.commit()
flash(_('Your password has been reset.')) flash(_('Your password has been reset. Please use it to log in with user name of %(name)s.', name=user.user_name))
return redirect(url_for('auth.login')) return redirect(url_for('auth.login'))
return render_template('auth/reset_password.html', form=form) return render_template('auth/reset_password.html', form=form)

View file

@ -16,8 +16,15 @@
</div> </div>
<img class="community_icon_big bump_up rounded-circle" src="{{ community.icon_image() }}" /> <img class="community_icon_big bump_up rounded-circle" src="{{ community.icon_image() }}" />
<h1 class="mt-2">{{ community.title }}</h1> <h1 class="mt-2">{{ community.title }}</h1>
{% elif community.icon_image() != '' %} {% elif community.icon_id %}
<div class="row"> <div class="row">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/communities">{{ _('Communities') }}</a></li>
<li class="breadcrumb-item active">{{ community.title|shorten }}</li>
</ol>
</nav>
<div class="col-2"> <div class="col-2">
<img class="community_icon_big rounded-circle" src="{{ community.icon_image() }}" /> <img class="community_icon_big rounded-circle" src="{{ community.icon_image() }}" />
</div> </div>