diff options
author | Andrew Godwin | 2022-11-17 19:21:00 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-17 17:33:09 -0700 |
commit | 291d7e404e12e1d017403242f8ed199046f0904c (patch) | |
tree | 89a60ff7f321537b6a58835aaa726f7e22ed09ba /templates | |
parent | 0851fbd1ec09b142608667bf90ee806e59cafb28 (diff) | |
download | takahe-291d7e404e12e1d017403242f8ed199046f0904c.tar.gz takahe-291d7e404e12e1d017403242f8ed199046f0904c.tar.bz2 takahe-291d7e404e12e1d017403242f8ed199046f0904c.zip |
Logged out experience, config, and profiles
Diffstat (limited to 'templates')
-rw-r--r-- | templates/activities/_menu.html | 38 | ||||
-rw-r--r-- | templates/auth/login.html | 12 | ||||
-rw-r--r-- | templates/base.html | 45 | ||||
-rw-r--r-- | templates/forms/_field.html | 9 | ||||
-rw-r--r-- | templates/identity/_menu.html | 12 | ||||
-rw-r--r-- | templates/identity/view.html | 2 | ||||
-rw-r--r-- | templates/index.html | 12 | ||||
-rw-r--r-- | templates/settings/_menu.html | 6 | ||||
-rw-r--r-- | templates/settings/settings.html | 2 |
9 files changed, 90 insertions, 48 deletions
diff --git a/templates/activities/_menu.html b/templates/activities/_menu.html index 6bb18c2..a671712 100644 --- a/templates/activities/_menu.html +++ b/templates/activities/_menu.html @@ -2,15 +2,35 @@ <a href="/" {% if current_page == "home" %}class="selected"{% endif %}> <i class="fa-solid fa-home"></i> Home </a> - <a href="/notifications/" {% if current_page == "notifications" %}class="selected"{% endif %}> - <i class="fa-solid fa-at"></i> Notifications - </a> - <a href="/local/" {% if current_page == "local" %}class="selected"{% endif %}> - <i class="fa-solid fa-city"></i> Local - </a> - <a href="/federated/" {% if current_page == "federated" %}class="selected"{% endif %}> - <i class="fa-solid fa-globe"></i> Federated - </a> + {% if request.user.is_authenticated %} + <a href="{% url "notifications" %}" {% if current_page == "notifications" %}class="selected"{% endif %}> + <i class="fa-solid fa-at"></i> Notifications + </a> + <a href="{% url "local" %}" {% if current_page == "local" %}class="selected"{% endif %}> + <i class="fa-solid fa-city"></i> Local + </a> + <a href="{% url "federated" %}" {% if current_page == "federated" %}class="selected"{% endif %}> + <i class="fa-solid fa-globe"></i> Federated + </a> + <h3></h3> + <a href="{% url "compose" %}" {% if top_section == "compose" %}class="selected"{% endif %}> + <i class="fa-solid fa-feather"></i> Compose + </a> + <a href="{% url "search" %}" {% if top_section == "search" %}class="selected"{% endif %}> + <i class="fa-solid fa-search"></i> Search + </a> + <a href="{% url "settings" %}" {% if top_section == "settings" %}class="selected"{% endif %}> + <i class="fa-solid fa-gear"></i> Settings + </a> + {% else %} + <a href="/local/" {% if current_page == "local" %}class="selected"{% endif %}> + <i class="fa-solid fa-city"></i> Local Posts + </a> + <h3></h3> + <a href="/auth/signup/" {% if current_page == "signup" %}class="selected"{% endif %}> + <i class="fa-solid fa-user-plus"></i> Create Account + </a> + {% endif %} </nav> {% if current_page == "home" %} diff --git a/templates/auth/login.html b/templates/auth/login.html index c892c78..b3b0a05 100644 --- a/templates/auth/login.html +++ b/templates/auth/login.html @@ -3,14 +3,14 @@ {% block title %}Login{% endblock %} {% block content %} - <nav> - <a href="." class="selected">Login</a> - </nav> <form action="." method="POST"> {% csrf_token %} - {% for field in form %} - {% include "forms/_field.html" %} - {% endfor %} + <fieldset> + <legend>Login</legend> + {% for field in form %} + {% include "forms/_field.html" %} + {% endfor %} + </fieldset> <div class="buttons"> <button>Login</button> </div> diff --git a/templates/base.html b/templates/base.html index edcb11a..b64f4f5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -23,56 +23,57 @@ <main> <header> <a class="logo" href="/"> - <img src="{% static "img/icon-128.png" %}" width="32"> + <img src="{{ config.site_icon }}" width="32"> {{ config.site_name }} </a> <menu> {% if user.is_authenticated %} <a href="{% url "compose" %}" title="Compose" {% if top_section == "compose" %}class="selected"{% endif %}> - <i class="fa-solid fa-feather"></i> Compose + <i class="fa-solid fa-feather"></i> </a> <a href="{% url "search" %}" title="Search" {% if top_section == "search" %}class="selected"{% endif %}> - <i class="fa-solid fa-search"></i> Search + <i class="fa-solid fa-search"></i> </a> <a href="{% url "settings" %}" title="Settings" {% if top_section == "settings" %}class="selected"{% endif %}> - <i class="fa-solid fa-gear"></i> Settings + <i class="fa-solid fa-gear"></i> </a> <div class="gap"></div> <a href="/identity/select/" class="identity"> {% if not request.identity %} No Identity <img src="{% static "img/unknown-icon-128.png" %}" title="No identity selected"> - {% elif request.identity.icon %} - {{ request.identity.username }} - <img src="{{ request.identity.icon.url }}" title="{{ request.identity.handle }}"> - {% elif request.identity.icon_uri %} - {{ request.identity.username }} - <img src="{{ request.identity.icon_uri }}" title="{{ request.identity.handle }}"> {% else %} {{ request.identity.username }} - <img src="{% static "img/unknown-icon-128.png" %}" title="{{ request.identity.handle }}"> + <img src="{{ request.identity.local_icon_url }}" title="{{ request.identity.handle }}"> {% endif %} </a> {% else %} - <a href="/auth/login/"><i class="fa-solid fa-right-to-bracket"></i> Login</a> + <div class="gap"></div> + <a href="/auth/login/" class="identity"><i class="fa-solid fa-right-to-bracket"></i> Login</a> {% endif %} </menu> </header> {% block full_content %} - <div class="columns"> - <div class="left-column"> - {% block content %} - {% endblock %} + {% block pre_content %} + {% endblock %} + <div class="columns"> + <div class="left-column"> + {% block content %} + {% endblock %} + </div> + <div class="right-column"> + {% block right_content %} + {% include "activities/_menu.html" %} + {% endblock %} + </div> </div> - <div class="right-column"> - {% block right_content %} - {% include "activities/_menu.html" %} - {% endblock %} - </div> - </div> {% endblock %} </main> + <footer> + <span>Powered by <a href="https://jointakahe.com">Takahē {{ config.version }}</a></span> + </footer> + </body> </html> diff --git a/templates/forms/_field.html b/templates/forms/_field.html index 595546d..99db819 100644 --- a/templates/forms/_field.html +++ b/templates/forms/_field.html @@ -10,9 +10,14 @@ </p> {% endif %} {{ field.errors }} + {% if field.field.widget.input_type == "file" and field.value %} + <div class="clear"> + <input type="checkbox" class="clear" name="{{ field.name }}__clear"> Clear current value</input> + </div> + {% endif %} {{ field }} </div> - {% if preview %} - <img class="preview" src="{{ preview }}"> + {% if field.field.widget.input_type == "file" %} + <img class="preview" src="{{ field.value }}"> {% endif %} </div> diff --git a/templates/identity/_menu.html b/templates/identity/_menu.html index fff70cb..f841284 100644 --- a/templates/identity/_menu.html +++ b/templates/identity/_menu.html @@ -1,5 +1,11 @@ <nav> - <a href="/identity/select/" {% if identities %}class="selected"{% endif %}>Select Identity</a> - <a href="/identity/create/" {% if form %}class="selected"{% endif %}>Create Identity</a> - <a href="/auth/logout/">Logout</a> + <a href="/identity/select/" {% if identities %}class="selected"{% endif %}> + <i class="fa-solid fa-user"></i> Select Identity + </a> + <a href="/identity/create/" {% if form %}class="selected"{% endif %}> + <i class="fa-solid fa-plus"></i> Create Identity + </a> + <a href="/auth/logout/"> + <i class="fa-solid fa-right-from-bracket"></i> Logout + </a> </nav> diff --git a/templates/identity/view.html b/templates/identity/view.html index 0dd0592..223c2bb 100644 --- a/templates/identity/view.html +++ b/templates/identity/view.html @@ -2,6 +2,8 @@ {% block title %}{{ identity }}{% endblock %} +{% block body_class %}has-banner{% endblock %} + {% block content %} <h1 class="identity"> {% if identity.local_image_url %} diff --git a/templates/index.html b/templates/index.html index 9e09a43..79f81cf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,12 +2,14 @@ {% block title %}Welcome{% endblock %} -{% block content %} - <nav> - <a href="/" class="selected">Home</a> - </nav> +{% block content %} + <div class="about"> + <img class="banner" src="{{ config.site_banner }}"> + {{ config.site_about|safe|linebreaks }} + </div> + <h2>People</h2> {% for identity in identities %} - <a href="{{ identity.urls.view }}">{{ identity }}</a> + {% include "activities/_identity.html" %} {% endfor %} {% endblock %} diff --git a/templates/settings/_menu.html b/templates/settings/_menu.html index e2dc70b..d85c878 100644 --- a/templates/settings/_menu.html +++ b/templates/settings/_menu.html @@ -11,6 +11,9 @@ <a href="#" {% if section == "login" %}class="selected"{% endif %}> <i class="fa-solid fa-key"></i> Login & Security </a> + <a href="/auth/logout/"> + <i class="fa-solid fa-right-from-bracket"></i> Logout + </a> <h3>Administration</h3> <a href="{% url "admin_basic" %}" {% if section == "basic" %}class="selected"{% endif %}> <i class="fa-solid fa-book"></i> Basic @@ -24,5 +27,8 @@ <a href="{% url "admin_identities" %}" {% if section == "identities" %}class="selected"{% endif %}> <i class="fa-solid fa-id-card"></i> Identities </a> + <a href="/djadmin"> + <i class="fa-solid fa-gear"></i> Django Admin + </a> {% endif %} </nav> diff --git a/templates/settings/settings.html b/templates/settings/settings.html index a933627..36a6c10 100644 --- a/templates/settings/settings.html +++ b/templates/settings/settings.html @@ -3,7 +3,7 @@ {% block subtitle %}{{ section.title }}{% endblock %} {% block content %} - <form action="." method="POST"> + <form action="." method="POST" enctype="multipart/form-data"> {% csrf_token %} {% for title, fields in fieldsets.items %} <fieldset> |