remetric 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile +6 -0
  4. data/{MIT-LICENSE → LICENSE.txt} +3 -1
  5. data/README.md +49 -0
  6. data/Rakefile +1 -32
  7. data/lib/remetric.rb +43 -6
  8. data/lib/remetric/version.rb +2 -2
  9. data/remetric.gemspec +23 -0
  10. metadata +21 -461
  11. data/README.rdoc +0 -10
  12. data/app/assets/images/remetric/loading_logo.gif +0 -0
  13. data/app/assets/images/remetric/logo.png +0 -0
  14. data/app/assets/javascripts/remetric/app.js.coffee +0 -23
  15. data/app/assets/javascripts/remetric/application.js +0 -16
  16. data/app/assets/javascripts/remetric/dialog.js.coffee +0 -21
  17. data/app/assets/javascripts/remetric/messages.js.coffee +0 -21
  18. data/app/assets/javascripts/remetric/search.js.coffee +0 -8
  19. data/app/assets/javascripts/remetric/window.js.coffee +0 -12
  20. data/app/assets/stylesheets/remetric/app.css.scss +0 -103
  21. data/app/assets/stylesheets/remetric/application.css +0 -16
  22. data/app/assets/stylesheets/remetric/dialog.css.scss +0 -100
  23. data/app/assets/stylesheets/remetric/nav.css.scss +0 -57
  24. data/app/assets/stylesheets/remetric/reset.css +0 -61
  25. data/app/assets/stylesheets/remetric/search.css.scss +0 -31
  26. data/app/assets/stylesheets/remetric/tables.css.scss +0 -25
  27. data/app/controllers/remetric/application_controller.rb +0 -9
  28. data/app/controllers/remetric/dashboard_controller.rb +0 -11
  29. data/app/controllers/remetric/events_controller.rb +0 -42
  30. data/app/controllers/remetric/trackables_controller.rb +0 -91
  31. data/app/models/remetric/event.rb +0 -68
  32. data/app/models/remetric/trackable.rb +0 -30
  33. data/app/views/layouts/remetric/application.html.erb +0 -29
  34. data/app/views/remetric/application/_footer.html.erb +0 -17
  35. data/app/views/remetric/application/_nav.html.erb +0 -21
  36. data/app/views/remetric/dashboard/index.html.erb +0 -1
  37. data/app/views/remetric/dashboard/settings.html.erb +0 -8
  38. data/app/views/remetric/events/_event.html.erb +0 -7
  39. data/app/views/remetric/events/index.html.erb +0 -25
  40. data/app/views/remetric/events/show.html.erb +0 -7
  41. data/app/views/remetric/trackables/_form.html.erb +0 -17
  42. data/app/views/remetric/trackables/_trackable.html.erb +0 -9
  43. data/app/views/remetric/trackables/edit.html.erb +0 -6
  44. data/app/views/remetric/trackables/index.html.erb +0 -68
  45. data/app/views/remetric/trackables/index.js.erb +0 -3
  46. data/app/views/remetric/trackables/new.html.erb +0 -5
  47. data/app/views/remetric/trackables/show.html.erb +0 -7
  48. data/config/routes.rb +0 -12
  49. data/db/migrate/20140412130825_create_remetric_people.rb +0 -8
  50. data/db/migrate/20140412174234_create_remetric_trackables.rb +0 -8
  51. data/lib/remetric/engine.rb +0 -25
  52. data/lib/tasks/remetric_tasks.rake +0 -4
  53. data/test/dummy/README.rdoc +0 -28
  54. data/test/dummy/Rakefile +0 -6
  55. data/test/dummy/app/assets/javascripts/application.js +0 -13
  56. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  57. data/test/dummy/app/assets/stylesheets/scaffold.css +0 -56
  58. data/test/dummy/app/controllers/application_controller.rb +0 -5
  59. data/test/dummy/app/helpers/application_helper.rb +0 -2
  60. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  61. data/test/dummy/bin/bundle +0 -3
  62. data/test/dummy/bin/rails +0 -4
  63. data/test/dummy/bin/rake +0 -4
  64. data/test/dummy/config.ru +0 -4
  65. data/test/dummy/config/application.rb +0 -23
  66. data/test/dummy/config/boot.rb +0 -5
  67. data/test/dummy/config/database.yml +0 -24
  68. data/test/dummy/config/environment.rb +0 -5
  69. data/test/dummy/config/environments/development.rb +0 -34
  70. data/test/dummy/config/environments/production.rb +0 -80
  71. data/test/dummy/config/environments/test.rb +0 -39
  72. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  73. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  74. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  75. data/test/dummy/config/initializers/inflections.rb +0 -16
  76. data/test/dummy/config/initializers/mime_types.rb +0 -4
  77. data/test/dummy/config/initializers/remetric.rb +0 -15
  78. data/test/dummy/config/initializers/session_store.rb +0 -3
  79. data/test/dummy/config/initializers/wrap_parameters.rb +0 -9
  80. data/test/dummy/config/locales/en.yml +0 -23
  81. data/test/dummy/config/mongoid.yml +0 -69
  82. data/test/dummy/config/routes.rb +0 -4
  83. data/test/dummy/config/secrets.yml +0 -22
  84. data/test/dummy/db/schema.rb +0 -20
  85. data/test/dummy/log/development.log +0 -77955
  86. data/test/dummy/log/test.log +0 -479
  87. data/test/dummy/public/404.html +0 -67
  88. data/test/dummy/public/422.html +0 -67
  89. data/test/dummy/public/500.html +0 -66
  90. data/test/dummy/public/favicon.ico +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sass/b3d404bff8ad98818c7006bbb375fc1377b98253/app.css.scssc +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sass/b3d404bff8ad98818c7006bbb375fc1377b98253/dialog.css.scssc +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sass/b3d404bff8ad98818c7006bbb375fc1377b98253/nav.css.scssc +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sass/b3d404bff8ad98818c7006bbb375fc1377b98253/search.css.scssc +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sass/b3d404bff8ad98818c7006bbb375fc1377b98253/tables.css.scssc +0 -0
  96. data/test/dummy/tmp/cache/assets/development/sass/b3d404bff8ad98818c7006bbb375fc1377b98253/topbar.css.scssc +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sass/ef6ae779781469a1465ad72c03c0938d2b0957c7/app.css.scssc +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sass/ef6ae779781469a1465ad72c03c0938d2b0957c7/nav.css.scssc +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sass/ef6ae779781469a1465ad72c03c0938d2b0957c7/tables.css.scssc +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/036811149d0b235dc6a5d390b4cb7798 +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/06044aa6fe90933931b87690cac756bb +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/06523dcd5742577ca664780dccd6580d +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/06cc1493872f7a7a686e7ceb15dc1edf +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/08489a22fa3cea1f692673a79aeccc4d +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/0d0cd4d3626b8b7af859b848bb261b3b +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/0ff64eb5301cc3a431a373318ef77ba9 +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/10777ee134d29c9933492eeb5f6a9a2e +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/11a53c34e9d924ddcee8311e550e2a6a +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/129284b0ab310e7cd9e25d84f9ee36ce +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/14ff5f14de79dc5534dda36eed0dc845 +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/16bc847779945aa181449f07c9100ce4 +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/1bc5ddb997a9674aa1ecf3596bcdea3b +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/1f7d448c7dd65aed702d885795263877 +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/220d17e65184e9dc17578233e30285fc +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/22359219f7d258ed678aa744625a1ff7 +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/23666533c8ff01f445bafdb2f1f02f86 +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/27aa9a37df2520f26820676eed4f3700 +0 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/281c6ce161cccf80f16cdb17ab4418cd +0 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/29cf8dc04f0a517a0942324f7b779454 +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/2c11af377df23e6b6cdb35d040ce2e11 +0 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/2ca8c93fa70493848ec54ace98c8a74e +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/2d61509baca84dc502058ddd3248ec90 +0 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/2d6d573978d9d81e29432df0ea46d478 +0 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/317da10b37ae905e1542a67d23559e69 +0 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/32415ecae858572a5f3f19657e9fb686 +0 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/396258e541c9223b9e7125c90bb3858b +0 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/399fe27d4c9f18008f13282aebe13bce +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/39f8aac6fdfbd8e63ad64acfff6f11f6 +0 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/3b016f440de7952117708d55661662d6 +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/3ca240f453c6ec94f2e9c5a27d7001f8 +0 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/3e5365e32d57e4ac856f716b1cd3459e +0 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/3f9ed1aa1e459fc046192c14ed163a6c +0 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/41444136ce4142d1170281f949577191 +0 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/42c1ebcb98209b8dd066f44a6f6e91a4 +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/43a4bb43dd1715ec2eb67640a4988b50 +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/45e79781056c40dc5cb1ed347f77706f +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/507aa6d1fad718f18dac9753b23c1134 +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/53e9204c5b6f9c911b53e6e7094c70cf +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/559c497c5bc5a3b0d6424b06c25fd993 +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/5e0f4b04d24167f4992c12c5debd3d8c +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/5ed4dfea5ce8c0191e138a49420dac41 +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/61ae00e63e21dfb8ebec7b02b5dd422b +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/6690911b74d6cd9a2551a8e7712f5ba4 +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/698af75cb266cf67de8b35c5fbb87424 +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/6d872803bfb95566f660e9798b3cc34c +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/6e15f97a017c405492d9fc87477ad721 +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/6e956f97a9713501d948b2d083a4a020 +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/6febf106bc4ae38f75f0887d1592de37 +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/702c0722c0c5b287d25a402f7ee117f0 +0 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/7064b9323802e4196822328ae83e9628 +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/71e500b75cfd9b76b02bf67e12b3c833 +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/72419c0eb8026ff0ce7f259890db2503 +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/724b47e2fc60f39379329a90781df725 +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/726ba6daceacbfd72d591ee2b20f55d0 +0 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/730529e519077e2969563e5e07f4fc00 +0 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/741b2378e393e0588e5f82ab58a24082 +0 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/76f4fb7efdd4f6c2acd738e55ea07d2f +0 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/7a29d789acb5ef53d4dc3e9a2a6cc762 +0 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/7b6dd538f069c113f1f9c8e76c9db372 +0 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/808bfcd132560482630ba70dc6e282c8 +0 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/8dfcdf65937789aca525d56adf1a4656 +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/9093f4594b2a064c24fc65f610e92e29 +0 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/94b993ea74b11163bd3bd728ae31d051 +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/9538978dc1870cad6434d9c702a08d78 +0 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/9b1a83d18767d300d400470a03bc4f7b +0 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/9b4fb1df1100690f915b3c08dc3b6e12 +0 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/9fe904495c3e56e07f56a2234def4ce3 +0 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/a095af3c7e60e112ec29d7629c8af830 +0 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/a14ef177cbf5fcfae6e7eaac56e034b9 +0 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/a31bbb879540ba0d456b98d902190384 +0 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/a3e3e63eb8abde2bd1dd81e850cf80e1 +0 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/a52f913105047ed83d060e708c394961 +0 -0
  173. data/test/dummy/tmp/cache/assets/development/sprockets/a776b0cf1650a70054f5da91283fecc4 +0 -0
  174. data/test/dummy/tmp/cache/assets/development/sprockets/b0785de9897c1eadef94fdaf024915f9 +0 -0
  175. data/test/dummy/tmp/cache/assets/development/sprockets/b49c711ecdbc2fff4f119705e2e53e4d +0 -0
  176. data/test/dummy/tmp/cache/assets/development/sprockets/bc613cfb0adcb20734431cf9b9d07141 +0 -0
  177. data/test/dummy/tmp/cache/assets/development/sprockets/bdae695e1d71988ce570d79394f0247e +0 -0
  178. data/test/dummy/tmp/cache/assets/development/sprockets/c195f58c840031e93dcf040048d5386b +0 -0
  179. data/test/dummy/tmp/cache/assets/development/sprockets/c2a902f3266b677f365fc3ce5a7bd820 +0 -0
  180. data/test/dummy/tmp/cache/assets/development/sprockets/c7bd9cf81453a7911957b783ec6ecf5c +0 -0
  181. data/test/dummy/tmp/cache/assets/development/sprockets/c8bb4469accab5fc441d923464873c47 +0 -0
  182. data/test/dummy/tmp/cache/assets/development/sprockets/c9ab7f296b30469ef9170c3ab336cdf4 +0 -0
  183. data/test/dummy/tmp/cache/assets/development/sprockets/c9bd5507d8142fbe02e5034485314999 +0 -0
  184. data/test/dummy/tmp/cache/assets/development/sprockets/cb13c3985fc61edc836f19c9fd5f9a01 +0 -0
  185. data/test/dummy/tmp/cache/assets/development/sprockets/cbf388d3208ecbd03a788db6891d2781 +0 -0
  186. data/test/dummy/tmp/cache/assets/development/sprockets/cc6c1b77f34a8e580980b31eb35b441b +0 -0
  187. data/test/dummy/tmp/cache/assets/development/sprockets/cc8e5fb7cbde151721ea55b7ad2d35dc +0 -0
  188. data/test/dummy/tmp/cache/assets/development/sprockets/cca380662516cb1daca88d3f2c9a3b9e +0 -0
  189. data/test/dummy/tmp/cache/assets/development/sprockets/d0796c18ca312aaa9f18fcf1091835a6 +0 -0
  190. data/test/dummy/tmp/cache/assets/development/sprockets/d15eb2bca16eb0f31c2089c5f397c5e2 +0 -0
  191. data/test/dummy/tmp/cache/assets/development/sprockets/da0a32f5a80c68a1464a23861b172ea8 +0 -0
  192. data/test/dummy/tmp/cache/assets/development/sprockets/db25052d96407ff539ebf9992cc5ba53 +0 -0
  193. data/test/dummy/tmp/cache/assets/development/sprockets/dbef3e25a00efadb8ebc056530ea9c77 +0 -0
  194. data/test/dummy/tmp/cache/assets/development/sprockets/dfdd2dcf54d51f737c704e8bb3d74997 +0 -0
  195. data/test/dummy/tmp/cache/assets/development/sprockets/e6ca11d406eb8e17f4bd3db3c73117d5 +0 -0
  196. data/test/dummy/tmp/cache/assets/development/sprockets/e8e21ae1f6a7630e209b12d622cb6581 +0 -0
  197. data/test/dummy/tmp/cache/assets/development/sprockets/ecdddb465b19971df1d705261890c12e +0 -0
  198. data/test/dummy/tmp/cache/assets/development/sprockets/eec9cdbbe1ffd8783ec43c910318e77a +0 -0
  199. data/test/dummy/tmp/cache/assets/development/sprockets/ef1ae4e5869278227bd877dc5b9c1ed1 +0 -0
  200. data/test/dummy/tmp/cache/assets/development/sprockets/ef55b424d975f62aa8ace6d8e6d1420b +0 -0
  201. data/test/dummy/tmp/cache/assets/development/sprockets/f58a02ac7bddf274a99d091aff62f179 +0 -0
  202. data/test/dummy/tmp/cache/assets/development/sprockets/f703d7f63b064f4c9363a37b6c8f7102 +0 -0
  203. data/test/dummy/tmp/cache/assets/development/sprockets/fa73f084d9c960b3822e9a670eddd6e9 +0 -0
  204. data/test/dummy/tmp/cache/assets/development/sprockets/fad64d3cc1d38839f623367e9e8bdab7 +0 -0
  205. data/test/dummy/tmp/cache/assets/development/sprockets/ff91cdc7d41ec915a2db3524da4c962f +0 -0
  206. data/test/fixtures/remetric/people.yml +0 -11
  207. data/test/fixtures/remetric/trackables.yml +0 -11
  208. data/test/integration/track_test.rb +0 -13
  209. data/test/models/remetric/event_test.rb +0 -17
  210. data/test/remetric_test.rb +0 -7
  211. data/test/test_helper.rb +0 -15
@@ -1,31 +0,0 @@
1
- @-webkit-keyframes rotate {
2
- from {
3
- -webkit-transform: rotate(0deg);
4
- }
5
- to {
6
- -webkit-transform: rotate(360deg);
7
- }
8
- }
9
-
10
- #quick_search {
11
- button {
12
- margin-left: -10px;
13
- border-radius: 0 4px 4px 0;
14
- border: 1px solid #ccc;
15
- padding: 5px 15px;
16
-
17
- .loading {
18
- display: none;
19
- -webkit-animation-name: rotate;
20
- -webkit-animation-duration: 0.5s;
21
- -webkit-animation-iteration-count: infinite;
22
- -webkit-animation-timing-function: linear;
23
- }
24
- }
25
- }
26
-
27
- #search {
28
- display: none;
29
- background: #eee;
30
- padding: 15px;
31
- }
@@ -1,25 +0,0 @@
1
- .table {
2
- margin: 20px auto;
3
- width: 100%;
4
- background: #eee;
5
-
6
- td, th {
7
- padding: 8px;
8
- text-align: left;
9
- }
10
-
11
- td {
12
- a {
13
- font-weight: 200;
14
- color: #333;
15
- display: block;
16
- }
17
- }
18
-
19
- th {
20
- background: #777;
21
- color: #fff;
22
- font-size: 13px;
23
- text-transform: uppercase;
24
- }
25
- }
@@ -1,9 +0,0 @@
1
- module Remetric
2
- class ApplicationController < ActionController::Base
3
- before_filter :set_trackable_models
4
-
5
- def set_trackable_models
6
- @trackable_models ||= Remetric.config.trackable_models.map { |k, v| k.to_s }
7
- end
8
- end
9
- end
@@ -1,11 +0,0 @@
1
- require_dependency "remetric/application_controller"
2
-
3
- module Remetric
4
- class DashboardController < ApplicationController
5
- def index
6
- end
7
-
8
- def settings
9
- end
10
- end
11
- end
@@ -1,42 +0,0 @@
1
- require_dependency "remetric/application_controller"
2
-
3
- module Remetric
4
- class EventsController < ApplicationController
5
- before_action :set_event, only: [:show]
6
-
7
- # GET /events
8
- def index
9
- @events = Event.all
10
- @events = Event.where(description: params[:description]) if params[:description]
11
- @descriptions = @events.group_by(&:description).sort_by{|k, v| v.count}.reverse.to_a
12
- end
13
-
14
- # POST /events
15
- def create
16
- @event = Event.new(event_params)
17
-
18
- if @event.save
19
- redirect_to @event, notice: 'Event was successfully created.'
20
- else
21
- render :new
22
- end
23
- end
24
-
25
- # DELETE /events/1
26
- def destroy
27
- @events = Event.delete_all if params[:confirm]
28
- redirect_to :back, notice: 'Event was successfully destroyed.'
29
- end
30
-
31
- private
32
- # Use callbacks to share common setup or constraints between actions.
33
- def set_event
34
- @event = Event.find(params[:id])
35
- end
36
-
37
- # Only allow a trusted parameter "white list" through.
38
- def event_params
39
- params[:event]
40
- end
41
- end
42
- end
@@ -1,91 +0,0 @@
1
- require_dependency "remetric/application_controller"
2
-
3
- module Remetric
4
- class TrackablesController < ApplicationController
5
- before_filter :set_model
6
- before_action :set_trackable, only: [:show, :edit, :update]
7
-
8
- # GET /trackables
9
- def index
10
- @cols = Remetric.config.trackable_models[@model.to_sym].except(:key).map { |k, v| k.to_s }
11
- @trackables = Trackable
12
- @trackables = @trackables.where(model: @model)
13
-
14
- cookies["#{@model}_q"] = params[:q] if params[:q]
15
- @q = cookies["#{@model}_q"]
16
-
17
- unless @q.blank?
18
- q = Regexp.new @q, i: true
19
- any_ofs = []
20
-
21
- @cols.each do |col|
22
- if col == "id"
23
- any_ofs.push({ "key" => q })
24
- else
25
- any_ofs.push({ "data.#{col}" => q })
26
- end
27
- end
28
-
29
- @trackables = @trackables.any_of(any_ofs)
30
- end
31
- end
32
-
33
- # GET /trackables/1
34
- def show
35
- end
36
-
37
- # GET /trackables/new
38
- def new
39
- @trackable = Trackable.new
40
- end
41
-
42
- # GET /trackables/1/edit
43
- def edit
44
- end
45
-
46
- # POST /trackables
47
- def create
48
- @trackable = Trackable.new(trackable_params)
49
-
50
- if @trackable.save
51
- redirect_to @trackable, notice: 'Trackable was successfully created.'
52
- else
53
- render :new
54
- end
55
- end
56
-
57
- # PATCH/PUT /trackables/1
58
- def update
59
- if @trackable.update(trackable_params)
60
- redirect_to @trackable, notice: 'Trackable was successfully updated.'
61
- else
62
- render :edit
63
- end
64
- end
65
-
66
- # DELETE /trackables/1
67
- def destroy
68
- Trackable.where(model: @model).delete_all if params[:confirm]
69
- redirect_to :back, notice: "#{@model.pluralize.capitalize} were successfully destroyed."
70
- end
71
-
72
- private
73
- # Use callbacks to share common setup or constraints between actions.
74
- def set_trackable
75
- @trackable = Trackable.where(model: @model, key: params[:key]).first
76
- end
77
-
78
- # Only allow a trusted parameter "white list" through.
79
- def trackable_params
80
- params[:trackable]
81
- end
82
-
83
- def set_model
84
- @model = params[:collection].downcase.singularize
85
-
86
- if !@trackable_models.include? @model
87
- redirect_to root_path, notice: "#{params[:collection].capitalize} do not exist. To track them, update your Remetric config."
88
- end
89
- end
90
- end
91
- end
@@ -1,68 +0,0 @@
1
- module Remetric
2
- class Event
3
- include Mongoid::Document
4
- include Mongoid::Timestamps
5
- include Mongoid::Attributes::Dynamic
6
-
7
- field :description
8
-
9
- index({ description: 1 }, { unique: true, name: "event_description_index" })
10
-
11
- validates_presence_of :description
12
-
13
- before_create :attach_trackable_models
14
-
15
- def story
16
- Liquid::Template.parse(description).render(attributes)
17
- end
18
-
19
- def linked_story
20
- d = attributes
21
-
22
- Remetric.config.trackable_models.each do |model, cols|
23
- model = model.to_s
24
-
25
- if self.has_attribute? model
26
- key = d[model]["id"]
27
-
28
- # if Trackable.where(model: model, key: key.to_s).first
29
- linked_model_attributes = {}
30
- self.send(model).map { |k, v| linked_model_attributes[k] = "<a href=\"#{Engine.routes.url_helpers.trackable_path(model.pluralize, key)}\">#{v}</a>" }
31
- d.delete model
32
- d[model] = linked_model_attributes
33
- # end
34
- end
35
- end
36
-
37
- Liquid::Template.parse(description).render(d)
38
- end
39
-
40
- def attach_trackable_models
41
- Remetric.config.trackable_models.each do |model, cols|
42
- model = model.to_s
43
-
44
- if self.has_attribute? model
45
- args = self.send(model)
46
-
47
- if args.respond_to? :remetric_attributes
48
- args = args.remetric_attributes
49
- elsif args.class.ancestors.include? ActiveRecord::Base
50
- args = args.attributes
51
- end
52
-
53
- args = args.with_indifferent_access
54
- key_field = cols[:key]
55
- key_field = :id if key_field.blank?
56
- key = args[key_field].to_s.parameterize
57
- t = Trackable.where(key: key, model: model).first_or_initialize
58
- t.data ||= {}
59
- t.data = t.data.merge(args)
60
-
61
- if t.save
62
- self[model] = t.data
63
- end
64
- end
65
- end
66
- end
67
- end
68
- end
@@ -1,30 +0,0 @@
1
- module Remetric
2
- class Trackable
3
- include Mongoid::Document
4
- include Mongoid::Timestamps
5
-
6
- field :model
7
- field :key
8
- field :data, type: Hash
9
-
10
- index({ key: 1 }, { unique: true, name: "trackable_key_index" })
11
-
12
- validates_presence_of :model
13
- validates_presence_of :key
14
- validates_uniqueness_of :key, scope: :model
15
-
16
- def self.matchers
17
- [
18
- ["contains", "ilike"],
19
- ["is exactly", "="],
20
- ["is not", "!="],
21
- ["greater than", ">"],
22
- ["greater than or equal to", ">="],
23
- ["less than", "<"],
24
- ["less than or equal to", "<="],
25
- ["exists", "exists"],
26
- ["does not exist", "does not exist"]
27
- ]
28
- end
29
- end
30
- end
@@ -1,29 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Remetric</title>
5
- <%= stylesheet_link_tag "remetric/application", media: "all" %>
6
- <%= javascript_include_tag "remetric/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= render "nav", placeholder: false %>
12
- <%= render "nav", placeholder: true %>
13
-
14
- <div class="wide_container">
15
- <% if notice %>
16
- <p><%= notice %></p>
17
- <% end %>
18
-
19
- <div id="yield">
20
- <%= yield %>
21
- </div>
22
- </div>
23
-
24
- <%= render "footer" %>
25
-
26
- <div id="dialog_overlay"></div>
27
-
28
- </body>
29
- </html>
@@ -1,17 +0,0 @@
1
- <div id="footer">
2
- <div class="wide_container">
3
- <p class="float_right">
4
- <%= link_to "Remetric<b>HD</b>: $750/yr".html_safe, "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UPE2M95QCEET6" %>
5
- </p>
6
-
7
- <p class="float_left">
8
- <%= Time.zone.now.strftime("%a, %b %-d - %k:%M:%S %Z") %>
9
- </p>
10
-
11
- <p class="align_center">
12
- <%= link_to "&copy; 2014 Remetric".html_safe, "https://github.com/dallas22ca/remetric" %>
13
- </p>
14
-
15
- <div class="clear"></div>
16
- </div>
17
- </div>
@@ -1,21 +0,0 @@
1
- <div class="topbar<%= " topbar_placeholder" if placeholder %>">
2
- <div class="wide_container">
3
-
4
- <%= link_to image_tag("remetric/logo.png"), root_path, id: "logo" %>
5
- <%= link_to image_tag("remetric/loading_logo.gif"), root_path, id: "loading_logo" %>
6
-
7
- <ul class="nav">
8
- <li><%= link_to "Dashboard", root_path, class: "#{"selected" if request.path == root_path}" %></li>
9
- <li><%= link_to "Events", events_path, class: "#{"selected" if controller_name == "events"}" %></li>
10
-
11
- <% @trackable_models.each do |model| %>
12
- <li><%= link_to model.pluralize.capitalize, trackables_path(model.downcase.pluralize), class: "#{"selected" if request.path.include? model.downcase.pluralize}" %>
13
- <% end %>
14
-
15
- <li><%= link_to "Settings", settings_path, class: "#{"selected" if request.path == settings_path}" %></li>
16
- </ul>
17
-
18
- <div class="clear"></div>
19
-
20
- </div>
21
- </div>
@@ -1 +0,0 @@
1
- Dashboard.
@@ -1,8 +0,0 @@
1
- <ul>
2
- <li><%= link_to "Delete All #{pluralize Remetric::Event.count, "Event"}", events_destroy_path(confirm: true), method: :delete, data: { confirm: "Are you sure you want to delete all #{pluralize Remetric::Event.count, "event"}?" } %></li>
3
-
4
- <% @trackable_models.each do |model| %>
5
- <% count = Remetric::Trackable.where(model: model).count %>
6
- <li><%= link_to "Delete All #{pluralize count, model.pluralize.capitalize}", trackables_destroy_path(model.downcase.pluralize, confirm: true), method: :delete, data: { confirm: "Are you sure you want to delete all #{pluralize count, model.pluralize.capitalize}?" } %>
7
- <% end %>
8
- </ul>
@@ -1,7 +0,0 @@
1
- <% cache event do %>
2
- <tr>
3
- <td><%= event.linked_story.html_safe %></td>
4
- <td style="display: none; "><%= event.to_json %></td>
5
- <td><%= link_to "&rarr;".html_safe, event %></td>
6
- </tr>
7
- <% end %>
@@ -1,25 +0,0 @@
1
- <% if params[:description] %>
2
- <h1><%= @descriptions[0][0] %></h1>
3
- <%= link_to "<= Back", events_path %>
4
- <% else %>
5
- <h1>What's Going On?</h1>
6
- <ol>
7
- <% @descriptions.each do |description, events| %>
8
- <li><%= link_to "#{pluralize events.count, "event"} - #{description}", events_path(description: description) %></li>
9
- <% end %>
10
- </ol>
11
- <% end %>
12
-
13
- <table>
14
- <thead>
15
- <tr>
16
- <th colspan="2"></th>
17
- </tr>
18
- </thead>
19
-
20
- <tbody>
21
- <%= render @events %>
22
- </tbody>
23
- </table>
24
-
25
- <!--< Remetric.track contact: { id: 1228, name: "Ready" }, organization: { id: "swell", name: "Swell Productions" }, adescription: "{{ contact.name }} from {{ organization.name }} laughs." >-->
@@ -1,7 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1><%= @event.story %></h1>
4
-
5
- <pre><%= JSON.pretty_generate @event.attributes %></pre>
6
-
7
- <%= link_to 'Back', events_path %>