Skip to content

feat: Updated welcome page #8057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cms/models/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class PlaceholderField(models.ForeignKey):
"""
.. warning::
This field is for django CMS versions below 4 only. It may only used for migrations.
This field is for django CMS versions below 4 only. It may only be used for migrations.

The ``PlaceholderField`` has been replaced by the :class:`~cms.models.fields.PlaceholderRelationField`,
the built-in migrations will automatically take care of the replacement.
Expand Down
8 changes: 5 additions & 3 deletions cms/plugin_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,23 @@ def render_close_frame(self, request, obj, extra_context=None):
# This is a nasty edge-case.
# If the parent plugin is a ghost plugin, fetching the plugin tree
# will fail because the downcasting function filters out all ghost plugins.
# Currently this case is only present in the djangocms-text-ckeditor app
# Currently, this case is only present in the djangocms-text-ckeditor app
# which uses ghost plugins to create inline plugins on the text.
root = obj

plugins = [root] + list(root.get_descendants())
# simulate the call to the unauthorized CMSPlugin.page property
cms_page = obj.placeholder.page if obj.placeholder_id else None

child_classes = self.get_child_classes(
slot=obj.placeholder.slot,
page=obj.page,
page=cms_page,
instance=obj,
)

parent_classes = self.get_parent_classes(
slot=obj.placeholder.slot,
page=obj.page,
page=cms_page,
instance=obj,
)

Expand Down
64 changes: 48 additions & 16 deletions cms/static/cms/sass/components/_welcome.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@
display: none;
}

.cms-welcome-section,
.cms-welcome-footer {
box-sizing: border-box;
width: $welcome-width;
min-width: $welcome-min-width;
margin: 0 auto;
}

// header area
.cms-welcome-header {
text-align: center;
h2, p {
text-align: center;
}
h2 {
padding-bottom: 30px;
}
padding-bottom: $padding-normal;
}

.cms-welcome-heading {
h1 {
color: $gray-light;
font-size: 22px;
font-weight: 200;
Expand All @@ -50,6 +49,29 @@
}
}

h2 {
font-size: $font-size-large;
font-weight: bold;
padding-bottom: 10px;
}

p.lead {
font-size: $font-size-large;
font-weight: 200;
margin-bottom: $padding-large + 10px;
}

a.cms-btn-action {
@include button-variant($btn-action-color, $btn-action-bgcolor, $btn-action-border);
padding: $padding-normal $padding-large;
font-size: $font-size-normal;
font-weight: bold;
&:hover {
text-decoration: none;
cursor: pointer;
}
}

.cms-welcome-logo {
&,
&:hover,
Expand All @@ -62,28 +84,38 @@
width: 200px;
font-size: 35px;
text-decoration: none;
margin: 50px auto 30px;
margin: 50px auto 10px;
}
}

.cms-welcome-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 20px;
}
// section area
.cms-welcome-section {
display: inline-block;
box-shadow: 0 0 5px $gray-lighter;
padding: $padding-large;
margin-bottom: 5px;
margin-top: 30px;
margin-bottom: $padding-large;
background: $white;
h2 {
font-size: $font-size-large;
font-weight: bold;
margin: 0 0 15px;
p + h2 {
padding-top: $padding-large;
}
p {
padding: 5px 0;
padding: 2 * $padding-base 0;
}
li {
list-style-type: disc;
margin-inline-start: 1.1em;
}
}

// footer area
.cms-welcome-links {
text-align: center;
padding: 10px 5px;
margin: 0 0 15px;
border-bottom: 1px solid $gray-lighter;
Expand Down
82 changes: 53 additions & 29 deletions cms/templates/cms/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,67 @@
<header class="cms-welcome-header">
<h1 class="cms-welcome-heading">
<span class="cms-icon cms-icon-check"></span>
{% trans "Installation successful!" %}
{% trans "Welcome to your new django CMS installation!" %}
</h1>
<a href="/" class="cms-welcome-logo">
<span class="cms-hidden">{% trans "django CMS" %}</span>
</a>
</header>
{{ request.version }}

<section class="cms-welcome-section">
<h2>
{% if user.is_authenticated %}
{% trans "Add your first page" %}
{% else %}
{% trans "Please log in" %}
{% endif %}
{% blocktrans %}Version {{ cms_version }}{% endblocktrans %}
</h2>
<p>
{% blocktrans %}
Welcome to django CMS version <strong>{{ cms_version }}</strong>.
{% endblocktrans %}
</p>
<p>
{% url "admin:cms_page_add" as admin_add_page %}
<p class="lead">
{% if user.is_authenticated %}
{% blocktrans %}
<a href="{{ admin_add_page }}" class="js-welcome-add">Add the first page</a> to the system to continue.
{% endblocktrans %}
{% trans "Let’s build something great together!" %}
{% else %}
{% blocktrans %}
JavaScript seems to be disabled so please
<a href="{{ admin_add_page }}" class="js-welcome-add">add a page</a> manually.
{% endblocktrans %}
{% trans "Please log in" %}
{% endif %}
</p>
{% url "admin:cms_page_add" as admin_add_page %}
{% blocktrans %}
<a class="js-welcome-add cms-btn cms-btn-action">Add your first page</a>
{% endblocktrans %}
</header>

<section class="cms-welcome-cards">
<div class="cms-welcome-section">
{% blocktranslate %}
<h2>Help Funding</h2>
<p>
Your funding directly benefits the product, mainly through the
<a href="https://www.django-cms.org/en/fellowship-program/)!">django CMS Fellowship Program</a>!
</p>
<p>
A quick way for yourself or your organisation to donate is on
<a href="https://github.com/sponsors/django-cms">Github Sponsors</a>.
</p>
{% endblocktranslate %}
</div>
<div class="cms-welcome-section">
{% blocktranslate %}
<h2>Join Us</h2>
<p>
The django CMS Association is a non-profit organisation that funds and steers the development of
django CMS.
</p>
<p>
You can <a href="https://www.django-cms.org/en/memberships/">join both as an individual or as an
organisation</a>.
</p>
{% endblocktranslate %}
</div>
<div class="cms-welcome-section">
{% blocktranslate %}
<h2>Contribute</h2>
<ul>
<li><a href="https://www.django-cms.org/en/contribute/">Contribute code:</a> fix a bug or
implement a new feature!</li>
<li><a href="https://www.django-cms.org/en/volunteering-opportunities/">Volunteer:</a>
We offer fun and efficient team work!</li>
<li><a href="https://www.django-cms.org/en/repositories-plugins/">Open-source your work:</a>
Make the ecosystem strong.</li>
</ul>
{% endblocktranslate %}
</div>
</section>

<footer class="cms-welcome-footer">
Expand All @@ -59,6 +86,8 @@ <h2 class="cms-hidden">{% trans "Installation Notes" %}</h2>
<a href="//django-cms.org/" target="_blank">{% trans "django CMS" %}</a>
<a href="//django-cms.org/en/support" target="_blank">{% trans "Support" %}</a>
<a href="//docs.django-cms.org/" target="_blank">{% trans "Documentation" %}</a>
<a href="//user-guide.django-cms.org/" target="_blank">{% trans "User guide" %}</a>
<a href="//www.django-cms.org/en/donate/" target="_blank">{% trans "Give back" %}</a>
</p>
{% blocktrans %}
<p class="cms-welcome-notes">If you don't see the django CMS logo at the top, make sure
Expand Down Expand Up @@ -91,11 +120,6 @@ <h2 class="cms-hidden">{% trans "Installation Notes" %}</h2>
title: '{% trans "Welcome to django CMS" %}'
});
});

// automatically trigger the modal if sideframe isn't open
if (!CMS.settings.sideframe.url) {
btn.trigger('click');
}
});
{% else %}
window.location.href = '{% url "admin:login" %}?next={{ next_url }}';
Expand Down