Skip to content

Commit

Permalink
refactor: move /contributor
Browse files Browse the repository at this point in the history
Resolves #1896
  • Loading branch information
jo-elimu committed Sep 29, 2024
1 parent ad7fdb3 commit b38b63c
Show file tree
Hide file tree
Showing 26 changed files with 58 additions and 67 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ai.elimu.web.content.contributor;
package ai.elimu.web.contributor;

import ai.elimu.dao.AudioContributionEventDao;
import ai.elimu.dao.AudioPeerReviewEventDao;
Expand Down Expand Up @@ -29,7 +29,7 @@
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/content/contributor/{contributorId}")
@RequestMapping("/contributor/{contributorId}")
public class ContributorController {

private final Logger logger = LogManager.getLogger();
Expand Down Expand Up @@ -111,6 +111,6 @@ public String handleRequest(
}
model.addAttribute("numberPeerReviewEventsByContributionMap", numberPeerReviewEventsByContributionMap);

return "content/contributor/contributor";
return "contributor/contributor";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ai.elimu.web.content.contributor;
package ai.elimu.web.contributor;

import ai.elimu.dao.ContributorDao;
import ai.elimu.dao.LetterContributionEventDao;
Expand Down Expand Up @@ -28,7 +28,7 @@
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/content/contributor/list")
@RequestMapping("/contributor/list")
public class ContributorCsvExportController {

private final Logger logger = LogManager.getLogger();
Expand Down Expand Up @@ -60,9 +60,9 @@ public void handleRequest(

CSVFormat csvFormat = CSVFormat.DEFAULT
.withHeader(
"contributor_id",
"ethereum_address",
"impact_percentage",
"contributor_id"
"impact_percentage"
);
StringWriter stringWriter = new StringWriter();
CSVPrinter csvPrinter = new CSVPrinter(stringWriter, csvFormat);
Expand Down Expand Up @@ -108,9 +108,9 @@ public void handleRequest(
logger.debug("impactPercentage: " + impactPercentage);

csvPrinter.printRecord(
contributor.getId(),
ethereumAddress,
impactPercentage,
contributor.getId()
impactPercentage
);

csvPrinter.flush();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ai.elimu.web.content.contributor;
package ai.elimu.web.contributor;

import ai.elimu.dao.ContributorDao;
import org.apache.logging.log4j.Logger;
Expand All @@ -10,7 +10,7 @@
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/content/contributor/list")
@RequestMapping("/contributor/list")
public class ContributorListController {

private final Logger logger = LogManager.getLogger();
Expand All @@ -24,6 +24,6 @@ public String handleRequest(Model model) {

model.addAttribute("contributors", contributorDao.readAllOrderedDesc());

return "content/contributor/list";
return "contributor/list";
}
}
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/admin/layout.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
</div>
</a>
<ul id='contributorDropdown' class='dropdown-content'>
<li><a href="<spring:url value='/content/contributor/${contributor.id}' />"><i class="material-icons left">art_track</i><fmt:message key="my.contributions" /></a></li>
<li><a href="<spring:url value='/contributor/${contributor.id}' />"><i class="material-icons left">art_track</i><fmt:message key="my.contributions" /></a></li>
<li class="divider"></li>
<li><a href="<spring:url value='/content/contributor/edit-name' />"><i class="material-icons left">mode_edit</i><fmt:message key="edit.name" /></a></li>
<li><a href="<spring:url value='/contributor/edit-name' />"><i class="material-icons left">mode_edit</i><fmt:message key="edit.name" /></a></li>
<%--<li class="divider"></li>
<li><a href="<spring:url value='/content/contributor/edit-email' />"><i class="material-icons left">mail</i><fmt:message key="edit.email" /></a></li>--%>
<sec:authorize access="hasRole('ROLE_ADMIN')">
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/jsp/content/layout.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
</div>
</a>
<ul id='contributorDropdown' class='dropdown-content'>
<li><a href="<spring:url value='/content/contributor/${contributor.id}' />"><i class="material-icons left">art_track</i><fmt:message key="my.contributions" /></a></li>
<li><a href="<spring:url value='/contributor/${contributor.id}' />"><i class="material-icons left">art_track</i><fmt:message key="my.contributions" /></a></li>
<li class="divider"></li>
<li><a href="<spring:url value='/content/contributor/edit-name' />"><i class="material-icons left">mode_edit</i><fmt:message key="edit.name" /></a></li>
<%--<li class="divider"></li>
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/letter-sound/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
(<fmt:formatNumber maxFractionDigits="0" value="${letterSoundContributionEvent.timeSpentMs / 1000 / 60}" /> min).
<fmt:formatDate value="${letterSoundContributionEvent.timestamp.time}" pattern="yyyy-MM-dd HH:mm" />
</span>
<a href="<spring:url value='/content/contributor/${letterSoundContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${letterSoundContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty letterSoundContributionEvent.contributor.imageUrl}">
Expand Down Expand Up @@ -244,7 +244,7 @@
<c:if test="${letterSoundPeerReviewEvent.letterSoundContributionEvent.id == letterSoundContributionEvent.id}">
<div class="row peerReviewEvent indent" data-approved="${letterSoundPeerReviewEvent.isApproved()}">
<div class="col s4">
<a href="<spring:url value='/content/contributor/${letterSoundPeerReviewEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${letterSoundPeerReviewEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty letterSoundPeerReviewEvent.contributor.imageUrl}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/ <c:forEach var="sound" items="${letterSound.sounds}"><a href="<spring:url value='/content/sound/edit/${sound.id}' />">${sound.valueIpa}</a> </c:forEach> /
</td>
<td>
<a href="<spring:url value='/content/contributor/${letterSoundContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${letterSoundContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty letterSoundContributionEvent.contributor.imageUrl}">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/letter/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
(<fmt:formatNumber maxFractionDigits="0" value="${letterContributionEvent.timeSpentMs / 1000 / 60}" /> min).
<fmt:formatDate value="${letterContributionEvent.timestamp.time}" pattern="yyyy-MM-dd HH:mm" />
</span>
<a href="<spring:url value='/content/contributor/${letterContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${letterContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty letterContributionEvent.contributor.imageUrl}">
Expand Down Expand Up @@ -105,7 +105,7 @@
<c:if test="${letterPeerReviewEvent.letterContributionEvent.id == letterContributionEvent.id}">
<div class="row peerReviewEvent indent" data-approved="${letterPeerReviewEvent.isApproved()}">
<div class="col s4">
<a href="<spring:url value='/content/contributor/${letterPeerReviewEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${letterPeerReviewEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty letterPeerReviewEvent.contributor.imageUrl}">
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/content/main.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<ol style="list-style-type: inherit;">
<c:forEach var="contributor" items="${contributorsWithStoryBookContributions}">
<li>
<a href="<spring:url value='/content/contributor/${contributor.id}' />">
<a href="<spring:url value='/contributor/${contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty contributor.imageUrl}">
Expand Down Expand Up @@ -179,7 +179,7 @@
<ol style="list-style-type: inherit;">
<c:forEach var="contributor" items="${contributorsWithAudioContributions}">
<li>
<a href="<spring:url value='/content/contributor/${contributor.id}' />">
<a href="<spring:url value='/contributor/${contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty contributor.imageUrl}">
Expand Down Expand Up @@ -212,7 +212,7 @@
<ol style="list-style-type: inherit;">
<c:forEach var="contributor" items="${contributorsWithWordContributions}">
<li>
<a href="<spring:url value='/content/contributor/${contributor.id}' />">
<a href="<spring:url value='/contributor/${contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty contributor.imageUrl}">
Expand Down Expand Up @@ -245,7 +245,7 @@
<ol style="list-style-type: inherit;">
<c:forEach var="contributor" items="${contributorsWithNumberContributions}">
<li>
<a href="<spring:url value='/content/contributor/${contributor.id}' />">
<a href="<spring:url value='/contributor/${contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty contributor.imageUrl}">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/multimedia/audio/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
(<fmt:formatNumber maxFractionDigits="0" value="${audioContributionEvent.timeSpentMs / 1000 / 60}" /> min).
<fmt:formatDate value="${audioContributionEvent.timestamp.time}" pattern="yyyy-MM-dd HH:mm" />
</span>
<a href="<spring:url value='/content/contributor/${audioContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${audioContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty audioContributionEvent.contributor.imageUrl}">
Expand Down Expand Up @@ -224,7 +224,7 @@
<c:if test="${audioPeerReviewEvent.audioContributionEvent.id == audioContributionEvent.id}">
<div class="row peerReviewEvent indent" data-approved="${audioPeerReviewEvent.isApproved()}">
<div class="col s4">
<a href="<spring:url value='/content/contributor/${audioPeerReviewEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${audioPeerReviewEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty audioPeerReviewEvent.contributor.imageUrl}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
(<fmt:formatNumber maxFractionDigits="0" value="${imageContributionEvent.timeSpentMs / 1000 / 60}" /> min).
<fmt:formatDate value="${imageContributionEvent.timestamp.time}" pattern="yyyy-MM-dd HH:mm" />
</span>
<a href="<spring:url value='/content/contributor/${imageContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${imageContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty imageContributionEvent.contributor.imageUrl}">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/number/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
(<fmt:formatNumber maxFractionDigits="0" value="${numberContributionEvent.timeSpentMs / 1000 / 60}" /> min).
<fmt:formatDate value="${numberContributionEvent.timestamp.time}" pattern="yyyy-MM-dd HH:mm" />
</span>
<a href="<spring:url value='/content/contributor/${numberContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${numberContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty numberContributionEvent.contributor.imageUrl}">
Expand Down Expand Up @@ -213,7 +213,7 @@
<c:if test="${numberPeerReviewEvent.numberContributionEvent.id == numberContributionEvent.id}">
<div class="row peerReviewEvent indent" data-approved="${numberPeerReviewEvent.isApproved()}">
<div class="col s4">
<a href="<spring:url value='/content/contributor/${numberPeerReviewEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${numberPeerReviewEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty numberPeerReviewEvent.contributor.imageUrl}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</c:forEach>
</td>
<td>
<a href="<spring:url value='/content/contributor/${numberContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${numberContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty numberContributionEvent.contributor.imageUrl}">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/sound/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
(<fmt:formatNumber maxFractionDigits="0" value="${soundContributionEvent.timeSpentMs / 1000 / 60}" /> min).
<fmt:formatDate value="${soundContributionEvent.timestamp.time}" pattern="yyyy-MM-dd HH:mm" />
</span>
<a href="<spring:url value='/content/contributor/${soundContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${soundContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty soundContributionEvent.contributor.imageUrl}">
Expand Down Expand Up @@ -109,7 +109,7 @@
<c:if test="${soundPeerReviewEvent.soundContributionEvent.id == soundContributionEvent.id}">
<div class="row peerReviewEvent indent" data-approved="${soundPeerReviewEvent.isApproved()}">
<div class="col s4">
<a href="<spring:url value='/content/contributor/${soundPeerReviewEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${soundPeerReviewEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty soundPeerReviewEvent.contributor.imageUrl}">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/storybook/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
(<fmt:formatNumber maxFractionDigits="0" value="${storyBookContributionEvent.timeSpentMs / 1000 / 60}" /> min).
<fmt:formatDate value="${storyBookContributionEvent.timestamp.time}" pattern="yyyy-MM-dd HH:mm" />
</span>
<a href="<spring:url value='/content/contributor/${storyBookContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${storyBookContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty storyBookContributionEvent.contributor.imageUrl}">
Expand Down Expand Up @@ -259,7 +259,7 @@
<c:if test="${storyBookPeerReviewEvent.storyBookContributionEvent.id == storyBookContributionEvent.id}">
<div class="row peerReviewEvent indent" data-approved="${storyBookPeerReviewEvent.isApproved()}">
<div class="col s4">
<a href="<spring:url value='/content/contributor/${storyBookPeerReviewEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${storyBookPeerReviewEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty storyBookPeerReviewEvent.contributor.imageUrl}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<fmt:message key="reading.level.${storyBook.readingLevel}" />
</td>
<td>
<a href="<spring:url value='/content/contributor/${storyBookContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${storyBookContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty storyBookContributionEvent.contributor.imageUrl}">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/word/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
(<fmt:formatNumber maxFractionDigits="0" value="${wordContributionEvent.timeSpentMs / 1000 / 60}" /> min).
<fmt:formatDate value="${wordContributionEvent.timestamp.time}" pattern="yyyy-MM-dd HH:mm" />
</span>
<a href="<spring:url value='/content/contributor/${wordContributionEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${wordContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty wordContributionEvent.contributor.imageUrl}">
Expand Down Expand Up @@ -269,7 +269,7 @@
<c:if test="${wordPeerReviewEvent.wordContributionEvent.id == wordContributionEvent.id}">
<div class="row peerReviewEvent indent" data-approved="${wordPeerReviewEvent.isApproved()}">
<div class="col s4">
<a href="<spring:url value='/content/contributor/${wordPeerReviewEvent.contributor.id}' />">
<a href="<spring:url value='/contributor/${wordPeerReviewEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty wordPeerReviewEvent.contributor.imageUrl}">
Expand Down
Loading

0 comments on commit b38b63c

Please sign in to comment.