motorefi-lit 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (347) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +170 -0
  4. data/Rakefile +38 -0
  5. data/app/assets/images/lit/famfamfam_flags/ad.png +0 -0
  6. data/app/assets/images/lit/famfamfam_flags/ae.png +0 -0
  7. data/app/assets/images/lit/famfamfam_flags/af.png +0 -0
  8. data/app/assets/images/lit/famfamfam_flags/ag.png +0 -0
  9. data/app/assets/images/lit/famfamfam_flags/ai.png +0 -0
  10. data/app/assets/images/lit/famfamfam_flags/al.png +0 -0
  11. data/app/assets/images/lit/famfamfam_flags/am.png +0 -0
  12. data/app/assets/images/lit/famfamfam_flags/an.png +0 -0
  13. data/app/assets/images/lit/famfamfam_flags/ao.png +0 -0
  14. data/app/assets/images/lit/famfamfam_flags/ar.png +0 -0
  15. data/app/assets/images/lit/famfamfam_flags/as.png +0 -0
  16. data/app/assets/images/lit/famfamfam_flags/at.png +0 -0
  17. data/app/assets/images/lit/famfamfam_flags/au.png +0 -0
  18. data/app/assets/images/lit/famfamfam_flags/aw.png +0 -0
  19. data/app/assets/images/lit/famfamfam_flags/ax.png +0 -0
  20. data/app/assets/images/lit/famfamfam_flags/az.png +0 -0
  21. data/app/assets/images/lit/famfamfam_flags/ba.png +0 -0
  22. data/app/assets/images/lit/famfamfam_flags/bb.png +0 -0
  23. data/app/assets/images/lit/famfamfam_flags/bd.png +0 -0
  24. data/app/assets/images/lit/famfamfam_flags/be.png +0 -0
  25. data/app/assets/images/lit/famfamfam_flags/bf.png +0 -0
  26. data/app/assets/images/lit/famfamfam_flags/bg.png +0 -0
  27. data/app/assets/images/lit/famfamfam_flags/bh.png +0 -0
  28. data/app/assets/images/lit/famfamfam_flags/bi.png +0 -0
  29. data/app/assets/images/lit/famfamfam_flags/bj.png +0 -0
  30. data/app/assets/images/lit/famfamfam_flags/bm.png +0 -0
  31. data/app/assets/images/lit/famfamfam_flags/bn.png +0 -0
  32. data/app/assets/images/lit/famfamfam_flags/bo.png +0 -0
  33. data/app/assets/images/lit/famfamfam_flags/br.png +0 -0
  34. data/app/assets/images/lit/famfamfam_flags/bs.png +0 -0
  35. data/app/assets/images/lit/famfamfam_flags/bt.png +0 -0
  36. data/app/assets/images/lit/famfamfam_flags/bv.png +0 -0
  37. data/app/assets/images/lit/famfamfam_flags/bw.png +0 -0
  38. data/app/assets/images/lit/famfamfam_flags/by.png +0 -0
  39. data/app/assets/images/lit/famfamfam_flags/bz.png +0 -0
  40. data/app/assets/images/lit/famfamfam_flags/ca.png +0 -0
  41. data/app/assets/images/lit/famfamfam_flags/catalonia.png +0 -0
  42. data/app/assets/images/lit/famfamfam_flags/cc.png +0 -0
  43. data/app/assets/images/lit/famfamfam_flags/cd.png +0 -0
  44. data/app/assets/images/lit/famfamfam_flags/cf.png +0 -0
  45. data/app/assets/images/lit/famfamfam_flags/cg.png +0 -0
  46. data/app/assets/images/lit/famfamfam_flags/ch.png +0 -0
  47. data/app/assets/images/lit/famfamfam_flags/ci.png +0 -0
  48. data/app/assets/images/lit/famfamfam_flags/ck.png +0 -0
  49. data/app/assets/images/lit/famfamfam_flags/cl.png +0 -0
  50. data/app/assets/images/lit/famfamfam_flags/cm.png +0 -0
  51. data/app/assets/images/lit/famfamfam_flags/cn.png +0 -0
  52. data/app/assets/images/lit/famfamfam_flags/co.png +0 -0
  53. data/app/assets/images/lit/famfamfam_flags/cr.png +0 -0
  54. data/app/assets/images/lit/famfamfam_flags/cs.png +0 -0
  55. data/app/assets/images/lit/famfamfam_flags/cu.png +0 -0
  56. data/app/assets/images/lit/famfamfam_flags/cv.png +0 -0
  57. data/app/assets/images/lit/famfamfam_flags/cx.png +0 -0
  58. data/app/assets/images/lit/famfamfam_flags/cy.png +0 -0
  59. data/app/assets/images/lit/famfamfam_flags/cz.png +0 -0
  60. data/app/assets/images/lit/famfamfam_flags/da.png +0 -0
  61. data/app/assets/images/lit/famfamfam_flags/de.png +0 -0
  62. data/app/assets/images/lit/famfamfam_flags/dj.png +0 -0
  63. data/app/assets/images/lit/famfamfam_flags/dk.png +0 -0
  64. data/app/assets/images/lit/famfamfam_flags/dm.png +0 -0
  65. data/app/assets/images/lit/famfamfam_flags/do.png +0 -0
  66. data/app/assets/images/lit/famfamfam_flags/dz.png +0 -0
  67. data/app/assets/images/lit/famfamfam_flags/ec.png +0 -0
  68. data/app/assets/images/lit/famfamfam_flags/ee.png +0 -0
  69. data/app/assets/images/lit/famfamfam_flags/eg.png +0 -0
  70. data/app/assets/images/lit/famfamfam_flags/eh.png +0 -0
  71. data/app/assets/images/lit/famfamfam_flags/en.png +0 -0
  72. data/app/assets/images/lit/famfamfam_flags/england.png +0 -0
  73. data/app/assets/images/lit/famfamfam_flags/er.png +0 -0
  74. data/app/assets/images/lit/famfamfam_flags/es.png +0 -0
  75. data/app/assets/images/lit/famfamfam_flags/et.png +0 -0
  76. data/app/assets/images/lit/famfamfam_flags/europeanunion.png +0 -0
  77. data/app/assets/images/lit/famfamfam_flags/fam.png +0 -0
  78. data/app/assets/images/lit/famfamfam_flags/fi.png +0 -0
  79. data/app/assets/images/lit/famfamfam_flags/fj.png +0 -0
  80. data/app/assets/images/lit/famfamfam_flags/fk.png +0 -0
  81. data/app/assets/images/lit/famfamfam_flags/fm.png +0 -0
  82. data/app/assets/images/lit/famfamfam_flags/fo.png +0 -0
  83. data/app/assets/images/lit/famfamfam_flags/fr.png +0 -0
  84. data/app/assets/images/lit/famfamfam_flags/ga.png +0 -0
  85. data/app/assets/images/lit/famfamfam_flags/gb.png +0 -0
  86. data/app/assets/images/lit/famfamfam_flags/gd.png +0 -0
  87. data/app/assets/images/lit/famfamfam_flags/ge.png +0 -0
  88. data/app/assets/images/lit/famfamfam_flags/gf.png +0 -0
  89. data/app/assets/images/lit/famfamfam_flags/gh.png +0 -0
  90. data/app/assets/images/lit/famfamfam_flags/gi.png +0 -0
  91. data/app/assets/images/lit/famfamfam_flags/gl.png +0 -0
  92. data/app/assets/images/lit/famfamfam_flags/gm.png +0 -0
  93. data/app/assets/images/lit/famfamfam_flags/gn.png +0 -0
  94. data/app/assets/images/lit/famfamfam_flags/gp.png +0 -0
  95. data/app/assets/images/lit/famfamfam_flags/gq.png +0 -0
  96. data/app/assets/images/lit/famfamfam_flags/gr.png +0 -0
  97. data/app/assets/images/lit/famfamfam_flags/gs.png +0 -0
  98. data/app/assets/images/lit/famfamfam_flags/gt.png +0 -0
  99. data/app/assets/images/lit/famfamfam_flags/gu.png +0 -0
  100. data/app/assets/images/lit/famfamfam_flags/gw.png +0 -0
  101. data/app/assets/images/lit/famfamfam_flags/gy.png +0 -0
  102. data/app/assets/images/lit/famfamfam_flags/hk.png +0 -0
  103. data/app/assets/images/lit/famfamfam_flags/hm.png +0 -0
  104. data/app/assets/images/lit/famfamfam_flags/hn.png +0 -0
  105. data/app/assets/images/lit/famfamfam_flags/hr.png +0 -0
  106. data/app/assets/images/lit/famfamfam_flags/ht.png +0 -0
  107. data/app/assets/images/lit/famfamfam_flags/hu.png +0 -0
  108. data/app/assets/images/lit/famfamfam_flags/id.png +0 -0
  109. data/app/assets/images/lit/famfamfam_flags/ie.png +0 -0
  110. data/app/assets/images/lit/famfamfam_flags/il.png +0 -0
  111. data/app/assets/images/lit/famfamfam_flags/in.png +0 -0
  112. data/app/assets/images/lit/famfamfam_flags/io.png +0 -0
  113. data/app/assets/images/lit/famfamfam_flags/iq.png +0 -0
  114. data/app/assets/images/lit/famfamfam_flags/ir.png +0 -0
  115. data/app/assets/images/lit/famfamfam_flags/is.png +0 -0
  116. data/app/assets/images/lit/famfamfam_flags/it.png +0 -0
  117. data/app/assets/images/lit/famfamfam_flags/ja.png +0 -0
  118. data/app/assets/images/lit/famfamfam_flags/jm.png +0 -0
  119. data/app/assets/images/lit/famfamfam_flags/jo.png +0 -0
  120. data/app/assets/images/lit/famfamfam_flags/jp.png +0 -0
  121. data/app/assets/images/lit/famfamfam_flags/ke.png +0 -0
  122. data/app/assets/images/lit/famfamfam_flags/kg.png +0 -0
  123. data/app/assets/images/lit/famfamfam_flags/kh.png +0 -0
  124. data/app/assets/images/lit/famfamfam_flags/ki.png +0 -0
  125. data/app/assets/images/lit/famfamfam_flags/km.png +0 -0
  126. data/app/assets/images/lit/famfamfam_flags/kn.png +0 -0
  127. data/app/assets/images/lit/famfamfam_flags/kp.png +0 -0
  128. data/app/assets/images/lit/famfamfam_flags/kr.png +0 -0
  129. data/app/assets/images/lit/famfamfam_flags/kw.png +0 -0
  130. data/app/assets/images/lit/famfamfam_flags/ky.png +0 -0
  131. data/app/assets/images/lit/famfamfam_flags/kz.png +0 -0
  132. data/app/assets/images/lit/famfamfam_flags/la.png +0 -0
  133. data/app/assets/images/lit/famfamfam_flags/lb.png +0 -0
  134. data/app/assets/images/lit/famfamfam_flags/lc.png +0 -0
  135. data/app/assets/images/lit/famfamfam_flags/li.png +0 -0
  136. data/app/assets/images/lit/famfamfam_flags/lk.png +0 -0
  137. data/app/assets/images/lit/famfamfam_flags/lr.png +0 -0
  138. data/app/assets/images/lit/famfamfam_flags/ls.png +0 -0
  139. data/app/assets/images/lit/famfamfam_flags/lt.png +0 -0
  140. data/app/assets/images/lit/famfamfam_flags/lu.png +0 -0
  141. data/app/assets/images/lit/famfamfam_flags/lv.png +0 -0
  142. data/app/assets/images/lit/famfamfam_flags/ly.png +0 -0
  143. data/app/assets/images/lit/famfamfam_flags/ma.png +0 -0
  144. data/app/assets/images/lit/famfamfam_flags/mc.png +0 -0
  145. data/app/assets/images/lit/famfamfam_flags/md.png +0 -0
  146. data/app/assets/images/lit/famfamfam_flags/me.png +0 -0
  147. data/app/assets/images/lit/famfamfam_flags/mg.png +0 -0
  148. data/app/assets/images/lit/famfamfam_flags/mh.png +0 -0
  149. data/app/assets/images/lit/famfamfam_flags/mk.png +0 -0
  150. data/app/assets/images/lit/famfamfam_flags/ml.png +0 -0
  151. data/app/assets/images/lit/famfamfam_flags/mm.png +0 -0
  152. data/app/assets/images/lit/famfamfam_flags/mn.png +0 -0
  153. data/app/assets/images/lit/famfamfam_flags/mo.png +0 -0
  154. data/app/assets/images/lit/famfamfam_flags/mp.png +0 -0
  155. data/app/assets/images/lit/famfamfam_flags/mq.png +0 -0
  156. data/app/assets/images/lit/famfamfam_flags/mr.png +0 -0
  157. data/app/assets/images/lit/famfamfam_flags/ms.png +0 -0
  158. data/app/assets/images/lit/famfamfam_flags/mt.png +0 -0
  159. data/app/assets/images/lit/famfamfam_flags/mu.png +0 -0
  160. data/app/assets/images/lit/famfamfam_flags/mv.png +0 -0
  161. data/app/assets/images/lit/famfamfam_flags/mw.png +0 -0
  162. data/app/assets/images/lit/famfamfam_flags/mx.png +0 -0
  163. data/app/assets/images/lit/famfamfam_flags/my.png +0 -0
  164. data/app/assets/images/lit/famfamfam_flags/mz.png +0 -0
  165. data/app/assets/images/lit/famfamfam_flags/na.png +0 -0
  166. data/app/assets/images/lit/famfamfam_flags/nc.png +0 -0
  167. data/app/assets/images/lit/famfamfam_flags/ne.png +0 -0
  168. data/app/assets/images/lit/famfamfam_flags/nf.png +0 -0
  169. data/app/assets/images/lit/famfamfam_flags/ng.png +0 -0
  170. data/app/assets/images/lit/famfamfam_flags/ni.png +0 -0
  171. data/app/assets/images/lit/famfamfam_flags/nl.png +0 -0
  172. data/app/assets/images/lit/famfamfam_flags/no.png +0 -0
  173. data/app/assets/images/lit/famfamfam_flags/np.png +0 -0
  174. data/app/assets/images/lit/famfamfam_flags/nr.png +0 -0
  175. data/app/assets/images/lit/famfamfam_flags/nu.png +0 -0
  176. data/app/assets/images/lit/famfamfam_flags/nz.png +0 -0
  177. data/app/assets/images/lit/famfamfam_flags/om.png +0 -0
  178. data/app/assets/images/lit/famfamfam_flags/pa.png +0 -0
  179. data/app/assets/images/lit/famfamfam_flags/pe.png +0 -0
  180. data/app/assets/images/lit/famfamfam_flags/pf.png +0 -0
  181. data/app/assets/images/lit/famfamfam_flags/pg.png +0 -0
  182. data/app/assets/images/lit/famfamfam_flags/ph.png +0 -0
  183. data/app/assets/images/lit/famfamfam_flags/pk.png +0 -0
  184. data/app/assets/images/lit/famfamfam_flags/pl.png +0 -0
  185. data/app/assets/images/lit/famfamfam_flags/pm.png +0 -0
  186. data/app/assets/images/lit/famfamfam_flags/pn.png +0 -0
  187. data/app/assets/images/lit/famfamfam_flags/pr.png +0 -0
  188. data/app/assets/images/lit/famfamfam_flags/ps.png +0 -0
  189. data/app/assets/images/lit/famfamfam_flags/pt.png +0 -0
  190. data/app/assets/images/lit/famfamfam_flags/pw.png +0 -0
  191. data/app/assets/images/lit/famfamfam_flags/py.png +0 -0
  192. data/app/assets/images/lit/famfamfam_flags/qa.png +0 -0
  193. data/app/assets/images/lit/famfamfam_flags/re.png +0 -0
  194. data/app/assets/images/lit/famfamfam_flags/ro.png +0 -0
  195. data/app/assets/images/lit/famfamfam_flags/rs.png +0 -0
  196. data/app/assets/images/lit/famfamfam_flags/ru.png +0 -0
  197. data/app/assets/images/lit/famfamfam_flags/rw.png +0 -0
  198. data/app/assets/images/lit/famfamfam_flags/sa.png +0 -0
  199. data/app/assets/images/lit/famfamfam_flags/sb.png +0 -0
  200. data/app/assets/images/lit/famfamfam_flags/sc.png +0 -0
  201. data/app/assets/images/lit/famfamfam_flags/scotland.png +0 -0
  202. data/app/assets/images/lit/famfamfam_flags/sd.png +0 -0
  203. data/app/assets/images/lit/famfamfam_flags/se.png +0 -0
  204. data/app/assets/images/lit/famfamfam_flags/sg.png +0 -0
  205. data/app/assets/images/lit/famfamfam_flags/sh.png +0 -0
  206. data/app/assets/images/lit/famfamfam_flags/si.png +0 -0
  207. data/app/assets/images/lit/famfamfam_flags/sj.png +0 -0
  208. data/app/assets/images/lit/famfamfam_flags/sk.png +0 -0
  209. data/app/assets/images/lit/famfamfam_flags/sl.png +0 -0
  210. data/app/assets/images/lit/famfamfam_flags/sm.png +0 -0
  211. data/app/assets/images/lit/famfamfam_flags/sn.png +0 -0
  212. data/app/assets/images/lit/famfamfam_flags/so.png +0 -0
  213. data/app/assets/images/lit/famfamfam_flags/sr.png +0 -0
  214. data/app/assets/images/lit/famfamfam_flags/st.png +0 -0
  215. data/app/assets/images/lit/famfamfam_flags/sv.png +0 -0
  216. data/app/assets/images/lit/famfamfam_flags/sy.png +0 -0
  217. data/app/assets/images/lit/famfamfam_flags/sz.png +0 -0
  218. data/app/assets/images/lit/famfamfam_flags/tc.png +0 -0
  219. data/app/assets/images/lit/famfamfam_flags/td.png +0 -0
  220. data/app/assets/images/lit/famfamfam_flags/tf.png +0 -0
  221. data/app/assets/images/lit/famfamfam_flags/tg.png +0 -0
  222. data/app/assets/images/lit/famfamfam_flags/th.png +0 -0
  223. data/app/assets/images/lit/famfamfam_flags/tj.png +0 -0
  224. data/app/assets/images/lit/famfamfam_flags/tk.png +0 -0
  225. data/app/assets/images/lit/famfamfam_flags/tl.png +0 -0
  226. data/app/assets/images/lit/famfamfam_flags/tm.png +0 -0
  227. data/app/assets/images/lit/famfamfam_flags/tn.png +0 -0
  228. data/app/assets/images/lit/famfamfam_flags/to.png +0 -0
  229. data/app/assets/images/lit/famfamfam_flags/tr.png +0 -0
  230. data/app/assets/images/lit/famfamfam_flags/tt.png +0 -0
  231. data/app/assets/images/lit/famfamfam_flags/tv.png +0 -0
  232. data/app/assets/images/lit/famfamfam_flags/tw.png +0 -0
  233. data/app/assets/images/lit/famfamfam_flags/tz.png +0 -0
  234. data/app/assets/images/lit/famfamfam_flags/ua.png +0 -0
  235. data/app/assets/images/lit/famfamfam_flags/ug.png +0 -0
  236. data/app/assets/images/lit/famfamfam_flags/um.png +0 -0
  237. data/app/assets/images/lit/famfamfam_flags/us.png +0 -0
  238. data/app/assets/images/lit/famfamfam_flags/uy.png +0 -0
  239. data/app/assets/images/lit/famfamfam_flags/uz.png +0 -0
  240. data/app/assets/images/lit/famfamfam_flags/va.png +0 -0
  241. data/app/assets/images/lit/famfamfam_flags/vc.png +0 -0
  242. data/app/assets/images/lit/famfamfam_flags/ve.png +0 -0
  243. data/app/assets/images/lit/famfamfam_flags/vg.png +0 -0
  244. data/app/assets/images/lit/famfamfam_flags/vi.png +0 -0
  245. data/app/assets/images/lit/famfamfam_flags/vn.png +0 -0
  246. data/app/assets/images/lit/famfamfam_flags/vu.png +0 -0
  247. data/app/assets/images/lit/famfamfam_flags/wales.png +0 -0
  248. data/app/assets/images/lit/famfamfam_flags/wf.png +0 -0
  249. data/app/assets/images/lit/famfamfam_flags/ws.png +0 -0
  250. data/app/assets/images/lit/famfamfam_flags/ye.png +0 -0
  251. data/app/assets/images/lit/famfamfam_flags/yt.png +0 -0
  252. data/app/assets/images/lit/famfamfam_flags/za.png +0 -0
  253. data/app/assets/images/lit/famfamfam_flags/zm.png +0 -0
  254. data/app/assets/images/lit/famfamfam_flags/zw.png +0 -0
  255. data/app/assets/images/lit/jquery-te.png +0 -0
  256. data/app/assets/javascripts/lit/application.js +19 -0
  257. data/app/assets/javascripts/lit/backend/bootstrap.js.coffee +4 -0
  258. data/app/assets/javascripts/lit/backend/dashboard.js +2 -0
  259. data/app/assets/javascripts/lit/backend/jquery-te-1.4.0.min.js +9 -0
  260. data/app/assets/javascripts/lit/backend/localizations.js.coffee +26 -0
  261. data/app/assets/javascripts/lit/backend/sources.js.coffee +24 -0
  262. data/app/assets/javascripts/lit/lit_frontend.js +103 -0
  263. data/app/assets/javascripts/lit/mousetrap.js +1044 -0
  264. data/app/assets/stylesheets/lit/application.css +59 -0
  265. data/app/assets/stylesheets/lit/backend/jquery-te-1.4.0.css.scss +457 -0
  266. data/app/assets/stylesheets/lit/lit_frontend.css +86 -0
  267. data/app/controllers/lit/api/v1/base_controller.rb +19 -0
  268. data/app/controllers/lit/api/v1/locales_controller.rb +14 -0
  269. data/app/controllers/lit/api/v1/localization_keys_controller.rb +15 -0
  270. data/app/controllers/lit/api/v1/localizations_controller.rb +18 -0
  271. data/app/controllers/lit/application_controller.rb +49 -0
  272. data/app/controllers/lit/concerns/request_info_store.rb +16 -0
  273. data/app/controllers/lit/concerns/request_keys_store.rb +16 -0
  274. data/app/controllers/lit/dashboard_controller.rb +9 -0
  275. data/app/controllers/lit/incomming_localizations_controller.rb +49 -0
  276. data/app/controllers/lit/locales_controller.rb +31 -0
  277. data/app/controllers/lit/localization_keys_controller.rb +117 -0
  278. data/app/controllers/lit/localizations_controller.rb +60 -0
  279. data/app/controllers/lit/sources_controller.rb +77 -0
  280. data/app/helpers/lit/application_helper.rb +4 -0
  281. data/app/helpers/lit/dashboard_helper.rb +4 -0
  282. data/app/helpers/lit/frontend_helper.rb +71 -0
  283. data/app/helpers/lit/localization_keys_helper.rb +5 -0
  284. data/app/helpers/lit/localizations_helper.rb +15 -0
  285. data/app/helpers/lit/sources_helper.rb +7 -0
  286. data/app/jobs/lit/synchronize_source_job.rb +11 -0
  287. data/app/models/lit/incomming_localization.rb +77 -0
  288. data/app/models/lit/locale.rb +48 -0
  289. data/app/models/lit/localization.rb +103 -0
  290. data/app/models/lit/localization_key.rb +107 -0
  291. data/app/models/lit/localization_version.rb +12 -0
  292. data/app/models/lit/source.rb +111 -0
  293. data/app/views/kaminari/lit/_first_page.html.erb +5 -0
  294. data/app/views/kaminari/lit/_gap.html.erb +3 -0
  295. data/app/views/kaminari/lit/_last_page.html.erb +6 -0
  296. data/app/views/kaminari/lit/_next_page.html.erb +5 -0
  297. data/app/views/kaminari/lit/_page.html.erb +3 -0
  298. data/app/views/kaminari/lit/_paginator.html.erb +17 -0
  299. data/app/views/kaminari/lit/_prev_page.html.erb +5 -0
  300. data/app/views/layouts/lit/_messages.html.erb +6 -0
  301. data/app/views/layouts/lit/_navigation.html.erb +23 -0
  302. data/app/views/layouts/lit/application.html.erb +46 -0
  303. data/app/views/lit/dashboard/index.html.erb +5 -0
  304. data/app/views/lit/incomming_localizations/accept.js.erb +2 -0
  305. data/app/views/lit/incomming_localizations/destroy.js.erb +1 -0
  306. data/app/views/lit/incomming_localizations/index.html.erb +52 -0
  307. data/app/views/lit/locales/_hide_link.html.erb +1 -0
  308. data/app/views/lit/locales/hide.js.erb +1 -0
  309. data/app/views/lit/locales/index.html.erb +20 -0
  310. data/app/views/lit/localization_keys/_localization_row.html.erb +14 -0
  311. data/app/views/lit/localization_keys/destroy.js.erb +1 -0
  312. data/app/views/lit/localization_keys/index.html.erb +127 -0
  313. data/app/views/lit/localization_keys/star.js.erb +1 -0
  314. data/app/views/lit/localizations/_form.html.erb +23 -0
  315. data/app/views/lit/localizations/_previous_versions_rows.html.erb +15 -0
  316. data/app/views/lit/localizations/edit.js.erb +7 -0
  317. data/app/views/lit/localizations/previous_versions.js.erb +3 -0
  318. data/app/views/lit/localizations/update.js.erb +4 -0
  319. data/app/views/lit/sources/_form.html.erb +35 -0
  320. data/app/views/lit/sources/edit.html.erb +6 -0
  321. data/app/views/lit/sources/index.html.erb +42 -0
  322. data/app/views/lit/sources/new.html.erb +5 -0
  323. data/app/views/lit/sources/show.html.erb +19 -0
  324. data/config/routes.rb +49 -0
  325. data/db/migrate/20180101010101_lit_create_lit_locales.rb +16 -0
  326. data/db/migrate/20180101010102_lit_create_lit_localization_keys.rb +18 -0
  327. data/db/migrate/20180101010103_lit_create_lit_localizations.rb +24 -0
  328. data/db/migrate/20180101010104_lit_add_is_completed_and_is_starred_to_localization_keys.rb +17 -0
  329. data/db/migrate/20180101010105_lit_add_is_hidden_to_locales.rb +12 -0
  330. data/db/migrate/20180101010106_lit_create_lit_localization_versions.rb +20 -0
  331. data/db/migrate/20180101010107_lit_create_lit_sources.rb +19 -0
  332. data/db/migrate/20180101010108_lit_create_lit_incomming_localizations.rb +34 -0
  333. data/db/migrate/20180101010109_lit_add_sync_complete_to_lit_sources.rb +12 -0
  334. data/lib/generators/lit/install/templates/initializer.rb +52 -0
  335. data/lib/generators/lit/install_generator.rb +66 -0
  336. data/lib/lit.rb +65 -0
  337. data/lib/lit/adapters/hash_storage.rb +12 -0
  338. data/lib/lit/adapters/redis_storage.rb +99 -0
  339. data/lib/lit/cache.rb +356 -0
  340. data/lib/lit/engine.rb +28 -0
  341. data/lib/lit/i18n_backend.rb +192 -0
  342. data/lib/lit/loader.rb +16 -0
  343. data/lib/lit/rails.rb +17 -0
  344. data/lib/lit/railtie.rb +12 -0
  345. data/lib/lit/version.rb +3 -0
  346. data/lib/tasks/lit_tasks.rake +29 -0
  347. metadata +478 -0
@@ -0,0 +1,14 @@
1
+ <% if localization.is_a?(Array) %>
2
+ <ul>
3
+ <% localization.each do |l| %>
4
+ <li><%= l %></li>
5
+ <% end %>
6
+ </ul>
7
+ <% else %>
8
+ <% if localization.nil? %>
9
+ <em title="<%= I18n.t('.value_not_yet_translated', default: 'Value not yet translated') %>">null</em>
10
+ <% else %>
11
+ <%= localization %>
12
+ <% end %>
13
+ <% end %>
14
+
@@ -0,0 +1 @@
1
+ $('tr.localization_key_row[data-id="<%= @localization_key.id %>"]').fadeOut();
@@ -0,0 +1,127 @@
1
+ <h3><%= I18n.t('.header', default: 'Localization keys') %></h3>
2
+ <% available_locales = I18n.backend.available_locales %>
3
+
4
+ <table class="table">
5
+ <%- @localization_keys.each do |lk| %>
6
+ <tr class="localization_key_row" data-id="<%= lk.id %>">
7
+ <td>
8
+ <strong><%= lk.localization_key %></strong>
9
+ <span class="badge"><%= Lit.init.cache.get_global_hits_counter(lk.localization_key) %></span>
10
+ <div class="localization_keys_options">
11
+ <% if Lit.store_request_info %>
12
+ <%= link_to '#', class: 'request_info_link title', title: 'Show / hide request' do %>
13
+ <%= draw_icon 'link' %>
14
+ <% end %>
15
+ <% end %>
16
+ <%= link_to lit.star_localization_key_path(lk), remote: true, class: 'star_icon title', title: 'Star / unstar translation key' do %>
17
+ <%= draw_icon lk.is_starred? ? 'star' : 'star-o' %>
18
+ <% end %>
19
+ <%= link_to lit.localization_key_path(lk), method: :delete, data: {confirm: t('lit.common.you_sure', default: "Are you sure?")}, remote: true, title: 'Delete translation key', class: 'title' do %>
20
+ <%= draw_icon 'trash-o' %>
21
+ <% end %>
22
+ </div>
23
+ <div class="detail_wrapper">
24
+ <table class="table table-bordered table-striped">
25
+ <%- available_locales.each do |locale| %>
26
+ <%- localization = localization_for(locale, lk) %>
27
+ <tr>
28
+ <td class="localization_row" data-id="<%= localization.id%>" data-edit="<%= edit_localization_key_localization_path(lk, localization, format: :js) %>" data-editing=0 data-content="">
29
+ <%= render partial: 'localization_row', locals: {localization: Lit.init.cache["#{locale}.#{lk.localization_key}"]} %>
30
+ </td>
31
+ <td class="locale_row">
32
+ <%= image_tag "lit/famfamfam_flags/#{locale[0,2]}.png" %>
33
+ <%= locale %>
34
+ <% if localization %>
35
+ <%= link_to lit.previous_versions_localization_key_localization_path(lk, localization, format: :js), class: "show_prev_versions #{'hidden' unless has_versions?(localization)}", remote: true do %>
36
+ <%= draw_icon 'random', title: I18n.t('lit.common.previous_versions', default: 'Previous versions') %>
37
+ <% end %>
38
+ <% end %>
39
+ </td>
40
+ </tr>
41
+ <tr class="hidden localization_versions_row" data-id="<%= localization.id %>">
42
+ <td colspan="2" class="localization_versions"></td>
43
+ </tr>
44
+ <% end %>
45
+ <% if Lit.store_request_info %>
46
+ <tr class="hidden request_info_row">
47
+ <td colspan="2">
48
+ <strong>Translation key recently displayed on following pages:</strong>
49
+ <ul>
50
+ <% Lit.init.cache.get_request_info(lk.localization_key).split(' ').reverse.each do |l| %>
51
+ <li><%= link_to l, l %></li>
52
+ <% end %>
53
+ </ul>
54
+ <em>Note: you might not have access to those pages!</em>
55
+ </td>
56
+ </tr>
57
+ <% end %>
58
+ </table>
59
+ </div>
60
+ </td>
61
+ </tr>
62
+ <% end %>
63
+
64
+ </table>
65
+ <% if defined?(Kaminari) %>
66
+ <%= paginate @localization_keys, :theme=>"lit" %>
67
+ <% end %>
68
+
69
+
70
+ <% content_for(:sidebar) do %>
71
+ <div class="well">
72
+ <%= form_tag '', :class=>"form-search", :method=>:get do |f| %>
73
+ <% if @search_options.has_key?(:key_prefix) %>
74
+ <%= hidden_field_tag :key_prefix, @search_options[:key_prefix] %>
75
+ <% end %>
76
+ <div class="input-group">
77
+ <%= text_field_tag :key, @search_options[:key], :class=>"form-control search-query" %>
78
+ <div class="input-group-btn">
79
+ <button type="submit" class="btn btn-default"><%= draw_icon 'search' %></button>
80
+ </div>
81
+ </div>
82
+ <label class="checkbox">
83
+ <%= check_box_tag :include_completed, '1', @search_options[:include_completed].to_i==1 %>
84
+ <%= t('.is_completed', :default=>"Include completed") %>
85
+ </label>
86
+ <% end %>
87
+ <ul class="nav nav-pills nav-stacked">
88
+ <li class="<%= "active" if params[:action]=='index' %>">
89
+ <%= link_to lit.localization_keys_path do -%>
90
+ <%= draw_icon 'list' %>
91
+ all
92
+ <% end %>
93
+ </li>
94
+ <li class="<%= "active" if params[:action]=='starred' %>">
95
+ <%= link_to lit.starred_localization_keys_path do -%>
96
+ <%= draw_icon 'star' %>
97
+ starred
98
+ <% end %>
99
+ </li>
100
+ <li class="nav-header"><%= t(".order_by", :default => "Order by") %>:</li>
101
+ <% Lit::LocalizationKey.order_options.each do |order| %>
102
+ <li class="<%= "active" if order == @search_options[:order] %>">
103
+ <%= link_to url_for(@search_options.merge(:order => order)) do %>
104
+ <%= t("lit.order_options.#{order.gsub(" ", "_")}", :default => order.humanize) %>
105
+ <% end %>
106
+ </li>
107
+ <% end %>
108
+ <li class="nav-header">Narrow with prefix</li>
109
+ <% if @search_options[:key_prefix].present? %>
110
+ <li>
111
+ <%= link_to url_for(@search_options.merge(:key_prefix=>@parent_prefix.present? ? @parent_prefix : nil)), :title=>(@parent_prefix.present? ? @parent_prefix : 'show all') do %>
112
+ <%= draw_icon('chevron-left') %>
113
+ <%= @parent_prefix.present? ? @parent_prefix.split('.').last : 'show all' %>
114
+ <% end %>
115
+ </li>
116
+ <% end %>
117
+ <% @prefixes.each do |p| %>
118
+ <li class="key_prefix">
119
+ <%= link_to url_for(@search_options.merge(:key_prefix=>p)) do %>
120
+ <%= draw_icon('chevron-right') %>
121
+ <%= p.split('.').last %>
122
+ <% end %>
123
+ </li>
124
+ <% end %>
125
+ </ul>
126
+ </div>
127
+ <% end %>
@@ -0,0 +1 @@
1
+ $('tr.localization_key_row[data-id="<%= @localization_key.id %>"] a.star_icon').html("<%= ejs(draw_icon(@localization_key.is_starred? ? 'star' : 'star-o')) %>");
@@ -0,0 +1,23 @@
1
+ <%= form_for @localization, url: lit.localization_key_localization_path(@localization_key, @localization, format: :js), html: {remote: true} do |f| %>
2
+ <%- f.label :translated_value %>
3
+ <% if @localization.translated_value.is_a?(Array) %>
4
+ <ul style="list-style: none;">
5
+ <% @localization.translated_value.each do |l| %>
6
+ <li><%= text_field_tag 'localization[translated_value][]', l, class: 'form-control input-xlarge' %></li>
7
+ <% end %>
8
+ </ul>
9
+ <% else %>
10
+ <%= f.text_area :translated_value, size: '40x2', class: 'form-control input-xxlarge' %>
11
+ <% if allow_wysiwyg_editor?(@localization_key.localization_key) %>
12
+ <br />
13
+ <label>
14
+ <input type="checkbox" class="wysiwyg_switch" /> use wysiwyg editor
15
+ </label>
16
+ <br />
17
+ <% end %>
18
+ <% end %>
19
+
20
+ <button class="btn btn-primary btn-sm" type="submit"><%= I18n.t('lit.common.update', default: "Update") %></button>
21
+ <button class="btn btn-default btn-sm cancel" type="reset"><%= I18n.t('lit.common.cancel', default: 'Cancel') %></button>
22
+ <% end %>
23
+
@@ -0,0 +1,15 @@
1
+ <span class="pull-right"><%= draw_icon 'times', :class=>"close_versions" %></span>
2
+ <table class="table table-condensed">
3
+ <tr>
4
+ <th><%= t('lit.common.previous_versions') %></th>
5
+ <th width="25%"><%= t('lit.common.changed_at') %></th>
6
+ </tr>
7
+ <% @versions.each do |v| %>
8
+ <tr>
9
+ <td>
10
+ <%= render :partial=>"/lit/localization_keys/localization_row", formats: ['html'], :locals=>{:localization=>v.translated_value} %>
11
+ </td>
12
+ <td><%= I18n.l v.created_at, format: :long %></td>
13
+ </tr>
14
+ <% end %>
15
+ </table>
@@ -0,0 +1,7 @@
1
+ var $row = $('td.localization_row[data-id="<%= @localization.id %>"]');
2
+ $row.data('editing', 1);
3
+ $row.html("<%= ejs render(partial: 'form', formats: ['html']) %>");
4
+ $row.find('textarea').focus();
5
+ <% if @localization.full_key.ends_with?('_html') -%>
6
+ $row.find('.wysiwyg_switch').click();
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ var row = $('.localization_versions_row[data-id="<%= @localization.id %>"]');
2
+ row.removeClass('hidden');
3
+ row.children('td').html("<%= j render(:partial=>'previous_versions_rows', formats: ['html'], :locals=>{:localization=>@localization, :versions=>@versions}) %>");
@@ -0,0 +1,4 @@
1
+ var $row = $('td.localization_row[data-id="<%= @localization.id %>"]');
2
+ $row.data('editing', 0);
3
+ $row.html("<%= ejs render(:partial=>"/lit/localization_keys/localization_row", formats: ['html'], :locals=>{:localization=>@localization.translated_value }) %>");
4
+ $row.siblings().find('.show_prev_versions').removeClass('hidden');
@@ -0,0 +1,35 @@
1
+ <%= form_for(@source, :class=>"form-horizontal") do |f| %>
2
+ <% if @source.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@source.errors.count, "error") %> prohibited this source from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @source.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+ <div class="control-group">
14
+ <%= f.label :identifier, :class=>"control-label" %>
15
+ <div class="controls">
16
+ <%= f.text_field :identifier, :class=>"form-control" %>
17
+ </div>
18
+ </div>
19
+ <div class="control-group">
20
+ <%= f.label :url, :class=>"control-label" %>
21
+ <div class="controls">
22
+ <%= f.text_field :url, :placeholder=>"http://your_other_env.host/lit", :class=>"form-control" %>
23
+ </div>
24
+ </div>
25
+ <div class="control-group">
26
+ <%= f.label :api_key, :class=>"control-label" %>
27
+ <div class="controls">
28
+ <%= f.text_field :api_key, :class=>"form-control" %>
29
+ </div>
30
+ </div>
31
+
32
+ <div class="actions">
33
+ <%= f.submit t('lit.common.save', :default => "Save"), :class=>"btn btn-primary btn-sm" %>
34
+ </div>
35
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing source</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @source %> |
6
+ <%= link_to 'Back', sources_path %>
@@ -0,0 +1,42 @@
1
+ <h1>Synchronization sources</h1>
2
+
3
+ <table class="table">
4
+ <tr>
5
+ <th>Identifier</th>
6
+ <th>Last synchronization</th>
7
+ <th>Last change (remote)</th>
8
+ <th width="95px"></th>
9
+ </tr>
10
+
11
+ <% @sources.each do |source| %>
12
+ <tr>
13
+ <td><%= link_to source.identifier, lit.source_path(source) %></td>
14
+ <td><%= source.last_updated_at.to_s(:db) unless source.last_updated_at.nil? %></td>
15
+ <td><%= source.get_last_change %></td>
16
+ <td>
17
+ <%= link_to lit.source_incomming_localizations_path(source), :title=>t('lit.common.browse_incomming', :default=>"Browse incomming localizations") do %>
18
+ <%= draw_icon 'search' %>
19
+ <% end %>
20
+ <%= link_to lit.synchronize_source_path(source), :title=>t('lit.common.synchronize', :default=>"Synchronize") do %>
21
+ <%= draw_icon 'refresh' %>
22
+ <% end %>
23
+ <%= link_to lit.source_path(source), :title=>t('lit.common.show', :default=>"Show") do %>
24
+ <%= draw_icon 'zoom-in' %>
25
+ <% end %>
26
+ <%= link_to lit.edit_source_path(source), :title=>t('lit.common.edit', :default=>"Edit") do %>
27
+ <%= draw_icon 'pencil' %>
28
+ <% end %>
29
+ <%= link_to lit.touch_source_path(source), :title=>t('lit.common.touch', :default=>"Touch (update) last_updated_at"), :method => :put, :data => { :confirm => 'Are you sure?' } do %>
30
+ <%= draw_icon 'clock-o' %>
31
+ <% end %>
32
+ <%= link_to lit.source_path(source), :method => :delete, :data => { :confirm => 'Are you sure?' }, :title=>t('lit.common.delete', :default=>"Delete") do %>
33
+ <%= draw_icon 'trash-o' %>
34
+ <% end %>
35
+ </td>
36
+ </tr>
37
+ <% end %>
38
+ </table>
39
+
40
+ <br />
41
+
42
+ <%= link_to 'New Source', new_source_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New source</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', sources_path %>
@@ -0,0 +1,19 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <strong>Indetifier:</strong>
4
+ <%= @source.identifier %>
5
+ <br/>
6
+ <strong>Url:</strong>
7
+ <%= @source.url %>
8
+ <br/>
9
+ <strong>API key:</strong>
10
+ <%= @source.api_key %>
11
+ <br/>
12
+ <strong>Last updated at:</strong>
13
+ <%= @source.last_updated_at.to_s(:db) unless @source.last_updated_at.nil? %>
14
+ <%= link_to '(touch!)', touch_source_path(@source), :method => :put, :data => { :confirm => 'Are you sure?' } %>
15
+ <br/>
16
+
17
+
18
+ <%= link_to 'Edit', edit_source_path(@source) %> |
19
+ <%= link_to 'Back', sources_path %>
@@ -0,0 +1,49 @@
1
+ Lit::Engine.routes.draw do
2
+ if Lit.api_enabled
3
+ namespace :api do
4
+ namespace :v1 do
5
+ get '/last_change' => 'localizations#last_change'
6
+ resources :locales, only: [:index]
7
+ resources :localization_keys, only: [:index]
8
+ resources :localizations, only: [:index] do
9
+ get 'last_change', on: :collection
10
+ end
11
+ end
12
+ end
13
+ end
14
+ resources :locales, only: [:index, :destroy] do
15
+ put :hide, on: :member
16
+ end
17
+ resources :localization_keys, only: [:index, :destroy] do
18
+ member do
19
+ get :star
20
+ end
21
+ collection do
22
+ get :starred
23
+ get :find_localization
24
+ end
25
+ resources :localizations, only: [:edit, :update, :show] do
26
+ member do
27
+ get :previous_versions
28
+ end
29
+ end
30
+ end
31
+ resources :sources do
32
+ member do
33
+ get :synchronize
34
+ get :sync_complete
35
+ put :touch
36
+ end
37
+ resources :incomming_localizations, only: [:index, :destroy] do
38
+ member do
39
+ get :accept
40
+ end
41
+ collection do
42
+ get :accept_all
43
+ post :reject_all
44
+ end
45
+ end
46
+ end
47
+
48
+ root to: 'dashboard#index'
49
+ end
@@ -0,0 +1,16 @@
1
+ class LitCreateLitLocales < Rails::VERSION::MAJOR >= 5 ?
2
+ ActiveRecord::Migration[4.2] :
3
+ ActiveRecord::Migration
4
+ def up
5
+ return if table_exists?(:lit_locales)
6
+ create_table :lit_locales do |t|
7
+ t.string :locale
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def down
14
+ drop_table :lit_locales
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ class LitCreateLitLocalizationKeys < Rails::VERSION::MAJOR >= 5 ?
2
+ ActiveRecord::Migration[4.2] :
3
+ ActiveRecord::Migration
4
+ def up
5
+ return if table_exists?(:lit_localization_keys)
6
+ create_table :lit_localization_keys do |t|
7
+ t.string :localization_key
8
+
9
+ t.timestamps
10
+ end
11
+ add_index :lit_localization_keys, :localization_key, unique: true
12
+ end
13
+
14
+ def down
15
+ remove_index :lit_localization_keys, :localization_key
16
+ drop_table :lit_localization_keys
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ class LitCreateLitLocalizations < Rails::VERSION::MAJOR >= 5 ?
2
+ ActiveRecord::Migration[4.2] :
3
+ ActiveRecord::Migration
4
+ def up
5
+ return if table_exists?(:lit_localizations)
6
+ create_table :lit_localizations do |t|
7
+ t.integer :locale_id
8
+ t.integer :localization_key_id
9
+ t.text :default_value
10
+ t.text :translated_value
11
+ t.boolean :is_changed, default: false
12
+
13
+ t.timestamps
14
+ end
15
+
16
+ add_index :lit_localizations, :locale_id
17
+ add_index :lit_localizations, :localization_key_id
18
+ end
19
+
20
+ def down
21
+ remove_index :lit_localizations, :locale_id
22
+ remove_index :lit_localizations, :localization_key_id
23
+ end
24
+ end
@@ -0,0 +1,17 @@
1
+ class LitAddIsCompletedAndIsStarredToLocalizationKeys < Rails::VERSION::MAJOR >= 5 ?
2
+ ActiveRecord::Migration[4.2] :
3
+ ActiveRecord::Migration
4
+ def up
5
+ unless column_exists?(:lit_localization_keys, :is_completed)
6
+ add_column :lit_localization_keys, :is_completed, :boolean, default: false
7
+ end
8
+ unless column_exists?(:lit_localization_keys, :is_starred)
9
+ add_column :lit_localization_keys, :is_starred, :boolean, default: false
10
+ end
11
+ end
12
+
13
+ def down
14
+ remove_column :lit_localization_keys, :is_completed
15
+ remove_column :lit_localization_keys, :is_starred
16
+ end
17
+ end