mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
created recently indicator on users
This commit is contained in:
parent
ddc747bb76
commit
c5f79ce1ca
7 changed files with 40 additions and 3 deletions
|
@ -283,6 +283,9 @@ class User(UserMixin, db.Model):
|
||||||
def profile_id(self):
|
def profile_id(self):
|
||||||
return self.ap_profile_id if self.ap_profile_id else f"{self.user_name}@{current_app.config['SERVER_NAME']}"
|
return self.ap_profile_id if self.ap_profile_id else f"{self.user_name}@{current_app.config['SERVER_NAME']}"
|
||||||
|
|
||||||
|
def created_recently(self):
|
||||||
|
return self.created and self.created > datetime.utcnow() - timedelta(days=7)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def verify_reset_password_token(token):
|
def verify_reset_password_token(token):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -167,7 +167,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.fe-camera::before {
|
.fe-camera::before {
|
||||||
content: "\e928";
|
content: "\e97a";
|
||||||
|
}
|
||||||
|
|
||||||
|
.fe-new-account {
|
||||||
|
position: relative;
|
||||||
|
top: 1px;
|
||||||
|
&:before {
|
||||||
|
content: "\e986";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.fe-new-account::before {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a.no-underline {
|
a.no-underline {
|
||||||
|
|
|
@ -170,7 +170,15 @@ nav, etc which are used site-wide */
|
||||||
}
|
}
|
||||||
|
|
||||||
.fe-camera::before {
|
.fe-camera::before {
|
||||||
content: "\e928";
|
content: "\e97a";
|
||||||
|
}
|
||||||
|
|
||||||
|
.fe-new-account {
|
||||||
|
position: relative;
|
||||||
|
top: 1px;
|
||||||
|
}
|
||||||
|
.fe-new-account:before {
|
||||||
|
content: "\e986";
|
||||||
}
|
}
|
||||||
|
|
||||||
a.no-underline {
|
a.no-underline {
|
||||||
|
|
|
@ -169,7 +169,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.fe-camera::before {
|
.fe-camera::before {
|
||||||
content: "\e928";
|
content: "\e97a";
|
||||||
|
}
|
||||||
|
|
||||||
|
.fe-new-account {
|
||||||
|
position: relative;
|
||||||
|
top: 1px;
|
||||||
|
}
|
||||||
|
.fe-new-account:before {
|
||||||
|
content: "\e986";
|
||||||
}
|
}
|
||||||
|
|
||||||
a.no-underline {
|
a.no-underline {
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
[deleted]
|
[deleted]
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="/u/{{ user.link() }}" title="{{ user.ap_id if user.ap_id != none else user.user_name }}">{{ user.user_name }}</a>
|
<a href="/u/{{ user.link() }}" title="{{ user.ap_id if user.ap_id != none else user.user_name }}">{{ user.user_name }}</a>
|
||||||
|
{% if user.created_recently() %}
|
||||||
|
<span class="fe fe-new-account" title="New account"> </span>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
|
|
|
@ -60,6 +60,9 @@
|
||||||
<a href="/u/{{ comment['comment'].author.link() }}" title="{{ comment['comment'].author.link() }}">
|
<a href="/u/{{ comment['comment'].author.link() }}" title="{{ comment['comment'].author.link() }}">
|
||||||
{{ comment['comment'].author.user_name }}</a>
|
{{ comment['comment'].author.user_name }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if comment['comment'].author.created_recently() %}
|
||||||
|
<span class="fe fe-new-account small" title="New account"> </span>
|
||||||
|
{% endif %}
|
||||||
{% if comment['comment'].author.id == post.author.id %}<span title="Submitter of original post" aria-label="submitter" class="small">[OP]</span>{% endif %}
|
{% if comment['comment'].author.id == post.author.id %}<span title="Submitter of original post" aria-label="submitter" class="small">[OP]</span>{% endif %}
|
||||||
<span class="text-muted small">{{ moment(comment['comment'].posted_at).fromNow(refresh=True) }}{% if comment['comment'].edited_at %}, edited {{ moment(comment['comment'].edited_at).fromNow(refresh=True) }} {% endif %}</span>
|
<span class="text-muted small">{{ moment(comment['comment'].posted_at).fromNow(refresh=True) }}{% if comment['comment'].edited_at %}, edited {{ moment(comment['comment'].edited_at).fromNow(refresh=True) }} {% endif %}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
<h1 class="mt-2">{{ user.user_name if user.ap_id == none else user.ap_id }}</h1>
|
<h1 class="mt-2">{{ user.user_name if user.ap_id == none else user.ap_id }}</h1>
|
||||||
|
<p class="small">{{ _('Joined') }}: {{ moment(user.created).fromNow(refresh=True) }}
|
||||||
{{ user.about_html|safe }}
|
{{ user.about_html|safe }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue