Skip to content

Commit

Permalink
added anchor tags on some profile help pages and refactored sidebar f…
Browse files Browse the repository at this point in the history
…or unauthenticated users
  • Loading branch information
James Wallace authored and James Wallace committed Apr 2, 2020
1 parent 4ee833c commit 836464a
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 18 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
env:
env:
BARTENSOR_EMAIL_USERNAME: ${{ secrets.BARTENSOR_EMAIL_USERNAME }}
BARTENSOR_EMAIL_PASSWORD: ${{ secrets.BARTENSOR_EMAIL_PASSWORD }}
BARTENSOR_EMAIL_PASSWORD: ${{ secrets.BARTENSOR_EMAIL_PASSWORD }}
WATSON_DISCOVERY_API_KEY: ${{ secrets.WATSON_DISCOVERY_API_KEY }}
WATSON_SPEECH_TO_TEXT_API_KEY: ${{ secrets.WATSON_SPEECH_TO_TEXT_API_KEY }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -28,4 +30,4 @@ jobs:
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
33 changes: 20 additions & 13 deletions gnt/templates/gnt/disliked_drinks.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
{% extends 'gnt/profile_base.html' %}

{% block profile_content %}
<div class="content-section">
{% if user.is_authenticated %}
{% if drinks %}
<div class="container title">
<h1>Disliked Drinks</h1>
</div>
{% include 'gnt/disliked_drinks_with_remove.html' %}
{% endif %}
{% if not drinks %}
<div>
You haven't disliked any drinks!
</div>
{% endif %}
{% endif %}

{% if user.is_authenticated %}

{% if drinks %}
<div class="container title">
<h1>Disliked Drinks</h1>
</div>
{% include 'gnt/disliked_drinks_with_remove.html' %}
{% endif %}

{% if not drinks %}
<div>
<article class="content-section">
You haven't disliked any drinks yet! <a href="{% url 'home' %}">Search a drink</a> and dislike any drink you don't want to try. We'll save those drinks here!
</article>
</div>
{% endif %}

{% endif %}
</div>
{% endblock profile_content %}
8 changes: 7 additions & 1 deletion gnt/templates/gnt/liked_drinks.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{% extends 'gnt/profile_base.html' %}

{% block profile_content %}
<div class="content-section">

{% if drinks %}
<div class="container title">
<h1>Liked Drinks</h1>
</div>
{% include 'gnt/liked_drinks_with_remove.html' %}
{% endif %}

{% if not drinks %}
<div>
You haven't Liked any drinks! Make a query and give feedback on anything you try! We'll save it for you for later.
<article class="content-section">
You haven't liked any drinks! <a href="{% url 'home' %}">Search a drink</a> and vote on any drinks you would like to try! We'll save it here for you later.
</article>
</div>
{% endif %}

</div>
{% endblock profile_content %}
27 changes: 26 additions & 1 deletion gnt/templates/gnt/profile_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% load crispy_forms_tags %}

{% block 'content' %}

<div class="container">
<div class="row" style="display: flex">
<div class="col-md-9" style="display: inline-block">
Expand All @@ -13,26 +14,32 @@ <h2 class="account-heading">{{ profile.username }}</h2>
<p class="text-secondary">{{ profile.email }}</p>
</div>
</div>

<p class="text-secondary">{{ profile.profile.bio }}</p>
{% if user != profile and not requests and not friends and request.user.is_authenticated %}

{% if user != profile and not requests and not friends and user.is_authenticated %}
<form method="POST">
{% csrf_token %}
<button class="btn btn-outline-info" type="submit" name="add-friend">Add Friend</button>
</form>
{% else %}

{% if user != profile and friends %}
<form method="POST">
{% csrf_token %}
<button class="btn btn-outline-info" type="submit" name="remove-friend">Remove Friend</button>
</form>
{% endif %}

{% endif %}
</div>

{% block profile_content %}
{% endblock profile_content %}

</div>

{% if user.is_authenticated %}
<div class="col-md-3" style="display: inline-block">
<div class="content-section">
<h3>Profile Help</h3>
Expand All @@ -50,6 +57,24 @@ <h3>Profile Help</h3>
</p>
</div>
</div>
{% else %}
<div class="col-md-3" style="display: inline-block">
<div class="content-section">
<h3>Profile Help</h3>
<p class='text-muted'>Explore profile here!
<ul class="list-group">
<li class="list-group-item list-group-item-light"><a href="{% url 'profile_public' username=user%}">Profile</a></li>
<li class="list-group-item list-group-item-light"><a href="{% url 'liked_drinks' %}">Liked Drinks</a></li>
<li class="list-group-item list-group-item-light"><a href="{% url 'disliked_drinks' %}">Disliked Drinks</a></li>
<li class="list-group-item list-group-item-light"><a href="{% url 'friends' username=user %}">Friends</a></li>
<li class="list-group-item list-group-item-light"><a href="#">Flavor Profile</a></li>
</ul>
</p>
</div>
</div>
{% endif %}

</div>
</div>

{% endblock 'content' %}
File renamed without changes

0 comments on commit 836464a

Please sign in to comment.