<commit_before><% title @item.title %>

<% title_html do %>	
	<h1><small>Item Details</small></h1>
<% end%>



<% sidebar do %>
	<p><a class="btn btn-small" data-toggle="modal" href="#assign_students_modal" > <i class="icon-user"></i> Assign To Students</a></p>

	<section>
		<h2>Students With Access</h2>

	<%= form_tag notify_students_path  do %>
		<ul class="unstyled">
			<% @item.students.unique_usernames.each do |student| %>
				<li><input class="student_notification" type="checkbox" name="students[]" value="<%= student.id %>">
					<a href="<%= student_path(student) %>"><%= student.name %></a>
					<%= link_to withhold_from_student_item_path(@item, :student_id => student.id), :confirm => 'Are you sure?', :method => :delete, :class => "tooltips close",
					:rel =>"tooltip",  :title => "Bar the student from accessing this item." do %>
						&times;
					<% end %>
					</li>
			<% end %>
			<% if @item.students.size < 1 %>
			<li>This item has not been assigned to any students</li>
			<% end %>
			<input type="hidden" name="item" value="<%= @item.id %>"/>
		</ul>	
		</section>
		
		
		<% if @item.students.size > 0 %>
		<section class="push-down">
			<div class="well">
		
				<p><strong>Send a Message</strong></p>
				<p>Select students to send a notification about this item.</p>
				<p>Message: <br/><%= text_area_tag 'message', nil, :rows => 8 %></p>
				<p><%= submit_tag "Send...", :class => "btn" %></p>
			
			</div>
		</section>
		<% end %>
		
	<% end %>
	
	
	<div class="modal hide" id="assign_students_modal">
    	<div class="modal-header">
    		<a class="close" data-dismiss="modal">×</a>
    		<h3>Assign This Item To Students</h3>
    	</div>
    	<div class="modal-body">
	    	<p>Type the name of the student in the box to search for students.</p>
			<%= form_tag assign_to_students_item_path(@item) do %>	
				<p><input type="text" id="assign-students-list" name="student_ids"/></p>
				<p>Expires at the end of <br/><%= collection_select(:expires_on, :date, Term.all, :end_date, :name, options ={:prompt => " Never"}, :class =>"terms") %></p>
				<p><%= submit_tag "Give Access To These Students", :class => "btn" %></p>
			<% end %>
	    </div>
	    <div class="modal-footer">
	    	<a href="#" class="btn" data-dismiss="modal">Close</a>
	    </div>
    </div>
	
	<script type="text/javascript">
		$(document).ready(function () {
		    $("#assign-students-list").tokenInput("<%= search_students_path %>");
			$("#assign_students_modal").modal({show: false});
			$(".tooltips").tooltip();
		});
	</script>
	
<% end %>

<div id="item">
	<%= render :partial => @item %>		
</div>

<%= render :partial => "items/shared/subnav"%>

<section class="attachments">
	<h2>
		Attached Files
		<a href="<%= url_for new_item_attachment_path(@item) %>" class="btn btn-small" onclick="$('#upload_form').toggle(); return false;">Upload Files</a>
	</h2>

	<div id="upload_form" class="hide well">
		<%= render :partial => "attachments/upload_files"%>
	</div>

	<% if @item.attachments.full_text.available.size > 0 %>
		<div class="full-text">
			<h4>Full Text</h4>
		
			<% @item.attachments.full_text.available.each do |attachment| %>
				<%= render :partial => attachment %>
			<% end %>
		</div>
	<% end %>
	
	<% @item.attachments.not_full_text.available.each do |attachment| %>
		<%= render :partial => attachment %>
	<% end %>
 	
</section>
<% if @item.attachments.size > 0 %>
	<a href="<%= zipped_files_item_path(@item) %>" class="btn btn-small"><i class="icon-download"></i> Download Zipped</a>
<% else %>
	<div class="alert alert-info">
		<a class="close" data-dismiss="alert">&times;</a>
		No File have been uploaded yet. Start by clicking on Upload Files button.
	</div>
<% end %><commit_msg>Hide download zipped button if there are no files to be downloaded<commit_after><% title @item.title %>

<% title_html do %>	
	<h1><small>Item Details</small></h1>
<% end%>



<% sidebar do %>
	<p><a class="btn btn-small" data-toggle="modal" href="#assign_students_modal" > <i class="icon-user"></i> Assign To Students</a></p>

	<section>
		<h2>Students With Access</h2>

	<%= form_tag notify_students_path  do %>
		<ul class="unstyled">
			<% @item.students.unique_usernames.each do |student| %>
				<li><input class="student_notification" type="checkbox" name="students[]" value="<%= student.id %>">
					<a href="<%= student_path(student) %>"><%= student.name %></a>
					<%= link_to withhold_from_student_item_path(@item, :student_id => student.id), :confirm => 'Are you sure?', :method => :delete, :class => "tooltips close",
					:rel =>"tooltip",  :title => "Bar the student from accessing this item." do %>
						&times;
					<% end %>
					</li>
			<% end %>
			<% if @item.students.size < 1 %>
			<li>This item has not been assigned to any students</li>
			<% end %>
			<input type="hidden" name="item" value="<%= @item.id %>"/>
		</ul>	
		</section>
		
		
		<% if @item.students.size > 0 %>
		<section class="push-down">
			<div class="well">
		
				<p><strong>Send a Message</strong></p>
				<p>Select students to send a notification about this item.</p>
				<p>Message: <br/><%= text_area_tag 'message', nil, :rows => 8 %></p>
				<p><%= submit_tag "Send...", :class => "btn" %></p>
			
			</div>
		</section>
		<% end %>
		
	<% end %>
	
	
	<div class="modal hide" id="assign_students_modal">
    	<div class="modal-header">
    		<a class="close" data-dismiss="modal">×</a>
    		<h3>Assign This Item To Students</h3>
    	</div>
    	<div class="modal-body">
	    	<p>Type the name of the student in the box to search for students.</p>
			<%= form_tag assign_to_students_item_path(@item) do %>	
				<p><input type="text" id="assign-students-list" name="student_ids"/></p>
				<p>Expires at the end of <br/><%= collection_select(:expires_on, :date, Term.all, :end_date, :name, options ={:prompt => " Never"}, :class =>"terms") %></p>
				<p><%= submit_tag "Give Access To These Students", :class => "btn" %></p>
			<% end %>
	    </div>
	    <div class="modal-footer">
	    	<a href="#" class="btn" data-dismiss="modal">Close</a>
	    </div>
    </div>
	
	<script type="text/javascript">
		$(document).ready(function () {
		    $("#assign-students-list").tokenInput("<%= search_students_path %>");
			$("#assign_students_modal").modal({show: false});
			$(".tooltips").tooltip();
		});
	</script>
	
<% end %>

<div id="item">
	<%= render :partial => @item %>		
</div>

<%= render :partial => "items/shared/subnav"%>

<section class="attachments">
	<h2>
		Attached Files
		<a href="<%= url_for new_item_attachment_path(@item) %>" class="btn btn-small" onclick="$('#upload_form').toggle(); return false;">Upload Files</a>
	</h2>

	<div id="upload_form" class="hide well">
		<%= render :partial => "attachments/upload_files"%>
	</div>

	<% if @item.attachments.full_text.available.size > 0 %>
		<div class="full-text">
			<h4>Full Text</h4>
		
			<% @item.attachments.full_text.available.each do |attachment| %>
				<%= render :partial => attachment %>
			<% end %>
		</div>
	<% end %>
	
	<% @item.attachments.not_full_text.available.each do |attachment| %>
		<%= render :partial => attachment %>
	<% end %>
 	
</section>
<% if @item.attachments.available.size > 0 %>
	<a href="<%= zipped_files_item_path(@item) %>" class="btn btn-small"><i class="icon-download"></i> Download Zipped</a>
<% else %>
	<div class="alert alert-info">
		<a class="close" data-dismiss="alert">&times;</a>
		No File have been uploaded yet. Start by clicking on Upload Files button.
	</div>
<% end %>
{'fraction_non_alphanumeric': 0.21262148848355744, 'fraction_numerical': 0.003994141925176408, 'mean_word_length': 3.7816677275620623, 'pattern_counts': {'":': 0, '<': 263, '<?xml version=': 0, '>': 299, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '216935', 'n_tokens_mistral': 3067, 'n_tokens_neox': 2618, 'n_words': 615}