From 6f37db7641c693caf861ee6c748984735c30895b Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Thu, 7 Dec 2017 14:30:51 +0000 Subject: [PATCH] drop down menu replaced with checkbox for notifications, see Task #9971 git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@160171 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 5 ++-- .settings/org.eclipse.jdt.core.prefs | 2 +- distro/changelog.xml | 4 +++ pom.xml | 2 +- .../client/view/ShareUpdateForm.java | 26 +++++++---------- .../client/view/ShareUpdateForm.ui.xml | 22 +++++++++++--- src/main/webapp/ShareUpdates.css | 27 +++++++++++++----- src/main/webapp/images/check_radio_sheet.png | Bin 0 -> 2170 bytes 8 files changed, 57 insertions(+), 31 deletions(-) create mode 100644 src/main/webapp/images/check_radio_sheet.png diff --git a/.classpath b/.classpath index fc9be77..b6ef958 100644 --- a/.classpath +++ b/.classpath @@ -22,7 +22,6 @@ - @@ -34,9 +33,9 @@ - + - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index b257af7..443e085 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,6 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error diff --git a/distro/changelog.xml b/distro/changelog.xml index 184b634..587fcc6 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,4 +1,8 @@ + + drop down menu replaced with checkbox for notifications, see Task #9971 + Ported to Java8 diff --git a/pom.xml b/pom.xml index 190ff4c..560f538 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,7 @@ org.gcube.portlets.widgets fileupload-progress-bar - [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + [1.5.0-SNAPSHOT, 2.0.0-SNAPSHOT) compile 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 64ce409..1e01393 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 @@ -3,9 +3,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapter; -import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapterException; - import org.gcube.portal.databook.shared.ClientFeed; import org.gcube.portal.databook.shared.ClientFeed.ClientFeedJsonizer; import org.gcube.portal.databook.shared.FeedType; @@ -54,6 +51,9 @@ import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment; import com.google.gwt.user.client.ui.Widget; + +import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapter; +import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapterException; /** * The main share update class. * @author Massimiliano Assante at ISTI CNR @@ -150,10 +150,6 @@ public class ShareUpdateForm extends Composite { @UiField ListBox privacyLevel = new ListBox(); - - @UiField - ListBox notifyListbox = new ListBox(); - @UiField SaveInWorkspaceBox saveInWorkspaceCheckbox; @@ -217,12 +213,7 @@ public class ShareUpdateForm extends Composite { //change css if deployed in VRE scope if (!userSettings.isInfrastructure()) { - notifyListbox.addItem("Share with: " + singleVREName); - notifyListbox.addItem("Share with: " + singleVREName+" + Notification to members"); - if (notificationEmail) { - notifyListbox.setSelectedIndex(1); - } - notifyListbox.setVisible(true); + setNotifyCheckboxValue(notificationEmail); } else privacyLevel.setVisible(true); @@ -480,7 +471,13 @@ public class ShareUpdateForm extends Composite { onSubmitClickHandlerBody(e); } + public final native boolean getNotifyCheckboxValue() /*-{ + return $doc.getElementById("notifyCheckbox").checked; + }-*/; + public final native void setNotifyCheckboxValue(boolean value) /*-{ + $doc.getElementById("notifyCheckbox").checked = value; + }-*/; /** * Publish a post. @@ -508,8 +505,7 @@ public class ShareUpdateForm extends Composite { } // notify group information - boolean notifyGroup = notifyListbox.getSelectedIndex() > 0; - + boolean notifyGroup = getNotifyCheckboxValue(); // case in which there are no attachments but there could be a link preview if(postContent == PostContent.ONLY_TEXT || postContent == PostContent.TEXT_AND_LINK){ 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 df46767..eeab662 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 @@ -7,10 +7,17 @@ width: 100%; } + .checkbox-inline { + display: inline-block; + vertical-align: middle; + float: left; + } + .paragraph-inline { display: inline-block; width: 25%; vertical-align: middle; + float: right; } @@ -43,12 +50,17 @@ - - - + + + + + + @@ -62,6 +74,8 @@ visible="false" /> + Notify diff --git a/src/main/webapp/ShareUpdates.css b/src/main/webapp/ShareUpdates.css index 590920c..2d3c561 100644 --- a/src/main/webapp/ShareUpdates.css +++ b/src/main/webapp/ShareUpdates.css @@ -1,5 +1,21 @@ +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) { - select.wizardListbox { + label.wizardListbox { width: 100% !important; } .attachment-container-full-width { @@ -332,14 +348,11 @@ a.link:hover { background-image: none; } -select.wizardListbox { +label.wizardListbox { + display: inline; width: 65%; - background: #F2F2F2 url(images/white-grad.png) repeat-x scroll left top; - border-color: #BBB; color: #444; - font-size: 12px; - border-width: 1px; - border-style: solid; + font-size: 16px; cursor: pointer; cursor: hand; margin-left: 0px; diff --git a/src/main/webapp/images/check_radio_sheet.png b/src/main/webapp/images/check_radio_sheet.png new file mode 100644 index 0000000000000000000000000000000000000000..65f51ccb5d2bb0ad3b2bf8899b68c66379ec2636 GIT binary patch literal 2170 zcmaJ@YgAKL7LEcD(Ubu#D2RrDU?t>DVj>Si5+Fj5hG2s;2r;=K5t18|izK{kMV<<% zP!uZ-RIP}-MOcbJfmT2Va0G)35GYi^Ql#oA2wEqhV&}&&cddKR*=K#3K~hk;c-|T0gETN;wdyDfri5& zKRhUXHl;{R<1&3d|OGZD+Cgpx1Wzte9i*6fqH7f)?|DAc0sfG4fpZ3RE zXz-|CSF-1oh5Jn;t8-k(19>(lYFnMAoW6;!X($Zuxskj2S_5&sqO&e>GNo;(apFAq zBq{zGHPWXFy+(dwEDZ)`SDdJ3l()V}*vj`d!2vI~b;CdZ6U4=X4563 zOB$(W6JY$fUE5QbVHMxNtv=j5XV$#CzkS4NrIoxW)a6d&Hk&*6{wKdaSHku%D!-q~ z6ih~(bLz+69$oBoPnfz@S+Ty1Z#Jqk4|Z?O zhch-ROfMj8ZvK%W4Gk;(er0#dMbg+sOFGP{q=O>Y+- z3o}s3ijtMy_61WRAx4OdzTbaMi|I0Ln9DJFqWb})-|iY4N#eVzQK*SzWqp)KV}tq-l{dFyr;fl(w! zt$BDXterC#rQ6>?T6Mn6%kqXOG;XD*dfS`%d?Cl^uDNrjoqK71PDGGJovb52p`*V% zM%bw|9lLy?icDP{b6xES-2SL(E6`@0RgCUzn14$ZwgmekcDM;zo~=t=6-tb_a;BJi zpL90(lt|-I8Iiw^y#jhZBy(20un+e_-wB{;p?_^!X<_zMYx4JKOa>?84m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