[settings] Clean up settings widget
This commit is contained in:
@ -5,54 +5,92 @@
|
|||||||
|
|
||||||
{% block head_extra %}
|
{% block head_extra %}
|
||||||
<style>
|
<style>
|
||||||
.container {
|
.settings-form {
|
||||||
max-width: 500px;
|
display: grid;
|
||||||
float:left;
|
grid-template-columns: 180px 1fr;
|
||||||
|
gap: 12px 16px;
|
||||||
|
align-items: center;
|
||||||
|
max-width: 700px;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
.settings-form p {
|
||||||
margin-bottom: 15px;
|
margin: 0;
|
||||||
|
display: contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
label {
|
.settings-form label {
|
||||||
display: block;
|
font-weight: 600;
|
||||||
font-weight: bold;
|
text-align: right;
|
||||||
margin-bottom: 5px;
|
padding-right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"] {
|
.settings-form input[type="text"],
|
||||||
|
.settings-form input[type="password"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 8px;
|
padding: 6px 10px;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="checkbox"] {
|
.settings-form input:focus {
|
||||||
margin-left: 5px;
|
|
||||||
transform: scale(1.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
input:focus {
|
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: #007bff;
|
border-color: #007bff;
|
||||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
|
box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-form .checkbox-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-form .checkbox-row label {
|
||||||
|
font-weight: normal;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-form input[type="checkbox"] {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-form input[type="submit"] {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
margin-top: 16px;
|
||||||
|
padding: 10px 24px;
|
||||||
|
background: #007bff;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-form input[type="submit"]:hover {
|
||||||
|
background: #0056b3;
|
||||||
|
}
|
||||||
|
|
||||||
.widget-links {
|
.widget-links {
|
||||||
margin: 10px 0 20px 20px;
|
grid-column: 2;
|
||||||
padding: 10px;
|
margin: 8px 0 16px 0;
|
||||||
|
padding: 12px;
|
||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget-links strong {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-links ul {
|
.widget-links ul {
|
||||||
margin: 5px 0 0 0;
|
margin: 0;
|
||||||
padding-left: 20px;
|
padding-left: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-links li {
|
.widget-links li {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -62,19 +100,16 @@ input:focus {
|
|||||||
|
|
||||||
{% block title %}Settings{% endblock %}
|
{% block title %}Settings{% endblock %}
|
||||||
{% block details %}
|
{% block details %}
|
||||||
<form method="post">{% csrf_token %}
|
<form method="post" class="settings-form">{% csrf_token %}
|
||||||
{% for field in form %}
|
{% for field in form %}
|
||||||
{% if field.name == "enable_public_widgets" %}
|
{% if field.name == "enable_public_widgets" %}
|
||||||
<p>
|
<p class="checkbox-row">
|
||||||
{{ field }}
|
{{ field }}
|
||||||
{{ field.label_tag }}
|
{{ field.label_tag }}
|
||||||
{% if field.errors %}
|
|
||||||
<span class="error">{{ field.errors }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</p>
|
</p>
|
||||||
{% if user_id %}
|
{% if user_id %}
|
||||||
<div class="widget-links">
|
<div class="widget-links">
|
||||||
<p><strong>Available Widgets:</strong></p>
|
<strong>Available Widgets:</strong>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{% url 'scrobbles:embeddable-top-artists' user_id %}">Top Artists</a></li>
|
<li><a href="{% url 'scrobbles:embeddable-top-artists' user_id %}">Top Artists</a></li>
|
||||||
<li><a href="{% url 'scrobbles:embeddable-top-board-games-week' user_id %}">Top Board Games (Week)</a></li>
|
<li><a href="{% url 'scrobbles:embeddable-top-board-games-week' user_id %}">Top Board Games (Week)</a></li>
|
||||||
@ -87,9 +122,6 @@ input:focus {
|
|||||||
<p>
|
<p>
|
||||||
{{ field.label_tag }}
|
{{ field.label_tag }}
|
||||||
{{ field }}
|
{{ field }}
|
||||||
{% if field.errors %}
|
|
||||||
<span class="error">{{ field.errors }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user