]> source.dussan.org Git - sonarqube.git/commitdiff
Ability to share copied filter
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 18 Dec 2012 22:31:19 +0000 (23:31 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 18 Dec 2012 22:31:19 +0000 (23:31 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb

index 79417be5417c6cce643b0226b8372f062640e501..3b5da35de388eaac1baaf134a8b2e4c364b7bd0b 100644 (file)
@@ -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
index 89d14fa379c219bf6136a9cf2f77a32ce5968fc7..019edbafc84e538c126c291e9c2b76ccb87dcf02 100644 (file)
         <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"/>
index 14af4202db54f0129911fee0013e6e1107d9fe99..d9046be651b4439f93c648f955fd205df859ad56 100644 (file)
@@ -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>
index 4e116fb07639b899087e390a94eab1173e616776..6b3b340579ce606cedf291efae1f8d6c135c3083 100644 (file)
@@ -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 %>