Skip to content

Commit

Permalink
feat(eighth): add subscribe and unsubscribe buttons everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnans2006 committed Apr 7, 2024
1 parent 8c47d51 commit 62a9f8a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
16 changes: 15 additions & 1 deletion intranet/templates/eighth/activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
</a>
{% endif %}

{% if activity.subscriptions_enabled %}
{% if request.user in activity.subscribers.all %}
<a class="button" href="{% url 'unsubscribe_from_club' activity.id %}">
<i class="fas fa-rss"></i>
Unsubscribe
</a>
{% else %}
<a class="button" href="{% url 'subscribe_to_club' activity.id %}">
<i class="fas fa-rss"></i>
Subscribe
</a>
{% endif %}
{% endif %}

<h2 style="padding-bottom: 0">Activity: {{ activity }}</h2>
{% if activity.special %}
<span class="badge green" title="This is a special activity.">Special</span>
Expand Down Expand Up @@ -200,7 +214,7 @@ <h3>
</tbody>
</table>
<br>
All meetings of this activity are not guaranteed to appear on this page.
Not all meetings of this activity are guaranteed to appear on this page.
<br>
<b>Activity schedules are not fixed, and may change. Check Eighth Period schedules.</b>
<br>
Expand Down
13 changes: 13 additions & 0 deletions intranet/templates/eighth/multi_signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,19 @@ <h3 class="activity-detail-header">
Get Notifications
</button>
<% } %>
<% if (subscriptions_enabled) { %>
<% if (subscribed_to) { %>
<a class="button" id="unsubscribe-button" href="/eighth/signup/unsubscribe/<%= id %>">
<i class="fas fa-rss"></i>
Unsubscribe
</a>
<% } else { %>
<a class="button" id="subscribe-button" href="/eighth/signup/subscribe/<%= id %>">
<i class="fas fa-rss"></i>
Subscribe
</a>
<% } %>
<% } %>
<div id="signup-spinner-container">
<div id="signup-spinner"></div>
</div>
Expand Down
13 changes: 13 additions & 0 deletions intranet/templates/eighth/profile_signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,19 @@ <h3 class="activity-detail-header">
Get Notifications
</button>
<% } %>
<% if (subscriptions_enabled) { %>
<% if (subscribed_to) { %>
<a class="button" id="unsubscribe-button" href="/eighth/signup/unsubscribe/<%= id %>">
<i class="fas fa-rss"></i>
Unsubscribe
</a>
<% } else { %>
<a class="button" id="subscribe-button" href="/eighth/signup/subscribe/<%= id %>">
<i class="fas fa-rss"></i>
Subscribe
</a>
<% } %>
<% } %>
<div id="signup-spinner-container">
<div id="signup-spinner"></div>
</div>
Expand Down

0 comments on commit 62a9f8a

Please sign in to comment.