Skip to content
Snippets Groups Projects
Commit f338ceb0 authored by John Watkins's avatar John Watkins
Browse files

Merge branch 'issueThirtyOne' into 'develop'

Issue thirty one

See merge request !86
parents 1a2601a4 133a01b8
Branches
No related tags found
4 merge requests!114LoggingService service class, new method to add a log to the "Logs" table when...,!88fixed small bug,!87added non-functional testing (see DeleteShopTests.java for notes) + added serverside validation,!86Issue thirty one
...@@ -21,11 +21,13 @@ public class ClaimableRewards { ...@@ -21,11 +21,13 @@ public class ClaimableRewards {
public int nextReward(UserStampBoards u){ public int nextReward(UserStampBoards u){
List<Rewards> r = u.getStampBoard().getRewards(); List<Rewards> r = u.getStampBoard().getRewards();
for(int i = 1; i<u.getStampBoard().getRewards().size()-1; i++){ if (r.size() != 0) {
if((r.get(i).getRewardStampLocation() >= u.getUserStampPosition()) && for (int i = 1; i < u.getStampBoard().getRewards().size() - 1; i++) {
(r.get(i-1).getRewardStampLocation() <= u.getUserStampPosition())){ if ((r.get(i).getRewardStampLocation() >= u.getUserStampPosition()) &&
(r.get(i - 1).getRewardStampLocation() <= u.getUserStampPosition())) {
return r.get(i).getRewardStampLocation(); return r.get(i).getRewardStampLocation();
}
} }
} }
return 0; return 0;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<div class="reward_card_content"> <div class="reward_card_content">
<h1 class="title is-4 mb-1" th:text="${title}" style="white-space: break-spaces;"></h1> <h1 class="title is-4 mb-1" th:text="${title}" style="white-space: break-spaces;"></h1>
<p class="mb-1" th:text="'You have ' + ${stamps} + ' stamps!'"></p> <p class="mb-1" th:text="'You have ' + ${stamps} + ' stamps!'"></p>
<th:block th:if="${next_reward != 0}">
<progress class="progress mb-1" th:value="${stamps}" th:max="${next_reward}"></progress> <progress class="progress mb-1" th:value="${stamps}" th:max="${next_reward}"></progress>
<p class="mb-2" th:text="${next_reward}-${stamps} + ' to next reward'"></p> <p class="mb-2" th:text="${next_reward}-${stamps} + ' to next reward'"></p>
<div class="is-full-width" style="display:flex;justify-content: space-between;align-items: center"> <div class="is-full-width" style="display:flex;justify-content: space-between;align-items: center">
...@@ -35,6 +36,27 @@ ...@@ -35,6 +36,27 @@
</button> </button>
</div> </div>
</div> </div>
</th:block>
<th:block th:if="${next_reward == 0}">
<progress class="progress mb-1" th:value="${stamps}" th:max="${stamps}"></progress>
<p class="mb-2"></p>
<div class="is-full-width" style="display:flex;justify-content: space-between;align-items: center">
<div class="level-left">
<span class="icon is-small is-left ml-1 mr-1">
<i class="fas fa-gift"></i>
</span>
<p style="margin-right:3px">No rewards!</p>
</div>
<div class="level-right">
<button class="button is-rounded">
Explore
<span class="icon is-small is-left ml-1">
<i class="fas fa-arrow-right"></i>
</span>
</button>
</div>
</div>
</th:block>
</div> </div>
<div class="reward_card_img" th:style="'background-image:url(' + ${img_path} + ');'"></div> <div class="reward_card_img" th:style="'background-image:url(' + ${img_path} + ');'"></div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment