Merge branch 'develop' of ssh://git.dsv.su.se/git/scipro/scipro into develop
* 'develop' of ssh://git.dsv.su.se/git/scipro/scipro: Fix of broken ui-logic, was impossible to create new final seminar Spelling+comments Fix of hiding of "Last 12 months" on peer portal page depending on
This commit is contained in:
commit
7563cc7e7f
src/main/java/se/su/dsv/scipro
components
opponent/panels
peer/panels
@ -56,7 +56,7 @@ public abstract class AbstractMenuPanel extends Panel {
|
||||
protected void populateItem( ListItem<MenuItem> item ) {
|
||||
final MenuItem mi = item.getModelObject();
|
||||
boolean highLightAsCurrentByInterface = false;
|
||||
Class<?> menuItemInterface = mi.getMenuHilightInterface();
|
||||
Class<?> menuItemInterface = mi.getMenuHighlightInterface();
|
||||
if( menuItemInterface != null ){
|
||||
for( Class<?> actualPageInterface : containerClass.getInterfaces() ){
|
||||
if( actualPageInterface.equals(menuItemInterface) ){
|
||||
@ -72,7 +72,7 @@ public abstract class AbstractMenuPanel extends Panel {
|
||||
&&
|
||||
mi.getTargetClass().getSuperclass() != menuContainerCommonSuperClass
|
||||
)
|
||||
){
|
||||
){
|
||||
//item.setMarkupId("current");
|
||||
//item.setOutputMarkupId(true);
|
||||
//Replaced the above because it generates invalid markup if two menus are added to the same page (id no longer unique)
|
||||
@ -99,7 +99,8 @@ public abstract class AbstractMenuPanel extends Panel {
|
||||
}
|
||||
/**
|
||||
* May not rely on anything in the implementing class's constructor as this will not have been initialized yet.
|
||||
* Items are rendered from left to right as you might expect, first item in the list will be first tab item on the left.
|
||||
* Items are rendered from left to right (or top to bottom depending on type of menu) as you might expect,
|
||||
* the first item in the list will be the first menu item on the left/top.
|
||||
* @return
|
||||
*/
|
||||
protected abstract List<MenuItem> getItemList();
|
||||
@ -118,7 +119,7 @@ public abstract class AbstractMenuPanel extends Panel {
|
||||
private Class<? extends Page> targetClass;
|
||||
private PageParameters pp;
|
||||
private String iconName;
|
||||
private Class<? extends MenuHighlight> menuHilightInterface;
|
||||
private Class<? extends MenuHighlight> menuHighlightInterface;
|
||||
|
||||
public MenuItem(final String name, final Class<? extends Page> targetClass) {
|
||||
this(name, targetClass, null, null, null);
|
||||
@ -148,7 +149,7 @@ public abstract class AbstractMenuPanel extends Panel {
|
||||
public MenuItem(final String name, final Class<? extends Page> targetClass, final Class<? extends MenuHighlight> menuHilightInterface, PageParameters pp, String iconName) {
|
||||
this.name = name;
|
||||
this.targetClass = targetClass;
|
||||
this.menuHilightInterface = menuHilightInterface;
|
||||
this.menuHighlightInterface = menuHilightInterface;
|
||||
this.pp = pp;
|
||||
this.iconName = iconName == null ? ImageIcon.ICON_EMPTY : iconName;
|
||||
}
|
||||
@ -169,13 +170,13 @@ public abstract class AbstractMenuPanel extends Panel {
|
||||
return iconName;
|
||||
}
|
||||
|
||||
public MenuItem setMenuHilightInterface(Class<? extends MenuHighlight> menuHilightInterface) {
|
||||
this.menuHilightInterface = menuHilightInterface;
|
||||
public MenuItem setMenuHighlightInterface(Class<? extends MenuHighlight> menuHighlightInterface) {
|
||||
this.menuHighlightInterface = menuHighlightInterface;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Class<? extends MenuHighlight> getMenuHilightInterface() {
|
||||
return menuHilightInterface;
|
||||
public Class<? extends MenuHighlight> getMenuHighlightInterface() {
|
||||
return menuHighlightInterface;
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,22 +23,15 @@ public class ProjectFinalSeminarContainerPanel extends Panel {
|
||||
public ProjectFinalSeminarContainerPanel(final String id, final Project project, final boolean isSupervisorView){
|
||||
super(id);
|
||||
|
||||
final List<FinalSeminar> seminars = finalSeminarDao.findFinalSeminarsByProject(project);
|
||||
List<FinalSeminar> seminars = finalSeminarDao.findFinalSeminarsByProject(project);
|
||||
|
||||
if(isSupervisorView && !seminars.isEmpty() ){
|
||||
if(isSupervisorView && seminars.isEmpty() ){
|
||||
add(new OpponentPanel("addSeminar", project));
|
||||
}
|
||||
else {
|
||||
add(new EmptyPanel("addSeminar"));
|
||||
}
|
||||
add(new Label("noSeminarsMessage", "No final seminar has been created for this project"){
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean isVisible(){
|
||||
return seminars.size() == 0;
|
||||
}
|
||||
});
|
||||
add(new Label("noSeminarsMessage", "No final seminar has been created for this project").setVisible(seminars.isEmpty()));
|
||||
|
||||
add(new ListView<FinalSeminar>("seminarList", seminars){
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -89,7 +89,7 @@
|
||||
<span class="box-title">Best rated reviewers</span>
|
||||
<div wicket:id="bestRatedPanel" class="append-bottom"></div>
|
||||
</div>
|
||||
<div>
|
||||
<div wicket:id="statsTimespanContainer">
|
||||
<i><span class="small right">Last 12 months</span></i>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -221,16 +221,23 @@ public class PeerPortalPanel extends Panel {
|
||||
int displayedReviews = gsettings.getNumberOfLatestReviewsDisplayed();
|
||||
|
||||
|
||||
boolean showStatsTimespan = false;
|
||||
if(gsettings.isPeerDisplayNumberOfReviewsPerformed()){
|
||||
add(new MostFrequentReviewersPanel(mostFrequentPanel));
|
||||
showStatsTimespan = true;
|
||||
} else {
|
||||
add(new InvisiblePanel(mostFrequentPanel));
|
||||
}
|
||||
if( gsettings.isPeerRatingsEnabled() ){
|
||||
add(new WebMarkupContainer(bestRatedContainer).add(new BestRatedReviewersPanel("bestRatedPanel") ) );
|
||||
showStatsTimespan = true;
|
||||
} else {
|
||||
add(new InvisiblePanel(bestRatedContainer));
|
||||
}
|
||||
WebMarkupContainer statsTimespanContainer = new WebMarkupContainer("statsTimespanContainer");
|
||||
statsTimespanContainer.setVisible(showStatsTimespan);
|
||||
add(statsTimespanContainer);
|
||||
|
||||
if(gsettings.isPeerDisplayLatestReviews()) {
|
||||
// Checkbox on the AdminPeerSettingsPage is not visible since it's
|
||||
// not decided what kind of info that should be public for students.
|
||||
|
Loading…
x
Reference in New Issue
Block a user