Replaced check_box_tags with radio_button
authorShrey <shrey14099@iiitd.ac.in>
Mon, 15 Jun 2015 17:09:02 +0000 (22:39 +0530)
committerMatt Amos <zerebubuth@gmail.com>
Mon, 22 Aug 2016 15:17:54 +0000 (16:17 +0100)
app/controllers/issues_controller.rb
app/views/issues/_reports.html.erb
app/views/issues/new.html.erb

index 576b3309fc29945e256ec1fc1a6871bd1cd5f3fd..dc357a6aea3bc6d3572f707942111388d06e19a6 100644 (file)
@@ -203,25 +203,13 @@ class IssuesController < ApplicationController
  
     def get_report_details
       details = params[:report][:details] + "--||--"
-      path = 'issues.report_strings.' + @issue.reportable.class.name.to_s
-      @report_strings_yaml = t( path)
-      @report_strings_yaml.each do |k,v|
-        if params[k.to_sym]
-          details = details + params[k.to_sym] + "--||--"
-        end
-      end
+      details = details + params[:report_type].to_s + "--||--"
       return details
     end
 
     def check_report_params
-      path = 'issues.report_strings.' + @issue.reportable.class.name.to_s
-      @report_strings_yaml = t( path)
-      if params[:report] and params[:report][:details]
-        @report_strings_yaml.each do |k,v|
-          if params[k.to_sym]
-            return true
-          end
-        end
+      if params[:report] and params[:report][:details] and params[:report_type]
+        return true
       end
       return false
     end
index 94ae3ca0e5d15fabcac5f0ba41e34e8dc36c5010..2aff5dbc9a91d348bf7b646ee1df0be6e7914d6e 100644 (file)
@@ -5,13 +5,11 @@
                </div>
                <b><%= link_to report.user.display_name, :controller => :user,:action =>:view, :display_name => report.user.display_name %></b> <br/>
                <% details =  report.details.split("--||--") %>
-               <%= details[0] %> 
+               <label>Tag:</label> 
+               <%= details[1] %>
                <br/>
+               <%= details[0] %> 
                <br/>
-               <label>Tags:</label> 
-               <% details[1..(details.size-1)].each do |tags| %>
-                       <%= tags %>
-               <% end %>
                <br/>
                <span class="deemphasize">
                On <%= l report.created_at.to_datetime, :format => :long %> </span>
index 8a0055e5132834d0a44d01652d1e74ce0e889ea0..e42ec19a627e101eb01dfca5d69f136d2ff04f39 100644 (file)
@@ -17,7 +17,7 @@
                 <% @report_strings_yaml.each do |k,v| %>
                     <div class="new-report-form">
                         <div class="new-report-checkbox">
-                        <%= check_box_tag k.to_sym, v[:type].to_s %>
+                        <%= radio_button_tag :report_type, v[:type].to_s %>
                         </div>
                         <div class="new-report-string">
                             <%= label_tag v[:details].to_s %> <br/>
@@ -26,7 +26,7 @@
                     <br/>
                 <% end %> 
                 
-                <label class="standard-label"><b><%= t 'issue.new.message' -%>: </b></label> <br/>
+                <label class="standard-label"><b><%= t 'issue.new.message' %>: </b></label> <br/>
                 <%= text_area :report, :details, :cols => 80, :rows => 20, placeholder: t('issues.new.details'), required: true %>
             </div>