Commit dbe070a0 by Juho Juopperi

Merge branch 'participantRemove' into 'master'

Participant remove

Kurssitauhkaa, sekä tyylityksen muokkaus takas 90% -jutuksi -> se kiinteä rikko monia listoja (napit ulos tilasta) -> tarttee testata hyvin.

Ja kettu, pitää tännekkin näemmä muuttaa se i18n tabitustäppä.
2 parents 64433b09 cf8ada59
......@@ -57,7 +57,7 @@
<p:outputLabel for="themeSwitcher" value="#{i18n['event.theme']}:" />
<p:themeSwitcher value="#{eventorgView.event.theme}" id="themeSwitcher" var="t" style="width: 200px;" >
<f:selectItem itemLabel="Choose Theme" itemValue="" />
<f:selectItem itemLabel="Choose Theme" itemValue="Aristo" />
<f:selectItems value="#{themeSwitcherView.themes}" />
</p:themeSwitcher>
<p:message for="themeSwitcher" />
......
......@@ -13,6 +13,11 @@
<ui:define name="content">
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
<p:commandButton value="#{i18n['yes']}" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
<p:commandButton value="#{i18n['no']}" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
</p:confirmDialog>
<p:fieldset legend="#{lectureReportsView.currentLecture.name}">
<p:panelGrid columns="2">
<p:outputLabel value="#{i18n['lecture.description']}" />
......@@ -46,6 +51,21 @@
<p:column>
<h:outputText value="#{user.user.firstnames}" />
</p:column>
<p:column>
<p:commandButton value="#{i18n['lecture.unparticipate']}" actionListener="#{lectureReportsView.unParticipateCurrent}" update="participants :participants_count" onerror="location.reload(true)">
<f:attribute name="userid" value="#{user.id}" />
<p:confirm header="#{i18n['lecture.unparticipate.confirm.title']}" message="#{i18n['lecture.unparticipate.confirm.message']}" icon="ui-icon-alert" />
</p:commandButton>
</p:column>
</p:dataTable>
<p:dataTable styleClass="onlyPrint" id="emptyParticipants" value="#{lectureReportsView.emptyLinesList}" var="number">
<p:column style="width: 20px;">
<h:outputText value="#{number}" />
</p:column>
<p:column style="width: 700px;">
&nbsp;
</p:column>
</p:dataTable>
</h:form>
<br />
......
......@@ -11,4 +11,6 @@
.no_print {
display: none;
}
}
\ No newline at end of file
.ui-widget,.ui-widget .ui-widget,.ui-button-text,.ui-wizard-step-title {
font-size: 10pt !important;
/* Muutin takas -TKjne.
Syy: listoja yms. meni rikki kun sinne tarkoitettu sisältö ei enää mahtunutkaan paikoilleen -> jos tähän koskee kannattaa testata n. kaikki.
Fonttimuutoksen vois esmes yhdistää siihen kun säätää mahdollista uutta leiskaa käyttöön.
*/
font-size: 90% !important;
}
.ui-panelmenu-header {
......@@ -148,9 +152,6 @@ h1 {
width: 200px;
}
nav {
min-width: 200px;
background: white;
......@@ -160,7 +161,8 @@ nav {
#main {
min-width: 810px;
min-height: 400px; background : white;
min-height: 400px;
background: white;
margin-right: 1em;
border-right: 1px solid #aaa;
border-bottom: 1px solid #aaa;
......@@ -183,7 +185,6 @@ aside {
color: #2694e8;
}
#header a {
color: white;
text-decoration: none;
......@@ -193,7 +194,7 @@ aside {
text-align: right;
}
th, td {
th,td {
padding: 5px;
}
......@@ -219,3 +220,8 @@ th, td {
padding-bottom: 20px;
}
@media screen {
.onlyPrint {
display: none;
}
}
\ No newline at end of file
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Sat Mar 30 17:56:44 EET 2013
accountEvent.commit = Tallenna
actionlog.create.header = Create new actionmessage
actionlog.create.message = Message
actionlog.create.role = Target role
......@@ -235,6 +237,8 @@ lecture.selectgroup = Valitse aihealue
lecture.showParticipants = N\u00E4yt\u00E4 osallistujat
lecture.startTime = Aloitusaika
lecture.unparticipate = Poista ilmoittautuminen
lecture.unparticipate.confirm.message = Oletko varma ett\u00E4 haluat poistaa k\u00E4ytt\u00E4j\u00E4n kurssilta?
lecture.unparticipate.confirm.title = Poistetaanko
lectureGroup.createLectureGroup = Luo kurssikokonaisuus
lectureGroup.createNew = Luo uusi
......@@ -277,6 +281,8 @@ navi.auth.login = frontpage
navi.auth.loginerror = frontpage
navi.auth.logout = frontpage
no = Ei
off = Poissa
on = P\u00E4\u00E4ll\u00E4
......@@ -381,3 +387,5 @@ usercart.downloadCsv = CSV
usercart.showoverview = Vie tarkastusn\u00E4kym\u00E4\u00E4n
viewlectures.title = Kurssit ja luennot
yes = Kyll\u00E4
......@@ -612,6 +612,8 @@ lecture.selectgroup = Select lecturegroup
lecture.showParticipants = Show participants
lecture.startTime = Start time
lecture.unparticipate = Remove participation
lecture.unparticipate.confirm.message = Are you sure you want to remove participator from lecture?
lecture.unparticipate.confirm.title = Do we remove
lectureGroup.createLectureGroup = Create lecturegroup
lectureGroup.createNew = Create new
......@@ -739,6 +741,8 @@ newsgroup.writerRole = Writer roles
newslist.header = Newsgroups
no = No
off = Off
on = On
......@@ -1587,3 +1591,5 @@ voting.create.submitEnd = Submit close
voting.create.submitStart = Submit start
voting.create.voteEnd = Voting close
voting.create.voteStart = Voting start
yes = Yes
......@@ -621,6 +621,8 @@ lecture.saveLecture = Muokkaa
lecture.selectgroup = Valitse aihealue
lecture.startTime = Aloitusaika
lecture.unparticipate = Poista ilmoittautuminen
lecture.unparticipate.confirm.message = Oletko varma ett\u00E4 haluat poistaa k\u00E4ytt\u00E4j\u00E4n kurssilta?
lecture.unparticipate.confirm.title = Poistetaanko
lectureGroup.createLectureGroup = Luo kurssikokonaisuus
lectureGroup.createNew = Luo uusi
......@@ -748,6 +750,8 @@ newsgroup.writerRole = Kirjoittajaryhm\u00E4
newslist.header = Uutisryhm\u00E4t
no = Ei
off = Poissa
on = P\u00E4\u00E4ll\u00E4
......@@ -1568,3 +1572,5 @@ voting.create.submitEnd = Submit kiinni
voting.create.submitStart = Submit auki
voting.create.voteEnd = \u00C4\u00E4nestys kiinni
voting.create.voteStart = \u00C4\u00E4nestys auki
yes = Kyll\u00E4
package fi.codecrew.moya.web.lecture;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.faces.event.ActionEvent;
import javax.faces.model.ListDataModel;
import javax.inject.Inject;
import javax.inject.Named;
......@@ -104,6 +106,30 @@ public class LectureReportsView extends GenericCDIView {
return lectures;
}
public void unParticipateCurrent(ActionEvent event) {
Integer userId = (Integer) event.getComponent().getAttributes().get("userid");
// sometimes you just are lazy
for(EventUser user : getCurrentLecture().getParticipants()) {
if(user.getId() == userId) {
lectureBean.unparticipate(user, getCurrentLecture());
break;
}
}
}
public List<String> getEmptyLinesList() {
ArrayList<String> retList = new ArrayList<String>();
for(int n = getCurrentLecture().getParticipantsCount(); n < getCurrentLecture().getMaxParticipantsCount(); n++) {
retList.add(""+(n+1)+":");
}
return retList;
}
public int getCurrentGroupParticipateCount() {
......
......@@ -144,6 +144,10 @@ public class LectureUserView extends GenericCDIView {
}
public void onLecureCalendarEventSelect(SelectEvent selectEvent) {
if (!isParticipateActive()) {
return;
}
Lecture lecture = (Lecture) ((DefaultScheduleEvent) selectEvent.getObject()).getData();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!