]> git.ipfire.org Git - ipfire.org.git/commitdiff
Add a Christmas banner
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 20 Nov 2019 09:57:17 +0000 (09:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 20 Nov 2019 09:57:17 +0000 (09:57 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/scss/style.scss
src/templates/index.html
src/templates/modules/christmas-banner.html [new file with mode: 0644]
src/web/__init__.py
src/web/ui_modules.py

index dcd08a0d737ff347da16fc023a1cdcb2c7feefa5..05b95d925ff91eb960b674bfb2360b89bce0965c 100644 (file)
@@ -213,6 +213,7 @@ templates_mirrors_DATA = \
 templates_mirrorsdir = $(templatesdir)/mirrors
 
 templates_modules_DATA = \
+       src/templates/modules/christmas-banner.html \
        src/templates/modules/map.html \
        src/templates/modules/progress-bar.html
 
index 401590f1a7f32ec217bd25d078c9078a5d168b49..fac51312a259ad00f63e91279c25cfa361156056 100644 (file)
@@ -59,7 +59,7 @@ body {
 }
 
 @each $color, $value in $theme-colors {
-       .btn-glow-#{$color} {
+       .glow-#{$color} {
                color: white;
                background-color: rgba($value, .15);
        }
@@ -140,7 +140,7 @@ header {
                position: relative;
                width: 100%;
                height: auto;
-               min-height: 35rem;
+               min-height: 42rem;
 
                @include media-breakpoint-up(lg) {
                        height: calc(100vh - #{$navbar-height});
index e88688a444ac60fe1a85af92ad337147c047da85..d76bea9f75f54937ff2bb7e793083e29c7dbf334 100644 (file)
@@ -9,8 +9,10 @@
 
 {% block container %}
        <header class="cover">
-               <div class="container d-flex h-100 align-items-center">
-                       <div class="row flex-fill flex-md-row-reverse">
+               <div class="container">
+                       {% module ChristmasBanner() %}
+
+                       <div class="row d-flex h-100 flex-fill flex-md-row-reverse">
                                <div class="col-12 col-md-5 my-5 text-center">
                                        <img class="img-fluid" src="{{ static_url("img/ipfire-tux.png") }}" alt="IPFire Logo" />
                                </div>
@@ -27,8 +29,8 @@
                                        {% end %}
 
                                        <div class="btn-toolbar my-5">
-                                               <a class="btn btn-outline-primary btn-glow-primary btn-lg mr-2" href="/download">{{ _("Download") }}</a>
-                                               <a class="btn btn-outline-secondary btn-glow-secondary btn-lg ml-2" href="/features">{{ _("Features") }}</a>
+                                               <a class="btn btn-outline-primary glow-primary btn-lg mr-2" href="/download">{{ _("Download") }}</a>
+                                               <a class="btn btn-outline-secondary glow-secondary btn-lg ml-2" href="/features">{{ _("Features") }}</a>
                                        </div>
                                </div>
                        </div>
diff --git a/src/templates/modules/christmas-banner.html b/src/templates/modules/christmas-banner.html
new file mode 100644 (file)
index 0000000..ad7e67d
--- /dev/null
@@ -0,0 +1,27 @@
+{% if now.month == 12 %}
+    <div class="container">
+        <div class="card glow-primary border-primary">
+            <div class="card-body">
+                <div class="row">
+                    <div class="col-2 d-flex align-items-center justify-content-center">
+                        <i class="fas fa-gifts fa-2x text-primary"></i>
+                    </div>
+
+                    <div class="col-10 col-lg-6 mb-3 mb-lg-0">
+                        <h6 class="mb-0">{{ _("Give a gift to us for Christmas!") }}</h6>
+
+                        <p class="card-text">
+                            {{ _("Support the IPFire Project with your donation") }}
+                        </p>
+                    </div>
+
+                    <div class="col-12 col-lg-4">
+                        <a class="btn btn-primary btn-block" href="/donate">
+                            {{ _("Give A Gift Today") }}
+                        </a>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+{% end %}
index be51b6a9f55c4234437e9aee5b8c10984526904c..4cead7808aa0795be7956ff72cc6da23acbbe821 100644 (file)
@@ -97,6 +97,7 @@ class Application(tornado.web.Application):
                                "WikiList"             : wiki.WikiListModule,
 
                                # Misc
+                               "ChristmasBanner"      : ui_modules.ChristmasBannerModule,
                                "Markdown"             : ui_modules.MarkdownModule,
                                "Map"                  : ui_modules.MapModule,
                                "ProgressBar"          : ui_modules.ProgressBarModule,
index a0ae5e352e9996b909aa6c376528506d25a130df..b2cbeb788f14ce9400c795e64b5e7b9c6b38fcb2 100644 (file)
@@ -10,6 +10,11 @@ class UIModule(tornado.web.UIModule):
                return self.handler.backend
 
 
+class ChristmasBannerModule(UIModule):
+       def render(self):
+               return self.render_string("modules/christmas-banner.html")
+
+
 class MarkdownModule(UIModule):
        def render(self, markdown):
                return self.backend.blog._render_text(markdown)