Revision 36153
Added by Stefania Martziou about 9 years ago
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/user/CurrentEligibleProjectsInfoElement.java | ||
---|---|---|
1 |
package eu.dnetlib.client.user; |
|
2 |
|
|
3 |
import com.github.gwtbootstrap.client.ui.Alert; |
|
4 |
import com.github.gwtbootstrap.client.ui.constants.AlertType; |
|
5 |
import com.google.gwt.i18n.client.DateTimeFormat; |
|
6 |
import com.google.gwt.user.client.ui.FlowPanel; |
|
7 |
import com.google.gwt.user.client.ui.HTML; |
|
8 |
import com.google.gwt.user.client.ui.IsWidget; |
|
9 |
import com.google.gwt.user.client.ui.Widget; |
|
10 |
import eu.dnetlib.goldoa.domain.Project; |
|
11 |
|
|
12 |
import java.util.List; |
|
13 |
|
|
14 |
/** |
|
15 |
* Created by stefania on 4/8/15. |
|
16 |
*/ |
|
17 |
public class CurrentEligibleProjectsInfoElement implements IsWidget { |
|
18 |
|
|
19 |
private FlowPanel currentEligibleProjectsPanel = new FlowPanel(); |
|
20 |
private HTML currentEligibleProjectsInfo = new HTML(); |
|
21 |
private String currentEligibleProjectsInfoContents = ""; |
|
22 |
private Alert currentEligibleProjectsWarningLabel = new Alert(); |
|
23 |
|
|
24 |
private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd"); |
|
25 |
|
|
26 |
public CurrentEligibleProjectsInfoElement(List<Project> projectList) { |
|
27 |
|
|
28 |
for(int i=0; i<projectList.size(); i++) { |
|
29 |
if(((i+1)%2)==1) |
|
30 |
currentEligibleProjectsInfoContents += "<dd class=\"odd\">"; |
|
31 |
else |
|
32 |
currentEligibleProjectsInfoContents += "<dd>"; |
|
33 |
|
|
34 |
if (projectList.get(i).getAcronym() != null) |
|
35 |
currentEligibleProjectsInfoContents += "<span class=\"strong\">" + projectList.get(i).getAcronym() + "</span>"; |
|
36 |
|
|
37 |
if (projectList.get(i).getGrant() !=null) |
|
38 |
currentEligibleProjectsInfoContents += "<span class=\"strong\"> - " + projectList.get(i).getGrant() + "</span>"; |
|
39 |
|
|
40 |
if (projectList.get(i).getTitle() != null) |
|
41 |
currentEligibleProjectsInfoContents += " \"" + projectList.get(i).getTitle() + "\" "; |
|
42 |
|
|
43 |
if (projectList.get(i).getEndDate()!=null) |
|
44 |
currentEligibleProjectsInfoContents += " (ends " + dtf.format(projectList.get(i).getEndDate()) + ")"; |
|
45 |
|
|
46 |
currentEligibleProjectsInfoContents += "</dd>"; |
|
47 |
} |
|
48 |
currentEligibleProjectsInfo.setHTML(currentEligibleProjectsInfoContents); |
|
49 |
|
|
50 |
currentEligibleProjectsPanel.add(currentEligibleProjectsInfo); |
|
51 |
|
|
52 |
if(projectList.isEmpty()) { |
|
53 |
currentEligibleProjectsWarningLabel.addStyleName("alertLabel"); |
|
54 |
currentEligibleProjectsWarningLabel.setType(AlertType.WARNING); |
|
55 |
currentEligibleProjectsWarningLabel.setClose(false); |
|
56 |
currentEligibleProjectsWarningLabel.setText("No projects matched your criteria"); |
|
57 |
currentEligibleProjectsPanel.add(currentEligibleProjectsWarningLabel); |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public Widget asWidget() { |
|
63 |
return currentEligibleProjectsPanel; |
|
64 |
} |
|
65 |
|
|
66 |
public void addStyleName(String styleName) { |
|
67 |
currentEligibleProjectsPanel.addStyleName(styleName); |
|
68 |
} |
|
69 |
} |
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/user/EligibleProjectsInfoWidget.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.client.user; |
2 | 2 |
|
3 |
import com.github.gwtbootstrap.client.ui.Alert; |
|
4 |
import com.github.gwtbootstrap.client.ui.constants.AlertType; |
|
5 |
import com.google.gwt.i18n.client.DateTimeFormat; |
|
3 |
import com.github.gwtbootstrap.client.ui.Tab; |
|
4 |
import com.github.gwtbootstrap.client.ui.TabPanel; |
|
6 | 5 |
import com.google.gwt.user.client.ui.FlowPanel; |
7 |
import com.google.gwt.user.client.ui.HTML; |
|
8 | 6 |
import com.google.gwt.user.client.ui.IsWidget; |
9 | 7 |
import com.google.gwt.user.client.ui.Widget; |
10 |
import eu.dnetlib.goldoa.domain.Project; |
|
11 | 8 |
import eu.dnetlib.shared.EligiblePresentAndFutureProjects; |
12 | 9 |
|
13 |
import java.util.List; |
|
14 |
|
|
15 | 10 |
/** |
16 | 11 |
* Created by stefania on 4/6/15. |
17 | 12 |
*/ |
... | ... | |
19 | 14 |
|
20 | 15 |
private FlowPanel eligibleProjectsInfoPanel = new FlowPanel(); |
21 | 16 |
|
22 |
private FlowPanel currentEligibleProjectsPanel = new FlowPanel(); |
|
23 |
private HTML currentEligibleProjectsInfo = new HTML(); |
|
24 |
private String currentEligibleProjectsInfoContents = ""; |
|
25 |
private Alert currentEligibleProjectsWarningLabel = new Alert(); |
|
17 |
private TabPanel eligibleProjectsTabPanel = new TabPanel(); |
|
18 |
private Tab currentEligibleProjectsTab = new Tab(); |
|
19 |
private Tab futureEligibleProjectsTab = new Tab(); |
|
26 | 20 |
|
27 |
private FlowPanel futureEligibleProjectsPanel = new FlowPanel(); |
|
28 |
private HTML futureEligibleProjectsInfo = new HTML(); |
|
29 |
private String futureEligibleProjectsInfoContents = ""; |
|
30 |
private Alert futureEligibleProjectsWarningLabel = new Alert(); |
|
21 |
private CurrentEligibleProjectsInfoElement currentEligibleProjectsInfoElement; |
|
22 |
private FutureEligibleProjectsInfoElement futureEligibleProjectsInfoElement; |
|
31 | 23 |
|
32 |
private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd"); |
|
33 |
|
|
34 | 24 |
public EligibleProjectsInfoWidget(EligiblePresentAndFutureProjects eligiblePresentAndFutureProjects) { |
35 | 25 |
|
36 |
List<Project> currentEligibleProjects = eligiblePresentAndFutureProjects.getPresentEligibleProjects();
|
|
37 |
currentEligibleProjectsInfoContents += "<dl><dt class=\"chronologySubTitle\">CURRENTLY ELIGIBLE PROJECTS</dt></dl>";
|
|
26 |
currentEligibleProjectsInfoElement = new CurrentEligibleProjectsInfoElement(eligiblePresentAndFutureProjects.getPresentEligibleProjects());
|
|
27 |
currentEligibleProjectsInfoElement.addStyleName("tabInner");
|
|
38 | 28 |
|
39 |
for(int i=0; i<currentEligibleProjects.size(); i++) { |
|
40 |
if(((i+1)%2)==1) |
|
41 |
currentEligibleProjectsInfoContents += "<dd class=\"odd\">"; |
|
42 |
else |
|
43 |
currentEligibleProjectsInfoContents += "<dd>"; |
|
29 |
futureEligibleProjectsInfoElement = new FutureEligibleProjectsInfoElement(eligiblePresentAndFutureProjects.getFutureEligibleProjects()); |
|
30 |
futureEligibleProjectsInfoElement.addStyleName("tabInner"); |
|
44 | 31 |
|
45 |
if (currentEligibleProjects.get(i).getAcronym() != null)
|
|
46 |
currentEligibleProjectsInfoContents += "<span class=\"strong\">" + currentEligibleProjects.get(i).getAcronym() + "</span>";
|
|
32 |
eligibleProjectsTabPanel.add(currentEligibleProjectsTab);
|
|
33 |
eligibleProjectsTabPanel.add(futureEligibleProjectsTab);
|
|
47 | 34 |
|
48 |
if (currentEligibleProjects.get(i).getTitle() != null)
|
|
49 |
currentEligibleProjectsInfoContents += " - " + currentEligibleProjects.get(i).getTitle();
|
|
35 |
eligibleProjectsTabPanel.setTabPosition("above");
|
|
36 |
eligibleProjectsTabPanel.addStyleName("tabPanel");
|
|
50 | 37 |
|
51 |
if (currentEligibleProjects.get(i).getEndDate()!=null) |
|
52 |
currentEligibleProjectsInfoContents += " (end date: " + dtf.format(currentEligibleProjects.get(i).getEndDate()) + ")"; |
|
38 |
currentEligibleProjectsTab.setActive(true); |
|
39 |
currentEligibleProjectsTab.setHeading("CURRENT ELIGIBLE PROJECTS"); |
|
40 |
currentEligibleProjectsTab.add(currentEligibleProjectsInfoElement.asWidget()); |
|
53 | 41 |
|
54 |
currentEligibleProjectsInfoContents += "</dd>"; |
|
55 |
} |
|
56 |
currentEligibleProjectsInfo.setHTML(currentEligibleProjectsInfoContents); |
|
42 |
futureEligibleProjectsTab.setHeading("FUTURE ELIGIBLE PROJECTS"); |
|
43 |
futureEligibleProjectsTab.add(futureEligibleProjectsInfoElement.asWidget()); |
|
57 | 44 |
|
58 |
currentEligibleProjectsPanel.add(currentEligibleProjectsInfo); |
|
59 |
|
|
60 |
if(currentEligibleProjects.isEmpty()) { |
|
61 |
currentEligibleProjectsWarningLabel.addStyleName("alertLabel"); |
|
62 |
currentEligibleProjectsWarningLabel.setType(AlertType.WARNING); |
|
63 |
currentEligibleProjectsWarningLabel.setClose(false); |
|
64 |
currentEligibleProjectsWarningLabel.setText("No projects matched your criteria"); |
|
65 |
currentEligibleProjectsPanel.add(currentEligibleProjectsWarningLabel); |
|
66 |
} |
|
67 |
|
|
68 |
List<Project> futureEligibleProjects = eligiblePresentAndFutureProjects.getFutureEligibleProjects(); |
|
69 |
futureEligibleProjectsInfoContents += "<dl><dt class=\"chronologySubTitle\">FUTURE ELIGIBLE PROJECTS</dt></dl>"; |
|
70 |
|
|
71 |
for(int i=0; i<futureEligibleProjects.size(); i++) { |
|
72 |
if(((i+1)%2)==1) |
|
73 |
futureEligibleProjectsInfoContents += "<dd class=\"odd\">"; |
|
74 |
else |
|
75 |
futureEligibleProjectsInfoContents += "<dd>"; |
|
76 |
|
|
77 |
if (futureEligibleProjects.get(i).getAcronym() != null) |
|
78 |
futureEligibleProjectsInfoContents += "<span class=\"strong\">" + futureEligibleProjects.get(i).getAcronym() + "</span>"; |
|
79 |
|
|
80 |
if (futureEligibleProjects.get(i).getTitle() != null) |
|
81 |
futureEligibleProjectsInfoContents += " - " + futureEligibleProjects.get(i).getTitle(); |
|
82 |
|
|
83 |
if (futureEligibleProjects.get(i).getEndDate()!=null) |
|
84 |
futureEligibleProjectsInfoContents += " (end date: " + dtf.format(futureEligibleProjects.get(i).getEndDate()) + ")"; |
|
85 |
|
|
86 |
futureEligibleProjectsInfoContents += "</dd>"; |
|
87 |
} |
|
88 |
futureEligibleProjectsInfo.setHTML(futureEligibleProjectsInfoContents); |
|
89 |
|
|
90 |
futureEligibleProjectsPanel.add(futureEligibleProjectsInfo); |
|
91 |
|
|
92 |
if(futureEligibleProjects.isEmpty()) { |
|
93 |
futureEligibleProjectsWarningLabel.addStyleName("alertLabel"); |
|
94 |
futureEligibleProjectsWarningLabel.setType(AlertType.WARNING); |
|
95 |
futureEligibleProjectsWarningLabel.setClose(false); |
|
96 |
futureEligibleProjectsWarningLabel.setText("No projects matched your criteria"); |
|
97 |
futureEligibleProjectsPanel.add(futureEligibleProjectsWarningLabel); |
|
98 |
} |
|
99 |
|
|
100 |
|
|
101 |
eligibleProjectsInfoPanel.add(currentEligibleProjectsPanel); |
|
102 |
eligibleProjectsInfoPanel.add(futureEligibleProjectsPanel); |
|
103 |
|
|
45 |
eligibleProjectsInfoPanel.add(eligibleProjectsTabPanel); |
|
104 | 46 |
} |
105 | 47 |
|
106 | 48 |
@Override |
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/user/FutureEligibleProjectsInfoElement.java | ||
---|---|---|
1 |
package eu.dnetlib.client.user; |
|
2 |
|
|
3 |
import com.github.gwtbootstrap.client.ui.Alert; |
|
4 |
import com.github.gwtbootstrap.client.ui.constants.AlertType; |
|
5 |
import com.google.gwt.i18n.client.DateTimeFormat; |
|
6 |
import com.google.gwt.user.client.ui.FlowPanel; |
|
7 |
import com.google.gwt.user.client.ui.HTML; |
|
8 |
import com.google.gwt.user.client.ui.IsWidget; |
|
9 |
import com.google.gwt.user.client.ui.Widget; |
|
10 |
import eu.dnetlib.goldoa.domain.Project; |
|
11 |
|
|
12 |
import java.util.List; |
|
13 |
|
|
14 |
/** |
|
15 |
* Created by stefania on 4/8/15. |
|
16 |
*/ |
|
17 |
public class FutureEligibleProjectsInfoElement implements IsWidget { |
|
18 |
|
|
19 |
private FlowPanel futureEligibleProjectsPanel = new FlowPanel(); |
|
20 |
private HTML futureEligibleProjectsInfo = new HTML(); |
|
21 |
private String futureEligibleProjectsInfoContents = ""; |
|
22 |
private Alert futureEligibleProjectsWarningLabel = new Alert(); |
|
23 |
|
|
24 |
private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd"); |
|
25 |
|
|
26 |
public FutureEligibleProjectsInfoElement(List<Project> projectList) { |
|
27 |
|
|
28 |
for(int i=0; i<projectList.size(); i++) { |
|
29 |
if(((i+1)%2)==1) |
|
30 |
futureEligibleProjectsInfoContents += "<dd class=\"odd\">"; |
|
31 |
else |
|
32 |
futureEligibleProjectsInfoContents += "<dd>"; |
|
33 |
|
|
34 |
if (projectList.get(i).getAcronym() != null) |
|
35 |
futureEligibleProjectsInfoContents += "<span class=\"strong\">" + projectList.get(i).getAcronym() + "</span>"; |
|
36 |
|
|
37 |
if (projectList.get(i).getGrant() !=null) |
|
38 |
futureEligibleProjectsInfoContents += "<span class=\"strong\"> - " + projectList.get(i).getGrant() + "</span>"; |
|
39 |
|
|
40 |
if (projectList.get(i).getTitle() != null) |
|
41 |
futureEligibleProjectsInfoContents += " \"" + projectList.get(i).getTitle() + "\" "; |
|
42 |
|
|
43 |
if (projectList.get(i).getEndDate()!=null) |
|
44 |
futureEligibleProjectsInfoContents += " (ends " + dtf.format(projectList.get(i).getEndDate()) + ")"; |
|
45 |
|
|
46 |
futureEligibleProjectsInfoContents += "</dd>"; |
|
47 |
} |
|
48 |
futureEligibleProjectsInfo.setHTML(futureEligibleProjectsInfoContents); |
|
49 |
|
|
50 |
futureEligibleProjectsPanel.add(futureEligibleProjectsInfo); |
|
51 |
|
|
52 |
if(projectList.isEmpty()) { |
|
53 |
futureEligibleProjectsWarningLabel.addStyleName("alertLabel"); |
|
54 |
futureEligibleProjectsWarningLabel.setType(AlertType.WARNING); |
|
55 |
futureEligibleProjectsWarningLabel.setClose(false); |
|
56 |
futureEligibleProjectsWarningLabel.setText("No projects matched your criteria"); |
|
57 |
futureEligibleProjectsPanel.add(futureEligibleProjectsWarningLabel); |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public Widget asWidget() { |
|
63 |
return futureEligibleProjectsPanel; |
|
64 |
} |
|
65 |
|
|
66 |
public void addStyleName(String styleName) { |
|
67 |
futureEligibleProjectsPanel.addStyleName(styleName); |
|
68 |
} |
|
69 |
} |
modules/uoa-goldoa-portal/trunk/src/main/webapp/GoldOAPortal.css | ||
---|---|---|
1467 | 1467 |
|
1468 | 1468 |
.marginTop30 { |
1469 | 1469 |
margin-top: 30px !important; |
1470 |
} |
|
1471 |
|
|
1472 |
/********************************/ |
|
1473 |
|
|
1474 |
.tabPanel { |
|
1475 |
padding: 0 3% 3%; |
|
1476 |
width: 94%; |
|
1477 |
} |
|
1478 |
|
|
1479 |
.tabPanel .nav { |
|
1480 |
margin-bottom: 0px; |
|
1481 |
} |
|
1482 |
|
|
1483 |
.nav-tabs > li > a { |
|
1484 |
color: #006a90; |
|
1485 |
} |
|
1486 |
|
|
1487 |
.tabInner { |
|
1488 |
border-left: 1px solid rgba(83, 68, 65, 0.3); |
|
1489 |
border-right: 1px solid rgba(83, 68, 65, 0.3); |
|
1490 |
border-bottom: 1px solid rgba(83, 68, 65, 0.3); |
|
1491 |
padding: 3%; |
|
1492 |
} |
|
1493 |
|
|
1494 |
.tabInner dd { |
|
1495 |
margin-bottom: 5px !important; |
|
1496 |
padding: 5px 10px; |
|
1497 |
} |
|
1498 |
|
|
1499 |
.nav-tabs { |
|
1500 |
border-bottom: 1px solid rgba(83, 68, 65, 0.3) !important; |
|
1501 |
} |
|
1502 |
|
|
1503 |
.nav-tabs > .active > a, |
|
1504 |
.nav-tabs > .active > a:hover, |
|
1505 |
.nav-tabs > .active > a:focus { |
|
1506 |
background-color: rgba(83, 68, 65, 0.08) !important; |
|
1507 |
border-left-color: rgba(83, 68, 65, 0.3) !important; |
|
1508 |
border-right-color: rgba(83, 68, 65, 0.3) !important; |
|
1509 |
border-top-color: rgba(83, 68, 65, 0.3) !important; |
|
1510 |
border-bottom: 0 none !important; |
|
1470 | 1511 |
} |
Also available in: Unified diff
- Current and future eligible projects list are now in seperate tabs
- Added grant agreement number in lists of current/future eligible projects