質問編集履歴
1
ソースコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -253,3 +253,261 @@
|
|
253
253
|
|
254
254
|
|
255
255
|
```
|
256
|
+
|
257
|
+
```html
|
258
|
+
|
259
|
+
<form method="post" enctype="multipart/form-data">
|
260
|
+
|
261
|
+
{% extends "./_base.html" %}
|
262
|
+
|
263
|
+
{% load static %}
|
264
|
+
|
265
|
+
{% block content %}
|
266
|
+
|
267
|
+
{% load crispy_forms_tags %}
|
268
|
+
|
269
|
+
<div class="container-fluid bg-secondary text-white">
|
270
|
+
|
271
|
+
<div class ="bg-secondary text-white"> <!-- 画面上部色設定 -->
|
272
|
+
|
273
|
+
<div id="myModal" class="modal fade" tabindex="-1" role="dialog">
|
274
|
+
|
275
|
+
<!-- 検索機能一覧設定 -->
|
276
|
+
|
277
|
+
<div class="modal-dialog" role="document">
|
278
|
+
|
279
|
+
<div class="modal-content">
|
280
|
+
|
281
|
+
<div class="modal-header">
|
282
|
+
|
283
|
+
<h5 class="modal-title">検索条件</h5>
|
284
|
+
|
285
|
+
<button type="button" class="close" data-dismiss="modal" aria-label="閉じる">
|
286
|
+
|
287
|
+
<span aria-hidden="true">×</span>
|
288
|
+
|
289
|
+
</button>
|
290
|
+
|
291
|
+
</div>
|
292
|
+
|
293
|
+
<form id="filter" method="get">
|
294
|
+
|
295
|
+
<div class="modal-body">
|
296
|
+
|
297
|
+
{{ filter.form|crispy }}
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
</form>
|
302
|
+
|
303
|
+
<div class="modal-footer">
|
304
|
+
|
305
|
+
<a class="btn btn-outline-dark" data-dismiss="modal">戻る</a>
|
306
|
+
|
307
|
+
<button type="submit" class="btn btn-outline-dark" form="filter">検索</button>
|
308
|
+
|
309
|
+
</div>
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
</div>
|
314
|
+
|
315
|
+
</div>
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
<!-- 新規、検索ボタン設定 -->
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
<div class="row">
|
324
|
+
|
325
|
+
<div class="col-12">
|
326
|
+
|
327
|
+
<a class="btn btn-secondary filtered" style="visibility:hidden" href="/?page=1">検索を解除</a>
|
328
|
+
|
329
|
+
<div class="float-right mt-1">
|
330
|
+
|
331
|
+
<a class="btn btn-dark" href="{% url 'create' %}">新規</a>
|
332
|
+
|
333
|
+
<input class="btn btn-dark" data-toggle="modal" data-target="#myModal" href="#">検索</a>
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
</div>
|
338
|
+
|
339
|
+
</div>
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
<!-- ページ番号ボタン設定 -->
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
<div class="row mt-3">
|
348
|
+
|
349
|
+
<div class="col-10 mx-auto">
|
350
|
+
|
351
|
+
{% include "./_pagination.html" %}
|
352
|
+
|
353
|
+
</div>
|
354
|
+
|
355
|
+
</div>
|
356
|
+
|
357
|
+
</div>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
<html>
|
364
|
+
|
365
|
+
<head>
|
366
|
+
|
367
|
+
<link rel="stylesheet" type="text/css" href= "{% static 'app.css' %}">
|
368
|
+
|
369
|
+
</head>
|
370
|
+
|
371
|
+
<body>
|
372
|
+
|
373
|
+
<div class="container-fluid">
|
374
|
+
|
375
|
+
<div class="col-12 p-3 mb-12">
|
376
|
+
|
377
|
+
<ul class="list-group">
|
378
|
+
|
379
|
+
{% if item_list %}
|
380
|
+
|
381
|
+
{% for item in item_list %}
|
382
|
+
|
383
|
+
<li class="list-group-item bg-light text-dark"> <!-- サイト表示一覧 背景色変更設定 -->
|
384
|
+
|
385
|
+
{# item_detail_contents.html を参考に必要な項目を追加してください #}
|
386
|
+
|
387
|
+
<div class="row">
|
388
|
+
|
389
|
+
<div class="col-9">
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
<div class ="row">
|
394
|
+
|
395
|
+
<div class="col-2 offset-2">
|
396
|
+
|
397
|
+
<p>1_ラーメン店</p>
|
398
|
+
|
399
|
+
</div>
|
400
|
+
|
401
|
+
<div class="col-4 offset-2">
|
402
|
+
|
403
|
+
<p>{{ item.name | default_if_none:"未入力" }}</p>
|
404
|
+
|
405
|
+
</div>
|
406
|
+
|
407
|
+
</div>
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
<div class="row">
|
412
|
+
|
413
|
+
<div class="col-2 offset-2">
|
414
|
+
|
415
|
+
<p>2_メニュー名称</p>
|
416
|
+
|
417
|
+
</div>
|
418
|
+
|
419
|
+
<div class="col-4 offset-2">
|
420
|
+
|
421
|
+
<p>{{ item.name1 | default_if_none:"未入力" }}</p>
|
422
|
+
|
423
|
+
</div>
|
424
|
+
|
425
|
+
</div>
|
426
|
+
|
427
|
+
<!-- 画像表示設定 -->
|
428
|
+
|
429
|
+
<div class="col-3 clearfix">
|
430
|
+
|
431
|
+
{% if item.image %}
|
432
|
+
|
433
|
+
<p><img src ='{{item.image.url}}'class = "img-fluid" width=250 top=200></p>
|
434
|
+
|
435
|
+
{% endif %}
|
436
|
+
|
437
|
+
</div>
|
438
|
+
|
439
|
+
</div>
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
<div class="row">
|
444
|
+
|
445
|
+
<div class="col-12">
|
446
|
+
|
447
|
+
<div class="float-right">
|
448
|
+
|
449
|
+
<a class="btn btn-dark " href="{% url 'detail' item.pk %}">詳細</a>
|
450
|
+
|
451
|
+
<a class="btn btn-dark " href="{% url 'update' item.pk %}">編集</a>
|
452
|
+
|
453
|
+
<a class="btn btn-dark " href="{% url 'delete' item.pk %}">削除</a>
|
454
|
+
|
455
|
+
</div>
|
456
|
+
|
457
|
+
</div>
|
458
|
+
|
459
|
+
</div>
|
460
|
+
|
461
|
+
</li>
|
462
|
+
|
463
|
+
{% endfor %}
|
464
|
+
|
465
|
+
{% else %}
|
466
|
+
|
467
|
+
<li class="list-group-item">
|
468
|
+
|
469
|
+
<p>対象のデータがありません</p>
|
470
|
+
|
471
|
+
</li>
|
472
|
+
|
473
|
+
{% endif %}
|
474
|
+
|
475
|
+
</ul>
|
476
|
+
|
477
|
+
</div>
|
478
|
+
|
479
|
+
</div>
|
480
|
+
|
481
|
+
</body>
|
482
|
+
|
483
|
+
</html>
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
<div class ="bg-secondary text-white">
|
490
|
+
|
491
|
+
<div class="row mt-3">
|
492
|
+
|
493
|
+
<div class="col-10 mx-auto">
|
494
|
+
|
495
|
+
{% include "./_pagination.html" %}
|
496
|
+
|
497
|
+
</div>
|
498
|
+
|
499
|
+
</div>
|
500
|
+
|
501
|
+
</div>
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
</div>
|
506
|
+
|
507
|
+
{% endblock %}
|
508
|
+
|
509
|
+
</form>
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
```
|