metric_admin 0.0.9 → 0.0.10

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.
data/README.md CHANGED
@@ -23,10 +23,9 @@ And then execute:
23
23
 
24
24
  ## Usage
25
25
 
26
- In your application.js file add the following snippet:
26
+ Create a metric_admin.js file then add the following snippet:
27
27
 
28
28
  $(function(){
29
- $('a[rel="popover"]').popover();
30
29
  $(".list-group").sortable({
31
30
  update: function(event, ui) {
32
31
  var data = $(this).sortable('serialize');
@@ -53,51 +52,88 @@ Also ensure that you are allowing for the CSRF Meta tags:
53
52
  });
54
53
  });
55
54
 
56
- In your config/routes.rb add the following:
55
+ In your config/routes.rb, find the admin block of routes and add the following:
56
+
57
+ admin.connect '/metrics/sort', :action=>"sort", :controller => "metrics"
58
+
59
+ Your admin routes block should look like below:
60
+
61
+ #Admin routes
62
+ map.namespace :admin do |admin|
63
+ admin.resources :metrics, :controller => 'metrics'
64
+ admin.connect '/metrics/:id/evaluate.js', :action=>"evaluate", :controller => "metrics"
65
+ admin.connect '/metrics/sort', :action=>"sort", :controller => "metrics"
66
+ admin.connect '/metrics/:id/clone', :action=>"clone", :controller => "metrics"
67
+ admin.connect '/metrics/:id/calculate', :action=>"calculate", :controller => "metrics"
68
+ admin.connect '/admin/:controller/:action/:id', :action=>"destroy"
69
+ admin.resources :resources, :controller => 'resources'
70
+ end
57
71
 
58
- map.connect "/metrics/sort", :controller => "admin/admin", :action => "sort"
72
+ Make a new css file metric_admin.css in public/css and add the following:
59
73
 
60
- Make a new css file in public/css for the gem:
74
+ div#simpleList {
75
+ margin-bottom: 2em;
76
+ }
61
77
 
62
- h2.page-subtitle.pull-left {
63
- margin-left: 1.1em;
78
+ h2 {
79
+ margin-left: 1.2em;
64
80
  }
65
81
 
66
- .list-group {
67
- margin-bottom: 15px;
82
+ div.list-group {
68
83
  border: 1px solid #ccc;
69
84
  border-radius: 3px;
70
85
  }
71
86
 
72
- .list-group-item,
73
- .header {
74
- background-color: #f4f4f4;
75
- border-bottom: 1px solid #ccc;
76
- padding: 8px 15px;
77
- vertical-align: middle;
87
+ div.list-group-item < :first-child {
88
+ border: none;
78
89
  }
79
-
80
- .list-group-item:last-child {
81
- border-bottom: none;
90
+
91
+ div.header {
92
+ padding: 10px 0px 6px 10px;
93
+ background-color: #d5d5d5;
82
94
  }
83
-
84
- .list-group-item.odd {
85
- background-color: #f4f4f4;
95
+
96
+ div.list-group-item {
97
+ border-top: 1px solid #ccc;
98
+ padding: 16px 0px 6px 10px;
99
+ }
100
+
101
+ /*div.list-group-item a {
102
+ padding: 5px 8px 3px 8px;
103
+ }*/
104
+
105
+ div.list-group-item-wrapper.odd {
106
+ background-color: #ededed;
86
107
  }
87
- .list-group-item.even {
108
+
109
+ div.list-group-item-wrapper.even {
88
110
  background-color: #fff;
89
111
  }
112
+
113
+ div.btn-toolbar {
114
+ margin-top: -5px;
115
+ }
116
+
117
+ button.dropdown-toggle {
118
+ padding: 12px;
119
+ margin-right: 1em;
120
+ outline: none;
121
+ }
122
+
123
+ div.btn-toolbar span.caret {
124
+ display: inline-block !important;
125
+ margin-top: 0px !important;
126
+ }
127
+
128
+ div.btn-toolbar ul {
129
+ margin-left: -65px;
130
+ }
131
+
132
+ Link the metric_admin.js and the metric_admin.css in the admin view in ```layouts/admin.html.haml```
90
133
 
91
- In the AdminController add the following:
92
-
93
- def sort
94
- params[:metric].each_with_index do |metric_id, i|
95
- metric = Metric.find(metric_id)
96
- metric.update_attribute(:public_sort, i)
97
- end
98
- render :json => "sorted"
99
- end
134
+ Also ensure that you have linked in the admin layout the lastest jquery.ui.min.js file.
100
135
 
136
+ Ensure that the metric table has a public_sort column.
101
137
 
102
138
  ## Contributing
103
139
 
@@ -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
- = collection_select :metric, :resource_type_id, @metric.resource_type.resources, :code, :name
85
+ = collection_select :metric, :staff_evaluation, @metric.resource_type.resources, :code, :name
86
86
  %br
87
87
  %button.btn.run_logic{"aria-hidden" => "true", "data-dismiss" => "modal"}
88
88
  Run
@@ -1,3 +1,3 @@
1
1
  module MetricAdmin
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
metadata CHANGED
@@ -1,52 +1,61 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: metric_admin
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.9
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 10
9
+ version: 0.0.10
5
10
  platform: ruby
6
- authors:
11
+ authors:
7
12
  - Analytics For Lawyers
8
13
  autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
- date: 2016-09-08 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2016-09-23 00:00:00 -04:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
14
21
  name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.6'
20
- type: :development
21
22
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.6'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 10.4.2
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 6
30
+ version: "1.6"
34
31
  type: :development
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: rake
35
35
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 10
42
+ - 4
43
+ - 2
40
44
  version: 10.4.2
45
+ type: :development
46
+ version_requirements: *id002
41
47
  description: Build and edit metrics.
42
- email:
48
+ email:
43
49
  - matt@analyticsforlawyers.com
44
50
  - brandon@analyticsforlawyers.com
45
51
  executables: []
52
+
46
53
  extensions: []
54
+
47
55
  extra_rdoc_files: []
48
- files:
49
- - ".gitignore"
56
+
57
+ files:
58
+ - .gitignore
50
59
  - Gemfile
51
60
  - HEAD
52
61
  - LICENSE.txt
@@ -68,28 +77,35 @@ files:
68
77
  - lib/metric_admin/version.rb
69
78
  - metric_admin.gemspec
70
79
  - rails/init.rb
71
- homepage: ''
72
- licenses:
80
+ has_rdoc: true
81
+ homepage: ""
82
+ licenses:
73
83
  - MIT
74
- metadata: {}
75
84
  post_install_message:
76
85
  rdoc_options: []
77
- require_paths:
86
+
87
+ require_paths:
78
88
  - lib
79
- required_ruby_version: !ruby/object:Gem::Requirement
80
- requirements:
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
81
91
  - - ">="
82
- - !ruby/object:Gem::Version
83
- version: '0'
84
- required_rubygems_version: !ruby/object:Gem::Requirement
85
- requirements:
92
+ - !ruby/object:Gem::Version
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
86
98
  - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '0'
99
+ - !ruby/object:Gem::Version
100
+ segments:
101
+ - 0
102
+ version: "0"
89
103
  requirements: []
104
+
90
105
  rubyforge_project:
91
- rubygems_version: 2.4.6
106
+ rubygems_version: 1.3.6
92
107
  signing_key:
93
- specification_version: 4
108
+ specification_version: 3
94
109
  summary: Gem that builds and edits metrics.
95
110
  test_files: []
111
+
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: a76ce20aa129cdcc5ca8d69d90de3a8dcad3f282
4
- data.tar.gz: bd91d37abf17a9cb166f853bad67f7015761ed62
5
- SHA512:
6
- metadata.gz: 9e4622c73eab3b30ff1e9d0c7b4ee777a5ebcdc1215cc856b5c2354f5230af815b828c514b7c3c478102565676991be2ee1516ed9d6beb146019fdb12edca086
7
- data.tar.gz: 1f6e3e6f55072eefa5aa9c341187b0d14ae2d4b25d0ca09e70ad6a09a02b88681481d9fee98e07e48af2c7eff812f814cc6c3280a0e87196f203bb92aff3f8de