Skip to content

Commit

Permalink
th:の属性を決して問題用のhtmlに修正
Browse files Browse the repository at this point in the history
  • Loading branch information
igamasayuki committed Nov 13, 2018
1 parent 1c20ff6 commit c1a1f55
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 38 deletions.
17 changes: 7 additions & 10 deletions documents/html_mock/templates/administrator/insert.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<!-- ここから上を編集する必要はありません -->

<form method="post" action="login.html" th:action="@{/insert}" th:object="${insertAdministratorForm}">
<form method="post" action="login.html">
<fieldset>
<legend>管理者登録<br>(システムにログインできる管理者を登録します)</legend>
<!-- 氏名 -->
Expand All @@ -39,11 +39,10 @@
<label for="name">
氏名:
</label>
<label th:if="${#fields.hasErrors('name')}" th:errors="*{name}" class="error-messages">
<label class="error-messages">
氏名を入力してください
</label>
<input type="text" name="name" id="name" class="form-control" placeholder="山田太郎"
th:field="*{name}" th:errorclass="error-input" value="山田太郎">
<input type="text" name="name" id="name" class="form-control" placeholder="山田太郎">
</div>
</div>
</div>
Expand All @@ -54,11 +53,10 @@
<label for="mailAddress">
メールアドレス:
</label>
<label th:if="${#fields.hasErrors('mailAddress')}" th:errors="*{mailAddress}" class="error-messages">
<label class="error-messages">
メールアドレスを入力してください
</label>
<input type="text" name="mailAddress" id="mailAddress" class="form-control" placeholder="[email protected]"
th:field="*{mailAddress}" th:errorclass="error-input" value="[email protected]">
<input type="text" name="mailAddress" id="mailAddress" class="form-control" placeholder="[email protected]">
</div>
</div>
</div>
Expand All @@ -69,11 +67,10 @@
<label for="passwaord">
パスワード:
</label>
<label th:if="${#fields.hasErrors('password')}" th:errors="*{password}" class="error-messages">
<label class="error-messages">
パスワードを入力してください
</label>
<input type="password" name="password" id="password" class="form-control" placeholder="password"
th:field="*{password}" th:errorclass="error-input" value="xxxxxxxx">
<input type="password" name="password" id="password" class="form-control" placeholder="password">
</div>
</div>
</div>
Expand Down
14 changes: 6 additions & 8 deletions documents/html_mock/templates/administrator/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,27 @@
<!-- ここから上を編集する必要はありません -->


<form method="post" action="../employee/list.html" th:action="@{/login}" th:object="${loginForm}">
<form method="post" action="../employee/list.html">
<fieldset>
<legend>ログイン</legend>
<div class="form-group">
<div class="alert alert-danger" th:if="${#fields.hasGlobalErrors()}">
<p th:each="err : ${#fields.globalErrors()}" th:text="${err}">メールアドレスまたはパスワードが間違っています</p>
<div class="alert alert-danger">
<p>メールアドレスまたはパスワードが間違っています</p>
</div>
</div>
<div class="form-group">
<label for="mailAddress">メールアドレス:</label>
<input type="text" name="mailAddress" id="mailAddress" class="form-control" placeholder="Email"
th:field="*{mailAddress}" th:errorclass="error-input" value="[email protected]">
<input type="text" name="mailAddress" id="mailAddress" class="form-control" placeholder="Email">
</div>
<div class="form-group">
<label for="inputPassword">パスワード:</label>
<input type="password" name="password" id="inputPassword" class="form-control" placeholder="Password"
th:field="*{password}" th:errorclass="error-input" value="[email protected]">
<input type="password" name="password" id="inputPassword" class="form-control" placeholder="Password">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">ログイン</button>
</div>
<div class="form-group">
<a href="insert.html" th:href="@{/toInsert}">管理者登録はこちらから</a>
<a href="insert.html">管理者登録はこちらから</a>
</div>
</fieldset>
</form>
Expand Down
29 changes: 14 additions & 15 deletions documents/html_mock/templates/employee/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<!-- ここから上を編集する必要はありません -->


<form method="post" action="list.html" th:action="@{/employee/update}" th:object="${updateEmployeeForm}">
<form method="post" action="list.html">
<fieldset>
<legend>従業員情報</legend>
<table class="table table-striped">
Expand All @@ -74,93 +74,92 @@
従業員名
</th>
<td>
<span th:text="${employee.name}">山田花子</span>
<span>山田花子</span>
</td>
</tr>
<tr>
<th nowrap>
写真
</th>
<td>
<img src="../../static/img/e2.png" th:src="${'/img/' + employee.image}" />
<img src="../../static/img/e2.png">
</td>
</tr>
<tr>
<th nowrap>
性別
</th>
<td>
<span th:text="${employee.gender}">女性</span>
<span>女性</span>
</td>
</tr>
<tr>
<th nowrap>
入社日
</th>
<td>
<span th:text="${employee.hireDate}">2012/11/29</span>
<span>2012/11/29</span>
</td>
</tr>
<tr>
<th nowrap>
メールアドレス
</th>
<td>
<span th:text="${employee.mailAddress}">[email protected]</span>
<span>[email protected]</span>
</td>
</tr>
<tr>
<th nowrap>
郵便番号
</th>
<td>
<span th:text="${employee.zipCode}">111-1111</span>
<span>111-1111</span>
</td>
</tr>
<tr>
<th nowrap>
住所
</th>
<td>
<span th:text="${employee.address}">東京都新宿区1-1-1</span>
<span>東京都新宿区1-1-1</span>
</td>
</tr>
<tr>
<th nowrap>
電話番号
</th>
<td>
<span th:text="${employee.telephone}">090-0000-0000</span>
<span>090-0000-0000</span>
</td>
</tr>
<tr>
<th nowrap>
給料
</th>
<td>
<span th:text="${employee.salary + '円'}">400000円</span>
<span>400000円</span>
</td>
</tr>
<tr>
<th nowrap>
特性
</th>
<td>
<span th:text="${employee.characteristics}">明るく素直な性格です。リーダーシップを発揮します。新卒社員研修の時はグループ開発の時にリーダーを買ってでました。積極性も人間性も抜群です。周りに対する不満も聞いたことがありません。</span>
<span>明るく素直な性格です。リーダーシップを発揮します。新卒社員研修の時はグループ開発の時にリーダーを買ってでました。積極性も人間性も抜群です。周りに対する不満も聞いたことがありません。</span>
</td>
</tr>
<tr>
<th nowrap>
扶養人数
</th>
<td>
<label th:if="${#fields.hasErrors('dependentsCount')}" th:errors="*{dependentsCount}" class="error-messages">
<label class="error-messages">
扶養人数を入力してください
</label>
<label class="control-label" style="color: red" for="dependentsCount"></label>
<input type="hidden" name="id" th:value="${employee.id}">
<input type="text" name="dependentsCount" id="dependentsCount" class="form-control" value="3"
th:errorclass="error-input" th:value="${employee.dependentsCount}">
<input type="hidden" name="id">
<input type="text" name="dependentsCount" id="dependentsCount" class="form-control" value="3">
</td>
</tr>
</table>
Expand Down
36 changes: 31 additions & 5 deletions documents/html_mock/templates/employee/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,43 @@
</tr>
</thead>
<tbody>
<tr th:each="employee : ${employeeList}">
<tr>
<td>
<a href="detail.html">
<span>山田太郎</span>
</a>
</td>
<td>
<span>2016/12/1</span>
</td>
<td>
<span>3人</span>
</td>
</tr>
<tr>
<td>
<a href="detail.html">
<span>山田太郎</span>
</a>
</td>
<td>
<span>2016/12/1</span>
</td>
<td>
<span>3人</span>
</td>
</tr>
<tr>
<td>
<a href="detail.html" th:href="@{/employee/showDetail(id=${employee.id})}">
<span th:text="${employee.name}">山田太郎</span>
<a href="detail.html">
<span>山田太郎</span>
</a>
</td>
<td>
<span th:text="${employee.hireDate}">2016/12/1</span>
<span>2016/12/1</span>
</td>
<td>
<span th:text="${employee.dependentsCount} + '人'">3人</span>
<span>3人</span>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit c1a1f55

Please sign in to comment.