Navigation Menu

Skip to content

Commit

Permalink
fix(welcome): readd welcome_done
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-o committed Jul 8, 2019
1 parent 991794d commit bf99f98
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 47 deletions.
26 changes: 26 additions & 0 deletions intranet/apps/welcome/tests.py
@@ -0,0 +1,26 @@
from django.urls import reverse

from ...test.ion_test import IonTestCase


class WelcomeTest(IonTestCase):
"""Tests for the welcome module."""

def test_welcome_view_teacher(self):
user = self.login()
user.user_type = "teacher"
user.save()
response = self.client.get(reverse("welcome"))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context["first_login"], False)
self.assertTemplateUsed(response, "welcome/teacher.html")

def test_welcome_view_student(self):
user = self.login()
response = self.client.get(reverse("welcome"))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "welcome/student.html")

def test_welcome_done(self):
user = self.login()
response = self.client.get(revese("done"))
1 change: 1 addition & 0 deletions intranet/apps/welcome/urls.py
Expand Up @@ -5,5 +5,6 @@
urlpatterns = [
url(r"^/student$", views.student_welcome_view, name="welcome_student"),
url(r"^/teacher$", views.teacher_welcome_view, name="welcome_teacher"),
url(r"^/done$", views.done_welcome_view, name="welcome_done"),
url(r"^$", views.welcome_view, name="welcome"),
]
6 changes: 6 additions & 0 deletions intranet/apps/welcome/views.py
Expand Up @@ -27,3 +27,9 @@ def welcome_view(request):
return student_welcome_view(request)
else:
return redirect("index")

@login_required
def done_welcome_view(request):
request.user.seen_welcome = True
request.user.save()
return redirect("index")
91 changes: 45 additions & 46 deletions intranet/templates/welcome/base.html
Expand Up @@ -2,7 +2,6 @@
{% load static %}
{% load pipeline %}


{% block title %}
Intranet - Welcome
{% endblock %}
Expand All @@ -21,59 +20,59 @@

{% block body %}
{{ block.super }}
<div id="welcome-container">
<div id="welcome">
<div id="ion-welcome">
{% block welcome %}
<br>
<br>
<h2>
Welcome to <b>Ion</b>
</h2>
<div class="ion-welcome-logo"></div>
<div class="ion-welcome-icons"></div>
<button id="ion-welcome-continue" class="ion-welcome-continue">
Continue <i class="fa fa-chevron-right"></i>
</button>
{% endblock %}
</div>
<div id="step-1">
{% block step1 %}
<h2>Welcome to the TJ Intranet</h2>
<p>The TJ Intranet gives you access to eighth period activities, announcements, directory information, events, polls, files, and more. Before you can start using Intranet, spend a minute to jump through this one-time welcome process.</p>
<div id="welcome-container">
<div id="welcome">
<div id="ion-welcome">
{% block welcome %}
<br>
<br>
<h2>
Welcome to <b>Ion</b>
</h2>
<div class="ion-welcome-logo"></div>
<div class="ion-welcome-icons"></div>
<button id="ion-welcome-continue" class="ion-welcome-continue">
Continue <i class="fa fa-chevron-right"></i>
</button>
{% endblock %}
</div>
<div id="step-1">
{% block step1 %}
<h2>Welcome to the TJ Intranet</h2>
<p>The TJ Intranet gives you access to eighth period activities, announcements, directory information, events, polls, files, and more. Before you can start using Intranet, spend a minute to jump through this one-time welcome process.</p>

<p>Logged in as: {{ request.user.full_name }}{% if request.user.graduation_year %}, Class of {{ request.user.graduation_year }}{% endif %}</p>
<p>Email addresses on file:</p>
<ul>
{% for email in request.user.emails.all %}
<li>{{ email }}</li>
{% empty %}
<li>(No custom addresses)</li>
{% endfor %}
</ul>
<p>Logged in as: {{ request.user.full_name }}{% if request.user.graduation_year %}, Class of {{ request.user.graduation_year }}{% endif %}</p>
<p>Email addresses on file:</p>
<ul>
{% for email in request.user.emails.all %}
<li>{{ email }}</li>
{% empty %}
<li>(No custom addresses)</li>
{% endfor %}
</ul>

<br>
<br>

{% if request.user.emails.exists %}
<p>Please make sure that you check these accounts regularly. Go to Preferences, accessed by clicking on your user icon in the top right corner, to modify the email addresses shown on your profile.</p>
{% else %}
<p>You don't currently have any custom email addresses on file. Go to Preferences, accessed by clicking on your user icon in the top right corner, to add an email address to your profile.</p>
{% endif %}
{% if request.user.emails.exists %}
<p>Please make sure that you check these accounts regularly. Go to Preferences, accessed by clicking on your user icon in the top right corner, to modify the email addresses shown on your profile.</p>
{% else %}
<p>You don't currently have any custom email addresses on file. Go to Preferences, accessed by clicking on your user icon in the top right corner, to add an email address to your profile.</p>
{% endif %}


<p>You can access your TJ email account ({{ request.user.tj_email }}) by going to <a href="https://webmail.tjhsst.edu" target="_blank">webmail.tjhsst.edu</a>. You can also use another mail client <a href="https://livedoc.tjhsst.edu/wiki/Accessing_your_TJ_Email" target="_blank">via IMAP</a>. Use your Intranet credentials.</p>
<p>You can access your TJ email account ({{ request.user.tj_email }}) by going to <a href="https://webmail.tjhsst.edu" target="_blank">webmail.tjhsst.edu</a>. You can also use another mail client <a href="https://livedoc.tjhsst.edu/wiki/Accessing_your_TJ_Email" target="_blank">via IMAP</a>. Use your Intranet credentials.</p>

<p>It is <b>strongly recommended</b> that you set up email forwarding, which will ensure that you see all of the messages sent to your account.</p>
{% endblock %}
</div>
<p>It is <b>strongly recommended</b> that you set up email forwarding, which will ensure that you see all of the messages sent to your account.</p>
{% endblock %}
</div>

<div id="mail-forwarding">
{% include "welcome/mail_forwarding.html" %}
</div>
<div id="mail-forwarding">
{% include "welcome/mail_forwarding.html" %}
</div>

<div id="eighth-policy">
{% include "welcome/eighth_policy.html" %}
</div>
<div id="eighth-policy">
{% include "welcome/eighth_policy.html" %}
</div>

<div id="step-2">
{% block step2 %}
Expand Down
1 change: 0 additions & 1 deletion intranet/templates/welcome/student.html
Expand Up @@ -8,7 +8,6 @@
</center>
{% endblock %}


{% block step2 %}
<h2>
How to Navigate
Expand Down

0 comments on commit bf99f98

Please sign in to comment.