9 Commits

10 changed files with 574 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
@Controller
public class BookUpdateConfirmController {
@PostMapping("/updateconfirm")
public String updateConfirm() {
return "updateconfirm";
}
}

View File

@@ -0,0 +1,19 @@
package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
@Controller
public class BookUpdateController {
@PostMapping("/update")
public String update() {
return "update";
}
@PostMapping("/bookUpdate")
public String bookUpdate() {
return "book";
}
}

View File

@@ -0,0 +1,14 @@
package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class PasswordChangeController {
@GetMapping("/passwordChange")
public String showPasswordChange() {
return "passwordChange";
}
}

View File

@@ -0,0 +1,40 @@
package com.example.demo.entity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/*
* accountテーブル用のEntityクラス
* ログイン時やセッションでの管理者判別に使う
*/
@Entity
@Table(name = "account")
@Getter
@Setter
@NoArgsConstructor
public class Account {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="login_info_id")
private int loginInfoId;
@Column(name="employee_id")
private int employeeId;
@Column(name="password_hash")
private String passwordHash;
@Column(name="admin_flag")
private int adminFlag;
}

View File

@@ -0,0 +1,62 @@
function togglePassword(id) {
const input = document.getElementById(id);
if (input === null) {
return;
}
if (input.type === "password") {
input.type = "text";
} else {
input.type = "password";
}
}
function clearForm() {
const form = document.getElementById("pwForm");
if (form === null) {
return;
}
form.reset();
}
function showCompletedPopup() {
const completedDialog = document.getElementById("completedDialog");
if (completedDialog === null) {
return;
}
completedDialog.showModal();
}
function goTopMenu() {
const topMenuUrl = document.body.dataset.topmenuUrl;
if (topMenuUrl) {
window.location.href = topMenuUrl;
return;
}
window.location.href = "/topmenu";
}
function goLogin(){
const loginUrl = document.body.dataset.loginUrl;
if (loginUrl){
window.location.href = loginUrl;
return;
}
window.location.href="/login"
}

View File

@@ -13,6 +13,13 @@
貸出 貸出
</button> </button>
</form> </form>
<form method="post" action="update">
<button type="submit" class="btn-login">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
更新
</button>
</form>
</body> </body>
</html> </html>

View File

@@ -0,0 +1,377 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="ja">
<head>
<meta charset="UTF-8">
<title>ShareBooks|パスワード変更</title>
</head>
<body th:data-topmenu-url="@{/topmenu}">
<!-- ヘッダー -->
<div class="header-bar">
<div class="header-left">
ShareBooks
</div>
<div class="header-right">
<span class="bell">
🔔
<span class="badge">3</span>
</span>
<span class="user">
テストユーザー(一般)
</span>
<button type="button" class="logout">
ログアウト
</button>
</div>
</div>
<div class="layout">
<!-- サイドバー -->
<div class="sidebar">
<div class="section-label">
共通画面
</div>
<a class="side-menu" th:href="@{/topmenu}">
トップメニュー
</a>
<div class="active">
パスワード再設定
</div>
</div>
<!-- メイン -->
<div class="main-area">
<!-- パンくずリスト -->
<div class="breadcrumb">
<a th:href="@{/topmenu}">
トップメニュー
</a>
&gt; パスワード再設定
</div>
<h1 class="page-title">
パスワード再設定
</h1>
<p class="page-desc">
現在のパスワードと新しいパスワードを入力し、
「確定」ボタンを押してください。
</p>
<p class="required-note">
(※)は必須項目です。
</p>
<div class="content-columns">
<!-- 左カラム -->
<div class="left-column">
<div class="form-card">
<h2>
パスワード再設定入力
</h2>
<!--
簡易実装のため、フォーム送信は行いません。
-->
<form id="pwForm" onsubmit="return false;">
<!-- 現在のパスワード -->
<div class="form-group">
<label for="currentPassword">
現在のパスワード
<span class="req">(※)</span>
</label>
<div class="input-with-icon">
<input
type="password"
id="currentPassword"
name="currentPassword"
autocomplete="current-password"
placeholder="現在のパスワードを入力してください">
<button
type="button"
class="toggle-password"
aria-label="現在のパスワードの表示を切り替える"
onclick="togglePassword('currentPassword')">
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round">
<path
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
</path>
<circle
cx="12"
cy="12"
r="3">
</circle>
</svg>
</button>
</div>
</div>
<!-- 新しいパスワード -->
<div class="form-group">
<label for="newPassword">
新しいパスワード
<span class="req">(※)</span>
</label>
<div class="input-with-icon">
<input
type="password"
id="newPassword"
name="newPassword"
autocomplete="new-password"
placeholder="新しいパスワードを入力してください">
<button
type="button"
class="toggle-password"
aria-label="新しいパスワードの表示を切り替える"
onclick="togglePassword('newPassword')">
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round">
<path
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
</path>
<circle
cx="12"
cy="12"
r="3">
</circle>
</svg>
</button>
</div>
<p class="field-hint">
※ 半角英数字・記号を含む8文字以上16文字以下で入力してください。
</p>
</div>
<!-- 確認用パスワード -->
<div class="form-group">
<label for="confirmPassword">
新しいパスワードの確認
<span class="req">(※)</span>
</label>
<div class="input-with-icon">
<input
type="password"
id="confirmPassword"
name="confirmPassword"
autocomplete="new-password"
placeholder="新しいパスワードをもう一度入力してください">
<button
type="button"
class="toggle-password"
aria-label="確認用パスワードの表示を切り替える"
onclick="togglePassword('confirmPassword')">
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round">
<path
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
</path>
<circle
cx="12"
cy="12"
r="3">
</circle>
</svg>
</button>
</div>
<p class="field-hint">
※ 確認のため、もう一度新しいパスワードを入力してください。
</p>
</div>
</form>
</div>
<!-- 注意事項 -->
<div class="notice-box">
<div class="notice-title">
注意事項
</div>
</div>
<!-- 操作ボタン -->
<div class="button-row">
<button
type="button"
class="btn btn-secondary"
onclick="goTopMenu()">
トップメニューへ戻る
</button>
<div class="btn-group-right">
<button
type="button"
class="btn btn-secondary"
onclick="clearForm()">
クリア
</button>
<!-- ダイアログを表示 -->
<button
type="button"
class="btn btn-primary"
onclick="showCompletedPopup()">
確定
</button>
</div>
</div>
</div>
<!-- 右カラム -->
<div class="right-column">
<div class="constraint-panel">
<div class="panel-title">
パスワードの制約
</div>
<div class="group-label">
使用可能文字
</div>
<div class="chars-value">
半角英数字・記号
</div>
<hr>
<div class="group-label">
制約
</div>
<ul class="constraint-list">
<li>✓ 8文字以上16文字以下</li>
<li>✓ 1つ以上の小文字を使用</li>
<li>✓ 1つ以上の大文字を使用</li>
<li>✓ 1つ以上の数字を使用</li>
<li>✓ 1つ以上の記号を使用</li>
</ul>
<div class="example-box">
<div class="example-label">
設定例
</div>
<div class="example-value">
Abcdef12!
</div>
<div class="example-note">
(9文字、英字大小・数字・記号を含む)
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
© 2026 ShareBooks
</div>
<dialog id="completedDialog">
<h2>
変更完了
</h2>
<p>
パスワードの変更が完了しました。
</p>
<button
type="button"
onclick="goLogin()">
完了
</button>
</dialog>
<script th:src="@{/js/passwordChange.js}"></script>
</body>
</html>

View File

@@ -70,6 +70,16 @@
寄贈申請の<br> 受信一覧を確認します。 寄贈申請の<br> 受信一覧を確認します。
</p> </p>
</a> </a>
<hr>
<a class="card" href="/">
<h3>パスワード変更</h3>
<p>
初期パスワードを<br> 変更します。
</p>
</a>
</body> </body>
</html> </html>

View File

@@ -5,6 +5,13 @@
<title>図書情報更新入力</title> <title>図書情報更新入力</title>
</head> </head>
<body> <body>
更新入力画面
<form method="post" action="updateconfirm">
<button type="submit" class="btn-login">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
更新内容確認
</button>
</form>
</body> </body>
</html> </html>

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>更新内容確認</title>
</head>
<body>
更新内容確認画面
<form method="post" action="update">
<button type="submit" class="btn-login">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
戻る
</button>
</form>
<form method="post" action="bookUpdate">
<button type="submit" class="btn-login">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
更新完了
</button>
</form>
</body>
</html>