Skip to content

Commit

Permalink
Grey out & disable bookmarks link if instructor has not allowed bookm…
Browse files Browse the repository at this point in the history
…arks for assignment
  • Loading branch information
DanielleHancock committed Mar 23, 2020
1 parent f144594 commit f0352dd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
21 changes: 21 additions & 0 deletions app/views/sign_up_sheet/_actions.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
<% if @use_bookmark %>
<%= link_to :controller=>'bookmarks', :action=> 'list', :id => topic.id do %>
<span class="fa-stack fa-md" title='View topic bookmarks'>
<i class="fa fa-bookmark fa-stack-1x fa-2x"></i>
<p class="fa fa-stack-2x fa-inverse" style='font-size: 1.0em; padding-top: 2px; font-weight: bold;'>
<%= Bookmark.where(topic_id: topic.id).length.to_s %>
</p>
</span>
<% end %>
<%= link_to :controller=>'bookmarks', :action=> 'new', :id => topic.id , :assignment_id => params[:assignment_id] do %>
<span class="fa-stack fa-md" title='Add bookmark to topic'>
<i class="fa fa-bookmark fa-stack-1x fa-2x"></i>
<i class="fa fa-plus fa-stack-1x fa-inverse" style='font-size: .5em'></i>
</span>
<% end %>
<% else %>
<span class="fa-stack fa-md" title='View topic bookmarks'>
<i class="fa fa-bookmark fa-stack-1x fa-2x" style="opacity: 0.3;"></i>
</span>
<% end %>
<%= render :partial => '/sign_up_sheet/all_actions', :locals => {:i=>i, :topic=>topic, :is_suggested_topic=>is_suggested_topic} %>

14 changes: 0 additions & 14 deletions app/views/sign_up_sheet/_bookmarks.html.erb

This file was deleted.

6 changes: 3 additions & 3 deletions app/views/sign_up_sheet/_table_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<th width="5%">Num. of slots</th>
<th width="5%">Available slots</th>
<th width="5%">Num. on waitlist</th>
<% if @use_bookmark %>
<th width="10%">Bookmarks</th>
<% end %>
<th width="10%"> Bookmarks
<% unless @use_bookmark %> (disabled) <% end %>
</th>
<% if @assignment.current_stage_name(@topic_id) != 'Finished' %>
<th width="10%">Actions</th>
<th width="5%">Advertise- ment(s)</th>
Expand Down
5 changes: 1 addition & 4 deletions app/views/sign_up_sheet/_table_line.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
<td align="center"><%= topic.max_choosers %></td>
<%= render :partial => '/sign_up_sheet/available_slots', :locals => {:topic=>topic} %>
<%= render :partial => '/sign_up_sheet/num_waiting', :locals => {:topic=>topic} %>
<% if @use_bookmark %>
<td align="center"> <%= render :partial => '/sign_up_sheet/bookmarks', :locals => {:i=>i,:topic=>topic} %> </td>
<% end %>
<% if @assignment.current_stage_name(@topic_id) != 'Finished' %>
<td align="center"> <%= render :partial => '/sign_up_sheet/all_actions', :locals => {:i=>i,:topic=>topic, :is_suggested_topic=>is_suggested_topic ||= false} %> </td>
<td align="center"> <%= render :partial => '/sign_up_sheet/actions', :locals => {:i=>i,:topic=>topic, :is_suggested_topic=>is_suggested_topic ||= false} %> </td>
<% end %>
<td align="center">
<% if SignUpSheet.has_teammate_ads?(topic.id) %>
Expand Down

0 comments on commit f0352dd

Please sign in to comment.