mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
Fixes handling of ratings in status views and urls
This commit is contained in:
parent
2e36cfbcf6
commit
4a10c99026
4 changed files with 6 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
{% load bookwyrm_tags %}
|
||||
<div class="block">
|
||||
{% if status.status_type == 'Review' %}
|
||||
{% if status.status_type == 'Review' or status.status_type == 'Rating' %}
|
||||
<div>
|
||||
<h3 class="title is-5 has-subtitle">
|
||||
{% if status.name %}<span dir="auto">{{ status.name }}</span><br>{% endif %}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{% if status.status_type == 'GeneratedNote' %}
|
||||
{{ status.content | safe }}
|
||||
{% elif status.status_type == 'Review' and not status.name and not status.content%}
|
||||
{% elif status.status_type == 'Rating' %}
|
||||
rated
|
||||
{% elif status.status_type == 'Review' %}
|
||||
reviewed
|
||||
|
|
|
@ -13,6 +13,7 @@ local_user_path = r'^user/(?P<username>%s)' % regex.localname
|
|||
status_types = [
|
||||
'status',
|
||||
'review',
|
||||
'reviewrating',
|
||||
'comment',
|
||||
'quotation',
|
||||
'boost',
|
||||
|
|
|
@ -56,7 +56,7 @@ class CreateStatus(View):
|
|||
status.mention_users.set(set(status.mention_users.all()))
|
||||
|
||||
# don't apply formatting to generated notes
|
||||
if not isinstance(status, models.GeneratedNote):
|
||||
if not isinstance(status, models.GeneratedNote) and content:
|
||||
status.content = to_markdown(content)
|
||||
# do apply formatting to quotes
|
||||
if hasattr(status, 'quote'):
|
||||
|
@ -82,6 +82,8 @@ class DeleteStatus(View):
|
|||
|
||||
def find_mentions(content):
|
||||
''' detect @mentions in raw status content '''
|
||||
if not content:
|
||||
return
|
||||
for match in re.finditer(regex.strict_username, content):
|
||||
username = match.group().strip().split('@')[1:]
|
||||
if len(username) == 1:
|
||||
|
|
Loading…
Reference in a new issue