Skip to content

Commit adbcb71

Browse files
fsbraunGithub Release Action
andauthored
feat: Updated welcome page (#8057)
* feat: Add cta for support to welcome page * Update message * Add bullet points to welcome message * Two options for welcome message * feat: Update welcome page * Add ecosystem link * Update message * Remove exclamation marks * fix: text-decoration and cursor for button * Improve wording * Remove unwanted file * css finetuning --------- Co-authored-by: Github Release Action <info@django-cms.org>
1 parent 894458e commit adbcb71

File tree

4 files changed

+107
-49
lines changed

4 files changed

+107
-49
lines changed

cms/models/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class PlaceholderField(models.ForeignKey):
1111
"""
1212
.. warning::
13-
This field is for django CMS versions below 4 only. It may only used for migrations.
13+
This field is for django CMS versions below 4 only. It may only be used for migrations.
1414
1515
The ``PlaceholderField`` has been replaced by the :class:`~cms.models.fields.PlaceholderRelationField`,
1616
the built-in migrations will automatically take care of the replacement.

cms/plugin_base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,21 +405,23 @@ def render_close_frame(self, request, obj, extra_context=None):
405405
# This is a nasty edge-case.
406406
# If the parent plugin is a ghost plugin, fetching the plugin tree
407407
# will fail because the downcasting function filters out all ghost plugins.
408-
# Currently this case is only present in the djangocms-text-ckeditor app
408+
# Currently, this case is only present in the djangocms-text-ckeditor app
409409
# which uses ghost plugins to create inline plugins on the text.
410410
root = obj
411411

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

414416
child_classes = self.get_child_classes(
415417
slot=obj.placeholder.slot,
416-
page=obj.page,
418+
page=cms_page,
417419
instance=obj,
418420
)
419421

420422
parent_classes = self.get_parent_classes(
421423
slot=obj.placeholder.slot,
422-
page=obj.page,
424+
page=cms_page,
423425
instance=obj,
424426
)
425427

cms/static/cms/sass/components/_welcome.scss

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,19 @@
2525
display: none;
2626
}
2727

28-
.cms-welcome-section,
29-
.cms-welcome-footer {
30-
box-sizing: border-box;
31-
width: $welcome-width;
32-
min-width: $welcome-min-width;
33-
margin: 0 auto;
34-
}
35-
3628
// header area
3729
.cms-welcome-header {
3830
text-align: center;
31+
h2, p {
32+
text-align: center;
33+
}
34+
h2 {
35+
padding-bottom: 30px;
36+
}
37+
padding-bottom: $padding-normal;
3938
}
4039

41-
.cms-welcome-heading {
40+
h1 {
4241
color: $gray-light;
4342
font-size: 22px;
4443
font-weight: 200;
@@ -50,6 +49,29 @@
5049
}
5150
}
5251

52+
h2 {
53+
font-size: $font-size-large;
54+
font-weight: bold;
55+
padding-bottom: 10px;
56+
}
57+
58+
p.lead {
59+
font-size: $font-size-large;
60+
font-weight: 200;
61+
margin-bottom: $padding-large + 10px;
62+
}
63+
64+
a.cms-btn-action {
65+
@include button-variant($btn-action-color, $btn-action-bgcolor, $btn-action-border);
66+
padding: $padding-normal $padding-large;
67+
font-size: $font-size-normal;
68+
font-weight: bold;
69+
&:hover {
70+
text-decoration: none;
71+
cursor: pointer;
72+
}
73+
}
74+
5375
.cms-welcome-logo {
5476
&,
5577
&:hover,
@@ -62,28 +84,38 @@
6284
width: 200px;
6385
font-size: 35px;
6486
text-decoration: none;
65-
margin: 50px auto 30px;
87+
margin: 50px auto 10px;
6688
}
6789
}
6890

91+
.cms-welcome-cards {
92+
display: grid;
93+
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
94+
gap: 20px;
95+
}
6996
// section area
7097
.cms-welcome-section {
98+
display: inline-block;
7199
box-shadow: 0 0 5px $gray-lighter;
72100
padding: $padding-large;
73-
margin-bottom: 5px;
101+
margin-top: 30px;
102+
margin-bottom: $padding-large;
74103
background: $white;
75-
h2 {
76-
font-size: $font-size-large;
77-
font-weight: bold;
78-
margin: 0 0 15px;
104+
p + h2 {
105+
padding-top: $padding-large;
79106
}
80107
p {
81-
padding: 5px 0;
108+
padding: 2 * $padding-base 0;
109+
}
110+
li {
111+
list-style-type: disc;
112+
margin-inline-start: 1.1em;
82113
}
83114
}
84115

85116
// footer area
86117
.cms-welcome-links {
118+
text-align: center;
87119
padding: 10px 5px;
88120
margin: 0 0 15px;
89121
border-bottom: 1px solid $gray-lighter;

cms/templates/cms/welcome.html

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,67 @@
1717
<header class="cms-welcome-header">
1818
<h1 class="cms-welcome-heading">
1919
<span class="cms-icon cms-icon-check"></span>
20-
{% trans "Installation successful!" %}
20+
{% trans "Welcome to your new django CMS installation!" %}
2121
</h1>
2222
<a href="/" class="cms-welcome-logo">
2323
<span class="cms-hidden">{% trans "django CMS" %}</span>
2424
</a>
25-
</header>
26-
{{ request.version }}
27-
28-
<section class="cms-welcome-section">
2925
<h2>
30-
{% if user.is_authenticated %}
31-
{% trans "Add your first page" %}
32-
{% else %}
33-
{% trans "Please log in" %}
34-
{% endif %}
26+
{% blocktrans %}Version {{ cms_version }}{% endblocktrans %}
3527
</h2>
36-
<p>
37-
{% blocktrans %}
38-
Welcome to django CMS version <strong>{{ cms_version }}</strong>.
39-
{% endblocktrans %}
40-
</p>
41-
<p>
42-
{% url "admin:cms_page_add" as admin_add_page %}
28+
<p class="lead">
4329
{% if user.is_authenticated %}
44-
{% blocktrans %}
45-
<a href="{{ admin_add_page }}" class="js-welcome-add">Add the first page</a> to the system to continue.
46-
{% endblocktrans %}
30+
{% trans "Let’s build something great together!" %}
4731
{% else %}
48-
{% blocktrans %}
49-
JavaScript seems to be disabled so please
50-
<a href="{{ admin_add_page }}" class="js-welcome-add">add a page</a> manually.
51-
{% endblocktrans %}
32+
{% trans "Please log in" %}
5233
{% endif %}
5334
</p>
35+
{% url "admin:cms_page_add" as admin_add_page %}
36+
{% blocktrans %}
37+
<a class="js-welcome-add cms-btn cms-btn-action">Add your first page</a>
38+
{% endblocktrans %}
39+
</header>
40+
41+
<section class="cms-welcome-cards">
42+
<div class="cms-welcome-section">
43+
{% blocktranslate %}
44+
<h2>Help Funding</h2>
45+
<p>
46+
Your funding directly benefits the product, mainly through the
47+
<a href="https://www.django-cms.org/en/fellowship-program/)!">django CMS Fellowship Program</a>!
48+
</p>
49+
<p>
50+
A quick way for yourself or your organisation to donate is on
51+
<a href="https://github.com/sponsors/django-cms">Github Sponsors</a>.
52+
</p>
53+
{% endblocktranslate %}
54+
</div>
55+
<div class="cms-welcome-section">
56+
{% blocktranslate %}
57+
<h2>Join Us</h2>
58+
<p>
59+
The django CMS Association is a non-profit organisation that funds and steers the development of
60+
django CMS.
61+
</p>
62+
<p>
63+
You can <a href="https://www.django-cms.org/en/memberships/">join both as an individual or as an
64+
organisation</a>.
65+
</p>
66+
{% endblocktranslate %}
67+
</div>
68+
<div class="cms-welcome-section">
69+
{% blocktranslate %}
70+
<h2>Contribute</h2>
71+
<ul>
72+
<li><a href="https://www.django-cms.org/en/contribute/">Contribute code:</a> fix a bug or
73+
implement a new feature!</li>
74+
<li><a href="https://www.django-cms.org/en/volunteering-opportunities/">Volunteer:</a>
75+
We offer fun and efficient team work!</li>
76+
<li><a href="https://www.django-cms.org/en/repositories-plugins/">Open-source your work:</a>
77+
Make the ecosystem strong.</li>
78+
</ul>
79+
{% endblocktranslate %}
80+
</div>
5481
</section>
5582

5683
<footer class="cms-welcome-footer">
@@ -59,6 +86,8 @@ <h2 class="cms-hidden">{% trans "Installation Notes" %}</h2>
5986
<a href="//django-cms.org/" target="_blank">{% trans "django CMS" %}</a>
6087
<a href="//django-cms.org/en/support" target="_blank">{% trans "Support" %}</a>
6188
<a href="//docs.django-cms.org/" target="_blank">{% trans "Documentation" %}</a>
89+
<a href="//user-guide.django-cms.org/" target="_blank">{% trans "User guide" %}</a>
90+
<a href="//www.django-cms.org/en/donate/" target="_blank">{% trans "Give back" %}</a>
6291
</p>
6392
{% blocktrans %}
6493
<p class="cms-welcome-notes">If you don't see the django CMS logo at the top, make sure
@@ -91,11 +120,6 @@ <h2 class="cms-hidden">{% trans "Installation Notes" %}</h2>
91120
title: '{% trans "Welcome to django CMS" %}'
92121
});
93122
});
94-
95-
// automatically trigger the modal if sideframe isn't open
96-
if (!CMS.settings.sideframe.url) {
97-
btn.trigger('click');
98-
}
99123
});
100124
{% else %}
101125
window.location.href = '{% url "admin:login" %}?next={{ next_url }}';

0 commit comments

Comments
 (0)