metric_admin 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f68c7616f3f2dc5bf976c9fc019416df385c48bc
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a98d6e9957fd27814b0f32ad0341feb492616d8f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2f505cf785858e10e58957eed271540d29832ede2cd6c5e4811582d9ba80e8534c1aa851d3378ae47d9122f3b5f59adc7d409f2d556465f2875f10a028731509
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ad53597fd5586ec5a762d68065b5f6236aa62a41e23af5464e88f05cfaa79015f82f67c20de242caab9b74258d289e2007f474ad537c0ba9f48233ad8e7171ea
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -133,7 +133,7 @@ Link the metric_admin.js and the metric_admin.css in the admin view in ```layout 
     | 
|
| 
       133 
133 
     | 
    
         | 
| 
       134 
134 
     | 
    
         
             
            Also ensure that you have linked in the admin layout the lastest jquery.ui.min.js file.
         
     | 
| 
       135 
135 
     | 
    
         | 
| 
       136 
     | 
    
         
            -
            Ensure that the metric table has a  
     | 
| 
      
 136 
     | 
    
         
            +
            Ensure that the metric table has a sort column.
         
     | 
| 
       137 
137 
     | 
    
         | 
| 
       138 
138 
     | 
    
         
             
            In the dashboard application modify ```app/models/metric.rb```
         
     | 
| 
       139 
139 
     | 
    
         | 
| 
         @@ -54,7 +54,7 @@ module MetricAdmin 
     | 
|
| 
       54 
54 
     | 
    
         
             
                def sort
         
     | 
| 
       55 
55 
     | 
    
         
             
                  params[:metric].each_with_index do |metric_id, i|
         
     | 
| 
       56 
56 
     | 
    
         
             
                    @metric = Metric.find(metric_id)
         
     | 
| 
       57 
     | 
    
         
            -
                    @metric.update_attribute(: 
     | 
| 
      
 57 
     | 
    
         
            +
                    @metric.update_attribute(:sort, i)
         
     | 
| 
       58 
58 
     | 
    
         
             
                  end
         
     | 
| 
       59 
59 
     | 
    
         
             
                  render :text => "sorted"
         
     | 
| 
       60 
60 
     | 
    
         
             
                end
         
     | 
| 
         @@ -63,7 +63,7 @@ module MetricAdmin 
     | 
|
| 
       63 
63 
     | 
    
         
             
                  @metric_to_clone = Metric.find(params[:id])
         
     | 
| 
       64 
64 
     | 
    
         
             
                  @metric = @metric_to_clone.clone
         
     | 
| 
       65 
65 
     | 
    
         
             
                  @metric.title = "Copy of #{@metric.title}"
         
     | 
| 
       66 
     | 
    
         
            -
                  @metric. 
     | 
| 
      
 66 
     | 
    
         
            +
                  @metric.sort = Metric.maximum(:sort, :conditions=>["resource_type_id = ?", @metric_to_clone.resource_type_id ]).to_i + 1
         
     | 
| 
       67 
67 
     | 
    
         
             
                  if @metric.save
         
     | 
| 
       68 
68 
     | 
    
         
             
                    flash[:notice] = "#{@metric.title} has been cloned"
         
     | 
| 
       69 
69 
     | 
    
         
             
                    redirect_to edit_admin_metric_url(@metric)
         
     | 
| 
         @@ -39,7 +39,7 @@ 
     | 
|
| 
       39 
39 
     | 
    
         
             
                            .control-group
         
     | 
| 
       40 
40 
     | 
    
         
             
                              %label.control-label{:for => "title"} Sort order
         
     | 
| 
       41 
41 
     | 
    
         
             
                              .controls
         
     | 
| 
       42 
     | 
    
         
            -
                                = f.text_field :sort, :value => @metric. 
     | 
| 
      
 42 
     | 
    
         
            +
                                = f.text_field :sort, :value => @metric.sort.nil? ? @metric.resource_type.metrics.count : @metric.sort, :disabled => true, :class=>"span3"
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         
             
                          .span6
         
     | 
| 
       45 
45 
     | 
    
         
             
                            .row
         
     | 
| 
         @@ -18,7 +18,7 @@ 
     | 
|
| 
       18 
18 
     | 
    
         
             
                          %h2.page-subtitle.pull-left= c.name
         
     | 
| 
       19 
19 
     | 
    
         
             
                          = link_to "<i class='icon-plus icon-white'></i> Create a new #{c.name} metric", new_admin_metric_url(:resource_type_id => c), :class=>"btn btn-primary pull-right"
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                        - metrics = Metric.all(:conditions=>["resource_type_id=?", c.id], :order => 'category ASC,  
     | 
| 
      
 21 
     | 
    
         
            +
                        - metrics = Metric.all(:conditions=>["resource_type_id=?", c.id], :order => 'category ASC, sort ASC')
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
                        - if metrics
         
     | 
| 
       24 
24 
     | 
    
         
             
                          - metrics.group_by{|x| x.category }.each do |category, _metrics|
         
     | 
    
        data/lib/metric_admin/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: metric_admin
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.24
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Analytics For Lawyers
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2017-05- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-05-11 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |