Skip to content

Commit

Permalink
Merge branch 'master' into 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jsayles committed Dec 27, 2018
2 parents 7d56d4d + 892e387 commit ca20772
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ docs/_build/*
/themes/**
!/themes/README.md

# Ignore pycharm metadata
.idea*
2 changes: 1 addition & 1 deletion Dockerfile-nadine
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
############################################################

# Set the base image to use to python 2.7
FROM python:2.7
FROM python:3.7

# Set the file maintainer (your name - the file's author)
MAINTAINER Jacob Sayles
Expand Down
2 changes: 1 addition & 1 deletion frontend-testing/tests/mobile_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ casper.test.begin('Member App on Mobile Test', function(test) {
});

casper.then(function() {
test.assertUrlMatch('/member/faq', 'Navigation to help link via mobile navigation working.')
test.assertUrlMatch('/member/help', 'Navigation to help link via mobile navigation working.')
})

casper.run(function() {test.done();});
Expand Down
5 changes: 2 additions & 3 deletions member/templates/member/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
</div>
<a href='#' data-activates="mobile" class="button-collapse"><img class='menu-img' src="{% static 'img/hamburger.png' %}"/></a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="{% url 'member:help' %}">Help</a></li>
{% endblock %}
{% if request.user.profile.is_active %}
<li><a href="{% url 'member:faq' %}">Help</a></li>
<li>
<a class='dropdown-button' data-hover="true" data-beloworigin="true" data-activates='dropdown1' href="{% url 'member:members' %}">Members</a>
<ul id='dropdown1' class='dropdown-content'>
Expand Down Expand Up @@ -113,7 +113,6 @@
</ul>
</li>
{% else %}
<li><a href="{% url 'member:not_active' %}">Help</a></li>
<li><a href="{% url 'member:not_active' %}">Members</a></li>
<li><a href="{% url 'member:not_active' %}">Organizations</a></li>
<li><a href="{% url 'member:not_active' %}">Events</a></li>
Expand All @@ -137,7 +136,7 @@
{% block side-nav %}
<ul class="side-nav" id="mobile">
{% if request.user.profile.is_active %}
<li><a href="{% url 'member:faq' %}">Help</a></li>
<li><a href="{% url 'member:help' %}">Help</a></li>
<li><a href="{% url 'member:members' %}">Members</a></li>
<li><a href="{% url 'member:org:list' %}">Organizations</a></li>
<li><a href="{% url 'member:event:calendar' %}">Events</a></li>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion member/templates/member/core/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h3 style="text-align:center;">{{ title }}</h3>
<p>Printing, billing, or general questions about the space?</p>
</div>
<div class="card-action">
<a class='card-a' href="{% url 'member:faq' %}">Frequently Asked Questions</a>
<a class='card-a' href="{% url 'member:help' %}">Frequently Asked Questions</a>
</div>
</div>
<div class="card col s6 m3 l2 offset-s3 offset-m1 offset-l1">
Expand Down
11 changes: 7 additions & 4 deletions member/templates/member/core/not_active.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ <h3 class='header-font' style='text-align:center;'>Active Membership Required</h
<div class="letter">
<p>We're sorry, you are not currently an active member. </p>

<p>Certain features in Nadine require an active membership to access. If you are not a member,
or your membership has expired, you will have limited access to this system. You can view your membership and your history by going to
<a href="{% url 'member:profile:redirect' %}">your profile</a>. If you have any questions feel free to send an email to
<a href="mailto:staff@officenomads.com">staff@officenomads.com</a> or just stop by the front desk.</p>
<p>
Certain features in Nadine require an active membership to access. If you are not a member,
or your membership has expired, you will have limited access to this system. You can view your membership and your history by going to
<a href="{% url 'member:profile:redirect' %}">your profile</a>. If you have any questions feel free to send an email to
<a href="mailto:{{ settings.STAFF_EMAIL_ADDRESS }}">{{ settings.STAFF_EMAIL_ADDRESS }}</a>
or just stop by the front desk.
</p>

<p>
Sincerely,<br>
Expand Down
2 changes: 1 addition & 1 deletion member/templates/member/new_billing.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2>New Billing Profile - {{ username }}</h2>
</p>
<p>Your new billing profile has been approved. If you have any billing related questions
please stop by the front desk or send an email to <a href="mailto:billing@officenomads.com">billing@officenomads.com</a>.
Also, please take a moment to <a href="{% url 'member:help' 'billing' %}">review how we handle billing.</a>
Also, please take a moment to <a href="{% url 'member:help_topic' 'billing' %}">review how we handle billing.</a>
</p>
<p>- <a href="mailto:staff@officenomads.com">The Office Nomads Team</a></p>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion member/templates/member/profile/profile_events.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h3 class='header-font'>Upcoming Events and Room Bookings</h3>
</td>
</tr>
</table>
<a class='btn booking-redirect' href='{% url "member:event:create_booking" %}'>Make a New Room Booking</a>
<a class='btn booking-redirect' href='{% url "member:event:create_booking" user.username %}'>Make a New Room Booking</a>

<script>
$(document).ready(function() {
Expand Down
4 changes: 2 additions & 2 deletions member/urls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
app_name = 'member'
urlpatterns = [
path('', core.home, name='home'),
path('faq/', core.faq, name='faq'),
path('help/<slug:slug>/', core.help_topic, name='help'),
path('help/', core.help, name='help'),
path('help/<slug:slug>/', core.help_topic, name='help_topic'),
path('view/', core.view_members, name='members'),
path('receipt/<int:bill_id>', core.bill_receipt, name='receipt'),
path('register/', core.register, name='register'),
Expand Down
36 changes: 18 additions & 18 deletions member/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ def home(request):
return render(request, 'member/core/home.html', context)


@login_required
def faq(request):
title = "faq"
template_text = "Frequently Asked Questions "
def help(request):
title = "Help"
template_text = "Member Help Pages"
other_topics = {}
for topic in HelpText.objects.all():
if topic.slug == 'faq':
if topic.slug == 'welcome':
title = topic.title
template_text = topic.template
else:
Expand All @@ -87,28 +86,29 @@ def faq(request):
template = Template(template_text)
rendered = template.render(current_context)

context = {'title': title,
'page_body': rendered,
'other_topics': other_topics,
'settings': settings
}
return render(request, 'member/core/faq.html', context)
context = {
'title': title,
'page_body': rendered,
'other_topics': other_topics,
'settings': settings
}
return render(request, 'member/core/help.html', context)


@login_required
def help_topic(request, slug):
topic = get_object_or_404(HelpText, slug=slug)
title = topic.title
template_text = topic.template
other_topics = HelpText.objects.all().order_by('order')
current_context = context_instance = RequestContext(request)
template = Template(template_text)
rendered = template.render(current_context)
context = {'title': title,
'page_body': rendered,
'other_topics': other_topics,
'settings': settings
}
other_topics = HelpText.objects.all().order_by('order')
context = {
'title': title,
'page_body': rendered,
'other_topics': other_topics,
'settings': settings
}
return render(request, 'member/core/help_topic.html', context)


Expand Down
2 changes: 1 addition & 1 deletion nadine/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class EmailOrUsernameModelBackend(object):

def authenticate(self, username=None, password=None):
def authenticate(self, request, username=None, password=None):
try:
username = username.lower()
if '@' in username:
Expand Down
2 changes: 1 addition & 1 deletion nadine/management/commands/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def setup_timezone(self):
country = input(PROMPT).strip().upper()
if not country:
print("Country Codes:")
print((', '.join(country_names)))
print(('\n'.join('{}: {}'.format(k, country_names[k]) for k in sorted(country_names))))
print()
self.local_settings.set('COUNTRY', country)

Expand Down
1 change: 1 addition & 0 deletions nadine/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@

# URL that handles login
LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/member/profile/'

# The interface for the front desk tablet. Values are 'WEB' or "iOS"
#TABLET = "iOS"
Expand Down
20 changes: 10 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Core requirements
Django==2.1
Pillow==5.2.0
psycopg2==2.7.5
Django>=2.0,<2.1
Pillow==5.3.0
psycopg2==2.7.6.1
django-localflavor==2.1
django-localflavor-us==1.1
django-taggit==0.23.0
django-taggit-templatetags2==1.6.1
django-crontab==0.7.1
python-slugify==1.2.5
pytz==2018.5
requests==2.19.1
setuptools==40.2.0
python-slugify==1.2.6
pytz==2018.7
requests==2.20.0
setuptools==40.6.3

# Supporting libraries
mailchimp3==3.0.4
cryptography==2.3.1
mailchimp3==3.0.6
cryptography==2.4.2

# LDAP Syncing
#django-ldapdb==1.2.0
Expand Down Expand Up @@ -51,5 +51,5 @@ CommonMark==0.5.4

# A few handy tools
safety==1.8.4
django-debug-toolbar==1.9.1
django-debug-toolbar==1.11
pip-review==1.0
2 changes: 1 addition & 1 deletion staff/templates/email/new_key.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ regarding how your keycard works, but wanted to get a few other points over to
you via email.

If you prefer to read this information online you can always find it in the
Nadine help pages: http://{{ site.domain }}{% url 'member:help' 'keys' %}
Nadine help pages: http://{{ site.domain }}{% url 'member:help_topic' 'keys' %}

IMPORTANT POINTS:

Expand Down

0 comments on commit ca20772

Please sign in to comment.