<h1>Plugins</h1>

<div class="plugin_list">
  <h3>Installed Plugins</h3>
  
  <ul>
    <% Dir["#{CRUISE_DATA_ROOT}/builder_plugins/*"].each do |plugin| %>
      <% name = File.basename(plugin) %>
      <li>
        <%= link_to Inflector.titleize(name.sub(/\.rb$/, '')), :action => 'plugins', :type => 'installed', :name => name %> 
      </li>
    <% end %>

    <% Dir["#{RAILS_ROOT}/lib/builder_plugins/*"].each do |plugin| %>
      <% name = File.basename(plugin) %>
      <li>
        <%= link_to Inflector.titleize(name.sub(/\.rb$/, '')), :action => 'plugins', :type => 'builtin', :name => name %> 
        (built in)
      </li>
    <% end %>
  </ul>
</div>

<div id="plugin_documentation">
  <% if @file %>
    <h1><%= @plugin_title + " Plugin" %></h1>
    <%= render_plugin_doc @file || '' %>
  <% else %>
    <%= render :partial => 'about_plugins' %>
  <% end %>
</div>