my_profile.page=My Profile
project_roles.page=Project Roles
project_settings.page=Settings
+project_links.page=Links
+project_exclusions.page=Exclusions
quality_profiles.page=Quality Profiles
reviews.page=Reviews
settings.page=General Settings
redirect_to_default
end
+ def links
+ @project=Project.by_key(params[:id])
+ return access_denied unless is_admin?(@project)
+
+ @snapshot=@project.last_snapshot
+ if !@project.project?
+ redirect_to :action => 'index', :id => params[:id]
+ end
+ end
+
def set_links
project = Project.by_key(params[:project_id])
return access_denied unless is_admin?(project)
project.save!
flash[:notice] = 'Links updated.'
- redirect_to :action => 'settings', :id => project.id
+ redirect_to :action => 'links', :id => project.id
end
+
def settings
@project=Project.by_key(params[:id])
return access_denied unless is_admin?(@project)
end
+ def exclusions
+ @project=Project.by_key(params[:id])
+ return access_denied unless is_admin?(@project)
+
+ @snapshot=@project.last_snapshot
+ if !@project.project? && !@project.module?
+ redirect_to :action => 'index', :id => params[:id]
+ end
+ end
+
def set_exclusions
@project = Project.find(params[:id])
return access_denied unless is_admin?(@project)
Property.set('sonar.exclusions', patterns.collect{|x| x.strip}.join(','), @project.id)
end
flash[:notice]='Filters added'
- redirect_to :action => 'settings', :id => @project.id
+ redirect_to :action => 'exclusions', :id => @project.id
end
def delete_exclusions
Property.clear('sonar.exclusions', @project.id)
flash[:notice]='Filters deleted'
- redirect_to :action => 'settings', :id => @project.id
+ redirect_to :action => 'exclusions', :id => @project.id
end
protected
<% if (@project.project? || @project.module?) %>
<li class="<%= 'selected' if request.request_uri.include?('/project/settings') -%>"><a href="<%= ApplicationController.root_context -%>/project/settings/<%= @project.id -%>"><%= message('project_settings.page') -%></a></li>
<% end %>
+ <% if (@project.project? || @project.module?) %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project/exclusions') -%>"><a href="<%= ApplicationController.root_context -%>/project/exclusions/<%= @project.id -%>"><%= message('project_exclusions.page') -%></a></li>
+ <% end %>
+ <% if (@project.project?) %>
+ <li class="<%= 'selected' if request.request_uri.include?('/project/links') -%>"><a href="<%= ApplicationController.root_context -%>/project/links/<%= @project.id -%>"><%= message('project_links.page') -%></a></li>
+ <% end %>
<% if (@project.project? || @project.view? || @project.subview?) %>
<li class="<%= 'selected' if request.request_uri.include?('/project_roles') -%>"><a href="<%= ApplicationController.root_context -%>/project_roles/index?resource=<%= @project.id -%>"><%= message('project_roles.page') -%></a></li>
<% end %>
--- /dev/null
+<h1>Exclude sources from code analysis</h1>
+<br/>
+<div class="yui-g widget" id="widget_exclusions">
+
+
+ <div class="yui-u first">
+ <p>Changes will be applied during next code analysis.</p>
+ <% form_for( 'set_exclusions', :url => { :action => 'set_exclusions', :id => @project.id } ) do |form|
+ pattern_index=0
+ %>
+ <table class="spaced">
+ <% patterns = Property.value('sonar.exclusions', @project.id, '').split(',')
+ patterns.each do |pattern|
+ %>
+ <tr>
+ <td class=left>
+ <input id="exclusion_pattern_<%= pattern_index -%>" name="patterns[]" size="50" value="<%= pattern -%>" type="text">
+ </td>
+ </tr>
+ <% pattern_index += 1
+ end
+ %>
+ <tr><td class=left>
+ <input name="patterns[]" size="50" value="" type="text" id="exclusion_pattern_<%= pattern_index-%>">
+ </td></tr>
+ <tr><td class=left>
+ <input name="patterns[]" size="50" value="" type="text" id="exclusion_pattern_<%= pattern_index + 1-%>"><br/>
+ <span class="note"><ul><li>com/mycompany/**/*.java</li><li>**/*Dummy.java</li></ul></span>
+ </td></tr>
+ <tr><td class=left>
+ <%= submit_tag( "Save filters", :id => 'submit_exclusions') %>
+ <%= link_to 'Delete all filters', {:action => 'delete_exclusions', :id => @project.id}, :method => 'POST', :confirm => "Are you sure you want to delete all exclusion filters ?", :id => 'delete_exclusions' %>
+ </td></tr>
+ </table>
+ <% end %>
+ </div>
+
+ <div class="yui-u">
+ <div class="help">
+ <h2>Wildcards</h2>
+ <table class="data">
+ <thead><tr><th colspan="2"></th></tr></thead>
+ <tr class="odd">
+ <td>*</td>
+ <td>Match zero or more characters</td>
+ </tr>
+ <tr class="even">
+ <td>**</td>
+ <td>Match zero or more directories</td>
+ </tr>
+ <tr class="odd">
+ <td>?</td>
+ <td>Match a single character</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
\ No newline at end of file
--- /dev/null
+<h1>Project links</h1>
+<br/>
+<div class="yui-g widget" id="widget_links">
+
+<% form_for( 'set_links', :url => { :action => 'set_links', :project_id => @project.id } ) do |form|
+ links_by_key={}
+ @project.links.each do |link|
+ links_by_key[link.link_type]=link
+ end
+%>
+ <div class="yui-u first">
+ <table class="data">
+ <thead><tr><th>Title</th><th>URL</th></tr></thead>
+
+ <tr class="even">
+ <td align="left" nowrap width="1%">
+ <%= image_tag("links/homepage.png") -%> Home</td>
+ <td>
+ <input type="hidden" name="key_homepage" value="homepage" />
+ <input type="hidden" name="name_homepage" value="Home" />
+ <%= text_field_tag( "url_homepage", links_by_key['homepage'] ? links_by_key['homepage'].href : '', :readonly => true, :size => 30 ) -%>
+ </td>
+ </tr>
+ <tr class="odd">
+ <td align="left" nowrap width="1%">
+ <%= image_tag("links/ci.png") -%> Continuous integration</td>
+ <td>
+ <input type="hidden" name="key_ci" value="ci" />
+ <input type="hidden" name="name_ci" value="Continuous integration" />
+ <%= text_field_tag( "url_ci", links_by_key['ci'] ? links_by_key['ci'].href : '', :readonly => true, :size => 30 ) -%>
+ </td>
+ </tr>
+ <tr class="even">
+ <td align="left" nowrap width="1%">
+ <%= image_tag("links/issue.png") -%> Issue tracker</td>
+ <td>
+ <input type="hidden" name="key_issue" value="issue" />
+ <input type="hidden" name="name_issue" value="Issues" />
+ <%= text_field_tag( "url_issue", links_by_key['issue'] ? links_by_key['issue'].href : '', :readonly => true, :size => 30 ) -%>
+ </td>
+ </tr>
+ <tr class="odd">
+ <td align="left" nowrap width="1%">
+ <%= image_tag("links/scm.png") -%> Sources</td>
+ <td>
+ <input type="hidden" name="key_scm" value="scm" />
+ <input type="hidden" name="name_scm" value="Sources" />
+ <%= text_field_tag( "url_scm", links_by_key['scm'] ? links_by_key['scm'].href : '', :readonly => true, :size => 30 ) -%>
+ </td>
+ </tr>
+ <tr class="even">
+ <td align="left" nowrap width="1%">
+ <%= image_tag("links/scm_dev.png") -%> Developer connection</td>
+ <td>
+ <input type="hidden" name="key_scm_dev" value="scm_dev" />
+ <input type="hidden" name="name_scm_dev" value="Developer connection" />
+ <%= text_field_tag( "url_scm_dev", links_by_key['scm_dev'] ? links_by_key['scm_dev'].href : '', :readonly => true, :size => 30 ) -%>
+ </td>
+ </tr>
+<tr><td colspan="2" class="even"><%= submit_tag( "Save links" ) %></td></tr>
+ </table>
+ </div>
+ <div class="yui-u">
+ <table class="data">
+ <thead><tr><th>Title</th><th>URL</th></tr></thead>
+ <% index = 0
+ @project.custom_links.each do |custom_link|
+ index += 1 %>
+ <tr class="<%= cycle('even','odd') -%>">
+ <td align="left">
+ <%= image_tag("links/external.png") -%> <%= text_field_tag( "name_#{index}", h(custom_link.name), :size => 15 ) -%>
+ </td>
+ <td>
+ <%= text_field_tag( "url_#{index}", custom_link.href, :size => 30 ) -%>
+ </td>
+ </tr>
+ <% end %>
+ <% index += 1
+ for var in index..5 %>
+ <tr class="<%= cycle('even','odd') -%>">
+ <td align="left"><%= image_tag("links/external.png") -%> <%= text_field_tag( "name_#{var}", '', :size => 15) %></td>
+ <td><%= text_field_tag( "url_#{var}", '', :size => 30 ) %></td>
+ </tr>
+ <% end %>
+ </table>
+ </div>
+<% end %>
+</div>
\ No newline at end of file
<div name="settings">
<%= render :partial => 'project/settings/plugins' %>
-<br/>
-<%= render :partial => 'project/settings/exclusions' %>
<% if @project.project? %>
<br/>
-<%= render :partial => 'project/settings/links' %>
-<br/>
<%= render :partial => 'project/settings/delete_project' %>
<% end %>
+++ /dev/null
-<h1>Exclude sources from code analysis</h1>
-<div class="yui-g widget" id="widget_exclusions">
-
-
- <div class="yui-u first">
- <p>Changes will be applied during next code analysis.</p>
- <% form_for( 'set_exclusions', :url => { :action => 'set_exclusions', :id => @project.id } ) do |form|
- pattern_index=0
- %>
- <table class="spaced">
- <% patterns = Property.value('sonar.exclusions', @project.id, '').split(',')
- patterns.each do |pattern|
- %>
- <tr>
- <td class=left>
- <input id="exclusion_pattern_<%= pattern_index -%>" name="patterns[]" size="50" value="<%= pattern -%>" type="text">
- </td>
- </tr>
- <% pattern_index += 1
- end
- %>
- <tr><td class=left>
- <input name="patterns[]" size="50" value="" type="text" id="exclusion_pattern_<%= pattern_index-%>">
- </td></tr>
- <tr><td class=left>
- <input name="patterns[]" size="50" value="" type="text" id="exclusion_pattern_<%= pattern_index + 1-%>"><br/>
- <span class="note"><ul><li>com/mycompany/**/*.java</li><li>**/*Dummy.java</li></ul></span>
- </td></tr>
- <tr><td class=left>
- <%= submit_tag( "Save filters", :id => 'submit_exclusions') %>
- <%= link_to 'Delete all filters', {:action => 'delete_exclusions', :id => @project.id}, :method => 'POST', :confirm => "Are you sure you want to delete all exclusion filters ?", :id => 'delete_exclusions' %>
- </td></tr>
- </table>
- <% end %>
- </div>
-
- <div class="yui-u">
- <div class="help">
- <h2>Wildcards</h2>
- <table class="data">
- <thead><tr><th colspan="2"></th></tr></thead>
- <tr class="odd">
- <td>*</td>
- <td>Match zero or more characters</td>
- </tr>
- <tr class="even">
- <td>**</td>
- <td>Match zero or more directories</td>
- </tr>
- <tr class="odd">
- <td>?</td>
- <td>Match a single character</td>
- </tr>
- </table>
- </div>
- </div>
-</div>
\ No newline at end of file
+++ /dev/null
-<h1>Project links</h1>
-<div class="yui-g widget" id="widget_links">
-
-<% form_for( 'set_links', :url => { :action => 'set_links', :project_id => @project.id } ) do |form|
- links_by_key={}
- @project.links.each do |link|
- links_by_key[link.link_type]=link
- end
-%>
- <div class="yui-u first">
- <table class="data">
- <thead><tr><th>Title</th><th>URL</th></tr></thead>
-
- <tr class="even">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/homepage.png") -%> Home</td>
- <td>
- <input type="hidden" name="key_homepage" value="homepage" />
- <input type="hidden" name="name_homepage" value="Home" />
- <%= text_field_tag( "url_homepage", links_by_key['homepage'] ? links_by_key['homepage'].href : '', :readonly => true, :size => 30 ) -%>
- </td>
- </tr>
- <tr class="odd">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/ci.png") -%> Continuous integration</td>
- <td>
- <input type="hidden" name="key_ci" value="ci" />
- <input type="hidden" name="name_ci" value="Continuous integration" />
- <%= text_field_tag( "url_ci", links_by_key['ci'] ? links_by_key['ci'].href : '', :readonly => true, :size => 30 ) -%>
- </td>
- </tr>
- <tr class="even">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/issue.png") -%> Issue tracker</td>
- <td>
- <input type="hidden" name="key_issue" value="issue" />
- <input type="hidden" name="name_issue" value="Issues" />
- <%= text_field_tag( "url_issue", links_by_key['issue'] ? links_by_key['issue'].href : '', :readonly => true, :size => 30 ) -%>
- </td>
- </tr>
- <tr class="odd">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/scm.png") -%> Sources</td>
- <td>
- <input type="hidden" name="key_scm" value="scm" />
- <input type="hidden" name="name_scm" value="Sources" />
- <%= text_field_tag( "url_scm", links_by_key['scm'] ? links_by_key['scm'].href : '', :readonly => true, :size => 30 ) -%>
- </td>
- </tr>
- <tr class="even">
- <td align="left" nowrap width="1%">
- <%= image_tag("links/scm_dev.png") -%> Developer connection</td>
- <td>
- <input type="hidden" name="key_scm_dev" value="scm_dev" />
- <input type="hidden" name="name_scm_dev" value="Developer connection" />
- <%= text_field_tag( "url_scm_dev", links_by_key['scm_dev'] ? links_by_key['scm_dev'].href : '', :readonly => true, :size => 30 ) -%>
- </td>
- </tr>
-<tr><td colspan="2" class="even"><%= submit_tag( "Save links" ) %></td></tr>
- </table>
- </div>
- <div class="yui-u">
- <table class="data">
- <thead><tr><th>Title</th><th>URL</th></tr></thead>
- <% index = 0
- @project.custom_links.each do |custom_link|
- index += 1 %>
- <tr class="<%= cycle('even','odd') -%>">
- <td align="left">
- <%= image_tag("links/external.png") -%> <%= text_field_tag( "name_#{index}", h(custom_link.name), :size => 15 ) -%>
- </td>
- <td>
- <%= text_field_tag( "url_#{index}", custom_link.href, :size => 30 ) -%>
- </td>
- </tr>
- <% end %>
- <% index += 1
- for var in index..5 %>
- <tr class="<%= cycle('even','odd') -%>">
- <td align="left"><%= image_tag("links/external.png") -%> <%= text_field_tag( "name_#{var}", '', :size => 15) %></td>
- <td><%= text_field_tag( "url_#{var}", '', :size => 30 ) %></td>
- </tr>
- <% end %>
- </table>
- </div>
-<% end %>
-</div>
\ No newline at end of file