Skip to content

Commit

Permalink
Merge pull request #13 from wzyboy/feat/spoiler-text
Browse files Browse the repository at this point in the history
feat: show CW/title in toots
  • Loading branch information
wzyboy committed Jul 30, 2023
2 parents e2a2e06 + 4407267 commit 0067857
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ash.py
Expand Up @@ -150,7 +150,7 @@ def search(self, *, keyword=None, user_screen_name=None, index=None, limit=100)
keyword_query = {
'simple_query_string': {
'query': keyword,
'fields': ['text', 'full_text', 'content_text', 'media_attachments.description'],
'fields': ['text', 'full_text', 'content_text', 'spoiler_text', 'media_attachments.description'],
'default_operator': 'AND',
}
}
Expand Down
2 changes: 1 addition & 1 deletion static/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/main.css.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions static/scss/card.scss
Expand Up @@ -73,6 +73,13 @@
}
}
}
.title {
font-size: 20px;
font-style: italic;
padding-top: 0.2em;
padding-bottom: 0.5em;
border-bottom: 1px solid rgb(207, 217, 222);
}
.full-text {
color: rgb(15, 20, 25);
line-height: 24px;
Expand Down
7 changes: 7 additions & 0 deletions static/scss/list.scss
Expand Up @@ -87,6 +87,13 @@
}
}

.title {
font-style: italic;
padding-top: 0.2em;
padding-bottom: 0.5em;
border-bottom: 1px solid rgb(207, 217, 222);
}

.full-text {
overflow-wrap: break-word;
white-space: pre-wrap;
Expand Down
3 changes: 3 additions & 0 deletions templates/_tweet_list.html
Expand Up @@ -37,6 +37,9 @@
{%- endif %}
</div>

{%- if tweet.spoiler_text %}
<div class="title">{{ tweet.spoiler_text }}</div>
{%- endif %}
<div class="full-text">{{ tweet | format_tweet_text | safe }}</div>

</div>
Expand Down
8 changes: 6 additions & 2 deletions templates/tweet.html
Expand Up @@ -31,11 +31,15 @@
</div>

<div class="text">
{%- if tweet.in_reply_to_status_id %}
<div class="in-reply-to">
{%- if tweet.in_reply_to_status_id %}
<a href="{{ tweet | in_reply_to_link }}">Replying to @{{ tweet['in_reply_to_screen_name'] }}</a>
{%- endif %}
</div>
{%- endif %}

{%- if tweet.spoiler_text %}
<div class="title">{{ tweet.spoiler_text }}</div>
{%- endif %}

<div class="full-text">{{ tweet | format_tweet_text | safe }}</div>
</div>
Expand Down

0 comments on commit 0067857

Please sign in to comment.