Spaces:
Running
Running
buletomato25
commited on
Commit
·
ee13b1b
1
Parent(s):
3ceca0e
login_complete
Browse files- app.py +11 -9
- templates/resetting_password.html +0 -54
- templates/talkDetail.html +24 -7
app.py
CHANGED
@@ -115,6 +115,14 @@ if not HUGGINGFACE_HUB_TOKEN:
|
|
115 |
def top():
|
116 |
return redirect('/login')
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
# ログイン後画面
|
119 |
@app.route('/callback')
|
120 |
def callback():
|
@@ -145,7 +153,7 @@ def feedback():
|
|
145 |
'name': session.get('name'),
|
146 |
'email': session.get('email')
|
147 |
}
|
148 |
-
return render_template('feedback.html')
|
149 |
|
150 |
# 会話詳細画面(テンプレート: talkDetail.html)
|
151 |
@app.route('/talk_detail', methods=['GET', 'POST'])
|
@@ -156,17 +164,11 @@ def talk_detail():
|
|
156 |
'name': session.get('name'),
|
157 |
'email': session.get('email')
|
158 |
}
|
159 |
-
return render_template('talkDetail.html')
|
160 |
|
161 |
-
# ログイン画面(テンプレート: login.html)
|
162 |
-
@app.route('/login')
|
163 |
-
def login():
|
164 |
-
authorization_url, state = flow.authorization_url()
|
165 |
-
session['state'] = state
|
166 |
-
return redirect(authorization_url)
|
167 |
|
168 |
# インデックス画面(テンプレート: index.html)
|
169 |
-
@app.route('/index')
|
170 |
def index():
|
171 |
if 'google_id' not in session:
|
172 |
return redirect(url_for('login'))
|
|
|
115 |
def top():
|
116 |
return redirect('/login')
|
117 |
|
118 |
+
# ログイン画面(テンプレート: login.html)
|
119 |
+
@app.route('/login')
|
120 |
+
def login():
|
121 |
+
authorization_url, state = flow.authorization_url()
|
122 |
+
session['state'] = state
|
123 |
+
return redirect(authorization_url)
|
124 |
+
|
125 |
+
|
126 |
# ログイン後画面
|
127 |
@app.route('/callback')
|
128 |
def callback():
|
|
|
153 |
'name': session.get('name'),
|
154 |
'email': session.get('email')
|
155 |
}
|
156 |
+
return render_template('feedback.html', user=user_info)
|
157 |
|
158 |
# 会話詳細画面(テンプレート: talkDetail.html)
|
159 |
@app.route('/talk_detail', methods=['GET', 'POST'])
|
|
|
164 |
'name': session.get('name'),
|
165 |
'email': session.get('email')
|
166 |
}
|
167 |
+
return render_template('talkDetail.html', user=user_info)
|
168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
# インデックス画面(テンプレート: index.html)
|
171 |
+
@app.route('/index', methods=['GET', 'POST'])
|
172 |
def index():
|
173 |
if 'google_id' not in session:
|
174 |
return redirect(url_for('login'))
|
templates/resetting_password.html
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html lang="ja">
|
3 |
-
<head>
|
4 |
-
<meta charset="UTF-8" />
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6 |
-
<title>パスワード再設定画面</title>
|
7 |
-
<link rel="stylesheet" href="style.css">
|
8 |
-
|
9 |
-
</head>
|
10 |
-
<body>
|
11 |
-
<form method="POST">
|
12 |
-
<div class="container">
|
13 |
-
<h2>パスワード再設定</h2>
|
14 |
-
<div>
|
15 |
-
<label for="">ユーザ名</label>
|
16 |
-
<input type="text" name="username" />
|
17 |
-
<br />
|
18 |
-
<br />
|
19 |
-
<label for="">パスワード</label>
|
20 |
-
<input type="password" name="password" />
|
21 |
-
<br />
|
22 |
-
</div>
|
23 |
-
<div class="flex">
|
24 |
-
<input
|
25 |
-
type="submit"
|
26 |
-
class="history-button"
|
27 |
-
id="loginButton"
|
28 |
-
onclick="showRecorder()"
|
29 |
-
value="パスワード再設定"
|
30 |
-
/>
|
31 |
-
</div>
|
32 |
-
</form>
|
33 |
-
|
34 |
-
</div>
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
<script>
|
39 |
-
|
40 |
-
// 初期化処理
|
41 |
-
displayTranscription();
|
42 |
-
|
43 |
-
//画面遷移
|
44 |
-
function showRecorder() {
|
45 |
-
// 録音画面へ遷移
|
46 |
-
window.location.href = "/index";
|
47 |
-
}
|
48 |
-
function showFeedback() {
|
49 |
-
// フィードバック画面へ遷移
|
50 |
-
window.location.href = "/feedback";
|
51 |
-
}
|
52 |
-
</script>
|
53 |
-
</body>
|
54 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/talkDetail.html
CHANGED
@@ -4,6 +4,10 @@
|
|
4 |
<meta charset="UTF-8" />
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6 |
<title>会話詳細画面</title>
|
|
|
|
|
|
|
|
|
7 |
<style>
|
8 |
body {
|
9 |
font-family: Arial, sans-serif;
|
@@ -66,12 +70,25 @@
|
|
66 |
</style>
|
67 |
</head>
|
68 |
<body>
|
|
|
69 |
<div class="container">
|
70 |
<h2>会話の文字起こし表示</h2>
|
71 |
<div id="transcription">ここに会話内容が表示されます。</div>
|
72 |
<div class="flex">
|
73 |
-
<button
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
<!--
|
76 |
<form method="POST" action="/index">
|
77 |
<div class="feedback-space">
|
@@ -125,15 +142,15 @@
|
|
125 |
|
126 |
// 初期化処理
|
127 |
displayTranscription();
|
128 |
-
|
129 |
//画面遷移
|
130 |
function showRecorder() {
|
131 |
-
|
132 |
-
|
133 |
}
|
134 |
function showFeedback() {
|
135 |
-
|
136 |
-
|
137 |
}
|
138 |
</script>
|
139 |
</body>
|
|
|
4 |
<meta charset="UTF-8" />
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6 |
<title>会話詳細画面</title>
|
7 |
+
<link
|
8 |
+
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
|
9 |
+
rel="stylesheet"
|
10 |
+
/>
|
11 |
<style>
|
12 |
body {
|
13 |
font-family: Arial, sans-serif;
|
|
|
70 |
</style>
|
71 |
</head>
|
72 |
<body>
|
73 |
+
<h1>ようこそ, {{ user.name }} さん!</h1>
|
74 |
<div class="container">
|
75 |
<h2>会話の文字起こし表示</h2>
|
76 |
<div id="transcription">ここに会話内容が表示されます。</div>
|
77 |
<div class="flex">
|
78 |
+
<button
|
79 |
+
class="history-button"
|
80 |
+
id="detailButton"
|
81 |
+
onclick="showRecorder()"
|
82 |
+
>
|
83 |
+
録音画面を表示
|
84 |
+
</button>
|
85 |
+
<button
|
86 |
+
class="history-button"
|
87 |
+
id="detailButton"
|
88 |
+
onclick="showFeedback()"
|
89 |
+
>
|
90 |
+
フィードバック画面を表示
|
91 |
+
</button>
|
92 |
<!--
|
93 |
<form method="POST" action="/index">
|
94 |
<div class="feedback-space">
|
|
|
142 |
|
143 |
// 初期化処理
|
144 |
displayTranscription();
|
145 |
+
|
146 |
//画面遷移
|
147 |
function showRecorder() {
|
148 |
+
// 録音画面へ遷移
|
149 |
+
window.location.href = "/index";
|
150 |
}
|
151 |
function showFeedback() {
|
152 |
+
// フィードバック画面へ遷移
|
153 |
+
window.location.href = "/feedback";
|
154 |
}
|
155 |
</script>
|
156 |
</body>
|