From 4428266488617848c0d58d787c1435e5d1db70bd Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Sat, 24 Jul 2021 12:38:23 +0200 Subject: [PATCH] migrate panels to cards --- config/config.default.php | 16 +++++ .../controller/user_angeltypes_controller.php | 2 +- .../user_driver_licenses_controller.php | 2 +- includes/sys_menu.php | 2 +- includes/sys_template.php | 23 +++---- includes/view/UserHintsRenderer.php | 2 +- includes/view/User_view.php | 6 +- resources/assets/js/vendor.js | 2 +- resources/assets/themes/base.scss | 20 ++++++ resources/assets/themes/cyborg_variables.scss | 5 +- resources/assets/themes/theme0.scss | 6 +- resources/assets/themes/theme1.scss | 16 +++-- resources/views/macros/base.twig | 8 ++- resources/views/pages/faq/edit.twig | 11 ++- resources/views/pages/faq/overview.twig | 26 +++---- resources/views/pages/news/edit.twig | 17 ++--- resources/views/pages/news/news.twig | 19 +++-- resources/views/pages/news/overview.twig | 69 ++++++++++--------- resources/views/pages/questions/edit.twig | 14 ++-- resources/views/pages/questions/overview.twig | 38 +++++----- 20 files changed, 179 insertions(+), 125 deletions(-) diff --git a/config/config.default.php b/config/config.default.php index e9e0a265..9a6ef393 100644 --- a/config/config.default.php +++ b/config/config.default.php @@ -109,66 +109,82 @@ return [ 'themes' => [ 15 => [ 'name' => 'Engelsystem DiVOC R2R', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 14 => [ 'name' => 'Engelsystem rC3 teal (2020)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 13 => [ 'name' => 'Engelsystem rC3 violet (2020)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 12 => [ 'name' => 'Engelsystem 36c3 (2019)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 10 => [ 'name' => 'Engelsystem cccamp19 green (2019)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 9 => [ 'name' => 'Engelsystem cccamp19 yellow (2019)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 8 => [ 'name' => 'Engelsystem cccamp19 blue (2019)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 7 => [ 'name' => 'Engelsystem 35c3 dark (2018)', + 'type' => 'dark', 'navbar_classes' => 'navbar-primary bg-black border-primary', ], 6 => [ 'name' => 'Engelsystem 34c3 dark (2017)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 5 => [ 'name' => 'Engelsystem 34c3 light (2017)', + 'type' => 'light', 'navbar_classes' => 'navbar-light bg-light', ], 4 => [ 'name' => 'Engelsystem 33c3 (2016)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-darker border-dark', ], 3 => [ 'name' => 'Engelsystem 32c3 (2015)', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 2 => [ 'name' => 'Engelsystem cccamp15', + 'type' => 'light', 'navbar_classes' => 'navbar-light bg-light', ], 11 => [ 'name' => 'Engelsystem high contrast', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], 0 => [ 'name' => 'Engelsystem light', + 'type' => 'light', 'navbar_classes' => 'navbar-light bg-light', ], 1 => [ 'name' => 'Engelsystem dark', + 'type' => 'dark', 'navbar_classes' => 'navbar-dark bg-black border-dark', ], ], diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php index 038d919e..42fcf948 100644 --- a/includes/controller/user_angeltypes_controller.php +++ b/includes/controller/user_angeltypes_controller.php @@ -16,7 +16,7 @@ function user_angeltypes_unconfirmed_hint() $unconfirmed_links = []; foreach ($unconfirmed_user_angeltypes as $user_angeltype) { - $unconfirmed_links[] = '' . $user_angeltype['name'] . ' (+' . $user_angeltype['count'] . ')' diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php index e6924182..55b7696a 100644 --- a/includes/controller/user_driver_licenses_controller.php +++ b/includes/controller/user_driver_licenses_controller.php @@ -24,7 +24,7 @@ function user_driver_license_required_hint() if ($angeltype['requires_driver_license']) { return sprintf( __('You joined an angeltype which requires a driving license. Please edit your driving license information here: %s.'), - '' . __('driving license information') . '' + '' . __('driving license information') . '' ); } } diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 0d653b2f..510cb11e 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -239,7 +239,7 @@ function admin_new_questions() return null; } - return '' + return '' . __('There are unanswered questions!') . ''; } diff --git a/includes/sys_template.php b/includes/sys_template.php index 2ed37d19..c4b0b09e 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -252,21 +252,20 @@ EOT; function toolbar_popover($icon, $label, $content, $class = '') { $dom_id = md5(microtime() . $icon . $label); - return ''; } diff --git a/includes/view/UserHintsRenderer.php b/includes/view/UserHintsRenderer.php index 3c016426..c9496652 100644 --- a/includes/view/UserHintsRenderer.php +++ b/includes/view/UserHintsRenderer.php @@ -21,7 +21,7 @@ class UserHintsRenderer $icon = $this->important ? 'exclamation-triangle' : 'info-circle'; return toolbar_popover( - $icon . ' text-' . $hint_class, '', $this->hints, 'bg-' . $hint_class + $icon . ' text-white', '', $this->hints, 'bg-' . $hint_class ); } diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 3420402d..0d086cc2 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -934,7 +934,7 @@ function render_user_departure_date_hint() { if (config('enable_planned_arrival') && !auth()->user()->personalData->planned_departure_date) { $text = __('Please enter your planned date of departure on your settings page to give us a feeling for teardown capacities.'); - return render_profile_link($text, null, 'alert-link'); + return render_profile_link($text, null, 'text-danger'); } return null; @@ -980,7 +980,7 @@ function render_user_tshirt_hint() { if (config('enable_tshirt_size') && !auth()->user()->personalData->shirt_size) { $text = __('You need to specify a tshirt size in your settings!'); - return render_profile_link($text, null, 'alert-link'); + return render_profile_link($text, null, 'text-danger'); } return null; @@ -994,7 +994,7 @@ function render_user_dect_hint() $user = auth()->user(); if ($user->state->arrived && config('enable_dect') && !$user->contact->dect) { $text = __('You need to specify a DECT phone number in your settings! If you don\'t have a DECT phone, just enter \'-\'.'); - return render_profile_link($text, null, 'alert-link'); + return render_profile_link($text, null, 'text-danger'); } return null; diff --git a/resources/assets/js/vendor.js b/resources/assets/js/vendor.js index 1341a1e6..e0fc09f2 100644 --- a/resources/assets/js/vendor.js +++ b/resources/assets/js/vendor.js @@ -1,7 +1,7 @@ require('core-js/stable'); window.$ = window.jQuery = require('jquery'); require('jquery-ui'); -require('bootstrap'); +window.bootstrap = require('bootstrap'); window.moment = require('moment'); require('moment/locale/de'); require('eonasdan-bootstrap-datetimepicker'); diff --git a/resources/assets/themes/base.scss b/resources/assets/themes/base.scss index f5da7c64..2221eeba 100644 --- a/resources/assets/themes/base.scss +++ b/resources/assets/themes/base.scss @@ -32,6 +32,14 @@ body { color: $text-muted; } +.text-inherit { + color: inherit; + + &:hover { + color: inherit; + } +} + .text-big { display: block; font-size: 30px; @@ -62,6 +70,14 @@ a .icon-icon_angel { background-color: $body-color; } +.nav-item--userhints { + margin: -$navbar-padding-y 0; +} + +.popover--userhints .alert:last-of-type { + margin-bottom: 0; +} + table a > .icon-icon_angel { background-color: $body-color; } @@ -291,6 +307,10 @@ span.ref-id[id] { } } +.card-body > *:last-child { + margin-bottom: 0; +} + @keyframes pulse { 0% { transform: rotate(0deg); diff --git a/resources/assets/themes/cyborg_variables.scss b/resources/assets/themes/cyborg_variables.scss index 0a18042e..d0d13fa9 100644 --- a/resources/assets/themes/cyborg_variables.scss +++ b/resources/assets/themes/cyborg_variables.scss @@ -72,7 +72,7 @@ $font-family-sans-serif: 'Montserrat', Helvetica Neue, Helvetica, Arial, sans-se $font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace; $font-family-base: $font-family-sans-serif; -$font-size-base: .875rem; +$font-size-base: 1rem; $font-size-large: ceil(($font-size-base * 1.25)); // ~18px $font-size-small: ceil(($font-size-base * 0.85)); // ~12px @@ -84,7 +84,8 @@ $font-size-h5: 20px; $font-size-h6: 16px; //** Unit-less `line-height` for use in components like buttons. -$line-height-base: 1.428571429; // 20/14 +$line-height-base: 1.5; + //** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc. $line-height-computed: floor(($font-size-base * $line-height-base)); // ~20px diff --git a/resources/assets/themes/theme0.scss b/resources/assets/themes/theme0.scss index 53d56b88..a59c740e 100644 --- a/resources/assets/themes/theme0.scss +++ b/resources/assets/themes/theme0.scss @@ -1,2 +1,6 @@ -// light +// light theme + +$primary: #337ab7; +$light: #f5f5f5; + @import "base.scss"; diff --git a/resources/assets/themes/theme1.scss b/resources/assets/themes/theme1.scss index 11d11411..260e8348 100644 --- a/resources/assets/themes/theme1.scss +++ b/resources/assets/themes/theme1.scss @@ -8,11 +8,12 @@ $gray-dark: #282828; $gray-light: #888; $gray-lighter: #ADAFAE; -$primary: #437aca; -$success: #00c960; -$info: #3dbddf; -$warning: #f6b345; -$danger: #e93a44; +$primary: #437aca; +$secondary: #424242; +$success: #00c960; +$info: #3dbddf; +$warning: #f6b345; +$danger: #e93a44; $text-muted: $gray-light; @@ -63,6 +64,11 @@ $alert-color-scale: 0%; .alert { color: #fff !important; + + .text-danger, + .text-info { + color: #fff !important; + } } // dark diff --git a/resources/views/macros/base.twig b/resources/views/macros/base.twig index 0ea91efe..f1113697 100644 --- a/resources/views/macros/base.twig +++ b/resources/views/macros/base.twig @@ -2,8 +2,8 @@ {% endmacro %} -{% macro icon(icon) %} - +{% macro icon(icon, color) %} + {% endmacro %} {% macro alert(message, type) %} @@ -27,3 +27,7 @@ {% macro info(text) %} {{ _self.icon('info-lg') }}{{ text }} {%- endmacro %} + +{% macro type_bg_class() -%} + {% if theme.type == 'light' %}bg-white{% else %}bg-dark{% endif %} +{%- endmacro %} diff --git a/resources/views/pages/faq/edit.twig b/resources/views/pages/faq/edit.twig index 9be91605..dbc97b74 100644 --- a/resources/views/pages/faq/edit.twig +++ b/resources/views/pages/faq/edit.twig @@ -29,7 +29,7 @@
{{ csrf() }} -
+
{{ f.input('question', __('faq.question'), null, {'required': true, 'value': faq ? faq.question : ''}) }}
@@ -38,7 +38,7 @@ {{ f.submit() }} - {{ f.submit(m.icon('eye-slash'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} + {{ f.submit(m.icon('eye'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} {% if faq and faq.id %} {{ f.submit(m.icon('trash'), {'name': 'delete', 'btn_type': 'danger', 'title': __('form.delete')}) }} @@ -51,12 +51,11 @@

{{ __('form.preview') }}

-
-
+
+
{{ faq.question }}
- -
+
{{ faq.text|markdown }}
diff --git a/resources/views/pages/faq/overview.twig b/resources/views/pages/faq/overview.twig index 6e8e7948..853e72c2 100644 --- a/resources/views/pages/faq/overview.twig +++ b/resources/views/pages/faq/overview.twig @@ -30,26 +30,26 @@ {% for item in items %}
-
-
-

- {{ item.question }} - - {{ m.icon('link') }} - -

+
+
+ {{ item.question }} + + {{ m.icon('link') }} +
-
+
{{ item.text|markdown }}
-
-
+
{{ f.textarea('text', __('news.edit.message'), {'required': true, 'rows': 10, 'value': news ? news.text : ''}) }} {{ f.submit() }} - {{ f.submit(m.icon('eye-slash'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} + {{ f.submit(m.icon('eye'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} {% if news and news.id %} {{ f.submit(m.icon('trash'), {'name': 'delete', 'btn_type': 'danger', 'title': __('form.delete')}) }} @@ -65,15 +65,12 @@

{{ __('form.preview') }}

-
-
-

- {% if news.is_meeting %}{{ __('news.is_meeting') }}{% endif %} - {{ news.title }} -

+
+
+ {% if news.is_meeting %}{{ __('news.is_meeting') }}{% endif %} + {{ news.title }}
- -
+
{{ news.text|raw|markdown(false) }}
diff --git a/resources/views/pages/news/news.twig b/resources/views/pages/news/news.twig index e3f8f456..dc3e8770 100644 --- a/resources/views/pages/news/news.twig +++ b/resources/views/pages/news/news.twig @@ -9,18 +9,19 @@ {% endblock %} {% block comments %} -
+

{{ __('news.comments') }}

{% for comment in news.comments %} -
-
+
+
{{ comment.text|nl2br }}
- @@ -30,14 +31,12 @@ {% block write_comment %} {% if has_permission_to('news_comments') %} -
+

{{ __('news.comments.new') }}

{{ csrf() }} - {{ f.textarea('comment', __('news.comments.message'), {'required': true}) }} - {{ f.submit() }}
diff --git a/resources/views/pages/news/overview.twig b/resources/views/pages/news/overview.twig index d0ce481e..bb254e38 100644 --- a/resources/views/pages/news/overview.twig +++ b/resources/views/pages/news/overview.twig @@ -48,48 +48,53 @@ {% endblock %} {% macro news(news, show_comments_link, is_overview) %} -
+
{% if is_overview|default(false) %} -
-

- - {% if news.is_pinned %}{{ m.icon('pin-angle') }}{% endif %} - {% if news.is_meeting %}{{ __('news.is_meeting') }}{% endif %} - {{ news.title }} - -

+ {% endif %} -
+
{{ news.text|raw|markdown(false) }}
- {% if question %} -
+

{{ __('form.preview') }}

-
-
+
+
{{ question.text|nl2br }}
{% if question.answer %} -
-
-
+
+
+
{{ question.answer|markdown }}
diff --git a/resources/views/pages/questions/overview.twig b/resources/views/pages/questions/overview.twig index ae6ef3d9..7e629465 100644 --- a/resources/views/pages/questions/overview.twig +++ b/resources/views/pages/questions/overview.twig @@ -25,26 +25,29 @@
{% block questions %} {% for question in questions %} -
+
-
-
+
+
{{ question.text|nl2br }}
-
{% if question.answer %} -
-
-
+
+
+
{{ question.answer|markdown }}
-
{% endif %} -
+
{% endfor %} {% endblock %}