質問編集履歴

1

補足

2021/09/30 07:58

投稿

seyu0930
seyu0930

スコア20

test CHANGED
File without changes
test CHANGED
@@ -11,3 +11,213 @@
11
11
 
12
12
 
13
13
  最大文字数を指定して一部表示させないようにしても良いのですが、フォントを小さくしてできるだけフルネームで表示させたいです。
14
+
15
+
16
+
17
+ base.html
18
+
19
+ ```python
20
+
21
+ {% load static %}
22
+
23
+
24
+
25
+ <!DOCTYPE html>
26
+
27
+ <html lang="en">
28
+
29
+ <head>
30
+
31
+ <meta charset="utf-8" />
32
+
33
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
34
+
35
+ <meta name="description" content="" />
36
+
37
+ <meta name="author" content="" />
38
+
39
+ <title>Small Business - Start Bootstrap Template</title>
40
+
41
+ <!-- Favicon-->
42
+
43
+ <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
44
+
45
+ <!-- Core theme CSS (includes Bootstrap)-->
46
+
47
+ <link href="{% static 'css/styles.css' %}" rel="stylesheet" />
48
+
49
+ {% block head %}{% endblock %}
50
+
51
+ </head>
52
+
53
+
54
+
55
+ <body>
56
+
57
+ <!--ヘッダーの追加-->
58
+
59
+ <!--ナビゲーションバー-->
60
+
61
+ <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
62
+
63
+ <div class="container px-5">
64
+
65
+ <a class="navbar-brand" href="{% url 'shoplist:index' %}">kohriInfo</a>
66
+
67
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
68
+
69
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
70
+
71
+ <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
72
+
73
+ <li class="nav-item"><a class="nav-link active" aria-current="page" href="{% url 'shoplist:index' %}">shopInfo</a></li>
74
+
75
+ <li class="nav-item"><a class="nav-link" href="#!">community</a></li>
76
+
77
+ <li class="nav-item"><a class="nav-link" href="#!">Contact</a></li>
78
+
79
+ <li class="nav-item"><a class="nav-link" href="#!">Contact</a></li>
80
+
81
+ </ul>
82
+
83
+ </div>
84
+
85
+ </div>
86
+
87
+ </nav>
88
+
89
+ <header>
90
+
91
+ {% block header %}{% endblock %}
92
+
93
+ </header>
94
+
95
+
96
+
97
+ <!--メインの追加-->
98
+
99
+ <main class="container px-4 px-lg-5">
100
+
101
+ {% block main %}{% endblock %}
102
+
103
+ </main>
104
+
105
+
106
+
107
+ <!--フッターの追加-->
108
+
109
+ <footer class="py-5 bg-dark">
110
+
111
+ <div class="container px-4 px-lg-5"><p class="m-0 text-center text-white">Copyright &copy; Your Website 2021</p></div>
112
+
113
+ {% block footer %}
114
+
115
+ {% endblock %}
116
+
117
+ </footer>
118
+
119
+ <!-- Bootstrap core JS-->
120
+
121
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js"></script>
122
+
123
+ <!-- Core theme JS-->
124
+
125
+ <script src="{% static 'js/scripts.js' %}"></script>
126
+
127
+ </body>
128
+
129
+ </html>
130
+
131
+ ```
132
+
133
+
134
+
135
+ index.html
136
+
137
+ ```python
138
+
139
+ {% extends "base.html" %}
140
+
141
+ {% load static %}
142
+
143
+ {% block header %}
144
+
145
+ <!-- Responsive navbar-->
146
+
147
+ <!-- Page Content-->
148
+
149
+ <div class="container px-4 px-lg-5">
150
+
151
+ <!-- Heading Row-->
152
+
153
+ <div class="row gx-4 gx-lg-5 align-items-center my-5">
154
+
155
+ <div class="col-lg-7"><img class="img-fluid rounded mb-4 mb-lg-0" src="{% static 'image/けやき通り.jpg' %}" alt="..." width="990" height="400" /></div>
156
+
157
+ <div class="col-lg-5">
158
+
159
+ <h1 class="font-weight-light">Business Name or Tagline</h1>
160
+
161
+ <p>This is a template that is great for small businesses. It doesn't have too much fancy flare to it, but it makes a great use of the standard Bootstrap core components. Feel free to use this template for any project you want!</p>
162
+
163
+ <a class="btn btn-primary" href="#!">Call to Action!</a>
164
+
165
+ </div>
166
+
167
+ </div>
168
+
169
+ <!-- Call to Action-->
170
+
171
+ <div class="card text-white bg-secondary my-5 py-4 text-center">
172
+
173
+ <div class="card-body"><p class="text-white m-0">〜香里ヶ丘の人気店や店舗情報をご紹介〜</p></div>
174
+
175
+ </div>
176
+
177
+ {% endblock %}
178
+
179
+ {% block main %}
180
+
181
+ <!-- Content Row-->
182
+
183
+ <div class="row gx-4 gx-lg-5">
184
+
185
+ {% for object in object_list %}
186
+
187
+ <div class="col-md-4 mb-5">
188
+
189
+ <div class="card h-100">
190
+
191
+ <div class="card-body">
192
+
193
+ <h2 class="card-title">{{ object.shop_name }}</h2>
194
+
195
+ <img src="{{ object.photo1.url }}" alt="" height=250 width=350>
196
+
197
+ <p class="card-text mt-3">{{ object.shop_describe }}</p>
198
+
199
+ </div>
200
+
201
+ <div class="card-footer"><a class="btn btn-primary btn-sm" href="{% url 'shoplist:detail' object.pk %}">詳しく</a></div>
202
+
203
+ </div>
204
+
205
+ </div>
206
+
207
+ {% empty %}
208
+
209
+ <p>登録されているお店がありません</p>
210
+
211
+ {% endfor %}
212
+
213
+ </div>
214
+
215
+ {% endblock %}
216
+
217
+ {% block footer %}
218
+
219
+ {% endblock %}
220
+
221
+
222
+
223
+ ```