2 Commits

5 changed files with 22 additions and 11 deletions

View File

@@ -275,7 +275,9 @@ public class GoalController {
int currentAmount = goalService.getCurrentAmount(userId);
model.addAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, currentAmount);
System.out.println("************************currentAmount : " + currentAmount);
session.setAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, currentAmount);
return TransitionTargetPageNameKeyword.GOAL_CREATE_HTML;
}

View File

@@ -37,7 +37,7 @@
<div class="mb-3">
<label class="form-label" for="transactionType">収入・支出</label>
<select class="form-select" id="transactionType" required>
<select class="form-select" id="transactionType">
<option value="">選択してください</option>
<option value="0">支出</option>
@@ -51,7 +51,7 @@
<div class="mb-3">
<label class="form-label" for="categoryId">カテゴリ</label>
<select class="form-select" id="categoryId" th:field="*{categoryId}" required>
<select class="form-select" id="categoryId" th:field="*{categoryId}">
<option value="">選択してください</option>
<option class="expenseListClass" th:each="category : ${expenseList}"

View File

@@ -37,7 +37,9 @@
<div>
<label>目標金額</label>
<input type="number" th:field="*{targetAmount}" required min="1">
<span th:text="|所持金:${currentAmount}円|"></span>
<br>
<span th:text="|所持金:${session.currentAmount}円|"></span>
<input type="hidden" name="currentAmount" th:value="${currentAmount}">
<span th:if="${message != null}">
<span th:text="${message}" style="color: red;"></span>
</span>

View File

@@ -13,6 +13,7 @@
<div th:replace="~{header :: header}"></div>
<h1 class="page-title">コース選択</h1>
<<<<<<< HEAD
<div class="d-grid gap-2 mt-4">
<th:block th:if="${mode == 'change'}">
<form th:action="@{/course/create}" method="get">
@@ -23,6 +24,7 @@
</th:block>
<form th:action="${mode == 'regist'} ? @{/user/register/return}: @{/change}" method="post">
=======
<th:block th:if="${mode == 'change'}">
<form th:action="@{/course/create}" method="get">
<button type="submit">新規登録</button>
@@ -30,6 +32,7 @@
</th:block>
<form th:action="${mode == 'regist'} ? @{/user/register/return}: @{/change}" id="totalForm" method="post">
>>>>>>> 65b4a9e54a5bc5c1d1480fd4b9255addf73628e4
<button type="submit" class="btn btn-primary w-100">確定</button>
<div class="accordion" id="accordionExample">

View File

@@ -122,6 +122,16 @@
const tType = '[[${session.tType}]]';
console.log("tType: " + tType);
if (tType.includes("0")) {
console.log("okokokokokokokkkokokokoko");
transactionType.value = "0";
} else if (tType.includes("1")) {
transactionType.value = "1";
}
function toggleCategory() {
if (transactionType.value === "0") {
@@ -164,12 +174,6 @@
});
if (tType == "0") {
transactionType.value = "0";
} else if (tType == "1") {
transactionType.value = "1";
}
toggleCategory();
</script>