<div id="left">
<div class="blue">Actions</div>
<div class="articles">
  <%= loading_indicator_tag 'tag', "new" %>
  <%= link_to_remote "Create New",
         { :url => { :controller => 'Tags', :action => 'new' }, 
           :loading => "AjaxScaffold.newOnLoading(request,'tag');",
			     :success => "AjaxScaffold.newOnSuccess(request,'tag');",
			     :failure => "AjaxScaffold.newOnFailure(request,'tag');" },
         { :href => url_for(:controller => 'Tags', :action => 'new'), 
			     :class => "create" } %>
			   
			   <br />
			   
 <%= link_to("Prune Tags", { :action => 'prune_tags'}, :confirm => 'Are you sure you want to delete all the tags without a page?') %>
			     </div>
			     

 <div class="blue">Order By:</div>
  <div class="articles">
  
  <%= start_form_tag :action => 'update', :controller => 'options' %>
  
  <select name="setting[tag_order_by]" id="tag_order_by">
  <%= options_for_select(tag_order_by_options, config_value('tag_order_by')) %>
  </select>
  
  <select name="setting[tag_display_order]" id="tag_display_order">
  <%= options_for_select(['asc','desc'], config_value('tag_display_order')) %>
  </select>

  <%= submit_tag "Go" %>
  </div>
  
  <div class="blue">Display Number:</div>
  <div class="articles">
  <select name="setting[tag_display_number]" id="tag_display_number">
  <%= options_for_select(display_by_options, config_value('tag_display_number')) %>
  </select>
  <%= submit_tag "Go" %>
  <%= end_form_tag %>
</div>

<div id="page_search_box" style="display:none">
<div class="blue">Search Tags:</div>
<div class="articles">
<input id="page_search" name="page_search_list" type="text" value="">
<%= observe_field 'page_search',  :frequency => 0.5, 
         :update => 'tablediv', :url => 
         { :controller => 'tags', :action=> 'list' }, 
         :with => "'search=' + escape(value)",
         :loading => "$('page_search').className = 'blue_loader';",
         :success => "$('page_search').className = ''; Element.hide('tag-tfoot');" %>
<div id="page_search_loader" class="blue_loader" style="display:none"></div>
</div>
</div>

<script type="text/javascript">
Element.show('page_search_box');
</script>

</div>
			
			
<div id="content">

<div class="blue">Tags</div>
<div class="articles">
<div id="tablediv">
<table id="tag-list" class="list" cellpadding="0" cellspacing="0">
  <thead>  
	    <tr class="header">
	 		<th scope="col" width="120">Name</th>
	 		<th scope="col">Edited/Created</th>
	 		<th scope="col">Actions</th>
	    </tr> 
  </thead>
    <tfoot id="tag-tfoot">
    		  <tr>		<% if pagination_links(@tag_pages) %>
    		  		<th scope="row">Page: </th>
    		  		<td colspan="4"><%= pagination_links(@tag_pages) -%></td>
    		  		<% end %>
    		</tr>
 </tfoot>
  <tbody>
    <tr id="tag-error-message" class="error-message" style="display:none;">
      <td colspan="<%= num_columns - 1 %>">
          <p>An error has occurred</p>
      </td>
      <td class="actions">
         <%= link_to_function "Close", "AjaxScaffold.hideError('tag');" %>   
      </td>
    </tr>
    <tr id="tag-empty-message" class="empty-message" <%= " style=\"display:none;\" " if !@tagslist.empty? %>>
      <td colspan="<%= num_columns %>">No Entries</td>
    </tr>
  </tbody>  
  <tbody id="tag-list-body">
    <% if !@tagslist.empty? %>
  	  <%= render :partial => 'tag', :collection => @tagslist, :locals => { :hidden => false } %>
  	<% else %>
    <% # Do not remove the following TR, it is needed to load up the even row color when enableHighlighting is turned on and the list is empty %>
    <tr class="even ignore" style="display: none;">
      <td colspan="<%= num_columns %>"></td>
    </tr>
    <% end %>
  </tbody>
</table>
</div>
</div>

<div class="blue">Tag Cloud</div>
<div class="articles">

<p style="overflow:hidden;font-size:20px;">
<% @tags.each do |tag| -%>
<span style="font-size:<%= @sizes[tag] %>%"><%= link_to tag.name, :action => "show", :id => tag %>(<%= tag.page_counter %>)</span>
<% end -%>
</p>

</div>

</div>

<script type="text/javascript">
TableBodyUtil.disableHighlighting(AjaxScaffold.getTableBodyElement('tag'));
</script>
