Skip to content

Commit

Permalink
[ADD] feature to get agreement before signup
Browse files Browse the repository at this point in the history
  • Loading branch information
t-nakatani committed Oct 20, 2022
1 parent 88b3591 commit 1d284a5
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 17 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,8 @@ dmypy.json
notebook/
estimater/maml/model
estimater/yolov5/exp21_best.pt
.env
.env

img_processing/templates/note.html


2 changes: 1 addition & 1 deletion accounts/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<li class="nav-item"><a class="nav-link" href="{% url 'logout' %}">Logout ({{user.username}})</a></li>
{% else %}
<li class="nav-item"><a class="nav-link" href="{% url 'login' %}">Login</a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'signup' %}">User Registration</a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'note' %}">Sign Up</a></li>
{% endif %}
</ul>
</div>
Expand Down
4 changes: 4 additions & 0 deletions accounts/templates/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
{% load django_bootstrap5 %}

{% block content %}
{% if request.META.HTTP_REFERER == 'http://localhost:9001/agree/' or request.META.HTTP_REFERER == 'https://flwapp.imlab.jp/agree/' %}
<h1>User Registration</h1>
<form action="{% url 'signup' %}" method="post">
{% csrf_token %}
{% bootstrap_form form %}
{% bootstrap_button button_type='submit' content='Register' %}
</form>
{% else %}
<h3>研究に協力することを承諾してください</h3>
{% endif %}
{% endblock %}
23 changes: 23 additions & 0 deletions img_processing/templates/agree.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends 'base.html' %}

{% block content %}
<div class="text-black text-align:center bg-white p-sm-5">
<h3>研究協力承諾書</h3>
<ol>
<li>私は下記の研究について、文書に基づいて口頭で説明を受け、研究の目的、研究の意義、研究に参加するリスク、研究協力の方法、倫理的配慮について理解しました。</li>
<ul>
<li>研究テーマ: 花画像から花弁配置を推定するシステムの構築</li>
<li>協力内容: 花弁配置推定システムの評価実験</li>
</ul>
<li>この研究によって得られたデータは厳重に管理されること、個人のプライバシーが守られることの説明を受け、理解しました。</li>
<li>研究への参加は強制されるものではなく自由意志に基づくものであり、研究に参加した後でも、いつでも自由に研究への参加を止めることができ、不利益を被ることは一切ないことを理解しました。</li>
</ol>
<p>研究に協力することを承諾します。</p>

</div>
<div class="d-grid gap-2 col-5 mx-auto mt-2">
<a href="{% url 'signup' %}" class="btn btn-primary" tabindex="-1" role="button" aria-disabled="true">next</a>
</div>
<br>
<br>
{% endblock content %}
8 changes: 7 additions & 1 deletion img_processing/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ <h1 class="display-4">Petal Arrangement Estimater</h1>
{% endif %}

{% block content %}
{% if user_id %}
<div class="d-grid gap-2 col-5 mx-auto mt-2">
<a href="{% url 'note' %}" class="btn btn-primary " tabindex="-1" role="button" aria-disabled="true">next</a>
<a href="{% url 'progress' user_id %}" class="btn btn-primary " tabindex="-1" role="button" aria-disabled="true">next</a>
</div>
{% else %}
<div class="d-grid gap-2 col-5 mx-auto mt-2">
<a href="{% url 'login' %}" class="btn btn-primary " tabindex="-1" role="button" aria-disabled="true">Login</a>
</div>
{% endif %}

<!-- <a href="https://drive.google.com/drive/folders/1Y0DMwsQVRCSYTmfHAKzo9uoloa1_2qBI?usp=sharing" class="btn btn-outline-secondary" tabindex="-1" role="button" aria-disabled="true">download sample image</a> -->
{% endblock content %}
11 changes: 0 additions & 11 deletions img_processing/templates/note.html

This file was deleted.

1 change: 1 addition & 0 deletions img_processing/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

path('', basic.home, name='home'),
path('note/', basic.note, name='note'),
path('agree/', basic.agree, name='agree'),

path('progress/<int:user_id>/', exp.progress, name='progress'),
path('select_arrangement/<int:user_id>/', manual.arrangement, name='select_arrangement'),
Expand Down
10 changes: 7 additions & 3 deletions img_processing/views/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ def update_data_dir(user):

def home(request):
"""ホームページ"""
return render(request, 'home.html')
return render(request, 'home.html', {'user_id': request.user.id})


@login_required
def note(request):
"""実験注意書きページ"""
return render(request, 'note.html', {'user_id': request.user.id})
return render(request, 'note.html')


def agree(request):
"""実験同意ページ"""
return render(request, 'agree.html')
2 changes: 2 additions & 0 deletions media/target_img/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 1d284a5

Please sign in to comment.