-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from ecxia/feature/availability
Allow users to deactivate discovery and incoming requests
- Loading branch information
Showing
11 changed files
with
458 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
buddy_mentorship/migrations/0013_auto_20200717_0018_squashed_0015_auto_20200717_0039.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.1a1 on 2020-07-17 02:00 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("buddy_mentorship", "0012_auto_20200704_0232"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="profile", | ||
name="looking_for_mentees", | ||
field=models.BooleanField(default=True), | ||
), | ||
migrations.AddField( | ||
model_name="profile", | ||
name="looking_for_mentors", | ||
field=models.BooleanField(default=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
$(function () { | ||
$('[data-toggle="tooltip"]').tooltip() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,13 @@ <h1> | |
<div class="card-title h5"> | ||
Want Help | ||
</div> | ||
{% if profile.looking_for_mentors %} | ||
<span class="badge badge-success" id="lookingForMentorsBadge">Actively Looking for Mentors</span> | ||
{% endif %} | ||
{% if not profile.looking_for_mentors %} | ||
<span class="badge badge-secondary" id="notLookingForMentorsBadge">Not Actively Looking for Mentors</span> | ||
{% endif %} | ||
{% comment %} </div> {% endcomment %} | ||
<div class="card-text"> | ||
<ul class="list-group list-group-flush"> | ||
{% for experience in profile.get_help_wanted %} | ||
|
@@ -89,9 +96,10 @@ <h1> | |
{% endfor %} | ||
{% if request.user == profile.user %} | ||
{% if not profile.get_help_wanted %} | ||
<p></p> | ||
<div class="alert alert-warning" role="alert"> | ||
<p>Your profile has no skills you want help with.</p> | ||
<p>Adding skills that you want help with allows you to <b>send mentorship offers</b> and allows people looking for mentees to <b>find you via search</b> and <b>send you mentorship offers</b>.</p> | ||
<p>Adding skills that you want help with allows you to <b>send mentorship offers</b> and is needed for people looking for mentees to <b>find you via search</b> and <b>send you mentorship offers</b>.</p> | ||
</div> | ||
{% endif %} | ||
<li class="list-group-item d-flex align-items-left"> | ||
|
@@ -117,6 +125,12 @@ <h1> | |
<div class="card-title h5"> | ||
Can Help | ||
</div> | ||
{% if profile.looking_for_mentees %} | ||
<span class="badge badge-success" id="lookingForMenteesBadge">Actively Looking for Mentees</span> | ||
{% endif %} | ||
{% if not profile.looking_for_mentees %} | ||
<span class="badge badge-secondary" id="notLookingForMenteesBadge">Not Actively Looking for Mentees</span> | ||
{% endif %} | ||
<div class="card-text"> | ||
<ul class="list-group list-group-flush"> | ||
{% for experience in profile.get_can_help %} | ||
|
@@ -148,9 +162,10 @@ <h1> | |
{% endfor %} | ||
{% if request.user == profile.user %} | ||
{% if not profile.get_can_help %} | ||
<p></p> | ||
<div class="alert alert-warning" role="alert"> | ||
<p>Your profile has no skills you can help with.</p> | ||
<p>Adding skills that you can help with allows people looking for mentors to <b>find you via search</b> and <b>send you mentorship requests</b>, and allows you to <b>send mentorship offers</b>.</p> | ||
<p>Adding skills that you can help with is needed for people looking for mentors to <b>find you via search</b> and <b>send you mentorship requests</b>, and allows you to <b>send mentorship offers</b>.</p> | ||
</div> | ||
{% endif %} | ||
<li class="list-group-item d-flex align-items-left"> | ||
|
@@ -212,7 +227,15 @@ <h1> | |
</div> | ||
{% endif %} | ||
|
||
{% if not can_request and existing_request_from_user is None and existing_offer_to_user is None and user_profile != profile %} | ||
{% if cannot_request_not_looking %} | ||
<div class="alert alert-info" role="alert"> | ||
<p> | ||
You are not able to request help from this user because they are not actively looking for mentees. | ||
</p> | ||
</div> | ||
{% endif %} | ||
|
||
{% if cannot_request_no_skills %} | ||
<div class="alert alert-info" role="alert"> | ||
<p> | ||
You are not able to request help from this user. This may be because you have not added a skill you want help with or | ||
|
@@ -240,7 +263,15 @@ <h1> | |
|
||
{% endif %} | ||
|
||
{% if not can_offer and existing_request_to_user is None and existing_offer_from_user is None and user_profile != profile %} | ||
{% if cannot_offer_not_looking %} | ||
<div class="alert alert-info" role="alert"> | ||
<p> | ||
You are not able to offer to mentor this user because they are not actively looking for mentors. | ||
</p> | ||
</div> | ||
{% endif %} | ||
|
||
{% if cannot_offer_no_skills %} | ||
<div class="alert alert-info" role="alert"> | ||
<p> | ||
You are not able to offer to mentor this user. This may be because you have not added a skill you can help with or | ||
|
@@ -250,6 +281,7 @@ <h1> | |
{% endif %} | ||
</div> | ||
</div> | ||
|
||
{% block map_js %} | ||
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" | ||
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew==" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.