Skip to content

Commit

Permalink
add title descriptions for flags; update exception errors; new vocabu…
Browse files Browse the repository at this point in the history
…lary: authorized=on allowed list for restricted activity
  • Loading branch information
jwoglom committed Sep 13, 2015
1 parent 1ce35bd commit 1b063ef
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
7 changes: 4 additions & 3 deletions intranet/apps/eighth/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SignupException(Exception):
"contact an Intranet administrator."),
"ScheduledActivityCancelled": m("This activity has been cancelled for this block.",
"This activity has been cancelled for this block."),
"ActivityDeleted": m("This activity has been deleted.",
"ActivityDeleted": m("This activity has been deleted. Refresh this page to see an up-to-date list of activities.",
"This activity has been deleted."),
"ActivityFull": m("This activity is full. You may not sign up for it at this time.",
"This activity is full."),
Expand All @@ -22,9 +22,10 @@ class SignupException(Exception):
"This activity can't be signed up for more two days in advance."),
"Sticky": m("You may not switch out of a sticky activity.",
"This student is already in a sticky activity."),
"OneADay": m("You may only sign up for this activity once per day.",
"OneADay": m("You may only sign up for this activity once per day. To sign up for the activity during this block, "
"change your signup on the other block where you selected this activity.",
"This is a one-a-day activity."),
"Restricted": m("You may not sign up for this restricted activity.",
"Restricted": m("You may not sign up for this restricted activity. You are not on the authorized list.",
"This activity is restricted for this student."),
"OverrideBlockLocked": m("An override block ({}) has been locked. Signup is not allowed at this time.",
"An override block ({}) has been locked."),
Expand Down
6 changes: 5 additions & 1 deletion intranet/static/js/eighth/signup.search.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ $(document).ready(function() {
if(cmd[1].substring(0,1) == "r" && activity.restricted == fl) {
show = true;
}
// authorized
if(cmd[1].substring(0,2) == "au" && activity.restricted == fl && activity.restricted_for_user == !fl) {
show = true;
}
// cancelled
if(cmd[1].substring(0,1) == "c" && activity.cancelled == fl) {
show = true;
Expand All @@ -130,7 +134,7 @@ $(document).ready(function() {
show = true;
}
// admin
if(cmd[1].substring(0,1) == "a" && activity.administrative == fl) {
if(cmd[1].substring(0,2) == "ad" && activity.administrative == fl) {
show = true;
show_adminact = true;
}
Expand Down
40 changes: 22 additions & 18 deletions intranet/templates/eighth/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,35 +95,37 @@
<% } %>

<% if (special) { %>
<span class="badge green">Special</span>
<span class="badge green" title="This is a special activity.">Special</span>
<% } %>

<% if (cancelled) { %>
<span class="badge darkred">CANCELLED</span>
<span class="badge darkred" title="This activity was cancelled.">CANCELLED</span>
<% } %>

<% if (restricted_for_user) { %>
<span class="badge purple">Restricted</span>
<span class="badge purple" title="You are not on the authorized list for this restricted activity.">Restricted</span>
<% } else if (restricted) { %>
<span class="badge green" title="You are authorized to sign up for this restricted activity.">Authorized</span>
<% } %>

<% if (sticky) { %>
<span class="badge orange">Sticky</span>
<% if (sticky && (selected || isEighthAdmin)) { %>
<span class="badge orange" title="You are stuck to this activity.">Sticky</span>
<% } %>

<% if (both_blocks) { %>
<span class="badge blue">Both Blocks</span>
<span class="badge blue" title="This activity runs both blocks.">Both Blocks</span>
<% } %>

<% if (one_a_day) { %>
<span class="badge lightblue">One a Day</span>
<span class="badge lightblue" title="You may only sign up for this activity once per day.">One a Day</span>
<% } %>

<% if (administrative) { %>
<span class="badge">Admin</span>
<span class="badge" title="This activity is administrative.">Admin</span>
<% } %>

<% if (presign) { %>
<span class="badge yellow">48-hr</span>
<span class="badge yellow" title="You may only sign up for this activity 48 hours in advance.">48-hr</span>
<% } %>

</span>
Expand All @@ -150,35 +152,37 @@ <h3>
</h3>

<% if (cancelled) { %>
<span class="badge darkred clickable" data-append-search="is:c">CANCELLED</span>
<span class="badge darkred clickable" data-append-search="is:c" title="This activity was cancelled.">CANCELLED</span>
<% } %>

<% if (special) { %>
<span class="badge green clickable" data-append-search="is:sp">Special</span>
<span class="badge green clickable" data-append-search="is:sp" title="This is a special activity.">Special</span>
<% } %>

<% if (restricted_for_user) { %>
<span class="badge purple clickable" data-append-search="is:r">Restricted</span>
<span class="badge purple clickable" data-append-search="is:r" title="You are not on the authorized list for this restricted activity.">Restricted</span>
<% } else if (restricted) { %>
<span class="badge green clickable" data-append-search="is:au" title="You are authorized to sign up for this restricted activity.">Authorized</span>
<% } %>

<% if (sticky) { %>
<span class="badge orange clickable" data-append-search="is:st">Sticky</span>
<% if (sticky && (selected || isEighthAdmin)) { %>
<span class="badge orange clickable" data-append-search="is:st" title="You are stuck to this activity.">Sticky</span>
<% } %>

<% if (both_blocks) { %>
<span class="badge blue clickable" data-append-search="is:b">Both Blocks</span>
<span class="badge blue clickable" data-append-search="is:b" title="This activity runs both blocks.">Both Blocks</span>
<% } %>

<% if (one_a_day) { %>
<span class="badge lightblue clickable" data-append-search="is:one">One a Day</span>
<span class="badge lightblue clickable" data-append-search="is:one" title="You may only sign up for this activity once per day.">One a Day</span>
<% } %>

<% if (administrative) { %>
<span class="badge clickable" data-append-search="is:a">Administrative</span>
<span class="badge clickable" data-append-search="is:ad" title="This activity is administrative.">Administrative</span>
<% } %>

<% if (presign) { %>
<span class="badge yellow clickable" data-append-search="is:p">48-hr Presign</span>
<span class="badge yellow clickable" data-append-search="is:p" title="You may only sign up for this activity 48 hours in advance.">48-hr Presign</span>
<% } %>

<% scheduled_activity_id = this.model.attributes.scheduled_activity %>
Expand Down

0 comments on commit 1b063ef

Please sign in to comment.