From ea1d27cf81d28c914c3096fe266cbf49ba76b4c6 Mon Sep 17 00:00:00 2001 From: mst Date: Sun, 20 Oct 2024 00:17:41 +0300 Subject: [PATCH] add remaining files (moved/deleted) --- templates/admin/index.html | 336 ------------------ templates/snippets/admin/emojiRow.html | 10 + templates/snippets/admin/packRow.html | 14 + .../snippets/layout/description/normal.html | 26 ++ .../layout/description/retrospring.html | 29 ++ .../snippets/layout/homepage/normal.html | 70 ++++ .../snippets/layout/homepage/retrospring.html | 62 ++++ templates/snippets/layout/question_card.html | 217 +++++++++++ templates/snippets/layout/questions_list.html | 29 ++ templates/snippets/q-card-text.html | 14 + 10 files changed, 471 insertions(+), 336 deletions(-) delete mode 100644 templates/admin/index.html create mode 100644 templates/snippets/admin/emojiRow.html create mode 100644 templates/snippets/admin/packRow.html create mode 100644 templates/snippets/layout/description/normal.html create mode 100644 templates/snippets/layout/description/retrospring.html create mode 100644 templates/snippets/layout/homepage/normal.html create mode 100644 templates/snippets/layout/homepage/retrospring.html create mode 100644 templates/snippets/layout/question_card.html create mode 100644 templates/snippets/layout/questions_list.html create mode 100644 templates/snippets/q-card-text.html diff --git a/templates/admin/index.html b/templates/admin/index.html deleted file mode 100644 index accc5a6..0000000 --- a/templates/admin/index.html +++ /dev/null @@ -1,336 +0,0 @@ -{% extends 'base.html' %} -{% block title %}Admin{% endblock %} -{% set adminLink = 'active' %} -{% block additionalHeadItems %} - - -{% endblock %} -{% block content %} -

Admin panel

- -
-Skip to preview -Skip to preview -
-
-
-

- Instance - -

-
- - -

Title of this CatAsk instance

-
-
- - -

Description of this CatAsk instance

-
-
- - -

Rules of this CatAsk instance

-
-
- - -

Image that's going to be used in a link preview

-
-
- - -

Full URL to homepage of this CatAsk instance without a trailing slash

-
-
- -
-
-

Customize

-

Favicon

-
-

Current favicon: {{ cfg.instance.title }}'s icon

-
- - -
-
- -
-
-
-

Accent color

- {#

Color

#} -
- - -

Default: #6345d9

-
-
- - -

Default: #7259d9

-
- {# brain doesn't feel like implementing this rn (9/27/24) -

Background

-
- - -

Default: #ffffff

-
-
- - -

Default: #202020

-
- #} -
- - - -
- {# -
- - - -
- #} -

Navbar link style

-
- - -
-
- - -
-

Info box layout

-
- - -
-
- - -
-

Trimmed content

-
- - -

Maximum length of content before it gets trimmed (used in sharing options); set to 0 to disable

-
-

General

-
- - -

Max length of a question in characters; questions extending this character limit will not be added to the database

-
-
- - -

This name will be used for questions asked to you by anonymous users

-
- -
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- -
-
-
-
- -
- -

Blacklisted words for questions; one word per line

- - -
-
-
-
-
-
-

Preview

- -
- The preview is not guaranteed to render the same as on other pages, because it uses a different renderer (marked (js) while everything else uses mistune (python))
The reason for this is live markdown rendering support
-
-
- -

{{ cfg.instance.title }}

- {% autoescape off %} -

{{ cfg.instance.description | render_markdown }}

- {% endautoescape %} -
-
-
-

- -

-
-
-
{{ cfg.instance.rules | render_markdown }}
-
-
-
-
-
-
-
-
-{% endblock %} -{% block scripts %} - - - - - - -{% endblock %} diff --git a/templates/snippets/admin/emojiRow.html b/templates/snippets/admin/emojiRow.html new file mode 100644 index 0000000..567039a --- /dev/null +++ b/templates/snippets/admin/emojiRow.html @@ -0,0 +1,10 @@ + + + {{ emoji.name.capitalize() }} + {{ emoji.relative_path }} + +
+ +
+ + \ No newline at end of file diff --git a/templates/snippets/admin/packRow.html b/templates/snippets/admin/packRow.html new file mode 100644 index 0000000..ed52dba --- /dev/null +++ b/templates/snippets/admin/packRow.html @@ -0,0 +1,14 @@ + + + {{ pack.name }} + {% if json_pack %} + {{ pack.website }} + {{ formatRelativeTime(pack.exportedAt) }} + {% endif %} + {{ pack.relative_path }} + +
+ +
+ + \ No newline at end of file diff --git a/templates/snippets/layout/description/normal.html b/templates/snippets/layout/description/normal.html new file mode 100644 index 0000000..4e76152 --- /dev/null +++ b/templates/snippets/layout/description/normal.html @@ -0,0 +1,26 @@ +
+
+

{{ cfg.instance.title }}

+ {% autoescape off %} +

{{ cfg.instance.description | render_markdown }}

+ {% endautoescape %} +
+ {% if len(cfg.instance.rules) > 0 %} +
+
+
+

+ +

+
+
+
{{ cfg.instance.rules | render_markdown }}
+
+
+
+
+
+ {% endif %} +
\ No newline at end of file diff --git a/templates/snippets/layout/description/retrospring.html b/templates/snippets/layout/description/retrospring.html new file mode 100644 index 0000000..8819f0d --- /dev/null +++ b/templates/snippets/layout/description/retrospring.html @@ -0,0 +1,29 @@ +
+
+
+
+
+ {{ cfg.instance.description | render_markdown }} +
+
+
+ {% if len(cfg.instance.rules) > 0 %} +
+
+
+

+ +

+
+
+
{{ cfg.instance.rules | render_markdown }}
+
+
+
+
+
+ {% endif %} +
+
\ No newline at end of file diff --git a/templates/snippets/layout/homepage/normal.html b/templates/snippets/layout/homepage/normal.html new file mode 100644 index 0000000..de54936 --- /dev/null +++ b/templates/snippets/layout/homepage/normal.html @@ -0,0 +1,70 @@ +{% include 'snippets/layout/description/normal.html' %} + +
+
+ {% if cfg.lockInbox == false %} +
+

+ Ask a question + +

+
+
+
+ + +
+
+
+ + +
+
+ + +

Markdown supported {{ cfg.charLimit }}

+
+
+ + +
+
+ {# +
+ reserved for version 1.6.0 or later + + + +
+ #} + +
+
+
+ {% else %} +
+

New questions cannot be asked right now.

+ {% endif %} +
+
+{% if combined %} +
+ {% if cfg.showQuestionCount == true %} +

{{ len(combined) }} question(s)

+ {% endif %} +
+
+ {% include 'snippets/layout/questions_list.html' %} +
+
+{% endif %} \ No newline at end of file diff --git a/templates/snippets/layout/homepage/retrospring.html b/templates/snippets/layout/homepage/retrospring.html new file mode 100644 index 0000000..bd6b3c8 --- /dev/null +++ b/templates/snippets/layout/homepage/retrospring.html @@ -0,0 +1,62 @@ +{% include 'snippets/layout/description/retrospring.html' %} +
+
+
+
+ Ask a question + +
+
+ {% if cfg.lockInbox == false %} +
+
+
+ + +
+
+
+ + +
+
+ + +

Markdown supported {{ cfg.charLimit }}

+
+
+ + +
+
+ {# +
+ reserved for version 1.6.0 or later + + + +
+ #} + +
+
+
+ {% else %} +
+

New questions cannot be asked right now.

+ {% endif %} +
+
+
+ {% include 'snippets/layout/questions_list.html' %} +
\ No newline at end of file diff --git a/templates/snippets/layout/question_card.html b/templates/snippets/layout/question_card.html new file mode 100644 index 0000000..e5bf1aa --- /dev/null +++ b/templates/snippets/layout/question_card.html @@ -0,0 +1,217 @@ +{% if multipleAnswers %} +{% for answer in answers %} +
+
+
+
+

+ {% if question.from_who %} + {{ question.from_who | render_markdown }} + {% else %} + {{ cfg.anonName }} + {% endif %} +

+

{{ formatRelativeTime(str(question.creation_date)) }}

+
+ {% with question=question %} + {% include 'snippets/q-card-text.html' %} + {% endwith %} +
+
+
+ {% if answer.cw %} +
{{ answer.cw | render_markdown }}
+
+ {{ answer.content | render_markdown }} +
+ + {% else %} +
{{ answer.content | render_markdown }}
+ {% endif %} +
+ +
+{% endfor %} +{% else %} +
+
+
+
+

+ {% if question.from_who %} + {{ question.from_who | render_markdown }} + {% else %} + {{ cfg.anonName }} + {% endif %} +

+

{{ formatRelativeTime(str(question.creation_date)) }}

+
+ {% with question=question %} + {% include 'snippets/q-card-text.html' %} + {% endwith %} +
+
+
+ {% if answer.cw %} +
{{ answer.cw | render_markdown }}
+
+ {{ answer.content | render_markdown }} +
+ + {% else %} +
{{ answer.content | render_markdown }}
+ {% endif %} +
+ +
+{% endif %} \ No newline at end of file diff --git a/templates/snippets/layout/questions_list.html b/templates/snippets/layout/questions_list.html new file mode 100644 index 0000000..248b2e8 --- /dev/null +++ b/templates/snippets/layout/questions_list.html @@ -0,0 +1,29 @@ +{% for item in combined %} +{% with question=item.question, answers=item.answers, showViewQuestionBtn=True, multipleAnswers=True %} +{% include 'snippets/layout/question_card.html' %} +{% endwith %} +{% endfor %} +{% for item in combined %} +{% for answer in item.answers %} + +{% endfor %} +{% endfor %} \ No newline at end of file diff --git a/templates/snippets/q-card-text.html b/templates/snippets/q-card-text.html new file mode 100644 index 0000000..6e5e1ba --- /dev/null +++ b/templates/snippets/q-card-text.html @@ -0,0 +1,14 @@ +
+ {% if question.cw %} +

{{ question.cw }}

+
+ {{ question.content | render_markdown }} +
+ + {% else %} + {{ question.content | render_markdown }} + {% endif %} +
\ No newline at end of file