You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2020/02/13 16:55:02 UTC

[openmeetings] branch csp updated: [OPENMEETINGS-2165] enhancements in admin

This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch csp
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/csp by this push:
     new 6388e9b  [OPENMEETINGS-2165] enhancements in admin
6388e9b is described below

commit 6388e9b0c461b0c83f5aa796a88ef7ffb7da7849
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Thu Feb 13 23:54:46 2020 +0700

    [OPENMEETINGS-2165] enhancements in admin
---
 .../web/admin/configurations/ConfigsPanel.html     | 10 +--
 .../apache/openmeetings/web/app/Application.java   |  3 +-
 .../web/common/UploadableImagePanel.java           |  5 +-
 openmeetings-web/src/main/webapp/css/raw-admin.css | 76 ++++------------------
 4 files changed, 22 insertions(+), 72 deletions(-)

diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.html
index af0cc96..17accc1 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.html
@@ -66,14 +66,8 @@
 						<div wicket:id="boolean-box">
 							<label wicket:for="valueB" class="col-3 text-right"><wicket:message key="271" /></label>
 							<div class="onoffswitch">
-								<input type="checkbox" class="onoffswitch-checkbox" wicket:id="valueB">
-								<label class="onoffswitch-label" wicket:for="valueB">
-									<span class="onoffswitch-inner">
-										<span class="before"></span>
-										<span class="after"></span>
-									</span>
-									<span class="onoffswitch-switch"></span>
-								</label>
+								<input type="checkbox" class="onoff-checkbox" wicket:id="valueB">
+								<label class="onoff-label" wicket:for="valueB"></label>
 							</div>
 						</div>
 						<div wicket:id="hotkey-box">
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
index 5fb4cb7..a39e104 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
@@ -336,6 +336,7 @@ public class Application extends AuthenticatedWebApplication implements IApplica
 			Version.logOMStarted();
 			recordingDao.resetProcessingStatus(); //we are starting so all processing recordings are now errors
 
+			getCsp().blocking().disabled(); //FIXME TODO due to `reporting-only enabled`
 			oauthDao.getActive().forEach(oauth -> {
 				if (!Strings.isEmpty(oauth.getIconUrl())) {
 					cspConfig.add(CSPDirective.IMG_SRC, oauth.getIconUrl());
@@ -375,7 +376,7 @@ public class Application extends AuthenticatedWebApplication implements IApplica
 	}
 
 	public CSPHeaderConfiguration getCspConfig() {
-		return getCsp().blocking();
+		return getCsp().reporting();
 	}
 
 	public static OmAuthenticationStrategy getAuthenticationStrategy() {
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableImagePanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableImagePanel.java
index f2d4f82..7fdd0de 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableImagePanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableImagePanel.java
@@ -35,6 +35,7 @@ import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.form.upload.FileUpload;
 import org.apache.wicket.markup.html.form.upload.FileUploadField;
+import org.apache.wicket.markup.html.panel.EmptyPanel;
 import org.apache.wicket.model.util.ListModel;
 import org.apache.wicket.util.lang.Bytes;
 import org.slf4j.Logger;
@@ -69,7 +70,9 @@ public abstract class UploadableImagePanel extends ImagePanel {
 		form.add(fileUploadField);
 		form.add(new UploadProgressBar("progress", form, fileUploadField));
 		form.addOrReplace(getImage());
-		if (!delayed) {
+		if (delayed) {
+			add(new WebMarkupContainer("remove"));
+		} else {
 			BootstrapAjaxLink<String> remove = new BootstrapAjaxLink<>("remove", Buttons.Type.Outline_Secondary) {
 				private static final long serialVersionUID = 1L;
 
diff --git a/openmeetings-web/src/main/webapp/css/raw-admin.css b/openmeetings-web/src/main/webapp/css/raw-admin.css
index 36132b7..90e4719 100644
--- a/openmeetings-web/src/main/webapp/css/raw-admin.css
+++ b/openmeetings-web/src/main/webapp/css/raw-admin.css
@@ -69,75 +69,27 @@
 	background-repeat: no-repeat;
 	background-position: 5px;
 }
-/* generated using https://proto.io/freebies/onoff/ */
 .onoffswitch {
-	position: relative;
-	width: 50px;
-	display: inline-block;
-	margin-left:  2px;
+	display:inline-block;
 }
-.onoffswitch-checkbox {
+.onoffswitch .onoff-checkbox {
 	display: none !important;
-	float: none !important;
-	margin: 0 !important;
-}
-.onoffswitch-label {
-	display: block !important;
-	float: none !important;
-	margin: 0 !important;
-	overflow: hidden;
-	cursor: pointer;
-	border: 2px solid #999999;
-	border-radius: 0px;
-	width: auto !important;
 }
-.onoffswitch-inner {
-	display: block;
-	width: 200%;
-	margin-left: -100%;
-	transition: margin 0.3s ease-in 0s;
+.onoff-label {
+	margin: 0;
 }
-.onoffswitch-inner .before, .onoffswitch-inner .after {
-	display: block;
-	float: left;
-	width: 50%;
-	height: 20px;
-	padding: 0;
-	line-height: 20px;
-	font-size: 14px;
-	font-weight: bold;
-	box-sizing: border-box;
-}
-.onoffswitch-inner .before {
-	content: " ";
-	padding-left: 5px;
-	background-color: #14da33;
+.onoff-label::before {
+	font-family: 'Font Awesome 5 Free';
+	font-weight: 900;
+	font-size: 2.2em;
 }
-.onoffswitch-inner .after {
-	content: " ";
-	padding-right: 5px;
-	background-color: #ef0808;
-	text-align: right;
+.onoff-checkbox + .onoff-label::before {
+	content: '\f204';
+	color: var(--danger);
 }
-.onoffswitch-switch {
-	display: block;
-	width: 19px;
-	margin: 0.5px;
-	background: #A1A1A1;
-	position: absolute;
-	top: 0;
-	bottom: 0;
-	right: 26px;
-	border: 2px solid #999999;
-	border-radius: 0px;
-	transition: all 0.3s ease-in 0s;
-}
-.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner {
-	margin-left: 0;
-}
-.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch {
-	right: 0px;
-	background-color: #A1A1A1;
+.onoff-checkbox:checked + .onoff-label::before {
+	content: '\f205';
+	color: var(--success);
 }
 .addLanguagePanel select {
 	padding: 0px 0px;