質問編集履歴

1

コード追加

2018/11/18 12:29

投稿

G-ym
G-ym

スコア16

test CHANGED
File without changes
test CHANGED
@@ -46,6 +46,8 @@
46
46
 
47
47
 
48
48
 
49
+ assetGlaf.html
50
+
49
51
  ```HTML
50
52
 
51
53
  <!DOCTYPE html>
@@ -131,3 +133,155 @@
131
133
 
132
134
 
133
135
  ```
136
+
137
+
138
+
139
+ homeLayout.html
140
+
141
+ ```html
142
+
143
+ <!DOCTYPE html>
144
+
145
+ <html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
146
+
147
+
148
+
149
+ <head>
150
+
151
+ <meta charset="UTF-8">
152
+
153
+ <link th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}" rel="stylesheet">
154
+
155
+ <script th:src="@{/webjars/jquery/1.11.1/jquery.min.js}"></script>
156
+
157
+ <script th:src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"></script>
158
+
159
+ <link th:href="@{/css/home.css}" rel="stylesheet">
160
+
161
+ <title>Home</title>
162
+
163
+ </head>
164
+
165
+
166
+
167
+ <body>
168
+
169
+ <!--ナビゲーションバー-->
170
+
171
+ <nav class="navbar navbar-inverse navbar-fixed-top">
172
+
173
+ <div class="container-fluid">
174
+
175
+ <div class="navbar-header">
176
+
177
+ <a class="navbar-brand" href="#">MonthlyCost</a>
178
+
179
+ </div>
180
+
181
+ <form method="post" th:action="@{/logout}">
182
+
183
+ <button class="btn btn-link pull-right navbar-brand" type="submit">ログアウト</button>
184
+
185
+ </form>
186
+
187
+ </div>
188
+
189
+ </nav>
190
+
191
+ <!--サイドバー-->
192
+
193
+ <div class="container-fluid">
194
+
195
+ <div class="row">
196
+
197
+ <div class="col-sm-2 sidebar">
198
+
199
+ <ul class="nav nav-pills nav-stacked">
200
+
201
+ <li role="presentation"><a th:href="@{'/userList'}">ユーザ管理</a>
202
+
203
+ </li>
204
+
205
+ <li role="presentation"><a th:href="@{'/home'}">ホーム</a>
206
+
207
+ </li>
208
+
209
+ <li role="presentation"><a th:href="@{'/assetRegist'}">資産登録</a>
210
+
211
+ </li>
212
+
213
+ <li role="presentation"><a th:href="@{'/assetList'}">資産一覧</a>
214
+
215
+ </li>
216
+
217
+ <li role="presentation"><a th:href="@{'/assetGlaf'}">月々の資産グラフ</a>
218
+
219
+ </li>
220
+
221
+
222
+
223
+ </ul>
224
+
225
+ </div>
226
+
227
+ </div>
228
+
229
+ </div>
230
+
231
+ <!--コンテンツ-->
232
+
233
+ <div class="container-fluid">
234
+
235
+ <div class="row">
236
+
237
+ <div class="col-sm-10 col-sm-offset-2 main">
238
+
239
+ <div th:include="__${contents}__"></div>
240
+
241
+ </div>
242
+
243
+ </div>
244
+
245
+ </div>
246
+
247
+ </body>
248
+
249
+
250
+
251
+ </html>
252
+
253
+
254
+
255
+ ```
256
+
257
+
258
+
259
+ ```java
260
+
261
+ @Controller
262
+
263
+ public class AssetGrafController {
264
+
265
+
266
+
267
+ @Autowired
268
+
269
+ AssetService assetService;
270
+
271
+
272
+
273
+ @GetMapping("/assetGlaf")
274
+
275
+ public String getAssetGlaf(Model model,Principal principal) {
276
+
277
+ model.addAttribute("contents", "asset/assetGlaf :: assetGlaf_contents");
278
+
279
+ return "home/homeLayout";
280
+
281
+ }
282
+
283
+ }
284
+
285
+
286
+
287
+ ```