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

UI fixes, etc

1 parent 46fb9c9e
......@@ -28,7 +28,7 @@
<!-- Place slot count -->
<h3>
<h:outputText value="#{i18n['mapView.yourPlaces']}" />
<h:outputText value="#{i18n['placemove.header']}" />
</h3>
<p:fragment id="placeselector">
<h:form>
......@@ -37,22 +37,27 @@
value="#{mapPlacechangeView.slots}">
<!-- 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}" />
</p:column>
<p:column headerText="#{i18n['mapView.productcount.unused']}">
<p:column headerText="#{i18n['placemove.placename']}">
<h:outputText renderer="#{!empty slot.src.place}"
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 headerText="#{i18n['mapView.productcount.selected']}">
<p:column headerText="#{i18n['placemove.placeuser']}">
<h:outputText rendered="#{!empty slot.src.place.currentUser}"
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>
......@@ -66,23 +71,26 @@
actionListener="#{mapPlacechangeView.unselectSlot}"
rendered="#{slot.moving}" value="#{i18n['placemove.deselect']}"
update="placeselector" />
</ui:fragment>
</p:column>
</p:dataTable>
</h:form>
<script type="text/javascript">
toggleSuccess = #{mapPlacechangeView.toggleSuccess};
</script>
</p:fragment>
<div style="padding: 1em 0;">
<h:form id="placemove">
<p:commandButton
disabled="#{!mapPlacechangeView.isReadyForCommit()}"
rendered="#{ajaxMapView.canUserBuy()}"
value="#{i18n['mapPlacechange.commitMove']}"
action="#{mapPlacechangeView.commitMove()}"
ajax="false"
/>
value="#{i18n['placemove.commitMove']}"
action="#{mapPlacechangeView.commitMove()}" ajax="false" />
</h:form>
</div>
......
......@@ -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() {
// If we are overriding user, check permission.
......@@ -98,18 +107,18 @@ public class MapPlacechangeView extends GenericCDIView {
}
}
public String commitMove(){
public String commitMove() {
HashMap<Place, Place> change = new HashMap<Place,Place>();
for(MoveContainer s : slots){
if(s.isMoving() && s.getDst() != null){
HashMap<Place, Place> change = new HashMap<Place, Place>();
for (MoveContainer s : slots) {
if (s.isMoving() && s.getDst() != null) {
change.put(s.getSrc().getPlace(), s.getDst());
}
}
placebean.movePlaces(change);
//slots = null;
//initView();
// slots = null;
// initView();
return "/place/myGroups?faces_redirect=true";
}
......
......@@ -731,7 +731,7 @@ place.release = Release this place
place.releasetime = Release time
place.reserveForUser = Reserve for the user
place.reservetime = Reservetime
place.send = Transfer place
place.send = Assign to user
place.width = Width
placeReservation.buyConfirm.content = Are you sure, this is difficult to cancel?
......@@ -782,6 +782,15 @@ placegroupview.token = Place token / user
placegroupview.toptext = \
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.bill = Bill
placeslot.id = ID
......
......@@ -992,7 +992,7 @@ place.release = Release this place
place.releasetime = Release time
place.reserveForUser = Reserve for the user
place.reservetime = Reservetime
place.send = Transfer place
place.send = Assign to user
place.width = Width
placeReservation.buyConfirm.content = Are you sure, this is difficult to cancel?
......@@ -1042,6 +1042,15 @@ placegroupview.reserveForSelf = Select the place for yourself
placegroupview.token = Place token / user
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.bill = Bill
placeslot.id = ID
......
......@@ -979,7 +979,7 @@ place.release = Vapauta paikka
place.releasetime = Vapautusaika
place.reserveForUser = Varaa k\u00E4ytt\u00E4j\u00E4lle
place.reservetime = Varaamisaika
place.send = Siirr\u00E4 paikka
place.send = Luovuta k\u00E4ytt\u00E4j\u00E4lle
place.width = Leveys
placeReservation.buyConfirm.content = Oletko varma, t\u00E4t\u00E4 on vaikea peruuttaa?
......@@ -1029,6 +1029,15 @@ placegroupview.reserveForSelf = Valitse paikka itsellesi
placegroupview.token = Paikkakoodi / k\u00E4ytt\u00E4j\u00E4
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.bill = Lasku
placeslot.id = ID
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!