created recently indicator on users

This commit is contained in:
rimu 2023-11-30 05:14:22 +13:00
parent ddc747bb76
commit c5f79ce1ca
7 changed files with 40 additions and 3 deletions

View file

@ -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:

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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>

View file

@ -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>

View file

@ -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 %}