質問編集履歴

1

base.htmlの追加

2020/04/20 12:04

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -93,3 +93,203 @@
93
93
 
94
94
 
95
95
  ```
96
+
97
+
98
+
99
+ ```python
100
+
101
+ {% load static %}
102
+
103
+ <html lang="ja">
104
+
105
+ <head>
106
+
107
+ <meta charset="UTF-8">
108
+
109
+ <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
110
+
111
+ <meta name="descripition" content="">
112
+
113
+ <meta name="author" content="">
114
+
115
+
116
+
117
+
118
+
119
+ <title>{% block title %}{% endblock%}</title>
120
+
121
+
122
+
123
+ <!--Bootstrap core CSS-->
124
+
125
+ <link href="{% static '/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
126
+
127
+
128
+
129
+ <!--Custom fonts for this template-->
130
+
131
+ <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet">
132
+
133
+ <link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
134
+
135
+
136
+
137
+ <!--Custom styles for this template-->
138
+
139
+ <link href="{% static '/css/one-page-wonder.min.css' %}" rel="stylesheet">
140
+
141
+
142
+
143
+ <!--My style-->
144
+
145
+ <link rel="stylesheet" type="text/css" href="{% static '/css/mystyle.css' %}">
146
+
147
+ <link rel="icon" href="{% static '/img/favicon.ico' %}">
148
+
149
+
150
+
151
+ {% block head %}{% endblock %}
152
+
153
+ </head>
154
+
155
+
156
+
157
+ <body>
158
+
159
+
160
+
161
+ <div id="wrapper">
162
+
163
+ <!-- Navigation -->
164
+
165
+ <nav class="navbar navbar-expand-lg navbar-dark navbar-custom fixed-top">
166
+
167
+ <div class="container">
168
+
169
+ <a class="navbar-brand" href="{% url 'diary:index' %}">Squeeze Japanese</a>
170
+
171
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
172
+
173
+ <span class="navbar-toggler-icon"></span>
174
+
175
+ </button>
176
+
177
+ <div class="collapse navbar-collapse" id="navbarResponsive">
178
+
179
+ <ul class="navbar-nav mr-auto">
180
+
181
+ <li class="nav-item {% block active_inquiry %}{% endblock%}">
182
+
183
+ <a class="nav-link" href="{% url 'diary:inquiry' %}">INQUIRY</a>
184
+
185
+ </li>
186
+
187
+ {% if user.is_authenticated %}
188
+
189
+ <li class="nav-item{% block active_diary_list %}{% endblock %}">
190
+
191
+ <a class="nav-link" href="{% url 'diary:diary_list' %}">DIARY LIST</a>
192
+
193
+ </li>
194
+
195
+ {% endif %}
196
+
197
+ </ul>
198
+
199
+ <ul class="navbar-nav ml-auto">
200
+
201
+ {% if user.is_authenticated %}
202
+
203
+ <li class="nav-item">
204
+
205
+ <a class="nav-link" href="{% url 'account_logout' %}">Log Out</a></li>
206
+
207
+ {% else %}
208
+
209
+ <li class="nav-item{% block active_signup %}{% endblock %}">
210
+
211
+ <a class="nav-link" href="{% url 'account_signup' %}">Sign Up</a></li>
212
+
213
+ <li class="nav-item {% block active_login %}{% endblock %}">
214
+
215
+ <a class="nav-link" href="{% url 'account_login' %}">Log In</a></li>
216
+
217
+ {% endif %}
218
+
219
+ </ul>
220
+
221
+ </div>
222
+
223
+ </div>
224
+
225
+ </nav>
226
+
227
+
228
+
229
+ {% block header %}{% endblock %}
230
+
231
+ {% if messages%}
232
+
233
+ <div class="container">
234
+
235
+ <div class="row">
236
+
237
+ <div class="my-div-style w-100">
238
+
239
+ <ul class = "messages" style = "list-style: none;">
240
+
241
+ {% for message in messages %}
242
+
243
+ <li {% if message.tags %} class="{{message.tags}}" {% endif %}>
244
+
245
+ {{message}}
246
+
247
+ </li>
248
+
249
+ {% endfor %}
250
+
251
+ </ul>
252
+
253
+ </div>
254
+
255
+ </div>
256
+
257
+ </div>
258
+
259
+ {% endif %}
260
+
261
+ {% block contents%}{% endblock%}
262
+
263
+
264
+
265
+ <!-- Footer -->
266
+
267
+ <footer class="py-5 bg-black">
268
+
269
+ <div class="container">
270
+
271
+ <p class="m-0 text-center text-white small">Copyright &copy; Squeeze Japanese 2020</p>
272
+
273
+ </div>
274
+
275
+ <!-- /.container -->
276
+
277
+ </footer>
278
+
279
+
280
+
281
+ <!-- Bootstrap core JavaScript -->
282
+
283
+ <script src="{% static '/vendor/jquery/jquery.min.js' %}"></script>
284
+
285
+ <script src="{% static '/vendor/bootstrap/js/bootstrap.bundle.min.js' %}"></script>
286
+
287
+ </div>
288
+
289
+ </body>
290
+
291
+ </html>
292
+
293
+
294
+
295
+ ```