Browse Source

Bio settings page: add a short explanation

merge-requests/64/head
Deimos 6 years ago
parent
commit
38d8dfb1c5
  1. 6
      tildes/tildes/templates/settings_bio.jinja2
  2. 8
      tildes/tildes/views/settings.py

6
tildes/tildes/templates/settings_bio.jinja2

@ -10,6 +10,10 @@
{% block main_heading %}Edit your user bio{% endblock %} {% block main_heading %}Edit your user bio{% endblock %}
{% block settings %} {% block settings %}
<p>Enter a bio that others will be able to view on your user page (maximum {{ bio_max_length }} characters). To remove your bio, set it to blank.</p>
<div class="divider"></div>
<form <form
method="post" method="post"
name="user-bio" name="user-bio"
@ -20,7 +24,7 @@
{{ markdown_textarea('User Bio (Markdown)', text=request.user.bio_markdown) }} {{ markdown_textarea('User Bio (Markdown)', text=request.user.bio_markdown) }}
<div class="form-buttons"> <div class="form-buttons">
<button type="submit" class="btn btn-primary">Submit</button>
<button type="submit" class="btn btn-primary">Save bio</button>
</div> </div>
</form> </form>
{% endblock %} {% endblock %}

8
tildes/tildes/views/settings.py

@ -14,7 +14,11 @@ import qrcode
from webargs.pyramidparser import use_kwargs from webargs.pyramidparser import use_kwargs
from tildes.lib.string import separate_string from tildes.lib.string import separate_string
from tildes.schemas.user import EMAIL_ADDRESS_NOTE_MAX_LENGTH, UserSchema
from tildes.schemas.user import (
BIO_MAX_LENGTH,
EMAIL_ADDRESS_NOTE_MAX_LENGTH,
UserSchema,
)
PASSWORD_FIELD = UserSchema(only=("password",)).fields["password"] PASSWORD_FIELD = UserSchema(only=("password",)).fields["password"]
@ -113,7 +117,7 @@ def get_settings_two_factor_qr_code(request: Request) -> Response:
def get_settings_bio(request: Request) -> dict: def get_settings_bio(request: Request) -> dict:
"""Generate the user bio settings page.""" """Generate the user bio settings page."""
# pylint: disable=unused-argument # pylint: disable=unused-argument
return {}
return {"bio_max_length": BIO_MAX_LENGTH}
@view_config(route_name="settings_password_change", request_method="POST") @view_config(route_name="settings_password_change", request_method="POST")

Loading…
Cancel
Save