kms 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (409) hide show
  1. checksums.yaml +4 -4
  2. data/{vendor/assets/bower_components/Responsive-Dashboard/src/img → app/assets/images}/avatar.jpg +0 -0
  3. data/app/assets/javascripts/kms/application.js +3 -0
  4. data/app/assets/javascripts/kms/application/controllers/assets_controller.coffee.erb +14 -7
  5. data/app/assets/javascripts/kms/application/controllers/pages_controller.coffee.erb +11 -3
  6. data/app/assets/javascripts/kms/application/controllers/snippets_controller.coffee.erb +3 -0
  7. data/app/assets/javascripts/kms/application/controllers/templates_controller.coffee.erb +3 -0
  8. data/app/assets/javascripts/kms/application/controllers/users_controller.coffee +4 -4
  9. data/app/assets/javascripts/kms/application/routes.coffee.erb +1 -1
  10. data/app/assets/javascripts/kms/application/services/transliteration_service.js +160 -0
  11. data/app/assets/javascripts/templates/assets/edit.html.slim +24 -2
  12. data/app/assets/javascripts/templates/assets/form.html.slim +23 -0
  13. data/app/assets/javascripts/templates/assets/index.html.slim +13 -12
  14. data/app/assets/javascripts/templates/assets/new.html.slim +1 -15
  15. data/app/assets/javascripts/templates/help.html.slim +1 -1
  16. data/app/assets/javascripts/templates/pages/index.html.slim +16 -5
  17. data/app/assets/javascripts/templates/snippets/index.html.slim +16 -5
  18. data/app/assets/javascripts/templates/templates/index.html.slim +16 -6
  19. data/app/assets/stylesheets/kms/application.css +2 -2
  20. data/app/assets/stylesheets/kms/custom.css.scss +38 -0
  21. data/app/controllers/kms/assets_controller.rb +8 -9
  22. data/app/controllers/kms/pages_controller.rb +10 -11
  23. data/app/controllers/kms/public/pages_controller.rb +5 -4
  24. data/app/controllers/kms/public/search_controller.rb +2 -0
  25. data/app/controllers/kms/settings_controller.rb +1 -1
  26. data/app/controllers/kms/snippets_controller.rb +2 -1
  27. data/app/controllers/kms/templates_controller.rb +6 -5
  28. data/app/controllers/kms/users_controller.rb +11 -8
  29. data/app/models/ability.rb +1 -0
  30. data/app/models/concerns/kms/permalinkable.rb +1 -1
  31. data/app/models/kms/page.rb +13 -4
  32. data/app/serializers/kms/asset_serializer.rb +6 -0
  33. data/app/serializers/kms/page_serializer.rb +5 -0
  34. data/app/serializers/kms/template_serializer.rb +5 -0
  35. data/app/serializers/kms/user_serializer.rb +5 -0
  36. data/app/services/kms/page_fetcher.rb +30 -0
  37. data/app/services/kms/search_service.rb +28 -3
  38. data/app/services/kms/template_processor.rb +19 -0
  39. data/app/views/devise/passwords/edit.html.erb +1 -1
  40. data/app/views/devise/passwords/new.html.erb +1 -1
  41. data/app/views/devise/registrations/new.html.erb +1 -1
  42. data/app/views/devise/sessions/new.html.erb +1 -1
  43. data/app/views/layouts/kms/devise.html.erb +1 -1
  44. data/app/views/layouts/kms/kms.html.erb +47 -18
  45. data/config/initializers/externals.rb +6 -32
  46. data/config/initializers/search.rb +1 -0
  47. data/config/locales/en.yml +17 -1
  48. data/config/locales/ru.yml +17 -1
  49. data/config/routes.rb +7 -6
  50. data/lib/kms/dependencies.rb +1 -4
  51. data/lib/kms/engine.rb +1 -2
  52. data/lib/kms/search_item.rb +18 -0
  53. data/lib/kms/version.rb +1 -1
  54. data/spec/controllers/kms/assets_controller_spec.rb +51 -0
  55. data/spec/controllers/kms/pages_controller_spec.rb +82 -0
  56. data/spec/controllers/kms/public/pages_controller_spec.rb +30 -0
  57. data/spec/controllers/kms/snippets_controller_spec.rb +61 -47
  58. data/spec/controllers/kms/templates_controller_spec.rb +51 -0
  59. data/spec/controllers/kms/users_controller_spec.rb +56 -0
  60. data/spec/factories/assets.rb +8 -0
  61. data/spec/factories/pages.rb +33 -0
  62. data/spec/factories/templates.rb +20 -0
  63. data/spec/factories/users.rb +9 -4
  64. data/spec/internal/config/routes.rb +12 -1
  65. data/spec/internal/log/test.log +81239 -0
  66. data/spec/internal/public/404.html +67 -0
  67. data/spec/internal/public/avatar.jpg +0 -0
  68. data/spec/internal/public/style.css +1 -0
  69. data/spec/internal/public/uploads/kms/asset/file/1/avatar.jpg +0 -0
  70. data/spec/internal/public/uploads/kms/asset/file/2/avatar.jpg +0 -0
  71. data/spec/internal/public/uploads/kms/asset/file/2/style.css +1 -0
  72. data/spec/internal/public/uploads/kms/asset/file/3/style.css +1 -0
  73. data/spec/internal/public/uploads/kms/asset/file/4/style.css +1 -0
  74. data/spec/internal/public/uploads/tmp/1500976987-41025-0002-0883/style.css +1 -0
  75. data/spec/internal/public/uploads/tmp/1500977082-41195-0002-6495/style.css +1 -0
  76. data/spec/internal/public/uploads/tmp/1500977109-41364-0002-4518/style.css +1 -0
  77. data/spec/internal/public/uploads/tmp/1500977152-41405-0002-2345/style.css +1 -0
  78. data/spec/internal/public/uploads/tmp/1500977327-41694-0002-5448/style.css +1 -0
  79. data/spec/internal/public/uploads/tmp/1500977376-41732-0002-7916/style.css +1 -0
  80. data/spec/internal/public/uploads/tmp/1500977392-41759-0002-7593/style.css +1 -0
  81. data/spec/internal/public/uploads/tmp/1500977410-42259-0002-7527/style.css +1 -0
  82. data/spec/internal/public/uploads/tmp/1500977429-42306-0002-5937/style.css +1 -0
  83. data/spec/internal/public/uploads/tmp/1500977437-42324-0002-5880/style.css +1 -0
  84. data/spec/internal/public/uploads/tmp/1500983228-53594-0002-4559/style.css +1 -0
  85. data/spec/internal/public/uploads/tmp/1500983284-53632-0002-6590/style.css +1 -0
  86. data/spec/internal/public/uploads/tmp/1500983360-53784-0002-7289/style.css +1 -0
  87. data/spec/internal/public/uploads/tmp/1500983469-54321-0002-0386/avatar.jpg +0 -0
  88. data/spec/internal/public/uploads/tmp/1500983469-54321-0004-5691/style.css +1 -0
  89. data/spec/internal/public/uploads/tmp/1500983511-54352-0002-5720/avatar.jpg +0 -0
  90. data/spec/internal/public/uploads/tmp/1500983511-54352-0004-1399/style.css +1 -0
  91. data/spec/internal/public/uploads/tmp/1500983610-54507-0002-4280/avatar.jpg +0 -0
  92. data/spec/internal/public/uploads/tmp/1500983610-54507-0004-9758/style.css +1 -0
  93. data/spec/internal/public/uploads/tmp/1500984466-57012-0002-4146/avatar.jpg +0 -0
  94. data/spec/internal/public/uploads/tmp/1500984466-57012-0004-5895/style.css +1 -0
  95. data/spec/internal/public/uploads/tmp/1500984509-57158-0002-9657/avatar.jpg +0 -0
  96. data/spec/internal/public/uploads/tmp/1500984509-57158-0004-5003/style.css +1 -0
  97. data/spec/internal/public/uploads/tmp/1500984616-57697-0002-7201/avatar.jpg +0 -0
  98. data/spec/internal/public/uploads/tmp/1500984616-57697-0004-6255/style.css +1 -0
  99. data/spec/internal/public/uploads/tmp/1500985257-58947-0002-3629/avatar.jpg +0 -0
  100. data/spec/internal/public/uploads/tmp/1500985257-58947-0004-5338/style.css +1 -0
  101. data/spec/internal/public/uploads/tmp/1500985407-58947-0006-5929/style.css +1 -0
  102. data/spec/internal/public/uploads/tmp/1500985473-59264-0002-0397/avatar.jpg +0 -0
  103. data/spec/internal/public/uploads/tmp/1500985473-59264-0004-6493/style.css +1 -0
  104. data/spec/internal/public/uploads/tmp/1500985475-59264-0007-8674/style.css +1 -0
  105. data/spec/internal/public/uploads/tmp/1500985538-59468-0002-9206/avatar.jpg +0 -0
  106. data/spec/internal/public/uploads/tmp/1500985538-59468-0004-2586/style.css +1 -0
  107. data/spec/internal/public/uploads/tmp/1500985538-59468-0007-6200/style.css +1 -0
  108. data/spec/internal/public/uploads/tmp/1500988358-65877-0002-4528/avatar.jpg +0 -0
  109. data/spec/internal/public/uploads/tmp/1500988358-65877-0004-5904/style.css +1 -0
  110. data/spec/internal/public/uploads/tmp/1500988358-65877-0007-7320/style.css +1 -0
  111. data/spec/internal/public/uploads/tmp/1500988407-65916-0002-3138/avatar.jpg +0 -0
  112. data/spec/internal/public/uploads/tmp/1500988407-65916-0004-5400/style.css +1 -0
  113. data/spec/internal/public/uploads/tmp/1500988407-65916-0007-1655/style.css +1 -0
  114. data/spec/internal/public/uploads/tmp/1500988421-65950-0002-9415/avatar.jpg +0 -0
  115. data/spec/internal/public/uploads/tmp/1500988421-65950-0004-7130/style.css +1 -0
  116. data/spec/internal/public/uploads/tmp/1500988421-65950-0007-9886/style.css +1 -0
  117. data/spec/internal/public/uploads/tmp/1500988435-65981-0002-3228/avatar.jpg +0 -0
  118. data/spec/internal/public/uploads/tmp/1500988435-65981-0004-3682/style.css +1 -0
  119. data/spec/internal/public/uploads/tmp/1500988435-65981-0007-1582/style.css +1 -0
  120. data/spec/internal/public/uploads/tmp/1500988475-66122-0002-9516/avatar.jpg +0 -0
  121. data/spec/internal/public/uploads/tmp/1500988475-66122-0004-5634/style.css +1 -0
  122. data/spec/internal/public/uploads/tmp/1500988530-66122-0007-2272/style.css +1 -0
  123. data/spec/internal/public/uploads/tmp/1500988554-66315-0002-6262/avatar.jpg +0 -0
  124. data/spec/internal/public/uploads/tmp/1500988554-66315-0004-6099/style.css +1 -0
  125. data/spec/internal/public/uploads/tmp/1500988554-66315-0007-1632/style.css +1 -0
  126. data/spec/internal/public/uploads/tmp/1500991751-73722-0002-9937/avatar.jpg +0 -0
  127. data/spec/internal/public/uploads/tmp/1500991751-73722-0004-8034/style.css +1 -0
  128. data/spec/internal/public/uploads/tmp/1500991751-73722-0007-7763/style.css +1 -0
  129. data/spec/internal/public/uploads/tmp/1501233238-34385-0002-3210/avatar.jpg +0 -0
  130. data/spec/internal/public/uploads/tmp/1501233238-34385-0004-5881/style.css +1 -0
  131. data/spec/internal/public/uploads/tmp/1501233238-34385-0007-6280/style.css +1 -0
  132. data/spec/models/kms/page_spec.rb +31 -0
  133. data/spec/models/kms/template_spec.rb +15 -0
  134. data/spec/services/kms/page_fetcher_spec.rb +36 -0
  135. data/spec/services/kms/search_service_spec.rb +53 -0
  136. data/spec/services/kms/template_processor_spec.rb +20 -0
  137. data/spec/support/controller_macros.rb +9 -1
  138. data/vendor/assets/bower.json +3 -2
  139. data/vendor/assets/bower_components/angular-ui-select/CHANGELOG.md +169 -0
  140. data/vendor/assets/bower_components/angular-ui-select/CONTRIBUTING.md +161 -0
  141. data/vendor/assets/bower_components/angular-ui-select/README.md +27 -13
  142. data/vendor/assets/bower_components/angular-ui-select/bower.json +6 -3
  143. data/vendor/assets/bower_components/angular-ui-select/composer.json +29 -0
  144. data/vendor/assets/bower_components/angular-ui-select/deploy-docs.sh +31 -0
  145. data/vendor/assets/bower_components/angular-ui-select/dist/select.css +48 -2
  146. data/vendor/assets/bower_components/angular-ui-select/dist/select.js +454 -111
  147. data/vendor/assets/bower_components/angular-ui-select/dist/select.min.css +2 -2
  148. data/vendor/assets/bower_components/angular-ui-select/dist/select.min.js +2 -2
  149. data/vendor/assets/bower_components/angular-ui-select/docs/assets/app.js +1 -0
  150. data/vendor/assets/bower_components/angular-ui-select/docs/assets/demo.js +461 -0
  151. data/vendor/assets/bower_components/angular-ui-select/docs/assets/docs.css +339 -0
  152. data/vendor/assets/bower_components/angular-ui-select/docs/assets/plunkr.js +110 -0
  153. data/vendor/assets/bower_components/angular-ui-select/docs/index.html +191 -0
  154. data/vendor/assets/bower_components/angular-ui-select/docs/partials/_footer.html +2 -0
  155. data/vendor/assets/bower_components/angular-ui-select/docs/partials/_header.html +64 -0
  156. data/vendor/assets/bower_components/angular-ui-select/index.js +2 -0
  157. data/vendor/assets/bower_components/angular-ui-select/package.json +36 -15
  158. data/vendor/assets/bower_components/bootstrap/CHANGELOG.md +5 -0
  159. data/vendor/assets/bower_components/bootstrap/Gemfile +6 -0
  160. data/vendor/assets/bower_components/bootstrap/Gemfile.lock +43 -0
  161. data/vendor/assets/bower_components/bootstrap/Gruntfile.js +176 -145
  162. data/vendor/assets/bower_components/bootstrap/ISSUE_TEMPLATE.md +22 -0
  163. data/vendor/assets/bower_components/bootstrap/LICENSE +1 -1
  164. data/vendor/assets/bower_components/bootstrap/README.md +55 -40
  165. data/vendor/assets/bower_components/bootstrap/bower.json +5 -9
  166. data/vendor/assets/bower_components/bootstrap/dist/css/bootstrap-theme.css +204 -59
  167. data/vendor/assets/bower_components/bootstrap/dist/css/bootstrap-theme.css.map +1 -1
  168. data/vendor/assets/bower_components/bootstrap/dist/css/bootstrap-theme.min.css +4 -3
  169. data/vendor/assets/bower_components/bootstrap/dist/css/bootstrap-theme.min.css.map +1 -0
  170. data/vendor/assets/bower_components/bootstrap/dist/css/{bootstrap.less → bootstrap.css} +881 -327
  171. data/vendor/assets/bower_components/bootstrap/dist/css/bootstrap.css.map +1 -1
  172. data/vendor/assets/bower_components/bootstrap/dist/css/bootstrap.min.css +6 -0
  173. data/vendor/assets/bower_components/bootstrap/dist/css/bootstrap.min.css.map +1 -0
  174. data/vendor/assets/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  175. data/vendor/assets/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +272 -213
  176. data/vendor/assets/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  177. data/vendor/assets/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  178. data/vendor/assets/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 +0 -0
  179. data/vendor/assets/bower_components/bootstrap/dist/js/bootstrap.js +549 -286
  180. data/vendor/assets/bower_components/bootstrap/dist/js/bootstrap.min.js +5 -4
  181. data/vendor/assets/bower_components/bootstrap/dist/js/npm.js +13 -0
  182. data/vendor/assets/bower_components/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
  183. data/vendor/assets/bower_components/bootstrap/fonts/glyphicons-halflings-regular.svg +272 -213
  184. data/vendor/assets/bower_components/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
  185. data/vendor/assets/bower_components/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
  186. data/vendor/assets/bower_components/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
  187. data/vendor/assets/bower_components/bootstrap/grunt/bs-commonjs-generator.js +30 -0
  188. data/vendor/assets/bower_components/bootstrap/grunt/bs-glyphicons-data-generator.js +5 -4
  189. data/vendor/assets/bower_components/bootstrap/grunt/bs-lessdoc-parser.js +13 -12
  190. data/vendor/assets/bower_components/bootstrap/grunt/bs-raw-files-generator.js +6 -8
  191. data/vendor/assets/bower_components/bootstrap/grunt/change-version.js +109 -0
  192. data/vendor/assets/bower_components/bootstrap/grunt/configBridge.json +46 -0
  193. data/vendor/assets/bower_components/bootstrap/grunt/npm-shrinkwrap.json +2679 -0
  194. data/vendor/assets/bower_components/bootstrap/grunt/sauce_browsers.yml +5 -5
  195. data/vendor/assets/bower_components/bootstrap/js/affix.js +46 -26
  196. data/vendor/assets/bower_components/bootstrap/js/alert.js +8 -6
  197. data/vendor/assets/bower_components/bootstrap/js/button.js +34 -19
  198. data/vendor/assets/bower_components/bootstrap/js/carousel.js +35 -21
  199. data/vendor/assets/bower_components/bootstrap/js/collapse.js +69 -27
  200. data/vendor/assets/bower_components/bootstrap/js/dropdown.js +55 -41
  201. data/vendor/assets/bower_components/bootstrap/js/modal.js +91 -32
  202. data/vendor/assets/bower_components/bootstrap/js/popover.js +5 -10
  203. data/vendor/assets/bower_components/bootstrap/js/scrollspy.js +28 -26
  204. data/vendor/assets/bower_components/bootstrap/js/tab.js +45 -18
  205. data/vendor/assets/bower_components/bootstrap/js/tooltip.js +117 -54
  206. data/vendor/assets/bower_components/bootstrap/js/transition.js +2 -2
  207. data/vendor/assets/bower_components/bootstrap/less/alerts.less +5 -0
  208. data/vendor/assets/bower_components/bootstrap/less/badges.less +14 -3
  209. data/vendor/assets/bower_components/bootstrap/less/bootstrap.less +6 -0
  210. data/vendor/assets/bower_components/bootstrap/less/button-groups.less +22 -18
  211. data/vendor/assets/bower_components/bootstrap/less/buttons.less +19 -10
  212. data/vendor/assets/bower_components/bootstrap/less/carousel.less +34 -7
  213. data/vendor/assets/bower_components/bootstrap/less/close.less +1 -0
  214. data/vendor/assets/bower_components/bootstrap/less/code.less +1 -0
  215. data/vendor/assets/bower_components/bootstrap/less/component-animations.less +3 -1
  216. data/vendor/assets/bower_components/bootstrap/less/dropdowns.less +9 -8
  217. data/vendor/assets/bower_components/bootstrap/less/forms.less +123 -50
  218. data/vendor/assets/bower_components/bootstrap/less/glyphicons.less +75 -3
  219. data/vendor/assets/bower_components/bootstrap/less/input-groups.less +8 -3
  220. data/vendor/assets/bower_components/bootstrap/less/jumbotron.less +10 -4
  221. data/vendor/assets/bower_components/bootstrap/less/list-group.less +10 -11
  222. data/vendor/assets/bower_components/bootstrap/less/media.less +40 -30
  223. data/vendor/assets/bower_components/bootstrap/less/mixins.less +1 -0
  224. data/vendor/assets/bower_components/bootstrap/less/mixins/background-variant.less +2 -1
  225. data/vendor/assets/bower_components/bootstrap/less/mixins/buttons.less +19 -4
  226. data/vendor/assets/bower_components/bootstrap/less/mixins/forms.less +5 -1
  227. data/vendor/assets/bower_components/bootstrap/less/mixins/grid-framework.less +4 -4
  228. data/vendor/assets/bower_components/bootstrap/less/mixins/grid.less +4 -4
  229. data/vendor/assets/bower_components/bootstrap/less/mixins/hide-text.less +2 -2
  230. data/vendor/assets/bower_components/bootstrap/less/mixins/image.less +0 -1
  231. data/vendor/assets/bower_components/bootstrap/less/mixins/labels.less +1 -1
  232. data/vendor/assets/bower_components/bootstrap/less/mixins/list-group.less +2 -1
  233. data/vendor/assets/bower_components/bootstrap/less/mixins/pagination.less +2 -1
  234. data/vendor/assets/bower_components/bootstrap/less/mixins/reset-text.less +18 -0
  235. data/vendor/assets/bower_components/bootstrap/less/mixins/responsive-visibility.less +1 -1
  236. data/vendor/assets/bower_components/bootstrap/less/mixins/tab-focus.less +3 -3
  237. data/vendor/assets/bower_components/bootstrap/less/mixins/text-emphasis.less +2 -1
  238. data/vendor/assets/bower_components/bootstrap/less/mixins/vendor-prefixes.less +8 -5
  239. data/vendor/assets/bower_components/bootstrap/less/modals.less +3 -3
  240. data/vendor/assets/bower_components/bootstrap/less/navbar.less +30 -25
  241. data/vendor/assets/bower_components/bootstrap/less/navs.less +1 -1
  242. data/vendor/assets/bower_components/bootstrap/less/normalize.less +12 -13
  243. data/vendor/assets/bower_components/bootstrap/less/pager.less +1 -2
  244. data/vendor/assets/bower_components/bootstrap/less/pagination.less +5 -4
  245. data/vendor/assets/bower_components/bootstrap/less/panels.less +33 -5
  246. data/vendor/assets/bower_components/bootstrap/less/popovers.less +5 -7
  247. data/vendor/assets/bower_components/bootstrap/less/print.less +96 -96
  248. data/vendor/assets/bower_components/bootstrap/less/progress-bars.less +1 -19
  249. data/vendor/assets/bower_components/bootstrap/less/responsive-embed.less +10 -9
  250. data/vendor/assets/bower_components/bootstrap/less/scaffolding.less +13 -2
  251. data/vendor/assets/bower_components/bootstrap/less/tables.less +14 -13
  252. data/vendor/assets/bower_components/bootstrap/less/theme.less +49 -16
  253. data/vendor/assets/bower_components/bootstrap/less/thumbnails.less +1 -1
  254. data/vendor/assets/bower_components/bootstrap/less/tooltip.less +13 -7
  255. data/vendor/assets/bower_components/bootstrap/less/type.less +2 -13
  256. data/vendor/assets/bower_components/bootstrap/less/utilities.less +0 -2
  257. data/vendor/assets/bower_components/bootstrap/less/variables.less +45 -22
  258. data/vendor/assets/bower_components/bootstrap/nuget/MyGet.ps1 +8 -0
  259. data/vendor/assets/bower_components/bootstrap/nuget/bootstrap.less.nuspec +28 -0
  260. data/vendor/assets/bower_components/bootstrap/nuget/bootstrap.nuspec +28 -0
  261. data/vendor/assets/bower_components/bootstrap/package.js +32 -0
  262. data/vendor/assets/bower_components/bootstrap/package.json +49 -41
  263. data/vendor/assets/bower_components/flow.js/README.md +79 -64
  264. data/vendor/assets/bower_components/flow.js/bower.json +6 -2
  265. data/vendor/assets/bower_components/flow.js/dist/flow.js +1635 -1532
  266. data/vendor/assets/bower_components/flow.js/dist/flow.min.js +2 -2
  267. data/vendor/assets/bower_components/flow.js/package.js +24 -0
  268. data/vendor/assets/bower_components/flow.js/travis.sh +19 -0
  269. data/vendor/assets/bower_components/font-awesome/scss/_path.scss +5 -5
  270. data/vendor/assets/bower_components/font-awesome/scss/_variables.scss +1 -2
  271. data/vendor/assets/bower_components/ng-flow/bower.json +1 -1
  272. data/vendor/assets/bower_components/ng-flow/dist/ng-flow-standalone.js +1655 -1542
  273. data/vendor/assets/bower_components/ng-flow/dist/ng-flow-standalone.min.js +2 -2
  274. data/vendor/assets/bower_components/ng-flow/dist/ng-flow.js +19 -9
  275. data/vendor/assets/bower_components/ng-flow/dist/ng-flow.min.js +2 -2
  276. data/vendor/assets/bower_components/ng-flow/index.js +3 -0
  277. data/vendor/assets/bower_components/ng-flow/package.js +25 -0
  278. data/vendor/assets/bower_components/ng-flow/src/directives/drag-events.js +2 -1
  279. data/vendor/assets/bower_components/ng-flow/src/directives/events.js +2 -1
  280. data/vendor/assets/bower_components/ng-flow/src/directives/init.js +7 -1
  281. data/vendor/assets/bower_components/ng-flow/travis.sh +19 -0
  282. data/vendor/assets/bower_components/{Responsive-Dashboard → rdash-ui}/LICENSE +21 -21
  283. data/vendor/assets/bower_components/rdash-ui/README.md +55 -0
  284. data/vendor/assets/bower_components/rdash-ui/bower.json +33 -0
  285. data/vendor/assets/bower_components/rdash-ui/dist/css/rdash.min.css +1 -0
  286. data/vendor/assets/bower_components/rdash-ui/dist/css/rdash.scss +489 -0
  287. data/vendor/assets/bower_components/{Responsive-Dashboard/src → rdash-ui/dist}/fonts/montserrat-regular-webfont.eot +0 -0
  288. data/vendor/assets/bower_components/{Responsive-Dashboard/src → rdash-ui/dist}/fonts/montserrat-regular-webfont.svg +1316 -1316
  289. data/vendor/assets/bower_components/{Responsive-Dashboard/src → rdash-ui/dist}/fonts/montserrat-regular-webfont.ttf +0 -0
  290. data/vendor/assets/bower_components/{Responsive-Dashboard/src → rdash-ui/dist}/fonts/montserrat-regular-webfont.woff +0 -0
  291. metadata +227 -180
  292. data/config/initializers/bower_rails.rb +0 -16
  293. data/vendor/assets/bower_components/Responsive-Dashboard/CONTRIBUTING.md +0 -21
  294. data/vendor/assets/bower_components/Responsive-Dashboard/README.md +0 -119
  295. data/vendor/assets/bower_components/Responsive-Dashboard/bower.json +0 -32
  296. data/vendor/assets/bower_components/Responsive-Dashboard/gulpfile.js +0 -81
  297. data/vendor/assets/bower_components/Responsive-Dashboard/package.json +0 -21
  298. data/vendor/assets/bower_components/Responsive-Dashboard/src/index.html +0 -413
  299. data/vendor/assets/bower_components/Responsive-Dashboard/src/js/dashboard/controllers/alerts-ctrl.js +0 -19
  300. data/vendor/assets/bower_components/Responsive-Dashboard/src/js/dashboard/controllers/master-ctrl.js +0 -51
  301. data/vendor/assets/bower_components/Responsive-Dashboard/src/js/dashboard/directives/loading.js +0 -13
  302. data/vendor/assets/bower_components/Responsive-Dashboard/src/js/dashboard/directives/widget-body.js +0 -16
  303. data/vendor/assets/bower_components/Responsive-Dashboard/src/js/dashboard/directives/widget-header.js +0 -17
  304. data/vendor/assets/bower_components/Responsive-Dashboard/src/js/dashboard/directives/widget.js +0 -16
  305. data/vendor/assets/bower_components/Responsive-Dashboard/src/js/dashboard/module.js +0 -1
  306. data/vendor/assets/bower_components/Responsive-Dashboard/src/js/dashboard/routes.js +0 -22
  307. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/content.less +0 -19
  308. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/hamburg.less +0 -29
  309. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/header.less +0 -92
  310. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/loading.less +0 -40
  311. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/main.less +0 -73
  312. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/mixins.less +0 -5
  313. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/sidebar.less +0 -122
  314. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/variables.less +0 -10
  315. data/vendor/assets/bower_components/Responsive-Dashboard/src/less/dashboard/widgets.less +0 -95
  316. data/vendor/assets/bower_components/bootstrap/dist/css/bootstrap.min.css.erb +0 -5
  317. data/vendor/assets/bower_components/flow.js/CHANGELOG.md +0 -37
  318. data/vendor/assets/bower_components/flow.js/Gruntfile.js +0 -132
  319. data/vendor/assets/bower_components/flow.js/karma.conf.js +0 -114
  320. data/vendor/assets/bower_components/flow.js/package.json +0 -50
  321. data/vendor/assets/bower_components/flow.js/src/flow.js +0 -1532
  322. data/vendor/assets/bower_components/jquery/MIT-LICENSE.txt +0 -21
  323. data/vendor/assets/bower_components/jquery/bower.json +0 -27
  324. data/vendor/assets/bower_components/jquery/dist/jquery.js +0 -9190
  325. data/vendor/assets/bower_components/jquery/dist/jquery.min.js +0 -5
  326. data/vendor/assets/bower_components/jquery/dist/jquery.min.map +0 -1
  327. data/vendor/assets/bower_components/jquery/src/ajax.js +0 -806
  328. data/vendor/assets/bower_components/jquery/src/ajax/jsonp.js +0 -89
  329. data/vendor/assets/bower_components/jquery/src/ajax/load.js +0 -75
  330. data/vendor/assets/bower_components/jquery/src/ajax/parseJSON.js +0 -13
  331. data/vendor/assets/bower_components/jquery/src/ajax/parseXML.js +0 -28
  332. data/vendor/assets/bower_components/jquery/src/ajax/script.js +0 -64
  333. data/vendor/assets/bower_components/jquery/src/ajax/var/nonce.js +0 -5
  334. data/vendor/assets/bower_components/jquery/src/ajax/var/rquery.js +0 -3
  335. data/vendor/assets/bower_components/jquery/src/ajax/xhr.js +0 -135
  336. data/vendor/assets/bower_components/jquery/src/attributes.js +0 -11
  337. data/vendor/assets/bower_components/jquery/src/attributes/attr.js +0 -143
  338. data/vendor/assets/bower_components/jquery/src/attributes/classes.js +0 -158
  339. data/vendor/assets/bower_components/jquery/src/attributes/prop.js +0 -96
  340. data/vendor/assets/bower_components/jquery/src/attributes/support.js +0 -35
  341. data/vendor/assets/bower_components/jquery/src/attributes/val.js +0 -163
  342. data/vendor/assets/bower_components/jquery/src/callbacks.js +0 -205
  343. data/vendor/assets/bower_components/jquery/src/core.js +0 -498
  344. data/vendor/assets/bower_components/jquery/src/core/access.js +0 -60
  345. data/vendor/assets/bower_components/jquery/src/core/init.js +0 -123
  346. data/vendor/assets/bower_components/jquery/src/core/parseHTML.js +0 -39
  347. data/vendor/assets/bower_components/jquery/src/core/ready.js +0 -97
  348. data/vendor/assets/bower_components/jquery/src/core/var/rsingleTag.js +0 -4
  349. data/vendor/assets/bower_components/jquery/src/css.js +0 -451
  350. data/vendor/assets/bower_components/jquery/src/css/addGetHookIf.js +0 -24
  351. data/vendor/assets/bower_components/jquery/src/css/curCSS.js +0 -57
  352. data/vendor/assets/bower_components/jquery/src/css/defaultDisplay.js +0 -70
  353. data/vendor/assets/bower_components/jquery/src/css/hiddenVisibleSelectors.js +0 -15
  354. data/vendor/assets/bower_components/jquery/src/css/support.js +0 -91
  355. data/vendor/assets/bower_components/jquery/src/css/swap.js +0 -28
  356. data/vendor/assets/bower_components/jquery/src/css/var/cssExpand.js +0 -3
  357. data/vendor/assets/bower_components/jquery/src/css/var/getStyles.js +0 -5
  358. data/vendor/assets/bower_components/jquery/src/css/var/isHidden.js +0 -13
  359. data/vendor/assets/bower_components/jquery/src/css/var/rmargin.js +0 -3
  360. data/vendor/assets/bower_components/jquery/src/css/var/rnumnonpx.js +0 -5
  361. data/vendor/assets/bower_components/jquery/src/data.js +0 -179
  362. data/vendor/assets/bower_components/jquery/src/data/Data.js +0 -181
  363. data/vendor/assets/bower_components/jquery/src/data/accepts.js +0 -20
  364. data/vendor/assets/bower_components/jquery/src/data/var/data_priv.js +0 -5
  365. data/vendor/assets/bower_components/jquery/src/data/var/data_user.js +0 -5
  366. data/vendor/assets/bower_components/jquery/src/deferred.js +0 -149
  367. data/vendor/assets/bower_components/jquery/src/deprecated.js +0 -13
  368. data/vendor/assets/bower_components/jquery/src/dimensions.js +0 -50
  369. data/vendor/assets/bower_components/jquery/src/effects.js +0 -649
  370. data/vendor/assets/bower_components/jquery/src/effects/Tween.js +0 -114
  371. data/vendor/assets/bower_components/jquery/src/effects/animatedSelector.js +0 -13
  372. data/vendor/assets/bower_components/jquery/src/event.js +0 -868
  373. data/vendor/assets/bower_components/jquery/src/event/alias.js +0 -39
  374. data/vendor/assets/bower_components/jquery/src/event/support.js +0 -9
  375. data/vendor/assets/bower_components/jquery/src/exports/amd.js +0 -24
  376. data/vendor/assets/bower_components/jquery/src/exports/global.js +0 -32
  377. data/vendor/assets/bower_components/jquery/src/intro.js +0 -44
  378. data/vendor/assets/bower_components/jquery/src/jquery.js +0 -36
  379. data/vendor/assets/bower_components/jquery/src/manipulation.js +0 -582
  380. data/vendor/assets/bower_components/jquery/src/manipulation/_evalUrl.js +0 -18
  381. data/vendor/assets/bower_components/jquery/src/manipulation/support.js +0 -31
  382. data/vendor/assets/bower_components/jquery/src/manipulation/var/rcheckableType.js +0 -3
  383. data/vendor/assets/bower_components/jquery/src/offset.js +0 -204
  384. data/vendor/assets/bower_components/jquery/src/outro.js +0 -1
  385. data/vendor/assets/bower_components/jquery/src/queue.js +0 -142
  386. data/vendor/assets/bower_components/jquery/src/queue/delay.js +0 -22
  387. data/vendor/assets/bower_components/jquery/src/selector-native.js +0 -172
  388. data/vendor/assets/bower_components/jquery/src/selector-sizzle.js +0 -14
  389. data/vendor/assets/bower_components/jquery/src/selector.js +0 -1
  390. data/vendor/assets/bower_components/jquery/src/serialize.js +0 -111
  391. data/vendor/assets/bower_components/jquery/src/sizzle/dist/sizzle.js +0 -2044
  392. data/vendor/assets/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
  393. data/vendor/assets/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
  394. data/vendor/assets/bower_components/jquery/src/traversing.js +0 -200
  395. data/vendor/assets/bower_components/jquery/src/traversing/findFilter.js +0 -100
  396. data/vendor/assets/bower_components/jquery/src/traversing/var/rneedsContext.js +0 -6
  397. data/vendor/assets/bower_components/jquery/src/var/arr.js +0 -3
  398. data/vendor/assets/bower_components/jquery/src/var/class2type.js +0 -4
  399. data/vendor/assets/bower_components/jquery/src/var/concat.js +0 -5
  400. data/vendor/assets/bower_components/jquery/src/var/hasOwn.js +0 -5
  401. data/vendor/assets/bower_components/jquery/src/var/indexOf.js +0 -5
  402. data/vendor/assets/bower_components/jquery/src/var/pnum.js +0 -3
  403. data/vendor/assets/bower_components/jquery/src/var/push.js +0 -5
  404. data/vendor/assets/bower_components/jquery/src/var/rnotwhite.js +0 -3
  405. data/vendor/assets/bower_components/jquery/src/var/slice.js +0 -5
  406. data/vendor/assets/bower_components/jquery/src/var/strundefined.js +0 -3
  407. data/vendor/assets/bower_components/jquery/src/var/support.js +0 -4
  408. data/vendor/assets/bower_components/jquery/src/var/toString.js +0 -5
  409. data/vendor/assets/bower_components/jquery/src/wrap.js +0 -78
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7a60114d095d742beb0d36848becbcdddf79bc8
4
- data.tar.gz: 614ac6dc07bf7781306c107c97c3438a43b88877
3
+ metadata.gz: 237100c614e22752cf5eaddf01376780624d4c49
4
+ data.tar.gz: 79942a4976ed0b918da8a7da405aebcb6f43e4ce
5
5
  SHA512:
6
- metadata.gz: 3155d389e80cac754afd5ac0d1d3d05e9e6d6574754a74ddb150ca52869b321e7a195b8d36d40d0889aae6240a958acb167ecf51f1dda3f52db127c91928162e
7
- data.tar.gz: 689ce17498530639bd86c95f03c486f6ffadd65c29ce4ab04ebccb01848bf91d510e6a14ea2971b98f5fed4e00d7ccb1ee31b4487f0e49bf0c44837439c92ae6
6
+ metadata.gz: 0ab78651f20b23fdefe7959266f27f38b8e15533610d8a620e3cf069b4e37f3465ac9b84623536d1f8c328d90b159776723c70eeb39bafdc51f27d6b419a144c
7
+ data.tar.gz: 123c93cf60bd57e202736b0559f1a6b256b261b068a8bd591ed14ac16e615b2ca08c149d12e97c36712705fcfe90f947d57b62af2b4073979e5ea1a2870f9a3f
@@ -18,7 +18,10 @@
18
18
  //= require "codemirror/addon/fold/xml-fold"
19
19
  //= require "codemirror/addon/edit/closetag"
20
20
  //= require "codemirror/addon/edit/matchtags"
21
+ //= require "codemirror/addon/edit/matchbrackets"
22
+ //= require "codemirror/addon/edit/closebrackets"
21
23
  //= require "codemirror/addon/display/fullscreen"
24
+ //= require "codemirror/addon/selection/active-line"
22
25
  //= require "ng-ckeditor/libs/ckeditor/ckeditor"
23
26
  //= require "angular/angular.js"
24
27
  //= require "angular-i18n/angular-locale_ru-ru.js"
@@ -3,6 +3,9 @@ AssetsController = ($scope, $state, $cookieStore, $cookies, Restangular, $stateP
3
3
  $scope.editorOptions = (asset)->
4
4
  lineNumbers: true
5
5
  mode: $scope.getMode(asset)
6
+ matchBrackets: true
7
+ autoCloseBrackets: true
8
+ styleActiveLine: true
6
9
  extraKeys:
7
10
  "F11": (cm)->
8
11
  cm.setOption("fullScreen", !cm.getOption("fullScreen"))
@@ -12,8 +15,10 @@ AssetsController = ($scope, $state, $cookieStore, $cookies, Restangular, $stateP
12
15
 
13
16
  $scope.store = Restangular.all('assets')
14
17
  $scope.store.getList().then (assets)->
18
+ $scope.assetsArray = assets
15
19
  $scope.assets = _.groupBy assets, (asset)->
16
20
  $scope.getAssetGroup(asset)
21
+ $state.go('assets.new') if $scope.assetsArray.length == 0
17
22
 
18
23
  if $stateParams.id
19
24
  $scope.store.get($stateParams.id).then (asset)->
@@ -23,12 +28,6 @@ AssetsController = ($scope, $state, $cookieStore, $cookies, Restangular, $stateP
23
28
  else
24
29
  {}
25
30
 
26
- $scope.create = ->
27
- $scope.store.post($scope.asset).then ->
28
- $state.go('assets')
29
- ,(response)->
30
- Alertify.error(ErrorsService.prepareErrorsString(response.data.errors))
31
-
32
31
  $scope.update = ($event)->
33
32
  $scope.asset.put().then ->
34
33
  if $event.target.attributes['data-redirect']
@@ -39,6 +38,7 @@ AssetsController = ($scope, $state, $cookieStore, $cookies, Restangular, $stateP
39
38
  $scope.destroy = (asset)->
40
39
  if(confirm('<%= I18n.t(:are_you_sure) %>'))
41
40
  asset.remove().then ->
41
+ $scope.assetsArray = _.without($scope.assetsArray, asset)
42
42
  for content_type, values of $scope.assets
43
43
  $scope.assets[content_type] = _.without($scope.assets[content_type], asset)
44
44
 
@@ -66,7 +66,14 @@ AssetsController = ($scope, $state, $cookieStore, $cookies, Restangular, $stateP
66
66
  "other"
67
67
 
68
68
  $scope.isImageType = (file)->
69
- ['jpg', 'jpeg', 'gif','png'].indexOf(file.getType()) >= 0
69
+ ['jpg', 'jpeg', 'gif', 'png'].indexOf(file.getType()) >= 0
70
+
71
+ $scope.updateTarget = (flowFile)->
72
+ "/kms/assets/#{flowFile.id}.json"
73
+
74
+ $scope.initFlowFile = (flowFile)->
75
+ flowFile['id'] = $scope.asset.id
76
+ flowFile
70
77
 
71
78
 
72
79
  angular.module('KMS')
@@ -1,12 +1,14 @@
1
- PagesController = ($scope, $state, $cookieStore, Restangular, $stateParams, Alertify, ErrorsService) ->
1
+ PagesController = ($scope, $state, $cookieStore, Restangular, $stateParams, Alertify, ErrorsService, TransliterationService) ->
2
2
  $scope.editorOptions =
3
- #filebrowserBrowseUrl: '/assets/asset/file'
4
3
  filebrowserUploadUrl: '/kms/assets/ckeditor'
5
4
  entities: false
6
5
  $scope.codeMirrorOptions =
7
6
  lineNumbers: true
8
7
  mode:'htmlmixed'
9
8
  autoCloseTags: true
9
+ matchBrackets: true
10
+ autoCloseBrackets: true
11
+ styleActiveLine: true
10
12
  matchTags:
11
13
  bothTags: true
12
14
  extraKeys:
@@ -15,6 +17,10 @@ PagesController = ($scope, $state, $cookieStore, Restangular, $stateParams, Aler
15
17
  "Esc": (cm)->
16
18
  if cm.getOption("fullScreen") then cm.setOption("fullScreen", false)
17
19
 
20
+ $scope.$watch 'page.title', (newValue, oldValue) ->
21
+ if newValue? and $scope.page.slug != 'index' and !$scope.page.id
22
+ $scope.page.slug = _.kebabCase TransliterationService.translit(newValue, 5).replace(/`/g, '')
23
+
18
24
  Restangular.all('resources').getList().then (templatable_types)->
19
25
  $scope.templatable_types = templatable_types
20
26
 
@@ -62,6 +68,8 @@ PagesController = ($scope, $state, $cookieStore, Restangular, $stateParams, Aler
62
68
  $scope.pages = $scope.exceptCurrentPage($scope.pages)
63
69
  $scope.parentPages = $scope.exceptCurrentPage($scope.parentPages)
64
70
  $scope.page.slug = "index" if $scope.pages.length == 0
71
+ if $scope.parentPages.length > 0 and $scope.page and !$scope.page.parent_id
72
+ $scope.page.parent_id = $scope.parentPages[0].id
65
73
 
66
74
 
67
75
  $scope.create = ->
@@ -93,4 +101,4 @@ PagesController = ($scope, $state, $cookieStore, Restangular, $stateParams, Aler
93
101
  }
94
102
 
95
103
  angular.module('KMS')
96
- .controller('PagesController', ['$scope', '$state', '$cookieStore', 'Restangular', '$stateParams', 'Alertify', 'ErrorsService', PagesController])
104
+ .controller('PagesController', ['$scope', '$state', '$cookieStore', 'Restangular', '$stateParams', 'Alertify', 'ErrorsService', 'TransliterationService', PagesController])
@@ -3,6 +3,9 @@ SnippetsController = ($scope, $state, Restangular, $stateParams, Alertify, Error
3
3
  lineNumbers: true
4
4
  mode:'htmlmixed'
5
5
  autoCloseTags: true
6
+ matchBrackets: true
7
+ autoCloseBrackets: true
8
+ styleActiveLine: true
6
9
  matchTags:
7
10
  bothTags: true
8
11
  extraKeys:
@@ -3,6 +3,9 @@ TemplatesController = ($scope, $state, $cookieStore, Restangular, $stateParams,
3
3
  lineNumbers: true
4
4
  mode:'htmlmixed'
5
5
  autoCloseTags: true
6
+ matchBrackets: true
7
+ autoCloseBrackets: true
8
+ styleActiveLine: true
6
9
  matchTags:
7
10
  bothTags: true
8
11
  extraKeys:
@@ -1,4 +1,4 @@
1
- UsersController = ($scope, $state, $cookieStore, Restangular, $stateParams) ->
1
+ UsersController = ($scope, $state, $cookieStore, Restangular, $stateParams, Alertify, ErrorsService) ->
2
2
  $scope.store = Restangular.all('users')
3
3
  $scope.store.getList().then (users)->
4
4
  $scope.users = users
@@ -12,8 +12,8 @@ UsersController = ($scope, $state, $cookieStore, Restangular, $stateParams) ->
12
12
  $scope.create = ->
13
13
  $scope.store.customPOST($scope.user, 'from_kms').then ->
14
14
  $state.go('users')
15
- ,->
16
- console.log('bug')
15
+ , (response)->
16
+ Alertify.error(ErrorsService.prepareErrorsString(response.data.errors))
17
17
 
18
18
  #$scope.update = ->
19
19
  #$scope.user.put().then ->
@@ -28,4 +28,4 @@ UsersController = ($scope, $state, $cookieStore, Restangular, $stateParams) ->
28
28
 
29
29
 
30
30
  angular.module('KMS')
31
- .controller('UsersController', ['$scope', '$state', '$cookieStore', 'Restangular', '$stateParams', UsersController])
31
+ .controller('UsersController', ['$scope', '$state', '$cookieStore', 'Restangular', '$stateParams', 'Alertify', 'ErrorsService', UsersController])
@@ -12,7 +12,7 @@ angular.module('KMS').config ['$stateProvider', '$urlRouterProvider', ($statePro
12
12
  url: '/kms/help',
13
13
  views:
14
14
  "header":
15
- template: "<%= I18n.t(:help) %>"
15
+ template: "<%= I18n.t(:documentation) %>"
16
16
  "@":
17
17
  controller: 'HelpController',
18
18
  controllerAs: 'help',
@@ -0,0 +1,160 @@
1
+ /* jshint -W100 */
2
+ /**
3
+ * @name translit.js
4
+ * @author XGuest <xguest@list.ru>
5
+ * @link https://github.com/xguest/iso_9_js
6
+ * @version 1.0.4
7
+ * @copyright GPL applies.
8
+ * No warranties XGuest[28.03.2016/07:59:18] translit [ver.1.0.4]
9
+ * #guid {E7088033-479F-47EF-A573-BBF3520F493C}
10
+ *
11
+ * @description Прямая и обратная транслитерация
12
+ * Соответствует ISO 9:1995 и ГОСТ 7.79-2000 системы А и Б
13
+ *
14
+ * @param {String} str транслитерируемая строка
15
+ * @param {Number} typ ± направление (тип) транслитерации
16
+ * + прямая с латиницы в кириллицу
17
+ * - обратная
18
+ * system A = 1-диакритика;
19
+ * system B = 2-Беларусь;3-Болгария;4-Македония;5-Россия;6-Украина;
20
+ * @example
21
+ * function example() {
22
+ * var a, b = [
23
+ * [],
24
+ * ["Диакритика", "Съешь ещё этих мягких французских булок, да выпей же чаю!"],
25
+ * ["Беларускую", "З'ясі яшчэ гэтых мяккіх французскіх булак, ды выпі ж чаю!"],
26
+ * ["Български", "Яжте повече от тези меки кифлички, но също така се пие чай!"],
27
+ * ["Македонски", "Јадат повеќе од овие меки францускиот ролни, па пијат чај!"],
28
+ * ["Русский", "Съешь ещё этих мягких французских булок, да выпей же чаю!"],
29
+ * ["Українська", "З'їж ще цих м'яких французьких булок, та випий же чаю!"]
30
+ * ], c, d;
31
+ * for(a = 1; a < b.length - 1; a++) {
32
+ * c = b[a][0]; // Language
33
+ * d = b[a][1]; // Source
34
+ * e = translit(d, a); // Forward
35
+ * console.log(
36
+ * "%s - %s\nSource : %s\nTranslit: %s\nReverse : %s\n",
37
+ * c, // Language
38
+ * translit(c, a), // Transliterated language
39
+ * d, // Source
40
+ * e, // Forward
41
+ * translit(e, -1 * a) // Reverse
42
+ * );
43
+ * }
44
+ * };
45
+ **/
46
+ angular.module('KMS').factory('TransliterationService', function() {
47
+ return {
48
+ translit: function(str, typ) {
49
+ var func = (function(typ) {
50
+ /** Function Expression
51
+ * Вспомогательная функция.
52
+ *
53
+ * FINISHED TESTED!
54
+ * В ней и хотелось навести порядок.
55
+ *
56
+ * Проверяет направление транслитерации.
57
+ * Возвращает массив из 2 функций:
58
+ * построения таблиц транслитерации.
59
+ * и пост-обработки строки (правила из ГОСТ).
60
+ *
61
+ * @param {Number} typ
62
+ * @return {Array} Массив функций пред и пост обработки.
63
+ **/
64
+ function prep (a) {
65
+ var write = !a ? function(chr, row) {trantab[row] = chr;regarr.push(row);} :
66
+ function(row, chr) {trantab[row] = chr;regarr.push(row);};
67
+ return function(col, row) { // создаем таблицу и RegExp
68
+ var chr = col[abs] || col[0]; // Символ
69
+ if (chr) write(chr, row); // Если символ есть
70
+ }
71
+ }
72
+ var abs = Math.abs(typ); // Абсолютное значение транслитерации
73
+ if (typ === abs) { // Прямая транслитерация в латиницу
74
+ str = str.replace(/(i(?=.[^аеиоуъ\s]+))/ig, '$1`'); // "i`" ГОСТ ст. рус. и болг.
75
+ return [prep(), // Возвращаем массив функций
76
+ function(str) { // str - транслируемая строка.
77
+ return str.replace(/i``/ig, 'i`'). // "i`" в ГОСТ ст. рус. и болг.
78
+ replace(/((c)z)(?=[ieyj])/ig, '$1'); // "cz" в символ "c"
79
+ }];
80
+ } else { // Обратная транслитерация в кириллицу
81
+ str = str.replace(/(c)(?=[ieyj])/ig, '$1z'); // Правило сочетания "cz"
82
+ return [prep(1),function(str) {return str;}];// nop - пустая функция.
83
+ }
84
+ }(typ));
85
+ var iso9 = { // Объект описания стандарта
86
+ // Имя - кириллица
87
+ // 0 - общие для всех
88
+ // 1 - диакритика 4 - MK|MKD - Македония
89
+ // 2 - BY|BLR - Беларусь 5 - RU|RUS - Россия
90
+ // 3 - BG|BGR - Болгария 6 - UA|UKR - Украина
91
+ /*-Имя---------0-,-------1-,---2-,---3-,---4-,----5-,---6-*/
92
+ '\u0449': [ '', '\u015D', '','sth', '', 'shh','shh'], // 'щ'
93
+ '\u044F': [ '', '\u00E2', 'ya', 'ya', '', 'ya', 'ya'], // 'я'
94
+ '\u0454': [ '', '\u00EA', '', '', '', '', 'ye'], // 'є'
95
+ '\u0463': [ '', '\u011B', '', 'ye', '', 'ye', ''], // ять
96
+ '\u0456': [ '', '\u00EC', 'i', 'i`', '', 'i`', 'i'], // 'і' йота
97
+ '\u0457': [ '', '\u00EF', '', '', '', '', 'yi'], // 'ї'
98
+ '\u0451': [ '', '\u00EB', 'yo', '', '', 'yo', ''], // 'ё'
99
+ '\u044E': [ '', '\u00FB', 'yu', 'yu', '', 'yu', 'yu'], // 'ю'
100
+ '\u0436': [ 'zh','\u017E'], // 'ж'
101
+ '\u0447': [ 'ch','\u010D'], // 'ч'
102
+ '\u0448': [ 'sh', '\u0161', '', '', '', '', ''], // 'ш'
103
+ '\u0473': [ '','f\u0300', '', 'fh', '', 'fh', ''], // фита
104
+ '\u045F': [ '','d\u0302', '', '', 'dh', '', ''], // 'џ'
105
+ '\u0491': [ '','g\u0300', '', '', '', '', 'g`'], // 'ґ'
106
+ '\u0453': [ '', '\u01F5', '', '', 'g`', '', ''], // 'ѓ'
107
+ '\u0455': [ '', '\u1E91', '', '', 'z`', '', ''], // 'ѕ'
108
+ '\u045C': [ '', '\u1E31', '', '', 'k`', '', ''], // 'ќ'
109
+ '\u0459': [ '','l\u0302', '', '', 'l`', '', ''], // 'љ'
110
+ '\u045A': [ '','n\u0302', '', '', 'n`', '', ''], // 'њ'
111
+ '\u044D': [ '', '\u00E8', 'e`', '', '', 'e`', ''], // 'э'
112
+ '\u044A': [ '', '\u02BA', '', 'a`', '', '``', ''], // 'ъ'
113
+ '\u044B': [ '', 'y', 'y`', '', '', 'y`', ''], // 'ы'
114
+ '\u045E': [ '', '\u01D4', 'u`', '', '', '', ''], // 'ў'
115
+ '\u046B': [ '', '\u01CE', '', 'o`', '', '', ''], // юс
116
+ '\u0475': [ '', '\u1EF3', '', 'yh', '', 'yh', ''], // ижица
117
+ '\u0446': [ 'cz', 'c'], // 'ц'
118
+ '\u0430': [ 'a'], // 'а'
119
+ '\u0431': [ 'b'], // 'б'
120
+ '\u0432': [ 'v'], // 'в'
121
+ '\u0433': [ 'g'], // 'г'
122
+ '\u0434': [ 'd'], // 'д'
123
+ '\u0435': [ 'e'], // 'е'
124
+ '\u0437': [ 'z'], // 'з'
125
+ '\u0438': [ '', 'i', '', 'i', 'i', 'i', 'y`'], // 'и'
126
+ '\u0439': [ '', 'j', 'j', 'j', '', 'j', 'j'], // 'й'
127
+ '\u043A': [ 'k'], // 'к'
128
+ '\u043B': [ 'l'], // 'л'
129
+ '\u043C': [ 'm'], // 'м'
130
+ '\u043D': [ 'n'], // 'н'
131
+ '\u043E': [ 'o'], // 'о'
132
+ '\u043F': [ 'p'], // 'п'
133
+ '\u0440': [ 'r'], // 'р'
134
+ '\u0441': [ 's'], // 'с'
135
+ '\u0442': [ 't'], // 'т'
136
+ '\u0443': [ 'u'], // 'у'
137
+ '\u0444': [ 'f'], // 'ф'
138
+ '\u0445': [ 'x', 'h'], // 'х'
139
+ '\u044C': [ '', '\u02B9', '`', '`', '', '`', '`'], // 'ь'
140
+ '\u0458': [ '','j\u030C', '', '', 'j', '', ''], // 'ј'
141
+ '\u2019': [ '\'','\u02BC'], // '’'
142
+ '\u2116': [ '#'] // '№'
143
+ /*-Имя---------0-,-------1-,---2-,---3-,---4-,----5-,---6-*/
144
+ }, regarr = [], trantab = {};
145
+ /* jshint -W030 */ // Создание таблицы и массива RegExp
146
+ for (var row in iso9) {if (Object.hasOwnProperty.call(iso9, row)) {func[0](iso9[row], row);}}
147
+ /* jshint +W030 */
148
+ return func[1]( // функция пост-обработки строки (правила и т.д.)
149
+ str.replace( // Транслитерация
150
+ new RegExp(regarr.join('|'), 'gi'),// Создаем RegExp из массива
151
+ function(R) { // CallBack Функция RegExp
152
+ if (R.toLowerCase() === R) { // Обработка строки с учетом регистра
153
+ return trantab[R];
154
+ } else {
155
+ return trantab[R.toLowerCase()].toUpperCase();
156
+ }
157
+ }));
158
+ }
159
+ };
160
+ });
@@ -1,9 +1,31 @@
1
1
  .row
2
- .col-lg-12
2
+ .col-lg-12 ng-if="asset.performing_plain_text"
3
3
  form role="form"
4
4
  .form-group
5
5
  small = I18n.t(:toggle_fullscreen_mode_instruction)
6
- textarea#text.form-control ng-if="asset.performing_plain_text" ng-model="asset.text" rows="40" ui-codemirror="editorOptions(asset)"
6
+ textarea#text.form-control ng-model="asset.text" rows="40" ui-codemirror="editorOptions(asset)"
7
7
  .btn-group
8
8
  button.btn.btn-default type="submit" data-redirect="true" ng-click="update($event)" = I18n.t(:update_asset)
9
9
  button.btn.btn-default type="submit" ng-click="update($event)" = I18n.t(:update_asset_and_continue)
10
+ .center-block ng-unless="asset.performing_plain_text" flow-init="{headers: setHeaders, singleFile: true, uploadMethod: 'PUT', target: updateTarget, initFileFn: initFlowFile}" flow-files-submitted="$flow.upload()" flow-file-success="$file.msg = $message" flow-complete="$state.go('assets')" flow-drop=""
11
+ .jumbotron.vertical-center.text-center
12
+ .container
13
+ h1
14
+ span.fa-stack.fa-lg
15
+ i.fa.fa-circle.fa-stack-2x
16
+ i.fa.fa-image.fa-stack-1x
17
+ p
18
+ | {{ asset.filename }}
19
+ p
20
+ button.btn.btn-primary.btn-lg flow-btn="" = I18n.t(:update_asset)
21
+ table.table.table-striped.files.ng-cloak
22
+ tr ng-repeat="file in $flow.files"
23
+ td style="width: 10%"
24
+ img flow-img="file" width="50" height="50" ng-show="isImageType(file)"
25
+ td style="width: 50%"
26
+ | {{ file.name }}
27
+ td style="width: 40%"
28
+ .progress.progress-striped ng-class="{active: file.isUploading()}"
29
+ .progress-bar role="progressbar" ng-style="{width: (file.progress() * 100) + '%'}"
30
+ /td
31
+ /| {{ file.msg }}
@@ -0,0 +1,23 @@
1
+ .center-block flow-init="{headers: setHeaders}" flow-files-submitted="$flow.upload()" flow-file-success="$file.msg = $message" flow-complete="$state.go('assets')" flow-drop=""
2
+ .jumbotron.vertical-center.text-center
3
+ .container
4
+ h1
5
+ span.fa-stack.fa-lg
6
+ i.fa.fa-circle.fa-stack-2x
7
+ i.fa.fa-image.fa-stack-1x
8
+ p = I18n.t(:assets_description)
9
+ p
10
+ button.btn.btn-primary.btn-lg flow-btn="" = I18n.t(:upload_assets)
11
+ p
12
+ h4 = I18n.t(:assets_drop_description)
13
+ table.table.table-striped.files.ng-cloak
14
+ tr ng-repeat="file in $flow.files"
15
+ td style="width: 10%"
16
+ img flow-img="file" width="50" height="50" ng-show="isImageType(file)"
17
+ td style="width: 50%"
18
+ | {{ file.name }}
19
+ td style="width: 40%"
20
+ .progress.progress-striped ng-class="{active: file.isUploading()}"
21
+ .progress-bar role="progressbar" ng-style="{width: (file.progress() * 100) + '%'}"
22
+ /td
23
+ /| {{ file.msg }}
@@ -1,9 +1,7 @@
1
- .row
1
+ .row ng-show="assetsArray.length"
2
2
  .col-lg-12
3
3
  .widget.assets-block
4
4
  .widget-header
5
- /i.fa.fa-image
6
- /= Kms::Asset.model_name.human(count: 1.1)
7
5
  tabset
8
6
  tab
9
7
  tab-heading
@@ -14,11 +12,12 @@
14
12
  tbody
15
13
  tr ng-repeat="asset in assets.images"
16
14
  td style="width: 10%"
17
- img.img-responsive ng-src="{{ asset.file.url }}"
15
+ img.img-responsive ng-src="{{ asset.url }}"
18
16
  td style="width: 40%"
19
- | {{ asset.filename }}
17
+ a ui-sref="assets.edit({id: asset.id})"
18
+ | {{ asset.filename }}
20
19
  td style="width: 40%"
21
- | {{asset.file.url}}
20
+ | {{asset.url}}
22
21
  td
23
22
  .btn-group.pull-right
24
23
  a.btn.btn-sm.btn-danger ng-click="destroy(asset)"
@@ -35,7 +34,7 @@
35
34
  a ui-sref="assets.edit({id: asset.id})"
36
35
  | {{ asset.filename }}
37
36
  td style="width: 40%"
38
- | {{asset.file.url}}
37
+ | {{asset.url}}
39
38
  td
40
39
  .btn-group.pull-right
41
40
  a.btn.btn-sm.btn-danger ng-click="destroy(asset)"
@@ -52,7 +51,7 @@
52
51
  a ui-sref="assets.edit({id: asset.id})"
53
52
  | {{ asset.filename }}
54
53
  td style="width: 40%"
55
- | {{asset.file.url}}
54
+ | {{asset.url}}
56
55
  td
57
56
  .btn-group.pull-right
58
57
  a.btn.btn-sm.btn-danger ng-click="destroy(asset)"
@@ -66,9 +65,10 @@
66
65
  tbody
67
66
  tr ng-repeat="asset in assets.fonts"
68
67
  td style="width: 40%"
69
- | {{ asset.filename }}
68
+ a ui-sref="assets.edit({id: asset.id})"
69
+ | {{ asset.filename }}
70
70
  td style="width: 40%"
71
- | {{asset.file.url}}
71
+ | {{asset.url}}
72
72
  td
73
73
  .btn-group.pull-right
74
74
  a.btn.btn-sm.btn-danger ng-click="destroy(asset)"
@@ -82,9 +82,10 @@
82
82
  tbody
83
83
  tr ng-repeat="asset in assets.other"
84
84
  td style="width: 40%"
85
- | {{ asset.filename }}
85
+ a ui-sref="assets.edit({id: asset.id})"
86
+ | {{ asset.filename }}
86
87
  td style="width: 40%"
87
- | {{asset.file.url}}
88
+ | {{asset.url}}
88
89
  td
89
90
  .btn-group.pull-right
90
91
  a.btn.btn-sm.btn-danger ng-click="destroy(asset)"