Skip to content

Commit

Permalink
changed user bio to 1 line
Browse files Browse the repository at this point in the history
  • Loading branch information
cc-d committed Dec 21, 2019
1 parent d2f6321 commit bd50d26
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
5 changes: 4 additions & 1 deletion app/ieddit.py
Expand Up @@ -48,6 +48,9 @@ def before_request():

sub = normalize_sub(current_sub, return_obj=True)

if hasattr(sub, 'name') is False:
return abort(404, 'sub does not exist')

request.sub = sub.name

if hasattr(sub, 'language'):
Expand Down Expand Up @@ -801,7 +804,7 @@ def view_user(username):
vuser = db.session.query(Iuser).filter(func.lower(Iuser.username) == func.lower(username)).first()

if vuser is None:
abort(404)
abort(404, 'user does not exist')

mod_of = db.session.query(Moderator).filter_by(username=vuser.username).all()
mods = {}
Expand Down
24 changes: 17 additions & 7 deletions app/static/base.css
Expand Up @@ -1360,20 +1360,30 @@ blockquote {
}

.user-bio {
max-height: 4rem;
overflow: hidden;
font-size: 70%;
color: #bbb;
word-break: break-word;
min-width: 14rem;
max-width: 20rem;
margin-right: 0.5rem;
overflow: hidden;
max-width: 14rem;
white-space: nowrap;
}

.bio-text {
color: #aaa;
display: inline-block;
padding: 0;
margin: 0;
max-width: 12rem;
overflow: hidden;
text-overflow: ellipsis;
}

.pref-header {
color: #fff;
}

.bio-text-wrap {
display: inline-flex;
}

#edit-bio-textarea {
min-width: 14rem;
max-width: 18rem;
Expand Down
5 changes: 3 additions & 2 deletions app/templates/user/user.html
Expand Up @@ -44,10 +44,11 @@ <h6 class='user-profile-info-top'>/u/{{ vuser.username }}
{% endif %}

<div class='user-bio'>
<div style="display: inline-flex;">About:</div>
{% if vuser.bio == None %}
<p class='bio-text' style="opacity: 0.5;">This user has not set a bio.</p>
<div class='bio-text-wrap' style="opacity: 0.5;"><p class='bio-text'>This user has not set a bio.</p></div>
{% else %}
<p class='bio-text'>{% for line in vuser.bio.splitlines() %}{{ line }}<br>{% endfor %}</p>
<div class='bio-text-wrap'><p data-toggle='tootltip' title="{{ vuser.bio }}" class='bio-text'>{{ vuser.bio }}</p></div>
{% endif %}
</div>

Expand Down

0 comments on commit bd50d26

Please sign in to comment.