mirror of
https://github.com/ArenMg/aren.git
synced 2024-12-23 07:19:46 +00:00
Regler problème sur vote majoritaire
This commit is contained in:
parent
dce5e7d132
commit
cf439ba51c
1 changed files with 53 additions and 49 deletions
|
@ -63,6 +63,31 @@ public class VMThemeRESTFacade extends AbstractRESTFacade<VMTheme>{
|
||||||
|
|
||||||
|
|
||||||
themes.forEach(theme -> {
|
themes.forEach(theme -> {
|
||||||
|
this.orderChoices(theme);
|
||||||
|
newThemes.add(theme) ;
|
||||||
|
});
|
||||||
|
|
||||||
|
return newThemes ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@DELETE
|
||||||
|
@Path("delete/{id}")
|
||||||
|
@RolesAllowed({"ADMIN"})
|
||||||
|
public void delete(@PathParam("id") Long id) {
|
||||||
|
themeService.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
//@RolesAllowed({"MODO"})
|
||||||
|
@PermitAll
|
||||||
|
public VMTheme find(Long id) {
|
||||||
|
boolean withChoices = this.overview == null;
|
||||||
|
VMTheme theme = themeService.find(id,withChoices,true);
|
||||||
|
this.orderChoices(theme);
|
||||||
|
return theme;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void orderChoices(VMTheme theme){
|
||||||
Object []choices=theme.getChoices().toArray() ;
|
Object []choices=theme.getChoices().toArray() ;
|
||||||
List<VMChoice> choicesNotVoted=new ArrayList<>() ;
|
List<VMChoice> choicesNotVoted=new ArrayList<>() ;
|
||||||
List<ProposalTallyInterface> proposalTallyInterfaces=new ArrayList<>() ;
|
List<ProposalTallyInterface> proposalTallyInterfaces=new ArrayList<>() ;
|
||||||
|
@ -111,26 +136,5 @@ public class VMThemeRESTFacade extends AbstractRESTFacade<VMTheme>{
|
||||||
}
|
}
|
||||||
|
|
||||||
theme.setChoices(setChoices);
|
theme.setChoices(setChoices);
|
||||||
newThemes.add(theme) ;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
return newThemes ;
|
|
||||||
}
|
|
||||||
|
|
||||||
@DELETE
|
|
||||||
@Path("delete/{id}")
|
|
||||||
@RolesAllowed({"ADMIN"})
|
|
||||||
public void delete(@PathParam("id") Long id) {
|
|
||||||
themeService.delete(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
//@RolesAllowed({"MODO"})
|
|
||||||
@PermitAll
|
|
||||||
public VMTheme find(Long id) {
|
|
||||||
boolean withChoices = this.overview == null;
|
|
||||||
VMTheme theme = themeService.find(id,withChoices,true);
|
|
||||||
return theme;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue