teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

階層構造,ソースコードの追記

2021/12/21 00:11

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -10,6 +10,8 @@
10
10
  ├ views/
11
11
  |└ skip_view.py
12
12
  └ templates/
13
+ |└ application.html
14
+ |└ index.html
13
15
  |└ nav.html
14
16
 
15
17
  #環境
@@ -85,6 +87,58 @@
85
87
  ```
86
88
  *一部抜粋しております。
87
89
 
90
+ ▼templates/application.html
91
+ ```
92
+ <!DOCTYPE html>
93
+ <html>
94
+ <head>
95
+ <meta charset="UTF-8">
96
+ <title>{{title}}</title>
97
+ <link rel="stylesheet" href="{{ url_for('static', filename='css/reset.css') }}">
98
+ <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
99
+ <link rel="preconnect" href="https://fonts.gstatic.com">
100
+ <!-- <script src="{{ url_for('static', filename='js/index.js') }}"></script> -->
101
+ <script src="https://kit.fontawesome.com/23659bd18a.js" crossorigin="anonymous"></script>
102
+ </head>
103
+
104
+ <body>
105
+ {% block body %}
106
+ {% endblock %}
107
+ </body>
108
+ </html>
109
+ ```
110
+
111
+ ▼templates/index.html
112
+ ```
113
+ {% extends 'application.html' %}
114
+
115
+ {% block body %}
116
+ <section class="admin">
117
+ {% include 'nav.html' %}
118
+ <div class="right_content">
119
+ {% include 'header.html' %}
120
+
121
+ <div id="content">
122
+ <div class="home_content">
123
+ <div class="user_content">
124
+ <h3>ユーザ管理</h3>
125
+ <a href="{{ url_for('user_edit_form') }}"><p>ユーザ情報の編集</p></a>
126
+ <a href="{{ url_for('user_list') }}"><p>ユーザ一覧</p></a>
127
+ </div>
128
+ <div class="news_content">
129
+ <h3>お知らせ管理</h3>
130
+ <a href="{{ url_for('news_post_form') }}"><p>お知らせ投稿</p></a>
131
+ <a href="{{ url_for('news_list') }}"><p>お知らせ一覧</p></a>
132
+ </div>
133
+ </div>
134
+ </div>
135
+
136
+ {% include 'footer.html' %}
137
+ </div>
138
+ </section>
139
+ {% endblock %}
140
+ ```
141
+
88
142
  ▼templates/nav.html
89
143
  ```
90
144
  <nav id="admin_nav">