diff --git a/.classpath b/.classpath
index b1af1f7..8ecf098 100644
--- a/.classpath
+++ b/.classpath
@@ -1,12 +1,12 @@
-
+
-
+
@@ -38,5 +38,5 @@
-
+
diff --git a/distro/changelog.xml b/distro/changelog.xml
index 587fcc6..3fc476e 100644
--- a/distro/changelog.xml
+++ b/distro/changelog.xml
@@ -1,4 +1,8 @@
+
+ restyled checkbox for notifications
+
drop down menu replaced with checkbox for notifications, see Task #9971
diff --git a/pom.xml b/pom.xml
index 21edff2..949b7c5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
org.gcube.portlets.user
share-updates
war
- 2.5.0-SNAPSHOT
+ 2.6.0-SNAPSHOT
gCube Share Updates Portlet
gCube Share Updates for exchanging updates with other users of VREs.
@@ -94,6 +94,11 @@
gcube-widgets
compile
+
+ org.gcube.portlets.widgets
+ switch-button-widget
+ [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)
+
org.gcube.core
common-scope-maps
diff --git a/src/main/java/org/gcube/portlets/user/shareupdates/client/view/ShareUpdateForm.java b/src/main/java/org/gcube/portlets/user/shareupdates/client/view/ShareUpdateForm.java
index 1e01393..856732e 100644
--- a/src/main/java/org/gcube/portlets/user/shareupdates/client/view/ShareUpdateForm.java
+++ b/src/main/java/org/gcube/portlets/user/shareupdates/client/view/ShareUpdateForm.java
@@ -19,6 +19,7 @@ import org.gcube.portlets.widgets.fileupload.client.events.FileUploadCompleteEve
import org.gcube.portlets.widgets.fileupload.client.events.FileUploadCompleteEventHandler;
import org.gcube.portlets.widgets.fileupload.client.view.FileSubmit;
import org.gcube.portlets.widgets.fileupload.client.view.UploadProgressPanel;
+import org.gcube.portlets.widgets.switchbutton.client.SwitchButton;
import org.jsonmaker.gwt.client.Jsonizer;
import com.github.gwtbootstrap.client.ui.Button;
@@ -152,7 +153,9 @@ public class ShareUpdateForm extends Composite {
ListBox privacyLevel = new ListBox();
@UiField
SaveInWorkspaceBox saveInWorkspaceCheckbox;
-
+ @UiField
+ SwitchButton sb;
+
// requested user's information
private UserInfo myUserInfo;
@@ -210,7 +213,6 @@ public class ShareUpdateForm extends Composite {
if (myUserInfo.isAdmin())
privacyLevel.addItem("Share with: Everyone", PrivacyLevel.PORTAL.toString());
-
//change css if deployed in VRE scope
if (!userSettings.isInfrastructure()) {
setNotifyCheckboxValue(notificationEmail);
@@ -282,10 +284,8 @@ public class ShareUpdateForm extends Composite {
* Bind events to manage
*/
private void bind() {
-
//get the uploaded file result
eventBus.addHandler(FileUploadCompleteEvent.TYPE, new FileUploadCompleteEventHandler() {
-
@Override
public void onUploadComplete(FileUploadCompleteEvent event) {
String absolutePathOnServer = event.getUploadedFileInfo().getAbsolutePath();
@@ -471,13 +471,13 @@ public class ShareUpdateForm extends Composite {
onSubmitClickHandlerBody(e);
}
- public final native boolean getNotifyCheckboxValue() /*-{
- return $doc.getElementById("notifyCheckbox").checked;
- }-*/;
+ private boolean getNotifyCheckboxValue() {
+ return sb.getValue();
+ }
- public final native void setNotifyCheckboxValue(boolean value) /*-{
- $doc.getElementById("notifyCheckbox").checked = value;
- }-*/;
+ private void setNotifyCheckboxValue(boolean value) {
+ sb.setValue(value);
+ }
/**
* Publish a post.
diff --git a/src/main/java/org/gcube/portlets/user/shareupdates/client/view/ShareUpdateForm.ui.xml b/src/main/java/org/gcube/portlets/user/shareupdates/client/view/ShareUpdateForm.ui.xml
index eeab662..c0cfda8 100644
--- a/src/main/java/org/gcube/portlets/user/shareupdates/client/view/ShareUpdateForm.ui.xml
+++ b/src/main/java/org/gcube/portlets/user/shareupdates/client/view/ShareUpdateForm.ui.xml
@@ -1,18 +1,13 @@
+ xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:s="urn:import:org.gcube.portlets.widgets.switchbutton.client"
+ xmlns:j="urn:import:org.gcube.portlets.widgets.fileupload.client.view">
.attachment-container {
width: 100%;
}
- .checkbox-inline {
- display: inline-block;
- vertical-align: middle;
- float: left;
- }
-
.paragraph-inline {
display: inline-block;
width: 25%;
@@ -52,14 +47,12 @@
-
-
-
-
-
+
+
+ Notify members:
+
+
+
+
diff --git a/src/main/webapp/ShareUpdates.css b/src/main/webapp/ShareUpdates.css
index 2d3c561..fd98ff7 100644
--- a/src/main/webapp/ShareUpdates.css
+++ b/src/main/webapp/ShareUpdates.css
@@ -1,19 +1,3 @@
-input#notifyCheckbox[type="checkbox"] {
- display:none;
-}
-input#notifyCheckbox[type="checkbox"] + label span {
- display:inline-block;
- width:19px;
- height:19px;
- margin:-2px 10px 0 0;
- vertical-align:middle;
- background:url(images/check_radio_sheet.png) left top no-repeat;
- cursor:pointer;
-}
-input#notifyCheckbox[type="checkbox"]:checked + label span {
- background:url(images/check_radio_sheet.png) -19px top no-repeat;
-}
-
@media screen and (max-width: 1050px) {
label.wizardListbox {
width: 100% !important;
@@ -50,6 +34,22 @@ input#notifyCheckbox[type="checkbox"]:checked + label span {
.share-updates-table {
width: 100% !important;
}
+ .checkbox-inline {
+ display: block;
+ vertical-align: middle;
+ }
+}
+
+@media screen and (min-width: 1051px) {
+ .checkbox-inline {
+ display: inline-block;
+ vertical-align: middle;
+ float: left;
+ }
+}
+
+div.switch-button-background {
+ margin: 4px 10px !important;
}
.attachment-container-full-width {