Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnyLlama committed Apr 28, 2024
1 parent b04eb76 commit 1f72056
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 89 deletions.
7 changes: 3 additions & 4 deletions scss/box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@
}
}

.content {
width: 100%;
}

&.success {
background-color: palette.$green100;
border-color: palette.$green300;

> h2[icon]::before {
@include mixins.icon(2.4);
Expand All @@ -40,6 +37,7 @@

&.warning {
background-color: palette.$yellow100;
border-color: palette.$yellow300;

> h2[icon]::before {
@include mixins.icon(2.4);
Expand All @@ -49,6 +47,7 @@

&.error {
background-color: palette.$red100;
border-color: palette.$red300;

> h2[icon]::before {
@include mixins.icon(2.4);
Expand Down
134 changes: 66 additions & 68 deletions templates/control_panel/main.html.tera
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% if creator.role == "Publisher" %}
<div class="box pad">
<h2 icon="admin_panel_settings">Administrativa verktyg</h2>
<div class="content flex wrap gap">
<div class="flex wrap gap">
<button class="btn" icon="person_add" data-dialog-button="create-user">Skapa ny användare</button>
<button class="btn" icon="person_edit" data-dialog-button="change-password-any">Byt lösenord för annan
användare</button>
Expand All @@ -42,77 +42,75 @@

<div class="box pad">
<h2 icon="feed">Dina texter</h2>
<div class="content">
<h3>Opublicerade texter (påbörjade)</h3>
{% if unpublished_texts | length > 0 %}
{% for text in unpublished_texts %}
{% if not text.marked_as_done %}
<div class="article-box">
<p class="title">{{ text.title }} </p>
<p class="date">{{ text.created_at | date(format="%F %T") }}</p>
<div class="flex wrap gap actions">
<a class="btn icon-only" icon="edit_note" href="/control-panel/edit/{{ text.id }}"></a>
<button class="btn icon-only share"
data-url="{{ get_env(name="SITE_URL") }}/t/{{ text.id }}/{{ text.title_slug }}"
data-title="{{ text.title }}" icon="share">
</button>
<a class="btn icon-only" icon="open_in_new" href="/t/{{ text.id }}/{{ text.title_slug }}"
target="_blank"></a>
</div>
</div>
{% endif %}
{% endfor %}
{% else %}
<p>Du har inga opublicerade texter.</p>
{% endif %}
<div class="flex wrap gap">
<a class="btn" icon="post_add" href="/control-panel/editor">Skapa ny text</a>
<h3>Opublicerade texter (påbörjade)</h3>
{% if unpublished_texts | length > 0 %}
{% for text in unpublished_texts %}
{% if not text.marked_as_done %}
<div class="article-box">
<p class="title">{{ text.title }} </p>
<p class="date">{{ text.created_at | date(format="%F %T") }}</p>
<div class="flex wrap gap actions">
<a class="btn icon-only" icon="edit_note" href="/control-panel/edit/{{ text.id }}"></a>
<button class="btn icon-only share"
data-url="{{ get_env(name="SITE_URL") }}/t/{{ text.id }}/{{ text.title_slug }}"
data-title="{{ text.title }}" icon="share">
</button>
<a class="btn icon-only" icon="open_in_new" href="/t/{{ text.id }}/{{ text.title_slug }}"
target="_blank"></a>
</div>
</div>
{% endif %}
{% endfor %}
{% else %}
<p>Du har inga opublicerade texter.</p>
{% endif %}
<div class="flex wrap gap">
<a class="btn" icon="post_add" href="/control-panel/editor">Skapa ny text</a>
</div>

<h3>Opublicerade texter (färdiga)</h3>
{% if unpublished_texts | length > 0 %}
{% for text in unpublished_texts %}
{% if text.marked_as_done %}
<div class="article-box">
<p class="title">{{ text.title }} </p>
<p class="date">{{ text.created_at | date(format="%F %T") }}</p>
<div class="flex wrap gap actions">
<a class="btn icon-only" icon="edit_note" href="/control-panel/edit/{{ text.id }}"></a>
<button class="btn icon-only share"
data-url="{{ get_env(name="SITE_URL") }}/t/{{ text.id }}/{{ text.title_slug }}"
data-title="{{ text.title }}" icon="share">
</button>
<a class="btn icon-only" icon="open_in_new" href="/t/{{ text.id }}/{{ text.title_slug }}"
target="_blank"></a>
</div>
<h3>Opublicerade texter (färdiga)</h3>
{% if unpublished_texts | length > 0 %}
{% for text in unpublished_texts %}
{% if text.marked_as_done %}
<div class="article-box">
<p class="title">{{ text.title }} </p>
<p class="date">{{ text.created_at | date(format="%F %T") }}</p>
<div class="flex wrap gap actions">
<a class="btn icon-only" icon="edit_note" href="/control-panel/edit/{{ text.id }}"></a>
<button class="btn icon-only share"
data-url="{{ get_env(name="SITE_URL") }}/t/{{ text.id }}/{{ text.title_slug }}"
data-title="{{ text.title }}" icon="share">
</button>
<a class="btn icon-only" icon="open_in_new" href="/t/{{ text.id }}/{{ text.title_slug }}"
target="_blank"></a>
</div>
{% endif %}
{% endfor %}
{% else %}
<p>Du har inga färdiga texter som inväntar publicering.</p>
{% endif %}

<h3>Publicerade texter</h3>
{% if published_texts | length > 0 %}
{% for text in published_texts %}
<div class="article-box">
<p class="title">{{ text.title }} </p>
<p class="date">{{ text.created_at | date(format="%F %T") }}</p>
<div class="flex wrap gap actions">
<a class="btn icon-only" icon="edit_note" href="/control-panel/edit/{{ text.id }}"></a>
<button class="btn icon-only share"
data-url="{{ get_env(name="SITE_URL") }}/t/{{ text.id }}/{{ text.title_slug }}"
data-title="{{ text.title }}" icon="share">
</button>
<a class="btn icon-only" icon="open_in_new" href="/t/{{ text.id }}/{{ text.title_slug }}"
target="_blank"></a>
</div>
</div>
{% endif %}
{% endfor %}
{% else %}
<p>Du har inga färdiga texter som inväntar publicering.</p>
{% endif %}

<h3>Publicerade texter</h3>
{% if published_texts | length > 0 %}
{% for text in published_texts %}
<div class="article-box">
<p class="title">{{ text.title }} </p>
<p class="date">{{ text.created_at | date(format="%F %T") }}</p>
<div class="flex wrap gap actions">
<a class="btn icon-only" icon="edit_note" href="/control-panel/edit/{{ text.id }}"></a>
<button class="btn icon-only share"
data-url="{{ get_env(name="SITE_URL") }}/t/{{ text.id }}/{{ text.title_slug }}"
data-title="{{ text.title }}" icon="share">
</button>
<a class="btn icon-only" icon="open_in_new" href="/t/{{ text.id }}/{{ text.title_slug }}"
target="_blank"></a>
</div>
{% endfor %}
{% else %}
<p>Du har inga publicerade texter.</p>
{% endif %}
</div>
{% endfor %}
{% else %}
<p>Du har inga publicerade texter.</p>
{% endif %}
</div>

{% if creator.role == "Publisher" %}
Expand Down Expand Up @@ -234,7 +232,7 @@
{% block aside %}
<div class="box side-content">
<h1>Din profil</h1>
<div class="content profile">
<div class="profile">
<img src="/dynamic-data/profile-pictures/{{ creator.username }}.webp" alt="Profilbild" class="pfp">
<h3 class="name">{{ creator.display_name }}</h3>
<div class="info-table">
Expand Down
27 changes: 12 additions & 15 deletions templates/control_panel/preview_done_unpublished.html.tera
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@

<div class="box pad">
<h2 icon="feed">Färdiga (opublicerade) texter</h2>
<div class="content">
{% if texts | length > 0 %}
{% for text in texts %}
<div class="article-box">
<p class="title">{{ text.title }} </p>
<p class="date">{{ text.created_at | date(format="%F %T") }}</p>
<p class="author">{{ text.author }}</p>
<div class="flex wrap gap actions">
<a class="btn icon-only" icon="preview" href="/t/{{ text.id }}/{{ text.title_slug }}"
target="_blank"></a>
</div>
{% if texts | length > 0 %}
{% for text in texts %}
<div class="article-box">
<p class="title">{{ text.title }} </p>
<p class="date">{{ text.created_at | date(format="%F %T") }}</p>
<p class="author">{{ text.author }}</p>
<div class="flex wrap gap actions">
<a class="btn icon-only" icon="preview" href="/t/{{ text.id }}/{{ text.title_slug }}" target="_blank"></a>
</div>
{% endfor %}
{% else %}
<p>Det finns inga texter att granska!</p>
{% endif %}
</div>
{% endfor %}
{% else %}
<p>Det finns inga texter att granska!</p>
{% endif %}
</div>
{% endblock main %}

Expand Down
4 changes: 2 additions & 2 deletions templates/single-text-view.html.tera
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% block main %}

{% if is_logged_in and not text.is_published %}
<div class="box warning">
<div class="box pad warning">
<h2 icon="warning">Artikeln är inte publicerad</h2>
<p>Denna artikel är inte publicerad. Endast inloggade skribenter kan se den.</p>
</div>
Expand Down Expand Up @@ -53,7 +53,7 @@

{% block aside %}
{% if is_logged_in %}
<div class="side-content">
<div class="side-content box">
<h1>Verktygslåda</h1>
<div class="flex wrap gap">
{% if can_mark_as_done %}
Expand Down

0 comments on commit 1f72056

Please sign in to comment.