aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-12-18 23:31:19 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-12-18 23:31:19 +0100
commit8e4f1f764c4da0bf2a48aa76a54c8b3c8b6bf260 (patch)
tree2bd48c69dae0ee0f76afb7f4e0750223fb8134df
parent50615d55dc5470adb12d788c481cd1039ec534d8 (diff)
downloadsonarqube-8e4f1f764c4da0bf2a48aa76a54c8b3c8b6bf260.tar.gz
sonarqube-8e4f1f764c4da0bf2a48aa76a54c8b3c8b6bf260.zip
Ability to share copied filter
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb11
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb2
4 files changed, 15 insertions, 12 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
index 79417be5417..3b5da35de38 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
@@ -161,12 +161,11 @@ class MeasuresController < ApplicationController
source = find_filter(params[:id])
target = MeasureFilter.new
- target.name = params[:name]
- target.description = params[:description]
- target.user_id = current_user.id
- target.shared = source.shared
- target.data = source.data
- target.shared = false
+ target.name=params[:name]
+ target.description=params[:description]
+ target.user_id=current_user.id
+ target.shared=(params[:shared]=='true')
+ target.data=source.data
if target.save
current_user.favourited_measure_filters << target
render :text => target.id.to_s, :status => 200
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb
index 89d14fa379c..019edbafc84 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb
@@ -13,13 +13,17 @@
<input type="text" size="50" maxlength="100" value="<%= h @filter.name -%>" disabled="disabled"/>
</div>
<div class="form-field">
- <label for="name">Name <em class="mandatory">*</em></label>
+ <label for="name"><%= h message('name') -%> <em class="mandatory">*</em></label>
<input id="name" name="name" type="text" size="50" maxlength="100" value=""/>
</div>
<div class="form-field">
- <label for="description">Description</label>
+ <label for="description"><%= h message('description') -%></label>
<input id="description" name="description" type="text" size="50" maxlength="4000" value="<%= h @filter.description -%>"/>
</div>
+ <div class="form-field">
+ <label for="shared"><%= h message('measure_filter.shared_with_all_users') -%></label>
+ <input id="shared" name="shared" type="checkbox" value="true" <%= 'checked' if @filter.shared -%>/>
+ </div>
</div>
<div class="form-foot">
<input type="submit" value="<%= h message('copy') -%>" id="copy-submit"/>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb
index 14af4202db5..d9046be651b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb
@@ -9,15 +9,15 @@
<p class="error"><%= h msg -%></p>
<% end %>
<div class="form-field">
- <label for="name">Name <em class="mandatory">*</em></label>
+ <label for="name"><%= h message('name') -%> <em class="mandatory">*</em></label>
<input id="name" name="name" type="text" size="50" maxlength="100" value="<%= h @filter.name -%>"/>
</div>
<div class="form-field">
- <label for="description">Description</label>
+ <label for="description"><%= h message('description') -%></label>
<input id="description" name="description" type="text" size="50" maxlength="4000" value="<%= h @filter.description -%>"/>
</div>
<div class="form-field">
- <label for="shared">Shared with all users</label>
+ <label for="shared"><%= h message('measure_filter.shared_with_all_users') -%></label>
<input id="shared" name="shared" type="checkbox" value="true" <%= 'checked' if @filter.shared -%>/>
</div>
</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb
index 4e116fb0763..6b3b340579c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb
@@ -39,7 +39,7 @@
<% end %>
<% unless @filter.id %>
<li>
- <a id="save_as" href="<%= url_for params.merge({:action => 'save_as_form', :id => @filter.id}) -%>" class="link-action open-modal"><%= message('save_as') -%></a>
+ <a id="save-as" href="<%= url_for params.merge({:action => 'save_as_form', :id => @filter.id}) -%>" class="link-action open-modal"><%= message('save_as') -%></a>
</li>
<% end %>
<% end %>