Commit 7b83cf06 by Tuomas Riihimäki Committed by Tuomas Riihimäki

UI fixes, etc

1 parent 46fb9c9e
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- Place slot count --> <!-- Place slot count -->
<h3> <h3>
<h:outputText value="#{i18n['mapView.yourPlaces']}" /> <h:outputText value="#{i18n['placemove.header']}" />
</h3> </h3>
<p:fragment id="placeselector"> <p:fragment id="placeselector">
<h:form> <h:form>
...@@ -37,22 +37,27 @@ ...@@ -37,22 +37,27 @@
value="#{mapPlacechangeView.slots}"> value="#{mapPlacechangeView.slots}">
<!-- rowStyleClass="#{mapPlacechangeView.srcPlace.contains(slot.place) ? 'selected' : 'unselected'}" --> <!-- rowStyleClass="#{mapPlacechangeView.srcPlace.contains(slot.place) ? 'selected' : 'unselected'}" -->
<p:column headerText="#{i18n['mapView.productcount.productname']}"> <p:column headerText="#{i18n['placemove.productname']}">
<h:outputText value="#{slot.src.product.name}" /> <h:outputText value="#{slot.src.product.name}" />
</p:column> </p:column>
<p:column headerText="#{i18n['mapView.productcount.unused']}"> <p:column headerText="#{i18n['placemove.placename']}">
<h:outputText renderer="#{!empty slot.src.place}" <h:outputText renderer="#{!empty slot.src.place}"
value="#{slot.src.place.name}" /> value="#{slot.src.place.name}" />
</p:column>
<p:column headerText="#{i18n['mapView.productcount.selected']}">
<h:outputText renderer="#{!empty slot.moving}"
value="#{slot.moving}" />
</p:column> </p:column>
<p:column headerText="#{i18n['mapView.productcount.selected']}"> <p:column headerText="#{i18n['placemove.placeuser']}">
<h:outputText renderer="#{!empty slot.dst}" <h:outputText rendered="#{!empty slot.src.place.currentUser}"
value="#{slot.dst.name}" /> value="#{slot.src.place.currentUser.wholeNmae}" />
<h:outputText rendered="#{empty slot.src.place.currentUser}"
value="-" />
</p:column>
<p:column headerText="#{i18n['placemove.dstplace']}">
<div style="padding: 0.3em 0;">
<h:outputText renderer="#{!empty slot.dst}"
value="#{slot.dst.name}" />
</div>
</p:column> </p:column>
<p:column> <p:column>
...@@ -66,23 +71,26 @@ ...@@ -66,23 +71,26 @@
actionListener="#{mapPlacechangeView.unselectSlot}" actionListener="#{mapPlacechangeView.unselectSlot}"
rendered="#{slot.moving}" value="#{i18n['placemove.deselect']}" rendered="#{slot.moving}" value="#{i18n['placemove.deselect']}"
update="placeselector" /> update="placeselector" />
</ui:fragment> </ui:fragment>
</p:column> </p:column>
</p:dataTable> </p:dataTable>
</h:form> </h:form>
<script type="text/javascript"> <script type="text/javascript">
toggleSuccess = #{mapPlacechangeView.toggleSuccess}; toggleSuccess = #{mapPlacechangeView.toggleSuccess};
</script> </script>
</p:fragment> </p:fragment>
<h:form id="placemove"> <div style="padding: 1em 0;">
<p:commandButton <h:form id="placemove">
rendered="#{ajaxMapView.canUserBuy()}" <p:commandButton
value="#{i18n['mapPlacechange.commitMove']}" disabled="#{!mapPlacechangeView.isReadyForCommit()}"
action="#{mapPlacechangeView.commitMove()}" rendered="#{ajaxMapView.canUserBuy()}"
ajax="false" value="#{i18n['placemove.commitMove']}"
/> action="#{mapPlacechangeView.commitMove()}" ajax="false" />
</h:form> </h:form>
</div>
......
...@@ -79,6 +79,15 @@ public class MapPlacechangeView extends GenericCDIView { ...@@ -79,6 +79,15 @@ public class MapPlacechangeView extends GenericCDIView {
} }
public boolean isReadyForCommit() {
for (MoveContainer mc : moveContainers) {
if (mc.isMoving() && mc.getDst() == null) {
return false;
}
}
return true;
}
public void initView() { public void initView() {
// If we are overriding user, check permission. // If we are overriding user, check permission.
...@@ -97,19 +106,19 @@ public class MapPlacechangeView extends GenericCDIView { ...@@ -97,19 +106,19 @@ public class MapPlacechangeView extends GenericCDIView {
} }
} }
public String commitMove(){ public String commitMove() {
HashMap<Place, Place> change = new HashMap<Place,Place>(); HashMap<Place, Place> change = new HashMap<Place, Place>();
for(MoveContainer s : slots){ for (MoveContainer s : slots) {
if(s.isMoving() && s.getDst() != null){ if (s.isMoving() && s.getDst() != null) {
change.put(s.getSrc().getPlace(), s.getDst()); change.put(s.getSrc().getPlace(), s.getDst());
} }
} }
placebean.movePlaces(change); placebean.movePlaces(change);
//slots = null; // slots = null;
//initView(); // initView();
return "/place/myGroups?faces_redirect=true"; return "/place/myGroups?faces_redirect=true";
} }
......
...@@ -731,7 +731,7 @@ place.release = Release this place ...@@ -731,7 +731,7 @@ place.release = Release this place
place.releasetime = Release time place.releasetime = Release time
place.reserveForUser = Reserve for the user place.reserveForUser = Reserve for the user
place.reservetime = Reservetime place.reservetime = Reservetime
place.send = Transfer place place.send = Assign to user
place.width = Width place.width = Width
placeReservation.buyConfirm.content = Are you sure, this is difficult to cancel? placeReservation.buyConfirm.content = Are you sure, this is difficult to cancel?
...@@ -782,6 +782,15 @@ placegroupview.token = Place token / user ...@@ -782,6 +782,15 @@ placegroupview.token = Place token / user
placegroupview.toptext = \ placegroupview.toptext = \
placegroupview.unlockedPlacesNotification = You have unlocked places, you must lock them before you can see your tickets! placegroupview.unlockedPlacesNotification = You have unlocked places, you must lock them before you can see your tickets!
placemove.commitMove = Move places
placemove.deselect = Cancel relocation
placemove.dstplace = New location
placemove.header = Relocate places
placemove.placename = Place
placemove.placeuser = User
placemove.productname = Ticket type
placemove.selectSlotForMove = Select for relocation
placeslot.add = Add place slot placeslot.add = Add place slot
placeslot.bill = Bill placeslot.bill = Bill
placeslot.id = ID placeslot.id = ID
......
...@@ -992,7 +992,7 @@ place.release = Release this place ...@@ -992,7 +992,7 @@ place.release = Release this place
place.releasetime = Release time place.releasetime = Release time
place.reserveForUser = Reserve for the user place.reserveForUser = Reserve for the user
place.reservetime = Reservetime place.reservetime = Reservetime
place.send = Transfer place place.send = Assign to user
place.width = Width place.width = Width
placeReservation.buyConfirm.content = Are you sure, this is difficult to cancel? placeReservation.buyConfirm.content = Are you sure, this is difficult to cancel?
...@@ -1042,6 +1042,15 @@ placegroupview.reserveForSelf = Select the place for yourself ...@@ -1042,6 +1042,15 @@ placegroupview.reserveForSelf = Select the place for yourself
placegroupview.token = Place token / user placegroupview.token = Place token / user
placegroupview.unlockedPlacesNotification = You have unlocked places, you must lock them before you can see your tickets! placegroupview.unlockedPlacesNotification = You have unlocked places, you must lock them before you can see your tickets!
placemove.commitMove = Move places
placemove.deselect = Cancel relocation
placemove.dstplace = New location
placemove.header = Relocate places
placemove.placename = Place
placemove.placeuser = User
placemove.productname = Ticket type
placemove.selectSlotForMove = Select for relocation
placeslot.add = Add place slot placeslot.add = Add place slot
placeslot.bill = Bill placeslot.bill = Bill
placeslot.id = ID placeslot.id = ID
......
...@@ -979,7 +979,7 @@ place.release = Vapauta paikka ...@@ -979,7 +979,7 @@ place.release = Vapauta paikka
place.releasetime = Vapautusaika place.releasetime = Vapautusaika
place.reserveForUser = Varaa k\u00E4ytt\u00E4j\u00E4lle place.reserveForUser = Varaa k\u00E4ytt\u00E4j\u00E4lle
place.reservetime = Varaamisaika place.reservetime = Varaamisaika
place.send = Siirr\u00E4 paikka place.send = Luovuta k\u00E4ytt\u00E4j\u00E4lle
place.width = Leveys place.width = Leveys
placeReservation.buyConfirm.content = Oletko varma, t\u00E4t\u00E4 on vaikea peruuttaa? placeReservation.buyConfirm.content = Oletko varma, t\u00E4t\u00E4 on vaikea peruuttaa?
...@@ -1029,6 +1029,15 @@ placegroupview.reserveForSelf = Valitse paikka itsellesi ...@@ -1029,6 +1029,15 @@ placegroupview.reserveForSelf = Valitse paikka itsellesi
placegroupview.token = Paikkakoodi / k\u00E4ytt\u00E4j\u00E4 placegroupview.token = Paikkakoodi / k\u00E4ytt\u00E4j\u00E4
placegroupview.unlockedPlacesNotification = Sinulla on lukitsemattomia paikkoja, sinun tulee lukita ne ennenkuin voit tarkastella lippuasi! placegroupview.unlockedPlacesNotification = Sinulla on lukitsemattomia paikkoja, sinun tulee lukita ne ennenkuin voit tarkastella lippuasi!
placemove.commitMove = Siirr\u00E4 paikat
placemove.deselect = Peru siirto
placemove.dstplace = Uusi paikka
placemove.header = Siirr\u00E4 paikkoja
placemove.placename = Paikka
placemove.placeuser = K\u00E4ytt\u00E4j\u00E4
placemove.productname = Lipputyyppi
placemove.selectSlotForMove = Valitse siirrett\u00E4v\u00E4ksi
placeslot.add = Lis\u00E4\u00E4 paikkaslotti placeslot.add = Lis\u00E4\u00E4 paikkaslotti
placeslot.bill = Lasku placeslot.bill = Lasku
placeslot.id = ID placeslot.id = ID
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!