Skip to content

Commit

Permalink
frontend: add button to see jury comments
Browse files Browse the repository at this point in the history
  • Loading branch information
slaporte committed Feb 23, 2022
1 parent b3975bb commit 5ccb6ef
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "montage",
"version": "20.11.14",
"version": "22.2.22",
"description": "Photo evaluation tool for and by Wiki Loves competitions",
"main": "src/app.module.js",
"repository": "https://github.com/hatnote/montage",
Expand Down Expand Up @@ -39,7 +39,6 @@
"ng-annotate-loader": "^0.1.0",
"ng-annotate-webpack-plugin": "^0.1.3",
"nib": "^1.1.0",
"node-sass": "^4.0.0",
"raw-loader": "^0.5.1",
"sass-loader": "^3.2.0",
"style-loader": "^0.13.1",
Expand All @@ -61,6 +60,7 @@
"lodash": "^4.17.20",
"material-design-icons": "^3.0.1",
"moment": "^2.15.1",
"ng-infinite-scroll": "^1.3.0"
"ng-infinite-scroll": "^1.3.0",
"node-sass": "^7.0.1"
}
}
17 changes: 17 additions & 0 deletions client/src/components/campaign/round/round.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@ function controller($window, adminService, alertService) {
vm.activateRound = activateRound;
vm.downloadResults = downloadResults;
vm.downloadEntries = downloadEntries;
vm.downloadReviews = downloadReviews;
vm.finalizeRound = finalizeRound;
vm.pauseRound = pauseRound;
vm.populateRound = populateRound;
vm.editRound = () => {
vm.round.edit = true;
};
vm.getReportedFiles = getReportedFiles;
vm.hasReviews = false

// functions

vm.$onInit = () => {
getRoundDetails(vm.round);
getRoundResults(vm.round);

adminService.getReviews(vm.round.id).then(data => {
if (data.data.length > 0) {
vm.hasReviews = true
}
})
};

/**
Expand Down Expand Up @@ -62,6 +70,15 @@ function controller($window, adminService, alertService) {
$window.open(url);
}

/**
*
*/
function downloadReviews() {
const url = adminService.downloadReviews(vm.round.id);
$window.open(url);
}


/**
*
*/
Expand Down
6 changes: 6 additions & 0 deletions client/src/components/campaign/round/round.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ <h4 layout="row" layout-align="space-between center">
<md-icon>collections</md-icon>
Download Entries
</md-button>
<md-button
ng-click="$ctrl.downloadReviews()"
ng-if="$ctrl.hasReviews">
<md-icon>feedback</md-icon>
See Jury Comments
</md-button>
<md-button ng-if="false"
ng-disabled="($ctrl.round.status !== 'paused' && $ctrl.round.status !== 'finalized') || $ctrl.loading"
ng-click="$ctrl.populateRound()">
Expand Down
4 changes: 3 additions & 1 deletion client/src/services/admin.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const Service = ($http, $q, $window) => {
allCampaigns: () => $http.get(base + '/campaigns/all'),
getCampaign: id => $http.get([base, 'campaign', id].join('/')),
getRound: id => $http.get([base, 'round', id].join('/')),
getReviews: id => $http.get([base, 'round', id, 'reviews'].join('/')),

addOrganizer: data => $http.post(`${base}/add_organizer`, data),
addCampaign: data => $http.post(`${base}/add_campaign`, data),
Expand All @@ -31,7 +32,8 @@ const Service = ($http, $q, $window) => {
advanceRound: (id, data) => $http.post(`${base}/round/${id}/advance`, data),

downloadRound: id => `${base}/round/${id}/results/download`,
downloadEntries: id => `${base}/round/${id}/entries/download`
downloadEntries: id => `${base}/round/${id}/entries/download`,
downloadReviews: id => `${base}/round/${id}/reviews`
};

return admin;
Expand Down

0 comments on commit 5ccb6ef

Please sign in to comment.