From 7e7ede8cb45e1b43f61b88ad70c7188de9b7bc2a Mon Sep 17 00:00:00 2001 From: hoan-infra Date: Fri, 19 Mar 2021 17:48:04 +0100 Subject: [PATCH 01/11] start with sass in webpack --- assets/css/app.scss | 19 +++ assets/css/{app.css => app_old.css} | 0 assets/css/helper/_variables.scss | 11 ++ assets/css/layout/_fonts.scss | 13 ++ assets/css/layout/_header.scss | 233 ++++++++++++++++++++++++++++ assets/css/layout/_main.scss | 74 +++++++++ assets/css/layout/_navbar.scss | 22 +++ assets/css/static.css | 9 ++ assets/css/style.css | 92 ----------- assets/js/app.js | 3 +- assets/js/frontend.js | 2 +- package-lock.json | 92 ++++++++--- package.json | 4 +- webpack.config.js | 4 +- 14 files changed, 461 insertions(+), 117 deletions(-) create mode 100644 assets/css/app.scss rename assets/css/{app.css => app_old.css} (100%) create mode 100644 assets/css/helper/_variables.scss create mode 100644 assets/css/layout/_fonts.scss create mode 100644 assets/css/layout/_header.scss create mode 100644 assets/css/layout/_main.scss create mode 100644 assets/css/layout/_navbar.scss create mode 100644 assets/css/static.css diff --git a/assets/css/app.scss b/assets/css/app.scss new file mode 100644 index 000000000..ba76f8845 --- /dev/null +++ b/assets/css/app.scss @@ -0,0 +1,19 @@ +@import "~bootstrap/dist/css/bootstrap.min.css"; +@import "~bootstrap/dist/css/bootstrap.min.css"; +@import '~@fortawesome/fontawesome-free/css/all.css'; +@import '~mdbootstrap/css/bootstrap.css'; +@import '~mdbootstrap/css/mdb.css'; +@import "~flatpickr/dist/flatpickr.min.css"; +@import "~jquery-confirm/css/jquery-confirm.css"; +@import '~h2-invent-apps/css/h2-invent-apps.css'; +@import '~@fullcalendar/common/main.css'; +@import '~@fullcalendar/daygrid/main.css'; + + +@import "./helper/variables"; +@import "./layout/fonts"; + +@import "./layout/main"; +@import "./layout/header"; +@import "./layout/navbar"; + diff --git a/assets/css/app.css b/assets/css/app_old.css similarity index 100% rename from assets/css/app.css rename to assets/css/app_old.css diff --git a/assets/css/helper/_variables.scss b/assets/css/helper/_variables.scss new file mode 100644 index 000000000..10069ce1f --- /dev/null +++ b/assets/css/helper/_variables.scss @@ -0,0 +1,11 @@ +$main-color: rgb(0, 88, 176); +$main-color-hover: rgb(0, 158, 251); +$main-color-activ: rgb(179, 230, 255); +$sec-color: rgb(245, 26, 32); +$sec-color-hover: rgb(201, 2, 0); +$sec-color-activ: rgb(244, 105, 104); +$contrast-base: rgb(85, 83, 80); +$contrast-dark: rgb(23, 21, 18); +$contrast-light: rgb(144, 142, 140); +$contrast-extra-light: rgb(255, 255, 255); +$contrast-white: rgb(253, 253, 253); \ No newline at end of file diff --git a/assets/css/layout/_fonts.scss b/assets/css/layout/_fonts.scss new file mode 100644 index 000000000..52f1bd056 --- /dev/null +++ b/assets/css/layout/_fonts.scss @@ -0,0 +1,13 @@ +/* poppins-regular - latin */ +@font-face { + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + src: url('../../../public/fonts/poppins-v9-latin-regular.eot'); /* IE9 Compat Modes */ + src: local('Poppins Regular'), local('Poppins-Regular'), + url('../../../public/fonts/poppins-v9-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../../../public/fonts/poppins-v9-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../../../public/fonts/poppins-v9-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../../../public/fonts/poppins-v9-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../../../public/fonts/poppins-v9-latin-regular.svg#Poppins') format('svg'); /* Legacy iOS */ +} diff --git a/assets/css/layout/_header.scss b/assets/css/layout/_header.scss new file mode 100644 index 000000000..fa50e19a2 --- /dev/null +++ b/assets/css/layout/_header.scss @@ -0,0 +1,233 @@ + +/* --------------------------------------------------- + CONTENT STYLE +----------------------------------------------------- */ + + + +/* --------------------------------------------------- + MEDIAQUERIES +----------------------------------------------------- */ + +@media (max-width: 1500px) { + #sidebar { + margin-left: -250px; + } + + #sidebar.active { + margin-left: 0; + } + + #sidebarCollapse span { + display: none; + } +} + + +/* --------------------------------------------------- + Add Reuqired Symbole to Forms +----------------------------------------------------- */ + +label.required:after { + content: " *"; +} + + +/* --------------------------------------------------- + Add Sticky Footer + id="content" need padding-bottom and the size of the footer +----------------------------------------------------- */ + +#mainContent { + position: relative; + min-height: 100%; + height: auto !important; + height: 100%; + background-color: whitesmoke +} + +#footer { + position: absolute; + bottom: 0px; +} + + + + + +#snackbar { + visibility: hidden; + width: 100%; + + background-color: #4b515d; + color: #fff; + text-align: center; + border-radius: 2px; + padding: 16px; + position: fixed; + z-index: 1; + right: 0; + bottom: 0; + font-size: 17px; +} + +#snackbar.show { + visibility: visible; + -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; + animation: fadein 0.5s, fadeout 0.5s 2.5s; +} + +@-webkit-keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + to { + bottom: 0; + opacity: 1; + } +} + +@keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + to { + bottom: 0; + opacity: 1; + } +} + +@-webkit-keyframes fadeout { + from { + bottom: 0; + opacity: 1; + } + to { + bottom: 0; + opacity: 0; + } +} + +@keyframes fadeout { + from { + bottom: 0; + opacity: 1; + } + to { + bottom: 0; + opacity: 0; + } +} + +.dropdown-toggle::after { + content: none !important; +} + + +.headerBorder:hover { + animation-play-state: paused; +} + + +/* MDB Scrollbar */ +.scrollbar-deep-purple::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); + background-color: transparent; + border-radius: 10px; +} + +.scrollbar-deep-purple::-webkit-scrollbar { + width: 12px; + background-color: transparent; +} + +.scrollbar-deep-purple::-webkit-scrollbar-thumb { + border-radius: 10px; + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); + background-color: $main-color; +} + +.scrollbar-deep-purple { + scrollbar-color: $main-color; +} + + +.bordered-deep-purple::-webkit-scrollbar-track { + -webkit-box-shadow: none; + border: 1px solid $main-color; +} + +.bordered-deep-purple::-webkit-scrollbar-thumb { + -webkit-box-shadow: none; +} + + +.thin::-webkit-scrollbar { + width: 10px; +} + +@media only screen and (min-width: 992px){ + .hide { + display: flex; + flex-direction: row!important; + justify-content: flex-end!important; + align-items: center; + } + + .triggerHide:hover .element { + visibility: visible; + opacity: 1; + transition: visibility 0s linear 0s, opacity 500ms; + } + .triggerHide .element { + visibility: hidden; + opacity: 0; + transition: visibility 0s linear 0s, opacity 500ms; + } + +} +.hide{ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + +} +.caretdown[aria-expanded="false"]:before{ + margin-right: 4px; + font-family: "Font Awesome 5 Free"; + font-weight: 900; + content: "\f0d7";; +} +.caretdown[aria-expanded="true"]:before{ + margin-right: 4px; + font-family: "Font Awesome 5 Free"; + font-weight: 900; + content: "\f0d8";; +} +.iconSytle{ + max-height: 25px; +} + +.iconSytle:Hover { + webkit-filter: drop-shadow(2px 2px 3px #9C9C9C); + filter: drop-shadow(2px 2px 3px #9c9c9c); +} + +@media only screen and (min-width: 768px) { + .iconSytle { + max-height: 30px; + } +} +.breakWord{ + word-break: break-all; + padding-right: 5px; +} +.noBreak{ + white-space: nowrap; +} +#modalAdressbook a[aria-expanded="true"] { + background: white; +} diff --git a/assets/css/layout/_main.scss b/assets/css/layout/_main.scss new file mode 100644 index 000000000..f9857286b --- /dev/null +++ b/assets/css/layout/_main.scss @@ -0,0 +1,74 @@ +/* --------------------------------------------------- + Body Config +----------------------------------------------------- */ +body { + font-family: 'Poppins'; +} + +/* --------------------------------------------------- + Paragraph Setting +----------------------------------------------------- */ +p { + font-family: 'Poppins'; + font-size: 1.1em; + font-weight: 300; + line-height: 1.7em; + color: #000; +} + +/* --------------------------------------------------- + Define Links +----------------------------------------------------- */ +a { + color: $contrast-dark; + + &:hover { + color: $sec-color-hover; + } + + &:focus { + color: $sec-color-activ; + text-decoration: none; + transition: all 0.3s; + } + +} + +/* --------------------------------------------------- + Base Line +----------------------------------------------------- */ +.line { + width: 100%; + height: 1px; + border-bottom: 1px dashed #ddd; + margin: 40px 0; +} + +/* --------------------------------------------------- + Content +----------------------------------------------------- */ +#content { + width: 100%; + padding: 20px; + min-height: 100vh; + transition: all 0.3s; + position: absolute; + padding-bottom: 80px; + top: 0; + right: 0; +} + +/* --------------------------------------------------- + Custom Buttons +----------------------------------------------------- */ +.btn-primary { + background-color: $main-color !important; +} + +.btn-secondary { + background-color: $sec-color !important; +} + +.btn-info { + background-color: $contrast-dark !important; +} \ No newline at end of file diff --git a/assets/css/layout/_navbar.scss b/assets/css/layout/_navbar.scss new file mode 100644 index 000000000..369255c73 --- /dev/null +++ b/assets/css/layout/_navbar.scss @@ -0,0 +1,22 @@ +.navbar { + padding: 15px 10px; + background: #fff; + border: none; + border-radius: 0; + margin-bottom: 40px; +} + +.navbar-btn { + box-shadow: none; + outline: none !important; + border: none; +} + +.navbar-btn-navigation { + background: linear-gradient(90deg, #1CB5E0 0%, #000880 100%); + color: #fff; + + &:hover { + color: #efefef !important; + } +} diff --git a/assets/css/static.css b/assets/css/static.css new file mode 100644 index 000000000..bfc0b5988 --- /dev/null +++ b/assets/css/static.css @@ -0,0 +1,9 @@ +@import "~bootstrap/dist/css/bootstrap.min.css"; +@import '~@fortawesome/fontawesome-free/css/all.css'; +@import '~mdbootstrap/css/bootstrap.css'; +@import '~mdbootstrap/css/mdb.css'; +@import "~flatpickr/dist/flatpickr.min.css"; +@import "~jquery-confirm/css/jquery-confirm.css"; +@import '~h2-invent-apps/css/h2-invent-apps.css'; +@import '~@fullcalendar/common/main.css'; +@import '~@fullcalendar/daygrid/main.css'; \ No newline at end of file diff --git a/assets/css/style.css b/assets/css/style.css index d7e675173..3e389bbbd 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -16,82 +16,6 @@ --contrast-white: rgb(253, 253, 253); } -/* Background Colors items*/ -.bg-vvt { - background-color: #34ce57; - color: black !important; -} - -.bg-dsfa { - background-color: #00e676; - color: black !important; -} - -.bg-audit { - background-color: #00e5ff; - color: black !important; -} - -.bg-tom { - background-color: #0e4377; - color: whitesmoke !important; -} - -.bg-daten { - background-color: #6f42c1; - color: whitesmoke !important; -} - -.bg-av { - background-color: #7e57c2; - color: whitesmoke !important; -} - -.bg-kontakt { - background-color: #6a1b9a; - color: whitesmoke !important; -} - -.bg-akademie { - background-color: #ba8b00; - color: black !important; -} - -.bg-vorfall { - background-color: #ff1744; - color: whitesmoke !important; -} - -.bg-forms { - background-color: #996800; - color: whitesmoke !important; -} - -.bg-policy { - background-color: #4b515d; - color: whitesmoke !important; -} - -.bg-software { - background-color: #2E9AFE; - color: whitesmoke !important; -} - -.bg-config { - background-color: #2E9AFE; - color: whitesmoke !important; -} - -.bg-tasks { - background-color: #789339; - color: whitesmoke !important; -} - -.bg-request { - background-color: #0b2e13; - color: whitesmoke !important; -} - /* poppins-regular - latin */ @font-face { font-family: 'Poppins'; @@ -163,22 +87,6 @@ a:focus { align-items: stretch; } -#sidebar { - width: 250px; - position: fixed; - top: 0; - left: -250px; - height: 100vh; - z-index: 999; - background-image: url("/images/navigation.jpg"); - background-repeat: no-repeat; - background-size: cover; - color: #000000; - transition: all 0.3s; - overflow-y: scroll; - box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2); -} - #sidebar.active { left: 0; } diff --git a/assets/js/app.js b/assets/js/app.js index 47da10659..e415247d5 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -2,7 +2,8 @@ * Welcome to your app's main JavaScript file! * */ -import '../css/app.css'; +import '../css/app.scss'; +//import(/* webpackChunkName: "H2" */ '../css/app.scss'); import $ from 'jquery'; global.$ = global.jQuery = $; diff --git a/assets/js/frontend.js b/assets/js/frontend.js index 779cbc2bd..7b8e35151 100644 --- a/assets/js/frontend.js +++ b/assets/js/frontend.js @@ -2,7 +2,7 @@ * Welcome to your app's main JavaScript file! * */ -import '../css/app.css'; +import(/* webpackChunkName: "H2" */ '../css/app.scss'); import $ from 'jquery'; diff --git a/package-lock.json b/package-lock.json index cd56edaa1..5c8961d84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1651,8 +1651,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "optional": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -1934,9 +1932,7 @@ "binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true, - "optional": true + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" }, "bluebird": { "version": "3.7.2", @@ -2372,8 +2368,6 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", - "dev": true, - "optional": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", @@ -2389,8 +2383,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "optional": true, "requires": { "fill-range": "^7.0.1" } @@ -2399,8 +2391,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "optional": true, "requires": { "to-regex-range": "^5.0.1" } @@ -2408,16 +2398,12 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "optional": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "optional": true, "requires": { "is-number": "^7.0.0" } @@ -2511,6 +2497,17 @@ } } }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, "coa": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", @@ -4599,7 +4596,6 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, "optional": true }, "function-bind": { @@ -5175,8 +5171,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, "requires": { "binary-extensions": "^2.0.0" } @@ -7414,8 +7408,6 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", - "dev": true, - "optional": true, "requires": { "picomatch": "^2.2.1" } @@ -7860,6 +7852,55 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "sass": { + "version": "1.32.8", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.32.8.tgz", + "integrity": "sha512-Sl6mIeGpzjIUZqvKnKETfMf0iDAswD9TNlv13A7aAF3XZlRPMq4VvJWBC2N2DXbp94MQVdNSFG6LfF/iOXrPHQ==", + "requires": { + "chokidar": ">=2.0.0 <4.0.0" + } + }, + "sass-loader": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-8.0.0.tgz", + "integrity": "sha512-+qeMu563PN7rPdit2+n5uuYVR0SSVwm0JsOUsaJXzgYcClWSlmX0iHDnmeOobPkf5kUglVot3QS6SyLyaQoJ4w==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "loader-utils": "^1.2.3", + "neo-async": "^2.6.1", + "schema-utils": "^2.1.0", + "semver": "^6.3.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -8072,6 +8113,15 @@ "safe-buffer": "^5.0.1" } }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", diff --git a/package.json b/package.json index 65fcee08d..33f830a92 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "@symfony/webpack-encore": "^0.30.0", "core-js": "^3.8.1", "regenerator-runtime": "^0.13.7", + "sass-loader": "^8.0.0", "webpack-notifier": "^1.12.0" }, "license": "UNLICENSED", @@ -31,6 +32,7 @@ "jquery-confirm": "^3.3.4", "mdbootstrap": "^4.19.2", "moment": "^2.29.1", - "popper.js": "^1.16.1" + "popper.js": "^1.16.1", + "sass": "^1.32.8" } } diff --git a/webpack.config.js b/webpack.config.js index 698513c77..ff3c5cf4d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,8 @@ var Encore = require('@symfony/webpack-encore'); const CopyWebpackPlugin = require('copy-webpack-plugin'); Encore + + // directory where all compiled assets will be stored .setOutputPath('public/build') @@ -28,7 +30,7 @@ Encore // allow sass/scss files to be processed - //.enableSassLoader() + .enableSassLoader() // allow legacy applications to use $/jQuery as a global variable .autoProvidejQuery() From 7b0a260630b81708434c28cce8725ee2c6530f79 Mon Sep 17 00:00:00 2001 From: holema Date: Fri, 19 Mar 2021 17:54:40 +0100 Subject: [PATCH 02/11] start with selfsubscritipn --- src/Controller/RoomController.php | 10 + src/Controller/ShareLinkController.php | 95 ++++++++++ src/Entity/Rooms.php | 104 +++++++++++ src/Entity/Subscriber.php | 77 ++++++++ src/Entity/User.php | 36 ++++ src/Form/Type/PublicRegisterType.php | 32 ++++ src/Form/Type/RoomType.php | 2 + src/Migrations/Version20210319115742.php | 32 ++++ src/Migrations/Version20210319115956.php | 31 ++++ src/Migrations/Version20210319120208.php | 31 ++++ src/Migrations/Version20210319150705.php | 33 ++++ src/Migrations/Version20210319150727.php | 33 ++++ src/Migrations/Version20210319150940.php | 31 ++++ src/Repository/SubscriberRepository.php | 50 +++++ templates/base/__newRoomModal.html.twig | 6 + templates/dashboard/__roomDetails.html.twig | 2 + templates/dashboard/__roomOption.html.twig | 3 + .../share_link/__shareLinkModal.html.twig | 16 ++ templates/share_link/subscribe.html.twig | 171 ++++++++++++++++++ translations/form.de.yml | 5 + translations/form.en.yml | 5 + translations/form.fr.yml | 6 +- 22 files changed, 810 insertions(+), 1 deletion(-) create mode 100644 src/Controller/ShareLinkController.php create mode 100644 src/Entity/Subscriber.php create mode 100644 src/Form/Type/PublicRegisterType.php create mode 100644 src/Migrations/Version20210319115742.php create mode 100644 src/Migrations/Version20210319115956.php create mode 100644 src/Migrations/Version20210319120208.php create mode 100644 src/Migrations/Version20210319150705.php create mode 100644 src/Migrations/Version20210319150727.php create mode 100644 src/Migrations/Version20210319150940.php create mode 100644 src/Repository/SubscriberRepository.php create mode 100644 templates/share_link/__shareLinkModal.html.twig create mode 100644 templates/share_link/subscribe.html.twig diff --git a/src/Controller/RoomController.php b/src/Controller/RoomController.php index 769aa0da9..afc9a4b6b 100644 --- a/src/Controller/RoomController.php +++ b/src/Controller/RoomController.php @@ -41,6 +41,13 @@ public function newRoom(Request $request, UserService $userService, TranslatorIn $title = $translator->trans('Konferenz bearbeiten'); $sequence = $room->getSequence() + 1; $room->setSequence($sequence); + if (!$room->getUidModerator()){ + $room->setUidModerator(md5(uniqid('h2-invent', true))); + } + if (!$room->getUidParticipant()){ + $room->setUidParticipant(md5(uniqid('h2-invent', true))); + } + } else { $room = new Rooms(); $room->addUser($this->getUser()); @@ -49,6 +56,9 @@ public function newRoom(Request $request, UserService $userService, TranslatorIn $room->setModerator($this->getUser()); $room->setSequence(0); $room->setUidReal(md5(uniqid('h2-invent', true))); + $room->setUidModerator(md5(uniqid('h2-invent', true))); + $room->setUidParticipant(md5(uniqid('h2-invent', true))); + $snack = $translator->trans('Konferenz erfolgreich erstellt'); $title = $translator->trans('Neue Konferenz erstellen'); } diff --git a/src/Controller/ShareLinkController.php b/src/Controller/ShareLinkController.php new file mode 100644 index 000000000..d5569a98f --- /dev/null +++ b/src/Controller/ShareLinkController.php @@ -0,0 +1,95 @@ +em = $entityManager; + } + + /** + * @Route("/room/share/link/{id}", name="share_link") + * @ParamConverter("rooms") + */ + public function index(Rooms $rooms): Response + { + if(!$rooms || !$rooms->getModerator() == $this->getUser() || $rooms->getPublic() != true){ + throw new NotFoundHttpException('Not found'); + } + return $this->render('share_link/__shareLinkModal.html.twig',array('room'=>$rooms)); + + } + /** + * @Route("/subscribe/participant/{uid}", name="public_subscribe_participant") + * @ParamConverter("rooms", options={"mapping": {"uid": "uidParticipant"}}) + */ + public function participants(Request $request, Rooms $rooms, TranslatorInterface $translator, PexelService $pexelService): Response + { + $data = array('email'=>''); + $form = $this->createForm(PublicRegisterType::class, $data); + $form->handleRequest($request); + $errors = array(); + $snack= $translator->trans('Bitte geben Sie ihre Daten ein'); + $color= 'success'; + $user = $this->getDoctrine()->getRepository(User::class)->findOneBy(['email' => $data['email']]); + $subscriber = $this->getDoctrine()->getRepository(Subscriber::class)->findOneBy(array('room'=>$rooms,'user'=>$user)); + if ($form->isSubmitted() && $form->isValid()) { + $data = $form->getData(); + + if(!filter_var($data['email'], FILTER_VALIDATE_EMAIL)){ + $snack = $translator->trans('Ungültige Email. Bitte überprüfen Sie ihre Emailadresse.'); + $color= 'danger'; + }elseif (in_array($rooms,$user->getRooms()->toArray())) + + $snack = $translator->trans('Sie haben sich bereits angemeldet.'); + $color= 'danger'; + } + elseif(!$user){ + $user = new User(); + $user->setEmail($data['email']); + } + + if($subscriber){ + $snack = $translator->trans('Sie haben sich bereits angemeldet. Bite bestätigen sie noch ihre Anmeldung durch klick auf den Link in der Email.'); + $color= 'danger'; + } + + $snack = $translator->trans('Vielen Dank für die Anmeldung'); + + + $server = $rooms->getServer(); + $image = $pexelService->getImageFromPexels(); + return $this->render('share_link/subscribe.html.twig', [ + 'form' => $form->createView(), + 'snack' => $snack, + 'server' => $server, + 'image' => $image, + 'room'=>$rooms, + ]); + } + /** + * @Route("/subscribe/moderator/{uid}", name="public_subscribe_moderator") + * @ParamConverter("rooms", options={"mapping": {"uid": "uidModerator"}}) + */ + public function moderaror(Rooms $rooms): Response + { + dump($rooms); + } +} diff --git a/src/Entity/Rooms.php b/src/Entity/Rooms.php index f74807bfb..1e3dd7980 100644 --- a/src/Entity/Rooms.php +++ b/src/Entity/Rooms.php @@ -96,10 +96,36 @@ class Rooms */ private $dissallowPrivateMessage; + /** + * @ORM\Column(type="boolean", nullable=true) + */ + private $public; + + /** + * @ORM\Column(type="boolean", nullable=true) + */ + private $showRoomOnJoinpage; + + /** + * @ORM\Column(type="text", nullable=true) + */ + private $uidParticipant; + + /** + * @ORM\Column(type="text", nullable=true) + */ + private $uidModerator; + + /** + * @ORM\OneToMany(targetEntity=Subscriber::class, mappedBy="room") + */ + private $subscribers; + public function __construct() { $this->user = new ArrayCollection(); $this->userAttributes = new ArrayCollection(); + $this->subscribers = new ArrayCollection(); } public function getId(): ?int @@ -316,4 +342,82 @@ public function setDissallowPrivateMessage(?bool $dissallowPrivateMessage): self return $this; } + + public function getPublic(): ?bool + { + return $this->public; + } + + public function setPublic(?bool $public): self + { + $this->public = $public; + + return $this; + } + + public function getShowRoomOnJoinpage(): ?bool + { + return $this->showRoomOnJoinpage; + } + + public function setShowRoomOnJoinpage(?bool $showRoomOnJoinpage): self + { + $this->showRoomOnJoinpage = $showRoomOnJoinpage; + + return $this; + } + + public function getUidParticipant(): ?string + { + return $this->uidParticipant; + } + + public function setUidParticipant(?string $uidParticipant): self + { + $this->uidParticipant = $uidParticipant; + + return $this; + } + + public function getUidModerator(): ?string + { + return $this->uidModerator; + } + + public function setUidModerator(?string $uidModerator): self + { + $this->uidModerator = $uidModerator; + + return $this; + } + + /** + * @return Collection|Subscriber[] + */ + public function getSubscribers(): Collection + { + return $this->subscribers; + } + + public function addSubscriber(Subscriber $subscriber): self + { + if (!$this->subscribers->contains($subscriber)) { + $this->subscribers[] = $subscriber; + $subscriber->setRoom($this); + } + + return $this; + } + + public function removeSubscriber(Subscriber $subscriber): self + { + if ($this->subscribers->removeElement($subscriber)) { + // set the owning side to null (unless already changed) + if ($subscriber->getRoom() === $this) { + $subscriber->setRoom(null); + } + } + + return $this; + } } diff --git a/src/Entity/Subscriber.php b/src/Entity/Subscriber.php new file mode 100644 index 000000000..d0daa793e --- /dev/null +++ b/src/Entity/Subscriber.php @@ -0,0 +1,77 @@ +id; + } + + public function getUser(): ?User + { + return $this->user; + } + + public function setUser(?User $user): self + { + $this->user = $user; + + return $this; + } + + public function getRoom(): ?Rooms + { + return $this->room; + } + + public function setRoom(?Rooms $room): self + { + $this->room = $room; + + return $this; + } + + public function getUid(): ?string + { + return $this->uid; + } + + public function setUid(string $uid): self + { + $this->uid = $uid; + + return $this; + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php index d375d84c3..567caf208 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -106,6 +106,11 @@ class User extends BaseUser */ private $roomsAttributes; + /** + * @ORM\OneToMany(targetEntity=Subscriber::class, mappedBy="user") + */ + private $subscribers; + public function __construct() @@ -117,6 +122,7 @@ public function __construct() $this->addressbook = new ArrayCollection(); $this->addressbookInverse = new ArrayCollection(); $this->roomsAttributes = new ArrayCollection(); + $this->subscribers = new ArrayCollection(); } @@ -406,6 +412,36 @@ public function removeRoomsAttributes(RoomsUser $roomsNew): self return $this; } + /** + * @return Collection|Subscriber[] + */ + public function getSubscribers(): Collection + { + return $this->subscribers; + } + + public function addSubscriber(Subscriber $subscriber): self + { + if (!$this->subscribers->contains($subscriber)) { + $this->subscribers[] = $subscriber; + $subscriber->setUser($this); + } + + return $this; + } + + public function removeSubscriber(Subscriber $subscriber): self + { + if ($this->subscribers->removeElement($subscriber)) { + // set the owning side to null (unless already changed) + if ($subscriber->getUser() === $this) { + $subscriber->setUser(null); + } + } + + return $this; + } + } diff --git a/src/Form/Type/PublicRegisterType.php b/src/Form/Type/PublicRegisterType.php new file mode 100644 index 000000000..78f7f69e2 --- /dev/null +++ b/src/Form/Type/PublicRegisterType.php @@ -0,0 +1,32 @@ +add('email', TextType::class, ['attr' => ['placeholder' => 'label.email'], 'label' => false, 'required' => true, 'translation_domain' => 'form']) + ->add('subscribe', SubmitType::class, ['attr' => array('class' => 'btn btn-outline-secondary btn-block p-3'), 'label' => 'label.subscribe', 'translation_domain' => 'form']); + } + + public function configureOptions(OptionsResolver $resolver) + { + + } +} diff --git a/src/Form/Type/RoomType.php b/src/Form/Type/RoomType.php index 077c773ae..fa85806e8 100644 --- a/src/Form/Type/RoomType.php +++ b/src/Form/Type/RoomType.php @@ -59,6 +59,8 @@ public function buildForm(FormBuilderInterface $builder, array $options) ->add('onlyRegisteredUsers',CheckboxType::class,array('required'=>false,'label' => 'label.nurRegistriertenutzer', 'translation_domain' => 'form')) ->add('dissallowScreenshareGlobal',CheckboxType::class,array('required'=>false,'label' => 'label.dissallowScreenshareGlobal', 'translation_domain' => 'form')) ->add('dissallowPrivateMessage',CheckboxType::class,array('required'=>false,'label' => 'label.dissallowPrivateMessage', 'translation_domain' => 'form')) + ->add('public',CheckboxType::class,array('required'=>false,'label' => 'label.puplicRoom', 'translation_domain' => 'form')) + ->add('showRoomOnJoinpage',CheckboxType::class,array('required'=>false,'label' => 'label.showRoomOnJoinpage', 'translation_domain' => 'form')) ->add('submit', SubmitType::class, ['attr' => array('class' => 'btn btn-outline-primary'), 'label' => 'label.speichern', 'translation_domain' => 'form']); } diff --git a/src/Migrations/Version20210319115742.php b/src/Migrations/Version20210319115742.php new file mode 100644 index 000000000..a63de3193 --- /dev/null +++ b/src/Migrations/Version20210319115742.php @@ -0,0 +1,32 @@ +addSql('ALTER TABLE rooms ADD public TINYINT(1) DEFAULT NULL'); + + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE rooms DROP public'); + } +} diff --git a/src/Migrations/Version20210319115956.php b/src/Migrations/Version20210319115956.php new file mode 100644 index 000000000..fa26eda48 --- /dev/null +++ b/src/Migrations/Version20210319115956.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE rooms ADD show_room_on_joinpage TINYINT(1) DEFAULT NULL'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE rooms DROP show_room_on_joinpage'); + } +} diff --git a/src/Migrations/Version20210319120208.php b/src/Migrations/Version20210319120208.php new file mode 100644 index 000000000..5e256c942 --- /dev/null +++ b/src/Migrations/Version20210319120208.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE rooms ADD uid_participant LONGTEXT DEFAULT NULL, ADD uid_moderator LONGTEXT DEFAULT NULL'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE rooms DROP uid_participant, DROP uid_moderator'); + } +} diff --git a/src/Migrations/Version20210319150705.php b/src/Migrations/Version20210319150705.php new file mode 100644 index 000000000..a39710f19 --- /dev/null +++ b/src/Migrations/Version20210319150705.php @@ -0,0 +1,33 @@ +addSql('CREATE TABLE subscriber (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, room_id INT NOT NULL, INDEX IDX_AD005B69A76ED395 (user_id), INDEX IDX_AD005B6954177093 (room_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE subscriber ADD CONSTRAINT FK_AD005B69A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE subscriber ADD CONSTRAINT FK_AD005B6954177093 FOREIGN KEY (room_id) REFERENCES rooms (id)'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE subscriber'); + } +} diff --git a/src/Migrations/Version20210319150727.php b/src/Migrations/Version20210319150727.php new file mode 100644 index 000000000..a838d2327 --- /dev/null +++ b/src/Migrations/Version20210319150727.php @@ -0,0 +1,33 @@ +addSql('CREATE TABLE subscriber (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, room_id INT NOT NULL, INDEX IDX_AD005B69A76ED395 (user_id), INDEX IDX_AD005B6954177093 (room_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE subscriber ADD CONSTRAINT FK_AD005B69A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE subscriber ADD CONSTRAINT FK_AD005B6954177093 FOREIGN KEY (room_id) REFERENCES rooms (id)'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE subscriber'); + } +} diff --git a/src/Migrations/Version20210319150940.php b/src/Migrations/Version20210319150940.php new file mode 100644 index 000000000..1d0884024 --- /dev/null +++ b/src/Migrations/Version20210319150940.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE subscriber ADD uid LONGTEXT NOT NULL'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE subscriber DROP uid'); + } +} diff --git a/src/Repository/SubscriberRepository.php b/src/Repository/SubscriberRepository.php new file mode 100644 index 000000000..5f6cb7f5e --- /dev/null +++ b/src/Repository/SubscriberRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('s') + ->andWhere('s.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('s.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Subscriber + { + return $this->createQueryBuilder('s') + ->andWhere('s.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/templates/base/__newRoomModal.html.twig b/templates/base/__newRoomModal.html.twig index c153a6d48..7d95183bd 100644 --- a/templates/base/__newRoomModal.html.twig +++ b/templates/base/__newRoomModal.html.twig @@ -34,6 +34,12 @@
{{ form_row(form.onlyRegisteredUsers) }}
+
+ {{ form_row(form.public) }} +
+
+ {{ form_row(form.showRoomOnJoinpage) }} +
{{ form_row(form.dissallowScreenshareGlobal) }} diff --git a/templates/dashboard/__roomDetails.html.twig b/templates/dashboard/__roomDetails.html.twig index c832d8080..74d8a91d4 100644 --- a/templates/dashboard/__roomDetails.html.twig +++ b/templates/dashboard/__roomDetails.html.twig @@ -5,6 +5,8 @@ {{ 'Moderator'|trans }}
{% endif %} {% if app.user == room.onlyRegisteredUsers %} {{ 'Intern'|trans }}
{% endif %} + {% if app.user == room.public %} + {{ 'Öffentlich'|trans }}
{% endif %}
{{ room.name }}
diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 174df20e2..737195e8b 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -775,6 +775,14 @@ Danke für die Anmeldung. __Danke für die Anmeldung. + + Einladungslink für Teilnehmer + __Einladungslink für Teilnehmer + + + Einladungslink für Moderatoren + __Einladungslink für Moderatoren + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index f3bd4c7f0..2cccf4c1b 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -775,6 +775,14 @@ Danke für die Anmeldung. __Danke für die Anmeldung. + + Einladungslink für Teilnehmer + __Einladungslink für Teilnehmer + + + Einladungslink für Moderatoren + __Einladungslink für Moderatoren + From 542d07d141cc1c7b2514cf3ccec6752915af2f98 Mon Sep 17 00:00:00 2001 From: holema Date: Sat, 20 Mar 2021 17:31:07 +0100 Subject: [PATCH 05/11] remove Test --- assets/js/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index e78470705..191aef3ff 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -147,7 +147,7 @@ $('#loadContentModal').on('shown.bs.modal', function (e) { $('#appId').collapse('hide') } }); - console.log('test'); + $(".copyLink").click(function(){ var $temp = $(""); $("body").append($temp); @@ -155,7 +155,6 @@ $('#loadContentModal').on('shown.bs.modal', function (e) { document.execCommand("copy"); $temp.remove(); }); - console.log('teest'); var clipboard = new ClipboardJS('.copyLink'); initSearchUser(); initServerFeatures(); From b6a59c0cebb0d66b40f3984357498a748f6f56bd Mon Sep 17 00:00:00 2001 From: holema Date: Sat, 20 Mar 2021 17:46:00 +0100 Subject: [PATCH 06/11] change color of hover --- assets/css/layout/_main.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/css/layout/_main.scss b/assets/css/layout/_main.scss index f9857286b..fc557d1d4 100644 --- a/assets/css/layout/_main.scss +++ b/assets/css/layout/_main.scss @@ -23,11 +23,11 @@ a { color: $contrast-dark; &:hover { - color: $sec-color-hover; + color: $main-color; } &:focus { - color: $sec-color-activ; + color: $main-color-hover; text-decoration: none; transition: all 0.3s; } From 8cc685e882dcae379bd5f8aa1eaf11d54650506a Mon Sep 17 00:00:00 2001 From: holema Date: Sun, 21 Mar 2021 12:34:32 +0100 Subject: [PATCH 07/11] joinpage: the button changes when to small, then no app button --- templates/join/index.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/join/index.html.twig b/templates/join/index.html.twig index 894296980..e05589ebb 100644 --- a/templates/join/index.html.twig +++ b/templates/join/index.html.twig @@ -44,7 +44,7 @@
-
+
@@ -122,7 +122,7 @@
{{ form_row(form.joinBrowser) }}
-
+
{{ form_row(form.joinApp) }}
From 0c4c9e8457b873a50365c5c26c47d8b9416ee0d8 Mon Sep 17 00:00:00 2001 From: holema Date: Sun, 21 Mar 2021 12:41:05 +0100 Subject: [PATCH 08/11] some change in translation --- assets/css/helper/_variables.scss | 2 +- translations/form.de.yml | 4 ++-- translations/form.en.yml | 4 ++-- translations/form.fr.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/css/helper/_variables.scss b/assets/css/helper/_variables.scss index 10069ce1f..55f6947a9 100644 --- a/assets/css/helper/_variables.scss +++ b/assets/css/helper/_variables.scss @@ -8,4 +8,4 @@ $contrast-base: rgb(85, 83, 80); $contrast-dark: rgb(23, 21, 18); $contrast-light: rgb(144, 142, 140); $contrast-extra-light: rgb(255, 255, 255); -$contrast-white: rgb(253, 253, 253); \ No newline at end of file +$contrast-white: rgb(253, 253, 253); diff --git a/translations/form.de.yml b/translations/form.de.yml index cd974c048..18d97227f 100644 --- a/translations/form.de.yml +++ b/translations/form.de.yml @@ -49,8 +49,8 @@ label: featureEnalbeByJwt: Enable Feature By JWT Plugin ist auf dem Server aktiviert dissallowScreenshareGlobal: Nur der Moderator darf seinen Bildschirm teilen dissallowPrivateMessage: Nur der Moderator darf private Nachrichten an Teilnehmer senden - puplicRoom: Diese Konferenz ist öffentlich und mit einem Link können sich die Teilnehmer selbst in die Teilnehmerliste eintragen - showRoomOnJoinpage: Diese Konferenz soll auf der Joinpage angezeigt werden. + puplicRoom: Öffentliche Konferenz + showRoomOnJoinpage: Konferenz auf Joinseite anzeigen subscribe: Anmelden vorname: Vorname nachname: Nachname diff --git a/translations/form.en.yml b/translations/form.en.yml index 52efc770b..21823c33a 100644 --- a/translations/form.en.yml +++ b/translations/form.en.yml @@ -48,8 +48,8 @@ label: schowStaticBackgroundColor: __Zeige eine feste Farbe, anstatt Bildern auf der Joinseite featureEnalbeByJwt: __Enable Feature By JWT Plugin ist auf dem Server aktiviert dissallowPrivateMessage: __Nur der Moderator darf private Nachrichten an Teilnehmer senden - puplicRoom: __Diese Konferenz ist öffentlich und mit einem Link können sich die Teilnehmer selbst in die Teilnehmerliste eintragen - showRoomOnJoinpage: __Diese Konferenz soll auf der Joinpage angezeigt werden. + puplicRoom: __Öffentliche Konferenz + showRoomOnJoinpage: __Konferenz auf Joinseite anzeigen vorname: __Vorname nachname: __Nachname subscribe: __Anmelden diff --git a/translations/form.fr.yml b/translations/form.fr.yml index f4e74d5a6..b65e03733 100644 --- a/translations/form.fr.yml +++ b/translations/form.fr.yml @@ -48,8 +48,8 @@ label: schowStaticBackgroundColor: Zeige eine feste Farbe, anstatt Bildern auf der Joinseite featureEnalbeByJwt: __Enable Feature By JWT Plugin ist auf dem Server aktiviert dissallowPrivateMessage: __Nur der Moderator darf private Nachrichten an Teilnehmer senden - puplicRoom: __Diese Konferenz ist öffentlich und mit einem Link können sich die Teilnehmer selbst in die Teilnehmerliste eintragen - showRoomOnJoinpage: __Diese Konferenz soll auf der Joinpage angezeigt werden. + puplicRoom: __Öffentliche Konferenz + showRoomOnJoinpage: __Konferenz auf Joinseite anzeigen vorname: __Vorname nachname: __Nachname subscribe: __Anmelden From 25d5ce99785e96b6e69192235ddd76ffd8e5dc1d Mon Sep 17 00:00:00 2001 From: holema Date: Sun, 21 Mar 2021 13:03:39 +0100 Subject: [PATCH 09/11] the subscribe link is wor moderator and part the same --- src/Controller/ShareLinkController.php | 46 +++++-------------- .../share_link/__shareLinkModal.html.twig | 2 +- 2 files changed, 13 insertions(+), 35 deletions(-) diff --git a/src/Controller/ShareLinkController.php b/src/Controller/ShareLinkController.php index 41d618276..b286f9951 100644 --- a/src/Controller/ShareLinkController.php +++ b/src/Controller/ShareLinkController.php @@ -42,11 +42,19 @@ public function index(Rooms $rooms): Response } /** - * @Route("/subscribe/participant/{uid}", name="public_subscribe_participant") - * @ParamConverter("rooms", options={"mapping": {"uid": "uidParticipant"}}) + * @Route("/subscribe/self/{uid}", name="public_subscribe_participant") */ - public function participants(Request $request, SubcriptionService $subcriptionService,Rooms $rooms, TranslatorInterface $translator, PexelService $pexelService): Response + public function participants($uid, Request $request, SubcriptionService $subcriptionService,TranslatorInterface $translator, PexelService $pexelService): Response { + $rooms = null; + $moderator = false; + $rooms = $this->em->getRepository(Rooms::class)->findOneBy(array('uidParticipant'=>$uid)); + if(!$rooms){ + $rooms = $this->em->getRepository(Rooms::class)->findOneBy(array('uidModerator'=>$uid)); + if ($rooms){ + $moderator = true; + } + } $data = array('email' => ''); $form = $this->createForm(PublicRegisterType::class, $data); $form->handleRequest($request); @@ -58,7 +66,7 @@ public function participants(Request $request, SubcriptionService $subcriptionSe if ($form->isSubmitted() && $form->isValid()) { $data = $form->getData(); - $res = $subcriptionService->subscripe($data['email'], $rooms); + $res = $subcriptionService->subscripe($data['email'], $rooms,$moderator); $snack = $res['text']; $color = $res['color']; } @@ -73,37 +81,7 @@ public function participants(Request $request, SubcriptionService $subcriptionSe ]); } - /** - * @Route("/subscribe/moderator/{uid}", name="public_subscribe_moderator") - * @ParamConverter("rooms", options={"mapping": {"uid": "uidModerator"}}) - */ - public function moderator(Rooms $rooms, Request $request, PexelService $pexelService, TranslatorInterface $translator, SubcriptionService $subcriptionService): Response - { - $data = array('email' => ''); - $form = $this->createForm(PublicRegisterType::class, $data); - $form->handleRequest($request); - $errors = array(); - $snack = $translator->trans('Bitte geben Sie ihre Daten ein'); - $color = 'success'; - $server = $rooms->getServer(); - - if ($form->isSubmitted() && $form->isValid()) { - $data = $form->getData(); - $res = $subcriptionService->subscripe($data['email'], $rooms,true); - $snack = $res['text']; - $color = $res['color']; - } - $image = $pexelService->getImageFromPexels(); - return $this->render('share_link/subscribe.html.twig', [ - 'form' => $form->createView(), - 'snack' => $snack, - 'server' => $server, - 'image' => $image, - 'room' => $rooms, - 'color'=>$color, - ]); - } /** * @Route("/subscribe/optIn/{uid}", name="public_subscribe_doupleOptIn") */ diff --git a/templates/share_link/__shareLinkModal.html.twig b/templates/share_link/__shareLinkModal.html.twig index 08bad2ba4..bad7ebaf0 100644 --- a/templates/share_link/__shareLinkModal.html.twig +++ b/templates/share_link/__shareLinkModal.html.twig @@ -20,7 +20,7 @@
{{'Einladungslink für Moderatoren'|trans}}
- +
From 20a9d69b57a8e9fc6bffab7605cd96535bc097ab Mon Sep 17 00:00:00 2001 From: holema Date: Sun, 21 Mar 2021 13:08:16 +0100 Subject: [PATCH 10/11] when no rom found then send to join page --- src/Controller/ShareLinkController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Controller/ShareLinkController.php b/src/Controller/ShareLinkController.php index b286f9951..51289702f 100644 --- a/src/Controller/ShareLinkController.php +++ b/src/Controller/ShareLinkController.php @@ -55,13 +55,16 @@ public function participants($uid, Request $request, SubcriptionService $subcrip $moderator = true; } } +if(!$rooms){ + return $this->redirectToRoute('join_index_no_slug'); +} $data = array('email' => ''); $form = $this->createForm(PublicRegisterType::class, $data); $form->handleRequest($request); $errors = array(); $snack = $translator->trans('Bitte geben Sie ihre Daten ein'); $color = 'success'; - $server = $rooms->getServer(); + $server = null; if ($form->isSubmitted() && $form->isValid()) { From 2962104a420adf55c6085930dc0203ee7519e7cc Mon Sep 17 00:00:00 2001 From: holema Date: Sun, 21 Mar 2021 13:08:29 +0100 Subject: [PATCH 11/11] reformat --- src/Controller/ShareLinkController.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Controller/ShareLinkController.php b/src/Controller/ShareLinkController.php index 51289702f..6299e9164 100644 --- a/src/Controller/ShareLinkController.php +++ b/src/Controller/ShareLinkController.php @@ -44,20 +44,20 @@ public function index(Rooms $rooms): Response /** * @Route("/subscribe/self/{uid}", name="public_subscribe_participant") */ - public function participants($uid, Request $request, SubcriptionService $subcriptionService,TranslatorInterface $translator, PexelService $pexelService): Response + public function participants($uid, Request $request, SubcriptionService $subcriptionService, TranslatorInterface $translator, PexelService $pexelService): Response { $rooms = null; $moderator = false; - $rooms = $this->em->getRepository(Rooms::class)->findOneBy(array('uidParticipant'=>$uid)); - if(!$rooms){ - $rooms = $this->em->getRepository(Rooms::class)->findOneBy(array('uidModerator'=>$uid)); - if ($rooms){ + $rooms = $this->em->getRepository(Rooms::class)->findOneBy(array('uidParticipant' => $uid)); + if (!$rooms) { + $rooms = $this->em->getRepository(Rooms::class)->findOneBy(array('uidModerator' => $uid)); + if ($rooms) { $moderator = true; } } -if(!$rooms){ - return $this->redirectToRoute('join_index_no_slug'); -} + if (!$rooms) { + return $this->redirectToRoute('join_index_no_slug'); + } $data = array('email' => ''); $form = $this->createForm(PublicRegisterType::class, $data); $form->handleRequest($request); @@ -69,7 +69,7 @@ public function participants($uid, Request $request, SubcriptionService $subcrip if ($form->isSubmitted() && $form->isValid()) { $data = $form->getData(); - $res = $subcriptionService->subscripe($data['email'], $rooms,$moderator); + $res = $subcriptionService->subscripe($data['email'], $rooms, $moderator); $snack = $res['text']; $color = $res['color']; } @@ -80,7 +80,7 @@ public function participants($uid, Request $request, SubcriptionService $subcrip 'server' => $server, 'image' => $image, 'room' => $rooms, - 'color'=>$color, + 'color' => $color, ]); } @@ -88,14 +88,14 @@ public function participants($uid, Request $request, SubcriptionService $subcrip /** * @Route("/subscribe/optIn/{uid}", name="public_subscribe_doupleOptIn") */ - public function doupleoptin($uid, SubcriptionService $subcriptionService, TranslatorInterface $translator, UserService $userService,PexelService $pexelService): Response + public function doupleoptin($uid, SubcriptionService $subcriptionService, TranslatorInterface $translator, UserService $userService, PexelService $pexelService): Response { - $subscriber = $this->em->getRepository(Subscriber::class)->findOneBy(array('uid'=>$uid)); + $subscriber = $this->em->getRepository(Subscriber::class)->findOneBy(array('uid' => $uid)); $res = $subcriptionService->acceptSub($subscriber); $message = $res['message']; $title = $res['title']; $image = $pexelService->getImageFromPexels(); - return $this->render('share_link/subscribeSuccess.html.twig',array('message'=>$message,'title'=>$title,'image'=>$image)); + return $this->render('share_link/subscribeSuccess.html.twig', array('message' => $message, 'title' => $title, 'image' => $image)); } }