Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Bug 1483263 / 1483261 - Remove 'Planning' + Applications for Council …
Browse files Browse the repository at this point in the history
…on Dashboard (#1499)

* Bug 1483263 - Remove 'Planning' section as it has been removed from Bugzilla

* Bug 1483261 - Show Reps Applications to Council as well even if they are not Mentors
  • Loading branch information
MichaelKohler committed Sep 1, 2018
1 parent b256e30 commit 86a5fd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 77 deletions.
69 changes: 0 additions & 69 deletions remo/dashboard/templates/dashboard_reps.jinja
Expand Up @@ -914,75 +914,6 @@
{% endif %}
<!-- end mentorship requests block -->

<!-- planning requests block -->
{% if my_planning_requests is defined %}
<div class="row">
<div class="large-7 columns dashboard-box">
<h2>Planning</h2>
</div>
</div>
<div class="row">
<div id="dashboard-mentorship-block" class="large-12 columns">
{% if my_planning_requests %}
<table class="dashboard-table responsive">
<thead>
<tr>
<th class="dashboard-clickable type-int">ID</th>
<th class="dashboard-clickable type-string">Creator</th>
<th>Summary</th>
<th class="dashboard-clickable type-string">Whiteboard</th>
<th class="dashboard-clickable type-string">Status</th>
<th class="dashboard-clickable type-string">Last updated</th>
</tr>
</thead>
<tbody>
{% for bug in my_planning_requests %}
<tr class='my-planning-request
{{ bug.assigned_to|ifeq(request.user, 'assigned-request') }}'>
<td>
<a href="{{ bug.bug_id|get_bugzilla_url }}" target="_blank">
{{ bug.bug_id }}
</a>
</td>
<td>
<a href="{{ url('profiles_view_profile',
bug.creator|get_display_name) }}">
{{ bug.creator|get_display_name }}
</a>
</td>
<td>
<div class="hide-for-small">
<div class="overflow-fix" title="{{ bug.summary }}">
{{ bug.summary }}
</div>
</div>
<div class="show-for-small">
{{ bug.summary }}
</div>
</td>
<td>{{ bug.whiteboard }}</td>
<td>{{ bug.status }}</td>
<td title="{{ bug.bug_last_change_time|format_datetime }}"
data-order-by="{{ bug.bug_last_change_time|format_datetime_unix }}"
data-time="{{ bug.bug_last_change_time|format_datetime_iso }}">
{{ bug.bug_last_change_time|format_datetime }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="row">
<div class="large-12 columns no-bugs">
<p>No Bugs found!</p>
</div>
</div>
{% endif %}
</div> <!-- end my_planning_requests -->
</div>
{% endif %}
<!-- end planning requests block -->

<!-- Strategy block -->
{% if can_view_administration %}
<div class="row">
Expand Down
12 changes: 4 additions & 8 deletions remo/dashboard/views.py
Expand Up @@ -111,7 +111,6 @@ def dashboard(request):
budget_requests = Bug.objects.filter(component='Budget Requests').exclude(q_closed)
swag_requests = Bug.objects.filter(component='Swag Requests').exclude(q_closed)
mentorship_requests = Bug.objects.filter(component='Mentorship').exclude(q_closed)
planning_requests = Bug.objects.filter(component='Planning').exclude(q_closed)

today = now().date()

Expand Down Expand Up @@ -151,21 +150,18 @@ def dashboard(request):
groups__name='Rep').distinct()
args['mentees_budget_requests'] = budget_requests.filter(creator__in=my_mentees).distinct()
args['mentees_swag_requests'] = swag_requests.filter(creator__in=my_mentees).distinct()
args['mentees_emails'] = my_mentees.values_list('first_name', 'last_name', 'email') or None
args['email_mentees_form'] = EmailUsersForm(my_mentees)

if user.groups.filter(Q(name='Mentor') | Q(name='Council')).exists():
my_mentorship_requests = mentorship_requests.filter(my_q_assigned)
my_mentorship_requests = my_mentorship_requests.order_by('whiteboard')
args['my_mentorship_requests'] = my_mentorship_requests.distinct()
args['mentees_emails'] = my_mentees.values_list('first_name', 'last_name', 'email') or None
args['email_mentees_form'] = EmailUsersForm(my_mentees)

if user.groups.filter(Q(name='Admin') | Q(name='Review')).exists():
args['all_budget_requests'] = budget_requests.all()[:20]
args['all_swag_requests'] = swag_requests.all()[:20]

if user.groups.filter(Q(name='Admin') | Q(name='Council')).exists():
args['my_planning_requests'] = planning_requests
else:
args['my_planning_requests'] = planning_requests.filter(my_q_assigned).distinct()

if user.groups.filter(Q(name='Admin') | Q(name='Council') | Q(name='Onboarding')).exists():
args['reps_without_profile'] = reps.filter(userprofile__registration_complete=False)

Expand Down

0 comments on commit 86a5fd6

Please sign in to comment.