Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 4725e26

Browse files
authored
Merge pull request #40 from crab85193/dev_crab
猫さんが作ったテンプレートをdjangoに反映
2 parents 9701b84 + 8d457c7 commit 4725e26

File tree

9 files changed

+38
-15
lines changed

9 files changed

+38
-15
lines changed

main_app/urls.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1616
"""
1717
from django.urls import path
18+
from .views.product_info import ProductInfoView
1819
from .views.login import LoginView
1920
from .views.logout import Logout
2021
from .views.register import RegisterRequestView, RegisterDoneView, RegisterCompleteView, RegisterErrorView
@@ -32,7 +33,9 @@
3233
app_name = 'main_app'
3334

3435
urlpatterns = [
35-
path("" , LoginView.as_view(), name="login" ),
36+
path("", ProductInfoView.as_view(), name="product_info" ),
37+
38+
path("login/" , LoginView.as_view(), name="login" ),
3639
path("logout/", Logout.as_view() , name="logout"),
3740

3841
path("register/" , RegisterRequestView.as_view() , name="register_request" ),

main_app/views/product_info.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.views.generic import TemplateView
2+
3+
class ProductInfoView(TemplateView):
4+
template_name = 'main_app/product_info.html'
5+

product_info/css/styles.css renamed to static/product_info/css/styles.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10892,6 +10892,8 @@ hr.divider-light {
1089210892
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
1089310893
background-color: #fff;
1089410894
transition: background-color 0.2s ease;
10895+
box-shadow: none;
10896+
background-color: transparent;
1089510897
}
1089610898
#mainNav .navbar-brand { /*カーソルの位置によって、naviの色が変わる.*/
1089710899
font-family: "Merriweather Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
@@ -10911,11 +10913,17 @@ hr.divider-light {
1091110913
#mainNav .navbar-nav .nav-item .nav-link.active {
1091210914
color: #f4623a !important;
1091310915
}
10916+
10917+
#mainNav.navbar-shrink {
10918+
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
10919+
background-color: #fff;
10920+
}
10921+
1091410922
@media (min-width: 992px) {
10915-
#mainNav {
10923+
/* #mainNav {
1091610924
box-shadow: none;
1091710925
background-color: transparent;
10918-
}
10926+
} */
1091910927
#mainNav .navbar-brand {
1092010928
color: rgba(255, 255, 255, 0.7);
1092110929
}
@@ -10932,10 +10940,10 @@ hr.divider-light {
1093210940
#mainNav .navbar-nav .nav-item:last-child .nav-link {
1093310941
padding-right: 0;
1093410942
}
10935-
#mainNav.navbar-shrink {
10943+
/* #mainNav.navbar-shrink {
1093610944
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
1093710945
background-color: #fff;
10938-
}
10946+
} */
1093910947
#mainNav.navbar-shrink .navbar-brand {
1094010948
color: #212529;
1094110949
}

product_info/js/scripts.js renamed to static/product_info/js/scripts.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ window.addEventListener('DOMContentLoaded', event => {
1313
var navbarShrink = function () {
1414
const logoImage = document.getElementById('logo');
1515
const navbarCollapsible = document.body.querySelector('#mainNav');
16-
const logoWhite = './img/Tely_logo_3.png'; // ロゴ白色画像のパス
17-
const logoBlack = './img/Tely_logo_1.png'; // ロゴ黒色画像のパス
16+
1817
if (!navbarCollapsible) {
1918
return;
2019
}
@@ -25,6 +24,8 @@ window.addEventListener('DOMContentLoaded', event => {
2524
navbarCollapsible.classList.add('navbar-shrink')
2625
logoImage.src = logoBlack;
2726
}
27+
// navbarCollapsible.classList.add('navbar-shrink')
28+
// logoImage.src = logoBlack;
2829

2930
};
3031

product_info/index.html renamed to templates/main_app/product_info.html

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{% load static %}
2+
13
<!DOCTYPE html>
24
<html lang="ja">
35
<head>
@@ -7,7 +9,7 @@
79
<meta name="author" content="" />
810
<title>Tely</title>
911
<!-- Favicon-->
10-
<link rel="icon" type="image/x-icon" href="./img/Tely_logo_3.png" />
12+
<link rel="icon" type="image/x-icon" href="{% static 'product_info/img/Tely_logo_3.png' %}" />
1113
<!-- Bootstrap Icons-->
1214
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
1315
<!-- Google fonts-->
@@ -16,7 +18,7 @@
1618
<!-- SimpleLightbox plugin CSS-->
1719
<link href="https://cdnjs.cloudflare.com/ajax/libs/SimpleLightbox/2.1.0/simpleLightbox.min.css" rel="stylesheet" />
1820
<!-- Core theme CSS (includes Bootstrap)-->
19-
<link href="css/styles.css" rel="stylesheet" />
21+
<link href="{% static 'product_info/css/styles.css' %}" rel="stylesheet" />
2022
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
2123
</head>
2224
<body id="page-top">
@@ -27,8 +29,8 @@
2729
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
2830
<div class="collapse navbar-collapse" id="navbarResponsive">
2931
<ul class="navbar-nav ms-auto my-2 my-lg-0">
30-
<li class="nav-item"><a class="nav-link" href="http://tely.st.ie.u-ryukyu.ac.jp/register/">新規登録</a></li>
31-
<li class="nav-item"><a class="nav-link" href="http://tely.st.ie.u-ryukyu.ac.jp/">ログイン</a></li>
32+
<li class="nav-item"><a class="nav-link" href="{% url 'main_app:register_request' %}">新規登録</a></li>
33+
<li class="nav-item"><a class="nav-link" href="{% url 'main_app:login' %}">ログイン</a></li>
3234
</ul>
3335
</div>
3436
</div>
@@ -44,7 +46,7 @@ <h1 class="text-white font-weight-bold">電話予約の代理アプリ Tely</h1>
4446
</div>
4547
<div class="col-lg-8 align-self-baseline">
4648
<p class="text-white-75 mb-5">電話をかけるのが面倒なあなたへ。自動で電話予約をします。</p>
47-
<a class="btn btn-primary btn-xl" href="http://tely.st.ie.u-ryukyu.ac.jp/register/">初めての方はこちら</a>
49+
<a class="btn btn-primary btn-xl" href="{% url 'main_app:register_request' %}">初めての方はこちら</a>
4850
</div>
4951
</div>
5052
</div>
@@ -86,7 +88,7 @@ <h2 class="mb-4">こんな時に使える</h2>
8688
</ul>
8789
</div>
8890
<div class="col-md-4">
89-
<img src="./img/Tely_display.png" class="img-fluid" alt="Responsive image">
91+
<img src="{% static 'product_info/img/Tely_display.png' %}" class="img-fluid" alt="Responsive image">
9092
</div>
9193
</div>
9294
</div>
@@ -100,7 +102,7 @@ <h2 class="text-white mt-0">完全無料</h2>
100102
<hr class="divider divider-light" />
101103
<p class="text-white-75 mb-4">自動電話予約WebアプリTelyは、無料で使用することができます。</p>
102104
<p class="text-white-75 mb-4">まずは登録して試してみましょう!</p>
103-
<a class="btn btn-light btn-xl" href="http://tely.st.ie.u-ryukyu.ac.jp/register/">Telyに登録する</a>
105+
<a class="btn btn-light btn-xl" href="{% url 'main_app:register_request' %}">Telyに登録する</a>
104106
</div>
105107
</div>
106108
</div>
@@ -115,11 +117,15 @@ <h2 class="text-white mt-0">完全無料</h2>
115117
<!-- SimpleLightbox plugin JS-->
116118
<script src="https://cdnjs.cloudflare.com/ajax/libs/SimpleLightbox/2.1.0/simpleLightbox.min.js"></script>
117119
<!-- Core theme JS-->
118-
<script src="js/scripts.js"></script>
120+
<script src="{% static 'product_info/js/scripts.js' %}"></script>
119121
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
120122
<!-- * * SB Forms JS * *-->
121123
<!-- * * Activate your form at https://startbootstrap.com/solution/contact-forms * *-->
122124
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
125+
<script>
126+
var logoWhite = "{% static 'product_info/img/Tely_logo_3.png'%}";
127+
var logoBlack = "{% static 'product_info/img/Tely_logo_1.png'%}"; // ロゴ黒色画像のパス
128+
</script>
123129
<script src="https://cdn.startbootstrap.com/sb-forms-latest.js"></script>
124130
</body>
125131
</html>

0 commit comments

Comments
 (0)