metric_admin 0.0.7 → 0.0.8

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: 4982211e79dec58fd53319bead5c4b3a57ff8de1
4
- data.tar.gz: 9eb11534752d346fbe36dbb7ddaa4dbd120f74b8
3
+ metadata.gz: c64f678a4f0726af48712b238739e9e94db0f6b0
4
+ data.tar.gz: 9ec79601a6d4ab724ad8ac407bf3be20df6dac42
5
5
  SHA512:
6
- metadata.gz: f40e1b7caa515c6d43d08a78b2edf94f27837fcfe897f955af0f005d1e7f4ee9b22e145d3a225554009a867c26d878b0e8a6105d1b810a82e89284a3f271613c
7
- data.tar.gz: 66dc5601000c00ff3b87f5be84c7667d06330d6c3817dc4ecd883f6adc2c064d4ed8896c428fd859620e7b094ed60ea97b3f47bc23d5e1e54da251d92eb07340
6
+ metadata.gz: 477064597e3eb91b095f61434032bc06b2a0ca734e3320b331db5a3413843aaa25e30b6a59d677347f11e7037f382d0034bcec9cdf6f01a2fc6cc6e22d7fd241
7
+ data.tar.gz: 048ecbe00d5b95c594d5512515348162b6f320fc919948c190390f8efe409ecd8b8b1a6f98c8d3d2b41715eeee93bc329071d0752c745529c26871bb5a946e53
@@ -48,6 +48,14 @@ module MetricAdmin
48
48
  end
49
49
  end
50
50
 
51
+ def sort
52
+ params[:metric].each_with_index do |metric_id, i|
53
+ @metric = Metric.find(metric_id)
54
+ @metric.update_attribute(:public_sort, i)
55
+ end
56
+ render :text => "sorted"
57
+ end
58
+
51
59
  def clone
52
60
  @metric_to_clone = Metric.find(params[:id])
53
61
  @metric = @metric_to_clone.clone
@@ -18,7 +18,7 @@
18
18
  .metric-content
19
19
  .row-fluid
20
20
  .span12
21
- %h3{:style=>"margin:0;"}= "Editing: #{params[:category]} - #{@metric.title}"
21
+ %h3{:style=>"margin:0;"}= "Editing: #{@metric.resource_type.name} - #{@metric.title}"
22
22
  %hr
23
23
  - form_for :metric, @metric, :url => admin_metric_path(@metric.id), :html => { :method => :put } do |f|
24
24
  = f.error_messages
@@ -82,7 +82,7 @@
82
82
  %br
83
83
  .controls
84
84
  %label.control-label{:for => "logic_staff"} Staff: (for purposes of metric evaluation)
85
- = grouped_collection_select :metric, :resource_type_id, @metric_categories, :resources, :name, :name, :code
85
+ = collection_select :metric, :resource_type_id, @metric.resource, :code, :name
86
86
  %br
87
87
  %button.btn.run_logic{"aria-hidden" => "true", "data-dismiss" => "modal"}
88
88
  Run
@@ -141,7 +141,7 @@
141
141
  url: "/admin/metrics/"+metric_id+"/evaluate.js",
142
142
  beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))},
143
143
  contentType: "application/json; charset=utf-8",
144
- data: JSON.stringify({logic: editor_contents , logic_staff: $("#logic_staff").val() }),
144
+ data: JSON.stringify({logic: editor_contents , logic_staff: $("#metric_resource_type_id").val() }),
145
145
  success: function(data){
146
146
  $('.loaderImage').hide();
147
147
  },
@@ -27,26 +27,27 @@
27
27
  = category.present? ? category : 'No Category'
28
28
 
29
29
  - _metrics.each do |metric|
30
- %div.item.list-group-item{:class => cycle('odd', 'even'), :id => "metric-#{metric.id}"}
31
- = link_to metric.title, edit_admin_metric_path(metric.id,:category => c.name)
30
+ %div.item.list-group-item-wrapper{:class => cycle('odd', 'even'), :id => "metric-#{metric.id}"}
31
+ %div.list-group-item
32
+ = link_to metric.title, edit_admin_metric_path(metric.id)
32
33
 
33
- - if Result.count(:conditions=>["calculated_at = ? and metric_id = ?", Date.today.to_s, metric.id ]) == 0 && metric.status == 'active'
34
- %p.label.warning Has not run today.
35
- - if metric.status != 'active'
36
- %p.label{:style=>"margin-left:5px;"} Not Active
34
+ - if Result.count(:conditions=>["calculated_at = ? and metric_id = ?", Date.today.to_s, metric.id ]) == 0 && metric.status == 'active'
35
+ %p.label.warning Has not run today.
36
+ - if metric.status != 'active'
37
+ %p.label{:style=>"margin-left:5px;"} Not Active
37
38
 
38
- .pull-right
39
- .btn-toolbar.actions{:style => "margin: 0;"}
40
- .btn-group
41
- %button.btn Action
42
- %button.btn.dropdown-toggle{"data-toggle" => "dropdown"}
43
- %span.caret
44
- %ul.dropdown-menu
45
- %li
46
- = link_to "Edit".html_safe, edit_admin_metric_path(metric.id)
47
- %li
48
- = link_to "Calculate", "/admin/metrics/#{metric.id}/calculate"
49
- %li
50
- = link_to "Clone", "/admin/metrics/#{metric.id}/clone"
51
- %li
52
- = link_to "Delete", admin_metric_path(metric.id), :confirm => "Are you sure?", :method => :delete
39
+ .pull-right
40
+ .btn-toolbar.actions
41
+ .btn-group
42
+ %button.btn Action
43
+ %button.btn.dropdown-toggle{"data-toggle" => "dropdown"}
44
+ %span.caret
45
+ %ul.dropdown-menu
46
+ %li
47
+ = link_to "Edit".html_safe, edit_admin_metric_path(metric.id)
48
+ %li
49
+ = link_to "Calculate", "/admin/metrics/#{metric.id}/calculate"
50
+ %li
51
+ = link_to "Clone", "/admin/metrics/#{metric.id}/clone"
52
+ %li
53
+ = link_to "Delete", admin_metric_path(metric.id), :confirm => "Are you sure?", :method => :delete
@@ -1,3 +1,3 @@
1
1
  module MetricAdmin
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metric_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Analytics For Lawyers