<commit_before><h1>Publishing Rights</h1>

<table class="listing" cellpadding=2>
<% if @user.digital_certificate.nil?  %>
<tr><td>
	<div class="flash_note">
		In order for your work to be published on our website, you need to need to grant us 
		publishing rights for your work. Before doing so you must generate a set of public and private keys so
		you can digitally sign your granting action.  Please <%= link_to 'generate',{:controller=>:users, :action=>:keys, :id=>@user.id} %>  keys now.


	</div></td></tr>
		<% else %>
	<tr>
					
		<td colspan=5>
			<div class="flash_note">
				In order for your work to be published on our website, you need to need to grant us 
				publishing rights for your work. You may do this on a per assignment basis, or if
				you wish you can grant or deny rights to all your past work.
			</div>
		</td>
	</tr>
	<tr>
		<td colspan=4><h3>Past assignments</h3></td>
		<td></td>
	</tr>
	<tr>
		<td colspan=4><%= link_to 'Grant', :action =>'update_publish_permissions', :allow => 1 %> publishing rights to all my past work.</td>
		<td></td>
	</tr>
	<tr>
		<td colspan=4><%= link_to 'Deny', :action =>'update_publish_permissions', :allow => 0 %> publishing rights to all my past work.</td>
		<td></td>
	</tr>
	<tr>
		<td colspan=4></td>
		<td></td>
	</tr>
  <tr>
		<th></th>
	  <th>Assignment</th>
	  <th>Publishing Rights</th>
	  <th>Digital Signature</th>
		<td></td>
  </tr>
	
<% @participants.each{
    |participant| %>
  <tr class="listingRow">
		<td>&nbsp;</td>
		<td><%= link_to participant.assignment.name, :controller => 'student_task', :action => 'view', :id => participant.id %></td>
	  <td align=center>
	  	<%if participant.permission_granted %>
	  		<%= link_to 'deny', :action =>'set_publish_permission', :id => participant.id, :allow => 0 %> 
		</td>
		<td align=center><%= (participant.verify_digital_signature(participant.digital_signature) ? "verified" : "invalid") %></td>
	    <% else %>
	    	<%= link_to 'grant', :action =>'grant', :id => participant.id %> 
		</td>
		<td>&nbsp;</td>
		<% end %>
		
		<td width=30%>&nbsp;</td>
	</tr>
<% } %>
<% end %>
</table><commit_msg>E13: Fix for when dig cert is null<commit_after><h1>Publishing Rights</h1>

<table class="listing" cellpadding=2>
<% if @user.digital_certificate.nil?  %>
<tr><td>
	<div class="flash_note">
		In order for your work to be published on our website, you need to need to grant us 
		publishing rights for your work. Before doing so you must generate a set of public and private keys so
		you can digitally sign your granting action.  Please <%= link_to 'generate',{:controller=>:users, :action=>:keys, :id=>@user.id} %>  keys now.


	</div></td></tr>
		<% else %>
	<tr>
					
		<td colspan=5>
			<div class="flash_note">
				In order for your work to be published on our website, you need to need to grant us 
				publishing rights for your work. You may do this on a per assignment basis, or if
				you wish you can grant or deny rights to all your past work.
			</div>
		</td>
	</tr>
	<tr>
		<td colspan=4><h3>Past assignments</h3></td>
		<td></td>
	</tr>
	<tr>
		<td colspan=4><%= link_to 'Grant', :action =>'update_publish_permissions', :allow => 1 %> publishing rights to all my past work.</td>
		<td></td>
	</tr>
	<tr>
		<td colspan=4><%= link_to 'Deny', :action =>'update_publish_permissions', :allow => 0 %> publishing rights to all my past work.</td>
		<td></td>
	</tr>
	<tr>
		<td colspan=4></td>
		<td></td>
	</tr>
  <tr>
		<th></th>
	  <th>Assignment</th>
	  <th>Publishing Rights</th>
	  <th>Digital Signature</th>
		<td></td>
  </tr>
	
<% @participants.each{
    |participant| %>
  <tr class="listingRow">
		<td>&nbsp;</td>
		<td><%= link_to participant.assignment.name, :controller => 'student_task', :action => 'view', :id => participant.id %></td>
	  <td align=center>
	  	<%if participant.permission_granted %>
	  		<%= link_to 'deny', :action =>'set_publish_permission', :id => participant.id, :allow => 0 %> 
		</td>
		<td align=center><% if (participant.digital_signature.nil?) %>&nbsp;<% else %>
		<%= (participant.verify_digital_signature(participant.digital_signature) ? "verified" : "invalid") %>
		<% end %>
		</td>
	    <% else %>
	    	<%= link_to 'grant', :action =>'grant', :id => participant.id %> 
		</td>
		<td>&nbsp;</td>
		<% end %>
		
		<td width=30%>&nbsp;</td>
	</tr>
<% } %>
<% end %>
</table>
{'fraction_non_alphanumeric': 0.18686868686868688, 'fraction_numerical': 0.0073461891643709825, 'mean_word_length': 3.68494623655914, 'pattern_counts': {'":': 0, '<': 174, '<?xml version=': 0, '>': 204, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6699475', 'n_tokens_mistral': 1777, 'n_tokens_neox': 1537, 'n_words': 457}