Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0bdb53ee
authored
May 13, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.insomnia.fi:/data/bortal
2 parents
1bbb6be2
e01439e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
6 deletions
code/LanBortalWeb/WebContent/voting/compolist.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoListView.java
code/LanBortalWeb/WebContent/voting/compolist.xhtml
View file @
0bdb53e
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:metadata>
<!-- <f:event type="preRenderView" listener="#{votingCompoListView.initView}" /> -->
<f:event
type=
"preRenderView"
listener=
"#{votingCompoListView.initView()}"
/>
</f:metadata>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:outputStylesheet
library=
"style"
name=
"insomnia2/css/actionlog.css"
/>
<h:outputStylesheet
library=
"style"
name=
"insomnia2/css/actionlog.css"
/>
...
@@ -33,14 +33,14 @@
...
@@ -33,14 +33,14 @@
</f:facet>
</f:facet>
<h:outputText
value=
"#{compo.description}"
/>
<h:outputText
value=
"#{compo.description}"
/>
</h:column>
</h:column>
<h:column>
<h:column
rendered=
"#{votingCompoListView.curEntries}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"current entries"
/>
<h:outputText
value=
"current entries"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{compo.compoEntries.size()}"
/>
<h:outputText
value=
"#{compo.compoEntries.size()}"
/>
</h:column>
</h:column>
<h:column>
<h:column
rendered=
"#{votingCompoListView.maxParts}"
>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"Max parts"
/>
<h:outputText
value=
"Max parts"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{compo.maxParticipantCount}"
/>
<h:outputText
value=
"#{compo.maxParticipantCount}"
/>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoListView.java
View file @
0bdb53e
...
@@ -4,12 +4,17 @@ import java.util.List;
...
@@ -4,12 +4,17 @@ import java.util.List;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.bean.ManagedBean
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
import
fi.insomnia.bortal.model.Compo
;
import
fi.insomnia.bortal.model.Compo
;
import
fi.insomnia.bortal.model.Role
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.enums.apps.CompoPermission
;
@ManagedBean
@Named
@Named
@RequestScoped
@RequestScoped
public
class
VotingCompoListView
extends
GenericCDIView
{
public
class
VotingCompoListView
extends
GenericCDIView
{
...
@@ -18,12 +23,43 @@ public class VotingCompoListView extends GenericCDIView {
...
@@ -18,12 +23,43 @@ public class VotingCompoListView extends GenericCDIView {
@EJB
@EJB
private
VotingBeanLocal
votbean
;
private
VotingBeanLocal
votbean
;
private
Role
role
;
boolean
curEntries
;
boolean
maxParts
;
public
boolean
isCurEntries
()
{
return
curEntries
;
}
public
void
setCurEntries
(
boolean
curEntries
)
{
this
.
curEntries
=
curEntries
;
}
boolean
curEntries
=
false
;
public
boolean
isMaxParts
()
{
boolean
maxParts
=
false
;
return
maxParts
;
}
public
void
setMaxParts
(
boolean
maxParts
)
{
this
.
maxParts
=
maxParts
;
}
public
List
<
Compo
>
getCompos
()
{
public
List
<
Compo
>
getCompos
()
{
return
votbean
.
getCompoList
();
return
votbean
.
getCompoList
();
}
}
public
void
initView
()
{
if
(
requirePermissions
(
CompoPermission
.
VIEW_COMPOS
)
&&
role
==
null
)
{
curEntries
=
true
;
maxParts
=
true
;
}
else
{
curEntries
=
false
;
maxParts
=
false
;
}
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment