metric_admin 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c64f678a4f0726af48712b238739e9e94db0f6b0
|
4
|
+
data.tar.gz: 9ec79601a6d4ab724ad8ac407bf3be20df6dac42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: #{
|
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
|
-
=
|
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: $("#
|
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
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
data/lib/metric_admin/version.rb
CHANGED