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

質問編集履歴

1

base.htmlの追加

2020/04/20 12:04

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -45,4 +45,104 @@
45
45
  </div>
46
46
  {% endblock %}
47
47
 
48
+ ```
49
+
50
+ ```python
51
+ {% load static %}
52
+ <html lang="ja">
53
+ <head>
54
+ <meta charset="UTF-8">
55
+ <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
56
+ <meta name="descripition" content="">
57
+ <meta name="author" content="">
58
+
59
+
60
+ <title>{% block title %}{% endblock%}</title>
61
+
62
+ <!--Bootstrap core CSS-->
63
+ <link href="{% static '/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
64
+
65
+ <!--Custom fonts for this template-->
66
+ <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet">
67
+ <link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
68
+
69
+ <!--Custom styles for this template-->
70
+ <link href="{% static '/css/one-page-wonder.min.css' %}" rel="stylesheet">
71
+
72
+ <!--My style-->
73
+ <link rel="stylesheet" type="text/css" href="{% static '/css/mystyle.css' %}">
74
+ <link rel="icon" href="{% static '/img/favicon.ico' %}">
75
+
76
+ {% block head %}{% endblock %}
77
+ </head>
78
+
79
+ <body>
80
+
81
+ <div id="wrapper">
82
+ <!-- Navigation -->
83
+ <nav class="navbar navbar-expand-lg navbar-dark navbar-custom fixed-top">
84
+ <div class="container">
85
+ <a class="navbar-brand" href="{% url 'diary:index' %}">Squeeze Japanese</a>
86
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
87
+ <span class="navbar-toggler-icon"></span>
88
+ </button>
89
+ <div class="collapse navbar-collapse" id="navbarResponsive">
90
+ <ul class="navbar-nav mr-auto">
91
+ <li class="nav-item {% block active_inquiry %}{% endblock%}">
92
+ <a class="nav-link" href="{% url 'diary:inquiry' %}">INQUIRY</a>
93
+ </li>
94
+ {% if user.is_authenticated %}
95
+ <li class="nav-item{% block active_diary_list %}{% endblock %}">
96
+ <a class="nav-link" href="{% url 'diary:diary_list' %}">DIARY LIST</a>
97
+ </li>
98
+ {% endif %}
99
+ </ul>
100
+ <ul class="navbar-nav ml-auto">
101
+ {% if user.is_authenticated %}
102
+ <li class="nav-item">
103
+ <a class="nav-link" href="{% url 'account_logout' %}">Log Out</a></li>
104
+ {% else %}
105
+ <li class="nav-item{% block active_signup %}{% endblock %}">
106
+ <a class="nav-link" href="{% url 'account_signup' %}">Sign Up</a></li>
107
+ <li class="nav-item {% block active_login %}{% endblock %}">
108
+ <a class="nav-link" href="{% url 'account_login' %}">Log In</a></li>
109
+ {% endif %}
110
+ </ul>
111
+ </div>
112
+ </div>
113
+ </nav>
114
+
115
+ {% block header %}{% endblock %}
116
+ {% if messages%}
117
+ <div class="container">
118
+ <div class="row">
119
+ <div class="my-div-style w-100">
120
+ <ul class = "messages" style = "list-style: none;">
121
+ {% for message in messages %}
122
+ <li {% if message.tags %} class="{{message.tags}}" {% endif %}>
123
+ {{message}}
124
+ </li>
125
+ {% endfor %}
126
+ </ul>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ {% endif %}
131
+ {% block contents%}{% endblock%}
132
+
133
+ <!-- Footer -->
134
+ <footer class="py-5 bg-black">
135
+ <div class="container">
136
+ <p class="m-0 text-center text-white small">Copyright &copy; Squeeze Japanese 2020</p>
137
+ </div>
138
+ <!-- /.container -->
139
+ </footer>
140
+
141
+ <!-- Bootstrap core JavaScript -->
142
+ <script src="{% static '/vendor/jquery/jquery.min.js' %}"></script>
143
+ <script src="{% static '/vendor/bootstrap/js/bootstrap.bundle.min.js' %}"></script>
144
+ </div>
145
+ </body>
146
+ </html>
147
+
48
148
  ```