Added 12 months views. Improved buttons.

This commit is contained in:
Christian P. MOMON 2020-01-30 02:19:52 +01:00
parent 52c6f6e91e
commit 3aae196481
3 changed files with 23 additions and 4 deletions

View file

@ -18,6 +18,8 @@
*/ */
package org.april.agirstatool.core.pages; package org.april.agirstatool.core.pages;
import java.time.LocalDate;
import org.april.agirstatool.core.AgirStatoolException; import org.april.agirstatool.core.AgirStatoolException;
import org.april.agirstatool.core.Project; import org.april.agirstatool.core.Project;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -60,12 +62,16 @@ public class ProjectPage
data.setAttribute("agirLink", "href", "https://agir.april.org/projects/" + project.getIdentifier() + "/issues"); data.setAttribute("agirLink", "href", "https://agir.april.org/projects/" + project.getIdentifier() + "/issues");
data.setContent("versionsup", BuildInformation.instance().version()); data.setContent("versionsup", BuildInformation.instance().version());
data.setContent("createClosePreviousYearButton", LocalDate.now().getYear() - 1);
data.setContent("createdClosed3MonthsChart", CreatedClosedCountChartView.buildLastMonths("Created/closed 3 months Count", project, 3)); data.setContent("createdClosed3MonthsChart", CreatedClosedCountChartView.buildLastMonths("Created/closed 3 months Count", project, 3));
data.setContent("created-Closed3MonthsChart", CreatedClosedDiffChartView.buildLastMonths("Created-closed 3 months Count", project, 3)); data.setContent("created-Closed3MonthsChart", CreatedClosedDiffChartView.buildLastMonths("Created-closed 3 months Count", project, 3));
data.setContent("age3MonthsChart", IssueAgeChartView.buildLastMonths("Issue Age 3 months Chart", project, 3)); data.setContent("age3MonthsChart", IssueAgeChartView.buildLastMonths("Issue Age 3 months Chart", project, 3));
data.setContent("createdClosed6MonthsChart", CreatedClosedCountChartView.buildLastMonths("Created/closed 6 months Count", project, 6)); data.setContent("createdClosed6MonthsChart", CreatedClosedCountChartView.buildLastMonths("Created/closed 6 months Count", project, 6));
data.setContent("created-Closed6MonthsChart", CreatedClosedDiffChartView.buildLastMonths("Created-closed 6 months Count", project, 6)); data.setContent("created-Closed6MonthsChart", CreatedClosedDiffChartView.buildLastMonths("Created-closed 6 months Count", project, 6));
data.setContent("age6MonthsChart", IssueAgeChartView.buildLastMonths("Issue Age 6 months", project, 6)); data.setContent("age6MonthsChart", IssueAgeChartView.buildLastMonths("Issue Age 6 months", project, 6));
data.setContent("createdClosed12MonthsChart", CreatedClosedCountChartView.buildLastMonths("Created/closed 12 months Count", project, 12));
data.setContent("created-Closed12MonthsChart", CreatedClosedDiffChartView.buildLastMonths("Created-closed 12 months Count", project, 12));
data.setContent("age12MonthsChart", IssueAgeChartView.buildLastMonths("Issue Age 12 months", project, 12));
data.setContent("createdClosedPreviousYearChart", CreatedClosedCountChartView.buildPreviousYear("Created/closed last year Count", project)); data.setContent("createdClosedPreviousYearChart", CreatedClosedCountChartView.buildPreviousYear("Created/closed last year Count", project));
data.setContent("created-ClosedPreviousYearChart", CreatedClosedDiffChartView.buildPreviousYear("Created-closed last year Count", project)); data.setContent("created-ClosedPreviousYearChart", CreatedClosedDiffChartView.buildPreviousYear("Created-closed last year Count", project));
data.setContent("agePreviousYearChart", IssueAgeChartView.buildPreviousYear("Issue Age Previous Year Chart", project)); data.setContent("agePreviousYearChart", IssueAgeChartView.buildPreviousYear("Issue Age Previous Year Chart", project));

View file

@ -240,7 +240,7 @@ h3 span
text-decoration: none; text-decoration: none;
display: inline-block; display: inline-block;
font-size: 16px; font-size: 16px;
width: 110px; width: 90px;
} }
.button:hover .button:hover

View file

@ -16,11 +16,12 @@
<div> <div>
<div style="margin: 5px;"> <div style="margin: 5px;">
<a id="createClose3MonthsButton" href="#" class="button" onclick="javascript:createClosedSelect('3months');">3 months</a> <a id="createClose3MonthsButton" href="#" class="button" onclick="javascript:createClosedSelect('3months');">3 months</a>
<a id="createClose6MonthsButton" href="#" class="button selected" onclick="javascript:createClosedSelect('6months');">6 months</a> <a id="createClose6MonthsButton" href="#" class="button" onclick="javascript:createClosedSelect('6months');">6 months</a>
<a id="createClose12MonthsButton" href="#" class="button selected" onclick="javascript:createClosedSelect('12months');">12 months</a>
<a id="createCloseFullButton" href="#" class="button" onclick="javascript:createClosedSelect('full');">Full</a> <a id="createCloseFullButton" href="#" class="button" onclick="javascript:createClosedSelect('full');">Full</a>
<a id="createClosePreviousYearButton" href="#" class="button" onclick="javascript:createClosedSelect('previousYear');">Previous Year</a> <a id="createClosePreviousYearButton" href="#" class="button" onclick="javascript:createClosedSelect('previousYear');">Previous Year</a>
<span style="margin-left: 50px;"> </span> <span style="margin-left: 50px;"> </span>
<a href="#part2" class="button" title="Go down to the table below.">Down</a> <a href="#part2" class="button" title="Go down to the table below.">⇊ ⇊</a>
<span style="margin-left: 50px;"> </span> <span style="margin-left: 50px;"> </span>
<a href="index.xhtml" class="button">Root</a> <a href="index.xhtml" class="button">Root</a>
<a href="admins.xhtml" class="button">Admins</a> <a href="admins.xhtml" class="button">Admins</a>
@ -31,11 +32,16 @@
<div id="created-Closed3MonthsChart" style="display: inline-block; width: 33%; height: 400px;">CREATED-CLOSED 3 MONTHS CHART</div> <div id="created-Closed3MonthsChart" style="display: inline-block; width: 33%; height: 400px;">CREATED-CLOSED 3 MONTHS CHART</div>
<div id="age3MonthsChart" style="display: inline-block; width: 33%; height: 400px;">AGE 3 MONTHS CHART</div> <div id="age3MonthsChart" style="display: inline-block; width: 33%; height: 400px;">AGE 3 MONTHS CHART</div>
</div> </div>
<div id="6MonthsBox" style=""> <div id="6MonthsBox" style="display: none;">
<div id="createdClosed6MonthsChart" style="display: inline-block; width: 33%; height: 400px;">CREATED/CLOSED 6 MONTHS CHART</div> <div id="createdClosed6MonthsChart" style="display: inline-block; width: 33%; height: 400px;">CREATED/CLOSED 6 MONTHS CHART</div>
<div id="created-Closed6MonthsChart" style="display: inline-block; width: 33%; height: 400px;">CREATED-CLOSED 6 MONTHS CHART</div> <div id="created-Closed6MonthsChart" style="display: inline-block; width: 33%; height: 400px;">CREATED-CLOSED 6 MONTHS CHART</div>
<div id="age6MonthsChart" style="display: inline-block; width: 33%; height: 400px;">AGE 6 MONTHS CHART</div> <div id="age6MonthsChart" style="display: inline-block; width: 33%; height: 400px;">AGE 6 MONTHS CHART</div>
</div> </div>
<div id="12MonthsBox" style="">
<div id="createdClosed12MonthsChart" style="display: inline-block; width: 33%; height: 400px;">CREATED/CLOSED 12 MONTHS CHART</div>
<div id="created-Closed12MonthsChart" style="display: inline-block; width: 33%; height: 400px;">CREATED-CLOSED 12 MONTHS CHART</div>
<div id="age12MonthsChart" style="display: inline-block; width: 33%; height: 400px;">AGE 12 MONTHS CHART</div>
</div>
<div id="previousYearBox" style="display: none;"> <div id="previousYearBox" style="display: none;">
<div id="createdClosedPreviousYearChart" style="display: inline-block; width: 33%; height: 400px;">CREATED/CLOSED PREVIOUS YEAR CHART</div> <div id="createdClosedPreviousYearChart" style="display: inline-block; width: 33%; height: 400px;">CREATED/CLOSED PREVIOUS YEAR CHART</div>
<div id="created-ClosedPreviousYearChart" style="display: inline-block; width: 33%; height: 400px;">CREATED-CLOSED PREVIOUS YEAR CHART</div> <div id="created-ClosedPreviousYearChart" style="display: inline-block; width: 33%; height: 400px;">CREATED-CLOSED PREVIOUS YEAR CHART</div>
@ -85,11 +91,13 @@
{ {
document.getElementById ('createClose3MonthsButton').classList.remove('selected'); document.getElementById ('createClose3MonthsButton').classList.remove('selected');
document.getElementById ('createClose6MonthsButton').classList.remove('selected'); document.getElementById ('createClose6MonthsButton').classList.remove('selected');
document.getElementById ('createClose12MonthsButton').classList.remove('selected');
document.getElementById ('createClosePreviousYearButton').classList.remove('selected'); document.getElementById ('createClosePreviousYearButton').classList.remove('selected');
document.getElementById ('createCloseFullButton').classList.remove('selected'); document.getElementById ('createCloseFullButton').classList.remove('selected');
document.getElementById ('3MonthsBox').style.display = 'none'; document.getElementById ('3MonthsBox').style.display = 'none';
document.getElementById ('6MonthsBox').style.display = 'none'; document.getElementById ('6MonthsBox').style.display = 'none';
document.getElementById ('12MonthsBox').style.display = 'none';
document.getElementById ('previousYearBox').style.display = 'none'; document.getElementById ('previousYearBox').style.display = 'none';
document.getElementById ('fullBox').style.display = 'none'; document.getElementById ('fullBox').style.display = 'none';
@ -102,6 +110,11 @@
{ {
document.getElementById ('createClose6MonthsButton').classList.add('selected'); document.getElementById ('createClose6MonthsButton').classList.add('selected');
document.getElementById ('6MonthsBox').style.display = 'block'; document.getElementById ('6MonthsBox').style.display = 'block';
}
else if (selection == '12months')
{
document.getElementById ('createClose12MonthsButton').classList.add('selected');
document.getElementById ('12MonthsBox').style.display = 'block';
} }
else if (selection == 'previousYear') else if (selection == 'previousYear')
{ {