Skip to content

Commit

Permalink
Merge branch 'develop' into ui-reader
Browse files Browse the repository at this point in the history
  • Loading branch information
yl5682 authored Oct 29, 2024
2 parents 44c8520 + e735964 commit dfc216d
Show file tree
Hide file tree
Showing 20 changed files with 302 additions and 241 deletions.
27 changes: 27 additions & 0 deletions apps/cms/migrations/0008_homepage_background_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 3.2.25 on 2024-10-14 17:20

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
("wagtailimages", "0025_alter_image_file_alter_rendition_file"),
("cms", "0007_homepage_featured_video"),
]

operations = [
migrations.AddField(
model_name="homepage",
name="background_image",
field=models.ForeignKey(
blank=True,
help_text="Optional background image for the site header",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtailimages.image",
),
),
]
10 changes: 10 additions & 0 deletions apps/cms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ class HomePage(Page):
collections = Collection.objects.all()[:8]
volumes = Manifest.objects.all()[:8]

background_image = models.ForeignKey(
'wagtailimages.Image',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+',
help_text="Optional background image for the site header",
)

featured_story_title = models.CharField(
help_text="Title of the featured story", blank=True, max_length=255
)
Expand Down Expand Up @@ -286,6 +295,7 @@ class HomePage(Page):

content_panels = Page.content_panels + [
FieldPanel('tagline', classname="full"),
FieldPanel('background_image', classname="full"),
FieldPanel('content_display', classname="full"),
AutocompletePanel('featured_collections', target_model="kollections.Collection"),
FieldPanel('featured_collections_sort_order', classname="full"),
Expand Down
4 changes: 2 additions & 2 deletions apps/readux/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class ManifestSearchForm(forms.Form):
("created_at", "Date added (oldest first)"),
("-date_sort_descending", "Date published (newest first)"),
("date_sort_ascending", "Date published (oldest first)"),
("label_alphabetical", "Label (A-Z)"),
("-label_alphabetical", "Label (Z-A)"),
("label_alphabetical", "Title (A-Z)"),
("-label_alphabetical", "Title (Z-A)"),
("_score", "Relevance"),
),
widget=forms.Select(
Expand Down
40 changes: 40 additions & 0 deletions apps/static/css/readux2/main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
/* base.html */
html, body {
height: 100%;
margin: 0;
display: flex;
flex-direction: column;
}

#v-readux {
flex-grow: 1;
display: flex;
flex-direction: column;
}

main {
flex-grow: 1;
}

.landing {
margin: 0;
padding: 0;
Expand All @@ -21,6 +38,15 @@
.content {
position: relative;
z-index: 2;
min-height: 100vh;
display: flex;
flex-flow: column;
.space {
flex-grow: 1;
}
.uk-section-default:empty {
background-color: transparent;
}
}

.paragraph {
Expand Down Expand Up @@ -598,6 +624,20 @@ iframe {
color: white;
}

.description-button {
transition: ease 0.1s;
&:hover {
background-color: darken(#E60000, 10%);
}
&:active {
background-color: darken(#E60000, 25%);
}
}

.justify-content-normal {
justify-content: normal !important;
}

.unset-min-height {
min-height: unset !important;
}
20 changes: 16 additions & 4 deletions apps/static/css/readux2/search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ form#search-form input[type="search"][name="q"] {
width: 100%;
}

// .uk-button-default {
// font-size: 1.25rem;
// }

#search-grid {
gap: 1.5rem;
}
Expand Down Expand Up @@ -243,4 +239,20 @@ ol#search-results dl {

.selectize-control.plugin-clear_button .clear {
height: 85%;
}

.search-button {
background-color: #E60000;
color: white;
padding: 0 9px;
border:none;
height: 40px;
font-size: 1.25rem;
transition: ease 0.1s;
&:hover {
background-color: darken(#E60000, 10%);
}
&:active {
background-color: darken(#E60000, 25%);
}
}
2 changes: 1 addition & 1 deletion apps/templates/_home/_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="uk-navbar-left">
<div class="uk-logo">
<div><a class="brand-logo" href="/">{{ request.site.name }}</a></div>
<div class="brand-tagline">built on <a class="brand-readux">Readux</a></div>
<div class="brand-tagline">built on <a class="brand-readux" href="https://readux.io/">Readux</a></div>
</div>

{% main_menu add_sub_menus_inline=True %}
Expand Down
56 changes: 49 additions & 7 deletions apps/templates/account/password_reset.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,68 @@
{% extends "account/base.html" %}

{% load sass_tags %}
{% load i18n %}
{% load account %}
{% load crispy_forms_tags %}

{% block head_title %}{% trans "Password Reset" %}{% endblock %}

{% block extra_javascript %}
<script>
document.addEventListener('DOMContentLoaded', function () {
// Get the reset button
const resetBtn = document.getElementById('sign-up-form-reset-btn');

// Add event listener to the reset button
resetBtn.addEventListener('click', function () {
// Get the form by its ID
const form = document.getElementById('password_reset_form');
// Reset the form
form.reset();
});
});
</script>
{% endblock %}

{% block inner %}
<link type="text/css" href="{% sass_src 'css/readux2/menu-inverse.scss' %}" rel="stylesheet">
{% include '_home/_nav.html' %}

<div class="uk-container uk-margin-bottom">
<!-- Breadcrumb -->
<ul class="breadcrumb uk-margin-small-top uk-margin-bottom">
<li><a href="/">Home</a></li>
<li>Password Reset</li>
</ul>
<!-- End -->

<h1 class="page-title uk-margin-top uk-margin-remove-bottom">{% trans "Password Reset" %}</h1>

<h1>{% trans "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}

<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}</p>

<form method="POST" action="{% url 'account_reset_password' %}" class="password_reset">
<form class="uk-form-stacked signup" id="password_reset_form" method="post" action="{% url 'account_reset_password' %}">
{% csrf_token %}
{{ form|crispy }}
<input class="btn btn-primary" type="submit" value="{% trans 'Reset My Password' %}" />
</form>
<!-- Email Field -->
<div class="uk-margin uk-input-icon uk-width-1-1 uk-width-1-2@m">
<span uk-icon="icon: mail" class="uk-icon"></span>
<input type="email" placeholder="{% trans 'Email' %}" class="uk-input" name="email" required>
</div>

<!-- Action Buttons -->
<div class="action-buttons justify-content-normal uk-margin-bottom uk-width-1-1 uk-width-1-2@m">
<button type="button" id="sign-up-form-reset-btn" class="uk-button uk-button-default">{% trans "Reset Form" %}</button>
<button type="submit" class="uk-button sign-in-btn">{% trans "Reset Password" %} </button>
</div>

<!-- Links -->
<div class="uk-flex uk-flex-between uk-width-1-1">
<p>{% blocktrans %}Please <a href="#" class="uk-link text-anchor-blue">contact us</a> if you have any trouble resetting your password.{% endblocktrans %}</p>
</div>
</form>

<p>{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}</p>
</div>
{% endblock %}

21 changes: 19 additions & 2 deletions apps/templates/account/password_reset_done.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
{% extends "account/base.html" %}
{% load sass_tags %}

{% load i18n %}
{% load account %}

{% block head_title %}{% trans "Password Reset" %}{% endblock %}

{% block inner %}
<h1>{% trans "Password Reset" %}</h1>

<link type="text/css" href="{% sass_src 'css/readux2/menu-inverse.scss' %}" rel="stylesheet">
{% include '_home/_nav.html' %}

<div class="uk-container uk-margin-bottom">

<!-- Breadcrumb -->
<ul class="breadcrumb uk-margin-small-top uk-margin-bottom">
<li><a href="/">Home</a></li>
<li>Password Reset</li>
</ul>
<!-- End -->

<h1 class="page-title uk-margin-top uk-margin-remove-bottom">{% trans "Password Reset" %}</h1>

{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}

<p>{% blocktrans %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
<p>{% blocktrans %}We have sent you an e-mail. Please <a href="#" class="uk-link text-anchor-blue">contact us</a> if you do not receive it within a few minutes.{% endblocktrans %}</p>
</div>

</div>
{% endblock %}

17 changes: 16 additions & 1 deletion apps/templates/account/password_set.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
{% extends "account/base.html" %}
{% load sass_tags %}

{% load i18n %}
{% load crispy_forms_tags %}

{% block head_title %}{% trans "Set Password" %}{% endblock %}

{% block inner %}
<h1>{% trans "Set Password" %}</h1>
<link type="text/css" href="{% sass_src 'css/readux2/menu-inverse.scss' %}" rel="stylesheet">
{% include '_home/_nav.html' %}

<div class="uk-container uk-margin-bottom">

<!-- Breadcrumb -->
<ul class="breadcrumb uk-margin-small-top uk-margin-bottom">
<li><a href="/">Home</a></li>
<li>Set Password</li>
</ul>
<!-- End -->

<h1 class="page-title uk-margin-top uk-margin-remove-bottom">{% trans "Set Password" %}</h1>

<form method="POST" action="{% url 'account_set_password' %}" class="password_set">
{% csrf_token %}
{{ form|crispy }}
<input type="submit" name="action" value="{% trans 'Set Password' %}"/>
</form>

</div>
{% endblock %}

Loading

0 comments on commit dfc216d

Please sign in to comment.