<div class="line-block marginbottom10">
-<% if administrator? %>
- <ul style="float: right" class="operations">
- <li>
- <%= image_tag 'compare.png' -%>
- <a href="<%= ApplicationController.root_context-%>/profiles/compare" id="compare-link"><%= message('quality_profiles.compare_profiles') -%></a>
- </li>
- <li class="last">
- <%= image_tag 'restore.gif' -%>
- <a href="#" onclick="$('restore-form').show();return false;" id="restore-link"><%= message('quality_profiles.restore_profile') -%></a>
- </li>
- </ul>
-<% end %>
+ <% if administrator? %>
+ <ul style="float: right" class="operations">
+ <li>
+ <%= image_tag 'compare.png' -%>
+ <a href="<%= ApplicationController.root_context -%>/profiles/compare" id="compare-link"><%= message('quality_profiles.compare_profiles') -%></a>
+ </li>
+ <li class="last">
+ <%= image_tag 'restore.gif' -%>
+ <a href="#" onclick="$('restore-form').show();return false;" id="restore-link"><%= message('quality_profiles.restore_profile') -%></a>
+ </li>
+ </ul>
+ <% end %>
<h1 class="marginbottom10"><%= message('quality_profiles.page') -%></h1>
</div>
<% if administrator? %>
-<form class="admin marginbottom10" id="restore-form" action="<%= url_for :action => 'restore' -%>" enctype="multipart/form-data" style="display: none" method="post">
+ <form class="admin marginbottom10" id="restore-form" action="<%= url_for :action => 'restore' -%>" enctype="multipart/form-data" style="display: none" method="post">
<table class="spaced width100">
<tr>
- <td width="1%" nowrap><%= message('backup_verb') -%>: </td>
+ <td width="1%" nowrap><%= message('backup_verb') -%>:</td>
<td><%= file_field_tag 'backup' %></td>
</tr>
<%
- languages.sort{|x,y| x.getName() <=> y.getName()}.each do |language|
- importers=controller.java_facade.getProfileImportersForLanguage(language.getKey())
+ languages.sort { |x, y| x.getName() <=> y.getName() }.each do |language|
+ importers=controller.java_facade.getProfileImportersForLanguage(language.getKey())
%>
-<div class="line-block">
- <% if administrator? %>
- <ul style="float: right" class="horizontal">
- <li class="marginleft10 add">
- <a href="#" onClick="$('create-form-<%= language.getKey() -%>').show();$('create-form-<%= language.getKey() -%>-name').focus();return false;" id="create-link-<%= language.getKey() -%>"><%= message('create') -%></a>
- </li>
- </ul>
- <% end %>
- <h2><%= message('quality_profiles.x_language_profiles', :params => language.getName()) -%></h2>
-</div>
+ <div class="line-block">
+ <% if administrator? %>
+ <ul style="float: right" class="horizontal">
+ <li class="marginleft10 add">
+ <a href="#" onClick="$('create-form-<%= language.getKey() -%>').show();$('create-form-<%= language.getKey() -%>-name').focus();return false;" id="create-link-<%= language.getKey() -%>"><%= message('create') -%></a>
+ </li>
+ </ul>
+ <% end %>
+ <h2><%= message('quality_profiles.x_language_profiles', :params => language.getName()) -%></h2>
+ </div>
-<% if administrator? %>
- <form class="admin" id="create-form-<%= language.getKey()-%>" action="<%= url_for :action => 'create' -%>" style="display: none" enctype="multipart/form-data" method="post">
- <input type="hidden" name="language" value="<%= language.getKey() -%>"/>
- <table class="spaced width100">
- <tr>
- <td width="1%" nowrap><%= message('name') -%>: </td>
- <td><input type="text" name="name" id="create-form-<%= language.getKey()-%>-name"/></td>
- </tr>
- <% importers.to_a.sort{|x,y| x.getName() <=> y.getName()}.each do |importer| %>
- <tr>
- <td width="1%" nowrap><%= importer.getName() -%>: </td>
- <td>
- <%= file_field_tag "backup[#{importer.getKey()}]" %>
- <span class="note"><%= message('quality_profiles.optional_configuration_file') -%></span>
- </td>
- </tr>
- <% end %>
+ <% if administrator? %>
+ <form class="admin" id="create-form-<%= language.getKey() -%>" action="<%= url_for :action => 'create' -%>" style="display: none" enctype="multipart/form-data" method="post">
+ <input type="hidden" name="language" value="<%= language.getKey() -%>"/>
+ <table class="spaced width100">
+ <tr>
+ <td width="1%" nowrap><%= message('name') -%>:</td>
+ <td><input type="text" name="name" id="create-form-<%= language.getKey() -%>-name"/></td>
+ </tr>
+ <% importers.to_a.sort { |x, y| x.getName() <=> y.getName() }.each do |importer| %>
+ <tr>
+ <td width="1%" nowrap><%= importer.getName() -%>:</td>
+ <td>
+ <%= file_field_tag "backup[#{importer.getKey()}]" %>
+ <span class="note"><%= message('quality_profiles.optional_configuration_file') -%></span>
+ </td>
+ </tr>
+ <% end %>
- <tr>
- <td colspan="2">
- <input type="submit" value="<%= message('quality_profiles.create_x_language_profile', :params => language.getName()) -%>" id="create-submit-<%= language.getKey() -%>"/>
- <a href="#" onclick="$('create-form-<%= language.getKey()-%>').reset();$('create-form-<%= language.getKey()-%>').hide();return false;"><%= message('cancel') -%></a>
- </td>
- </tr>
- </table>
- </form>
-<% end %>
+ <tr>
+ <td colspan="2">
+ <input type="submit" value="<%= message('quality_profiles.create_x_language_profile', :params => language.getName()) -%>" id="create-submit-<%= language.getKey() -%>"/>
+ <a href="#" onclick="$('create-form-<%= language.getKey()-%>').reset();$('create-form-<%= language.getKey()-%>').hide();return false;"><%= message('cancel') -%></a>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <% end %>
-<table class="data width100" id="profiles_<%= language.getKey() -%>">
+ <table class="data width100" id="profiles_<%= language.getKey() -%>">
<thead>
- <tr>
- <th class="left"><%= message('name') -%></th>
- <th class="right"><%= message('rules') -%></th>
- <th class="right"><%= message('alerts') -%></th>
- <th class="right"><%= message('projects') -%></th>
- <th class="right"><%= message('default') -%></th>
- <% if administrator? %>
+ <tr>
+ <th class="left"><%= message('name') -%></th>
+ <th class="right"><%= message('rules') -%></th>
+ <th class="right"><%= message('alerts') -%></th>
+ <th class="right"><%= message('projects') -%></th>
+ <th class="right"><%= message('default') -%></th>
+ <% if administrator? %>
<th width="1%" class="right" colspan="4"><%= message('operations') -%></th>
- <% end %>
- </tr>
+ <% end %>
+ </tr>
</thead>
<tbody>
- <% @profiles.select{|p| p.language==language.getKey()}.each do |profile| %>
- <tr class="<%= cycle 'even', 'odd', :name => language.getKey() -%>" id="<%= u profile.key %>">
- <td><a href="<%= url_for :controller => 'rules_configuration', :action => 'index', :id => profile.id -%>" id="rules-<%= language.getKey() -%>-<%= u(profile.name) -%>"><%= h profile.name %></a></td>
-
- <td align="right">
- <span id="activated_rules_<%= u profile.key -%>"><%= profile.count_active_rules -%></span>
- </td>
-
- <td align="right"><span id="alerts_<%= u profile.key -%>"><%= profile.alerts.size -%></span></td>
-
- <td align="right">
- <% unless profile.default_profile? %>
- <span id="projects_<%= u profile.key -%>"><%= profile.projects.size -%></span>
- <% end %>
- </td>
-
- <td align="right">
- <% if (!profile.default_profile? && administrator?) %>
- <%= button_to message('set_as_default'), { :action => 'set_as_default', :id => profile.id }, :class => 'action',
- :id => "activate_#{u profile.key}",
- :confirm => message('quality_profiles.are_you_sure_want_x_profile_as_default', :params => profile.name),
- :method => :post %>
- <% end %>
- <% if profile.default_profile? %>
- <%= image_tag 'tick.png', :id => "is_active_#{u profile.key}" %>
- <% end %>
- </td>
+ <% @profiles.select { |p| p.language==language.getKey() }.each do |profile| %>
+ <tr class="<%= cycle 'even', 'odd', :name => language.getKey() -%>" id="<%= u profile.key %>">
+ <td>
+ <a href="<%= url_for :controller => 'rules_configuration', :action => 'index', :id => profile.id -%>" id="rules-<%= language.getKey() -%>-<%= u(profile.name) -%>"><%= h profile.name %></a>
+ </td>
+ <td align="right">
+ <span id="activated_rules_<%= u profile.key -%>"><%= profile.count_active_rules -%></span>
+ </td>
- <% if administrator? %>
+ <td align="right"><span id="alerts_<%= u profile.key -%>"><%= profile.alerts.size -%></span></td>
- <td align="right">
- <% if !profile.provided? %>
- <% form_tag(:action => 'backup', :id => profile.id) do -%>
- <input type="submit" name="button_backup" id="backup_<%= u profile.key %>" value="<%= message('backup_verb') -%>"/>
- <% end
- end %>
+ <td align="right">
+ <% unless profile.default_profile? %>
+ <span id="projects_<%= u profile.key -%>"><%= profile.projects.size -%></span>
+ <% end %>
</td>
<td align="right">
- <% if !profile.provided? %>
- <a id="rename-<%= profile.key.parameterize -%>" href="<%= ApplicationController.root_context -%>/profiles/rename_form?id=<%= profile.id -%>" class="button open-modal"><%= message('rename') -%></a>
+ <% if (!profile.default_profile? && administrator?) %>
+ <%= button_to message('set_as_default'), {:action => 'set_as_default', :id => profile.id}, :class => 'action',
+ :id => "activate_#{u profile.key}",
+ :confirm => message('quality_profiles.are_you_sure_want_x_profile_as_default', :params => profile.name),
+ :method => :post %>
+ <% end %>
+ <% if profile.default_profile? %>
+ <%= image_tag 'tick.png', :id => "is_active_#{u profile.key}" %>
<% end %>
</td>
- <td align="right">
- <% form_tag(:action => 'copy', :id => profile.id) do -%>
+
+ <% if administrator? %>
+
+ <td align="right">
+ <% if !profile.provided? %>
+ <% form_tag(:action => 'backup', :id => profile.id) do -%>
+ <input type="submit" name="button_backup" id="backup_<%= u profile.key %>" value="<%= message('backup_verb') -%>"/>
+ <% end
+ end %>
+ </td>
+
+ <td align="right">
+ <% if !profile.provided? %>
+ <a id="rename-<%= profile.key.parameterize -%>" href="profiles/rename_form?id=<%= profile.id -%>" class="button open-modal"><%= message('rename') -%></a>
+ <% end %>
+ </td>
+
+ <td align="right">
+ <% form_tag(:action => 'copy', :id => profile.id) do -%>
<%= hidden_field_tag 'copy_' + profile.id.to_s %>
<input type="button" name="button_copy" id="copy_<%= u profile.key %>" value="<%= message('copy') -%>" onClick='var name=prompt("<%= message('quality_profiles.name_for_new_profile') -%>"); if (name!=null) {$("copy_<%= profile.id %>").value=name; submit();} else {return false;}'>
<% end %>
- </td>
+ </td>
- <td>
+ <td>
<% if profile.deletable? %>
- <%= button_to message('delete'), { :action => 'delete', :id => profile.id }, :class => 'action red-button',
- :id => "delete_#{u profile.key}",
- :confirm => message('quality_profiles.are_you_sure_want_delete_profile_x', :params => profile.name),
- :method => :post %>
- <% end %>
- </td>
- <% end %>
- </tr>
+ <%= button_to_action message('delete'), "profiles/delete/#{profile.id}",
+ :class => 'red-button',
+ :id => "delete_#{profile.key.parameterize}",
+ :message_key => 'quality_profiles.are_you_sure_want_delete_profile_x',
+ :message_params => [profile.name]
+ -%>
+ <% end %>
+ </td>
+ <% end %>
+ </tr>
<% end %>
</tbody>
-</table>
-<br/><br/>
-<% end %>
-
-<% content_for :script do %>
-<script>
- $j(document).ready(function () {
- $j('.open-modal').modal();
- });
-</script>
-<% end %>
+ </table>
+ <br/><br/>
+<% end %>
\ No newline at end of file