replaced checkbox with switch button widget
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@163171 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a28e65c7dd
commit
3e78a3044b
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/share-updates-2.5.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/share-updates-2.6.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/share-updates-2.5.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/share-updates-2.6.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -38,5 +38,5 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/share-updates-2.5.0-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/share-updates-2.6.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
|
<Changeset component="org.gcube.portlets-user.shareupdates.2-6-0"
|
||||||
|
date="2018-02-07">
|
||||||
|
<Change>restyled checkbox for notifications</Change>
|
||||||
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portlets-user.shareupdates.2-5-0"
|
<Changeset component="org.gcube.portlets-user.shareupdates.2-5-0"
|
||||||
date="2017-12-07">
|
date="2017-12-07">
|
||||||
<Change>drop down menu replaced with checkbox for notifications, see Task #9971</Change>
|
<Change>drop down menu replaced with checkbox for notifications, see Task #9971</Change>
|
||||||
|
|
7
pom.xml
7
pom.xml
|
@ -13,7 +13,7 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>share-updates</artifactId>
|
<artifactId>share-updates</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>2.5.0-SNAPSHOT</version>
|
<version>2.6.0-SNAPSHOT</version>
|
||||||
<name>gCube Share Updates Portlet</name>
|
<name>gCube Share Updates Portlet</name>
|
||||||
<description>
|
<description>
|
||||||
gCube Share Updates for exchanging updates with other users of VREs.
|
gCube Share Updates for exchanging updates with other users of VREs.
|
||||||
|
@ -94,6 +94,11 @@
|
||||||
<artifactId>gcube-widgets</artifactId>
|
<artifactId>gcube-widgets</artifactId>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
|
<artifactId>switch-button-widget</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.core</groupId>
|
||||||
<artifactId>common-scope-maps</artifactId>
|
<artifactId>common-scope-maps</artifactId>
|
||||||
|
|
|
@ -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.events.FileUploadCompleteEventHandler;
|
||||||
import org.gcube.portlets.widgets.fileupload.client.view.FileSubmit;
|
import org.gcube.portlets.widgets.fileupload.client.view.FileSubmit;
|
||||||
import org.gcube.portlets.widgets.fileupload.client.view.UploadProgressPanel;
|
import org.gcube.portlets.widgets.fileupload.client.view.UploadProgressPanel;
|
||||||
|
import org.gcube.portlets.widgets.switchbutton.client.SwitchButton;
|
||||||
import org.jsonmaker.gwt.client.Jsonizer;
|
import org.jsonmaker.gwt.client.Jsonizer;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
|
@ -152,7 +153,9 @@ public class ShareUpdateForm extends Composite {
|
||||||
ListBox privacyLevel = new ListBox();
|
ListBox privacyLevel = new ListBox();
|
||||||
@UiField
|
@UiField
|
||||||
SaveInWorkspaceBox saveInWorkspaceCheckbox;
|
SaveInWorkspaceBox saveInWorkspaceCheckbox;
|
||||||
|
@UiField
|
||||||
|
SwitchButton sb;
|
||||||
|
|
||||||
// requested user's information
|
// requested user's information
|
||||||
private UserInfo myUserInfo;
|
private UserInfo myUserInfo;
|
||||||
|
|
||||||
|
@ -210,7 +213,6 @@ public class ShareUpdateForm extends Composite {
|
||||||
|
|
||||||
if (myUserInfo.isAdmin())
|
if (myUserInfo.isAdmin())
|
||||||
privacyLevel.addItem("Share with: Everyone", PrivacyLevel.PORTAL.toString());
|
privacyLevel.addItem("Share with: Everyone", PrivacyLevel.PORTAL.toString());
|
||||||
|
|
||||||
//change css if deployed in VRE scope
|
//change css if deployed in VRE scope
|
||||||
if (!userSettings.isInfrastructure()) {
|
if (!userSettings.isInfrastructure()) {
|
||||||
setNotifyCheckboxValue(notificationEmail);
|
setNotifyCheckboxValue(notificationEmail);
|
||||||
|
@ -282,10 +284,8 @@ public class ShareUpdateForm extends Composite {
|
||||||
* Bind events to manage
|
* Bind events to manage
|
||||||
*/
|
*/
|
||||||
private void bind() {
|
private void bind() {
|
||||||
|
|
||||||
//get the uploaded file result
|
//get the uploaded file result
|
||||||
eventBus.addHandler(FileUploadCompleteEvent.TYPE, new FileUploadCompleteEventHandler() {
|
eventBus.addHandler(FileUploadCompleteEvent.TYPE, new FileUploadCompleteEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUploadComplete(FileUploadCompleteEvent event) {
|
public void onUploadComplete(FileUploadCompleteEvent event) {
|
||||||
String absolutePathOnServer = event.getUploadedFileInfo().getAbsolutePath();
|
String absolutePathOnServer = event.getUploadedFileInfo().getAbsolutePath();
|
||||||
|
@ -471,13 +471,13 @@ public class ShareUpdateForm extends Composite {
|
||||||
onSubmitClickHandlerBody(e);
|
onSubmitClickHandlerBody(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
public final native boolean getNotifyCheckboxValue() /*-{
|
private boolean getNotifyCheckboxValue() {
|
||||||
return $doc.getElementById("notifyCheckbox").checked;
|
return sb.getValue();
|
||||||
}-*/;
|
}
|
||||||
|
|
||||||
public final native void setNotifyCheckboxValue(boolean value) /*-{
|
private void setNotifyCheckboxValue(boolean value) {
|
||||||
$doc.getElementById("notifyCheckbox").checked = value;
|
sb.setValue(value);
|
||||||
}-*/;
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Publish a post.
|
* Publish a post.
|
||||||
|
|
|
@ -1,18 +1,13 @@
|
||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:org.gcube.portlets.user.shareupdates.client.view"
|
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:org.gcube.portlets.user.shareupdates.client.view"
|
||||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:j="urn:import:org.gcube.portlets.widgets.fileupload.client.view">
|
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">
|
||||||
<ui:style>
|
<ui:style>
|
||||||
.attachment-container {
|
.attachment-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkbox-inline {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.paragraph-inline {
|
.paragraph-inline {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 25%;
|
width: 25%;
|
||||||
|
@ -52,14 +47,12 @@
|
||||||
<b:Form>
|
<b:Form>
|
||||||
<b:ListBox styleName="wizardListbox" ui:field="privacyLevel"
|
<b:ListBox styleName="wizardListbox" ui:field="privacyLevel"
|
||||||
visible="false" />
|
visible="false" />
|
||||||
<g:SimplePanel styleName="{style.checkbox-inline}">
|
<g:SimplePanel styleName="checkbox-inline">
|
||||||
<g:HTMLPanel styleName="checkboxNotify">
|
<g:HorizontalPanel>
|
||||||
<input type="checkbox" id="notifyCheckbox" />
|
<g:HTML>Notify members: </g:HTML>
|
||||||
<label for="notifyCheckbox">
|
<s:SwitchButton ui:field="sb"></s:SwitchButton>
|
||||||
<span></span>
|
</g:HorizontalPanel>
|
||||||
Notify members
|
|
||||||
</label>
|
|
||||||
</g:HTMLPanel>
|
|
||||||
</g:SimplePanel>
|
</g:SimplePanel>
|
||||||
<g:HorizontalPanel styleName="{style.paragraph-inline}">
|
<g:HorizontalPanel styleName="{style.paragraph-inline}">
|
||||||
<b:Button ui:field="attachButtonScreen" icon="UPLOAD_ALT"
|
<b:Button ui:field="attachButtonScreen" icon="UPLOAD_ALT"
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||||
<!-- inherits GCUBE Widgets -->
|
<!-- inherits GCUBE Widgets -->
|
||||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||||
|
<inherits name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
|
||||||
|
|
||||||
<inherits
|
<inherits
|
||||||
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
|
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
|
||||||
|
|
|
@ -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) {
|
@media screen and (max-width: 1050px) {
|
||||||
label.wizardListbox {
|
label.wizardListbox {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
|
@ -50,6 +34,22 @@ input#notifyCheckbox[type="checkbox"]:checked + label span {
|
||||||
.share-updates-table {
|
.share-updates-table {
|
||||||
width: 100% !important;
|
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 {
|
.attachment-container-full-width {
|
||||||
|
|
Loading…
Reference in New Issue