family_gallery 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +41 -0
  4. data/Rakefile +22 -0
  5. data/app/assets/javascripts/family_gallery/application.js.coffee +5 -0
  6. data/app/assets/javascripts/family_gallery/locales.js.coffee +7 -0
  7. data/app/assets/javascripts/family_gallery/pictures.js.coffee +16 -0
  8. data/app/assets/javascripts/family_gallery/user_taggings.js.coffee +30 -0
  9. data/app/assets/stylesheets/family_gallery/application.css.scss +6 -0
  10. data/app/assets/stylesheets/family_gallery/groups.css.scss +0 -0
  11. data/app/assets/stylesheets/family_gallery/layout.css.scss +116 -0
  12. data/app/assets/stylesheets/family_gallery/pictures.css.scss +32 -0
  13. data/app/assets/stylesheets/family_gallery/user_taggings.css.scss +19 -0
  14. data/app/controllers/family_gallery/base_controller.rb +14 -0
  15. data/app/controllers/family_gallery/groups_controller.rb +17 -0
  16. data/app/controllers/family_gallery/locales_controller.rb +8 -0
  17. data/app/controllers/family_gallery/pictures_controller.rb +29 -0
  18. data/app/controllers/family_gallery/resources_controller.rb +87 -0
  19. data/app/controllers/family_gallery/sessions_controller.rb +4 -0
  20. data/app/controllers/family_gallery/user_taggings_controller.rb +41 -0
  21. data/app/controllers/family_gallery/users_controller.rb +4 -0
  22. data/app/controllers/family_gallery/welcome_controller.rb +5 -0
  23. data/app/helpers/family_gallery/groups_helper.rb +8 -0
  24. data/app/helpers/family_gallery/layout_helper.rb +5 -0
  25. data/app/helpers/family_gallery/pictures_helper.rb +13 -0
  26. data/app/helpers/family_gallery/users_helper.rb +5 -0
  27. data/app/models/family_gallery/ability.rb +22 -0
  28. data/app/models/family_gallery/group.rb +8 -0
  29. data/app/models/family_gallery/group_picture_link.rb +8 -0
  30. data/app/models/family_gallery/picture.rb +76 -0
  31. data/app/models/family_gallery/user.rb +24 -0
  32. data/app/models/family_gallery/user_role.rb +7 -0
  33. data/app/models/family_gallery/user_tagging.rb +18 -0
  34. data/app/views/family_gallery/devise/shared/_links.html.haml +0 -0
  35. data/app/views/family_gallery/groups/_form.html.haml +4 -0
  36. data/app/views/family_gallery/groups/edit.html.haml +3 -0
  37. data/app/views/family_gallery/groups/index.html.haml +15 -0
  38. data/app/views/family_gallery/groups/new.html.haml +3 -0
  39. data/app/views/family_gallery/groups/show.html.haml +25 -0
  40. data/app/views/family_gallery/pictures/_form.html.haml +8 -0
  41. data/app/views/family_gallery/pictures/edit.html.haml +3 -0
  42. data/app/views/family_gallery/pictures/new.html.haml +3 -0
  43. data/app/views/family_gallery/pictures/show.html.haml +47 -0
  44. data/app/views/family_gallery/sessions/new.html.erb +26 -0
  45. data/app/views/family_gallery/user_taggings/_form.html.haml +9 -0
  46. data/app/views/family_gallery/user_taggings/new.html.haml +3 -0
  47. data/app/views/family_gallery/users/show.html.haml +12 -0
  48. data/app/views/family_gallery/welcome/index.html.haml +10 -0
  49. data/app/views/layouts/family_gallery/application.html.haml +41 -0
  50. data/config/initializers/devise.rb +259 -0
  51. data/config/initializers/omniauth.rb +7 -0
  52. data/config/locales/awesome_translations/app/views/family_gallery/groups/da.yml +10 -0
  53. data/config/locales/awesome_translations/app/views/family_gallery/groups/en.yml +10 -0
  54. data/config/locales/awesome_translations/app/views/family_gallery/pictures/da.yml +12 -0
  55. data/config/locales/awesome_translations/app/views/family_gallery/pictures/en.yml +12 -0
  56. data/config/locales/awesome_translations/app/views/family_gallery/user_taggings/da.yml +6 -0
  57. data/config/locales/awesome_translations/app/views/family_gallery/user_taggings/en.yml +6 -0
  58. data/config/locales/awesome_translations/app/views/family_gallery/users/da.yml +10 -0
  59. data/config/locales/awesome_translations/app/views/family_gallery/users/en.yml +10 -0
  60. data/config/locales/awesome_translations/app/views/family_gallery/welcome/da.yml +7 -0
  61. data/config/locales/awesome_translations/app/views/family_gallery/welcome/en.yml +7 -0
  62. data/config/locales/awesome_translations/controllers/family_gallery/da.yml +9 -0
  63. data/config/locales/awesome_translations/controllers/family_gallery/en.yml +9 -0
  64. data/config/locales/awesome_translations/da.yml +9 -0
  65. data/config/locales/awesome_translations/en.yml +9 -0
  66. data/config/locales/awesome_translations/models/family_gallery__group/da.yml +26 -0
  67. data/config/locales/awesome_translations/models/family_gallery__group/en.yml +26 -0
  68. data/config/locales/awesome_translations/models/family_gallery__picture/da.yml +13 -0
  69. data/config/locales/awesome_translations/models/family_gallery__picture/en.yml +13 -0
  70. data/config/locales/awesome_translations/models/family_gallery__user_tagging/da.yml +14 -0
  71. data/config/locales/awesome_translations/models/family_gallery__user_tagging/en.yml +14 -0
  72. data/config/locales/awesome_translations/views/family_gallery/groups/da.yml +12 -0
  73. data/config/locales/awesome_translations/views/family_gallery/groups/en.yml +9 -0
  74. data/config/locales/awesome_translations/views/family_gallery/pictures/da.yml +13 -0
  75. data/config/locales/awesome_translations/views/family_gallery/pictures/en.yml +13 -0
  76. data/config/locales/awesome_translations/views/layouts/family_gallery/da.yml +9 -0
  77. data/config/locales/awesome_translations/views/layouts/family_gallery/en.yml +9 -0
  78. data/config/locales/devise.en.yml +60 -0
  79. data/config/routes.rb +19 -0
  80. data/db/plugin_migrate/20150224155212_create_family_gallery_users.rb +46 -0
  81. data/db/plugin_migrate/20150224155422_create_family_gallery_groups.rb +14 -0
  82. data/db/plugin_migrate/20150224155704_create_family_gallery_pictures.rb +29 -0
  83. data/db/plugin_migrate/20150224180931_create_family_gallery_user_roles.rb +12 -0
  84. data/db/plugin_migrate/20150224184005_create_family_gallery_group_picture_links.rb +13 -0
  85. data/db/plugin_migrate/20150301144620_create_family_gallery_user_taggings.rb +16 -0
  86. data/db/plugin_migrate/20150301144620_create_user_taggings.rb +16 -0
  87. data/lib/family_gallery/base_family_gallery_controller.rb +9 -0
  88. data/lib/family_gallery/engine.rb +5 -0
  89. data/lib/family_gallery/version.rb +3 -0
  90. data/lib/family_gallery.rb +20 -0
  91. data/lib/tasks/family_gallery/db.rake +3 -0
  92. data/lib/tasks/family_gallery/seed.rake +14 -0
  93. data/lib/tasks/family_gallery_tasks.rake +4 -0
  94. data/spec/controllers/family_gallery/pictures_controller_spec.rb +20 -0
  95. data/spec/dummy/README.md +28 -0
  96. data/spec/dummy/Rakefile +6 -0
  97. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  98. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  99. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  100. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  101. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  102. data/spec/dummy/bin/bundle +3 -0
  103. data/spec/dummy/bin/rails +4 -0
  104. data/spec/dummy/bin/rake +4 -0
  105. data/spec/dummy/config/application.rb +26 -0
  106. data/spec/dummy/config/boot.rb +5 -0
  107. data/spec/dummy/config/database.example.yml +39 -0
  108. data/spec/dummy/config/database.shippable.yml +5 -0
  109. data/spec/dummy/config/database.yml +13 -0
  110. data/spec/dummy/config/environment.rb +5 -0
  111. data/spec/dummy/config/environments/development.rb +32 -0
  112. data/spec/dummy/config/environments/production.rb +80 -0
  113. data/spec/dummy/config/environments/test.rb +41 -0
  114. data/spec/dummy/config/family_gallery.yml +3 -0
  115. data/spec/dummy/config/initializers/awesome_translations.rb +3 -0
  116. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  117. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  118. data/spec/dummy/config/initializers/inflections.rb +16 -0
  119. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  120. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  121. data/spec/dummy/config/initializers/session_store.rb +3 -0
  122. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  123. data/spec/dummy/config/routes.rb +58 -0
  124. data/spec/dummy/config.ru +4 -0
  125. data/spec/dummy/db/schema.rb +131 -0
  126. data/spec/dummy/log/test.log +3457 -0
  127. data/spec/dummy/public/404.html +58 -0
  128. data/spec/dummy/public/422.html +58 -0
  129. data/spec/dummy/public/500.html +57 -0
  130. data/spec/dummy/public/favicon.ico +0 -0
  131. data/spec/dummy/public/system/family_gallery/pictures/images/000/000/016/original/Profile.jpeg +0 -0
  132. data/spec/dummy/tmp/cache/assets/development/sass/79bc6a1530be4e47bb2bf0dda4943bc0e439789f/application.css.scssc +0 -0
  133. data/spec/dummy/tmp/cache/assets/development/sass/79bc6a1530be4e47bb2bf0dda4943bc0e439789f/groups.css.scssc +0 -0
  134. data/spec/dummy/tmp/cache/assets/development/sass/79bc6a1530be4e47bb2bf0dda4943bc0e439789f/layout.css.scssc +0 -0
  135. data/spec/dummy/tmp/cache/assets/development/sass/bc24de95c506de07c6571950d49f3258660a5d78/application.css.scssc +0 -0
  136. data/spec/dummy/tmp/cache/assets/development/sass/bc24de95c506de07c6571950d49f3258660a5d78/groups.css.scssc +0 -0
  137. data/spec/dummy/tmp/cache/assets/development/sass/bc24de95c506de07c6571950d49f3258660a5d78/layout.css.scssc +0 -0
  138. data/spec/dummy/tmp/cache/assets/development/sass/bc24de95c506de07c6571950d49f3258660a5d78/pictures.css.scssc +0 -0
  139. data/spec/dummy/tmp/cache/assets/development/sass/bc24de95c506de07c6571950d49f3258660a5d78/user_taggings.css.scssc +0 -0
  140. data/spec/dummy/tmp/cache/assets/development/sprockets/0cc5658eb161251c8bd64e1cf25e2191 +0 -0
  141. data/spec/dummy/tmp/cache/assets/development/sprockets/119923dc816dfafda90919183ba1581d +0 -0
  142. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  143. data/spec/dummy/tmp/cache/assets/development/sprockets/1442902bef094cd5f3d9fa021ab30bad +0 -0
  144. data/spec/dummy/tmp/cache/assets/development/sprockets/1575b3a4a178623381cdd55596cd8bc7 +0 -0
  145. data/spec/dummy/tmp/cache/assets/development/sprockets/1aab57c1924cdaa9ba148c9e3d5bbb85 +0 -0
  146. data/spec/dummy/tmp/cache/assets/development/sprockets/1dfc909a73e53e47b341f67cfd8a3fc3 +0 -0
  147. data/spec/dummy/tmp/cache/assets/development/sprockets/20d23fa5ea743ace10d6a5494fce8ddb +0 -0
  148. data/spec/dummy/tmp/cache/assets/development/sprockets/2128d293dc8ef13115c1f5d64b5acfc9 +0 -0
  149. data/spec/dummy/tmp/cache/assets/development/sprockets/21ce280aacf67faf44041900539d5470 +0 -0
  150. data/spec/dummy/tmp/cache/assets/development/sprockets/235a5e7d077adf3448617346dc10129f +0 -0
  151. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  152. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  153. data/spec/dummy/tmp/cache/assets/development/sprockets/3bd5629974bb1919d009bcb1da7a7e49 +0 -0
  154. data/spec/dummy/tmp/cache/assets/development/sprockets/41e4d54853d3193e68b50b72db515857 +0 -0
  155. data/spec/dummy/tmp/cache/assets/development/sprockets/44b768d3351f06e343edc95634297681 +0 -0
  156. data/spec/dummy/tmp/cache/assets/development/sprockets/50b9bcf05a8718d9cb5b99276f154ea9 +0 -0
  157. data/spec/dummy/tmp/cache/assets/development/sprockets/5270ab363f9384ff7f43ff83bdaf3f82 +0 -0
  158. data/spec/dummy/tmp/cache/assets/development/sprockets/5316fc0620afefc2ba81b690c8e2c34d +0 -0
  159. data/spec/dummy/tmp/cache/assets/development/sprockets/538966109f3bbd58bfb717ad57a37096 +0 -0
  160. data/spec/dummy/tmp/cache/assets/development/sprockets/58b9ed99ad62ba462ca6a9272b96bef3 +0 -0
  161. data/spec/dummy/tmp/cache/assets/development/sprockets/5fdd6c2e7777e739bd4e3400982c1bbf +0 -0
  162. data/spec/dummy/tmp/cache/assets/development/sprockets/673ce11f5cb7033b29ccc99310e62b93 +0 -0
  163. data/spec/dummy/tmp/cache/assets/development/sprockets/697d977cf9fc7e54534f5e29b0832836 +0 -0
  164. data/spec/dummy/tmp/cache/assets/development/sprockets/69944efcc9ea99d47389db34b0e05add +0 -0
  165. data/spec/dummy/tmp/cache/assets/development/sprockets/6aab60b365535cc305f37a738e75868b +0 -0
  166. data/spec/dummy/tmp/cache/assets/development/sprockets/6db8498274efddac6691248cc9afe855 +0 -0
  167. data/spec/dummy/tmp/cache/assets/development/sprockets/6e266734185d58588bcfaf0e33aa4162 +0 -0
  168. data/spec/dummy/tmp/cache/assets/development/sprockets/81ab882fef1228d654a7c697f2324309 +0 -0
  169. data/spec/dummy/tmp/cache/assets/development/sprockets/908bf508cc68079cab720d6b9c36cb95 +0 -0
  170. data/spec/dummy/tmp/cache/assets/development/sprockets/91090eda0f104056144ac17a4fcae91c +0 -0
  171. data/spec/dummy/tmp/cache/assets/development/sprockets/a316bc0d459b308530ee6b622235d103 +0 -0
  172. data/spec/dummy/tmp/cache/assets/development/sprockets/a3c8104e5830cd7047c6a3a1c1e2ba32 +0 -0
  173. data/spec/dummy/tmp/cache/assets/development/sprockets/adaf29eda594015193030af46474be58 +0 -0
  174. data/spec/dummy/tmp/cache/assets/development/sprockets/b349b574327b896b7a321351b14fe1d8 +0 -0
  175. data/spec/dummy/tmp/cache/assets/development/sprockets/b34e86a2845f7901154358882afdeaa4 +0 -0
  176. data/spec/dummy/tmp/cache/assets/development/sprockets/b446ef62b37b9bf3a8e24608d9f95634 +0 -0
  177. data/spec/dummy/tmp/cache/assets/development/sprockets/b512f2b016bd3aef8c28fa661e01308c +0 -0
  178. data/spec/dummy/tmp/cache/assets/development/sprockets/bd49bb0a6f5dfd284a750fb9cab40d85 +0 -0
  179. data/spec/dummy/tmp/cache/assets/development/sprockets/c39fce5fa19b758734af29527d4185ca +0 -0
  180. data/spec/dummy/tmp/cache/assets/development/sprockets/c8ecba0dbc7774cd6db79cb7fbe1ef3e +0 -0
  181. data/spec/dummy/tmp/cache/assets/development/sprockets/c9b79d7ebc7ef5550a14749b52427cef +0 -0
  182. data/spec/dummy/tmp/cache/assets/development/sprockets/c9c612c8259a6af5c4c02201dd2df161 +0 -0
  183. data/spec/dummy/tmp/cache/assets/development/sprockets/cb595904fcf7acdedf2b95571442fc59 +0 -0
  184. data/spec/dummy/tmp/cache/assets/development/sprockets/cfb60287b7af861000187e7ba72e39c1 +0 -0
  185. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  186. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  187. data/spec/dummy/tmp/cache/assets/development/sprockets/d8de240bbb697f46b26a6ef75d522aa5 +0 -0
  188. data/spec/dummy/tmp/cache/assets/development/sprockets/e4ec6c7c682836f272efa386cc68223d +0 -0
  189. data/spec/dummy/tmp/cache/assets/development/sprockets/eb9ed717a7ef467bf260b11dfc8451eb +0 -0
  190. data/spec/dummy/tmp/cache/assets/development/sprockets/ebdbddd03e404d3fa30adfae674cb9ea +0 -0
  191. data/spec/dummy/tmp/cache/assets/development/sprockets/efd7a36b3d6d057aa5229aa6d21cbebb +0 -0
  192. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  193. data/spec/dummy/tmp/cache/assets/development/sprockets/fe3c3cb0cdabd1bbcc88520fc768a6e9 +0 -0
  194. data/spec/dummy/views/family_gallery/groups/da.yml +9 -0
  195. data/spec/dummy/views/family_gallery/groups/en.yml +8 -0
  196. data/spec/dummy/views/family_gallery/pictures/da.yml +9 -0
  197. data/spec/dummy/views/family_gallery/pictures/en.yml +9 -0
  198. data/spec/dummy/views/layouts/family_gallery/da.yml +6 -0
  199. data/spec/dummy/views/layouts/family_gallery/en.yml +6 -0
  200. data/spec/factories/family_gallery/group.rb +6 -0
  201. data/spec/factories/family_gallery/picture.rb +10 -0
  202. data/spec/factories/family_gallery/user.rb +12 -0
  203. data/spec/models/family_gallery/picture_spec.rb +14 -0
  204. data/spec/spec_helper.rb +28 -0
  205. data/spec/test_files/0/family_gallery/pictures/000/000/039/original.jpg +0 -0
  206. data/spec/test_files/0/family_gallery/pictures/000/000/040/original.jpg +0 -0
  207. data/spec/test_files/0/family_gallery/pictures/000/000/041/original.jpg +0 -0
  208. data/spec/test_files/0/family_gallery/pictures/000/000/042/original.jpg +0 -0
  209. data/spec/test_files/0/family_gallery/pictures/000/000/043/original.jpg +0 -0
  210. data/spec/test_files/0/family_gallery/pictures/000/000/044/original.jpg +0 -0
  211. data/spec/test_files/0/family_gallery/pictures/000/000/045/original.jpg +0 -0
  212. data/spec/test_files/0/family_gallery/pictures/000/000/046/original.jpg +0 -0
  213. data/spec/test_pictures/christina.jpg +0 -0
  214. data/spec/test_pictures/sigrid.jpg +0 -0
  215. metadata +741 -0
@@ -0,0 +1,12 @@
1
+ ---
2
+ da:
3
+ family_gallery:
4
+ pictures:
5
+ show:
6
+ show_picture: 'Vis billede: %{title}'
7
+ edit_picture: Rediger billede
8
+ add_tagging: Tilføj tagging
9
+ previous: Forrige
10
+ next: Næste
11
+ tagged_users: Taggede brugere
12
+ no_users_was_tagged: Der er ikke blevet tagget nogle brugere
@@ -0,0 +1,12 @@
1
+ ---
2
+ en:
3
+ family_gallery:
4
+ pictures:
5
+ show:
6
+ show_picture: 'Show picture: %{title}'
7
+ edit_picture: Edit picture
8
+ add_tagging: Add tagging
9
+ previous: Previous
10
+ next: Next
11
+ tagged_users: Tagged users
12
+ no_users_was_tagged: No users have been tagged
@@ -0,0 +1,6 @@
1
+ ---
2
+ da:
3
+ family_gallery:
4
+ user_taggings:
5
+ new:
6
+ new_user_tagging: Ny brugertagging
@@ -0,0 +1,6 @@
1
+ ---
2
+ en:
3
+ family_gallery:
4
+ user_taggings:
5
+ new:
6
+ new_user_tagging: New user tagging
@@ -0,0 +1,10 @@
1
+ ---
2
+ da:
3
+ family_gallery:
4
+ users:
5
+ show:
6
+ show_user: Vis bruger
7
+ tagged_on: Tagget på
8
+ user_hasnt_been_tagged_on_any_pictures: Denne bruger er ikke blevet tagget
9
+ på nogle billeder
10
+ uploaded_pictures: Uploadede billeder
@@ -0,0 +1,10 @@
1
+ ---
2
+ en:
3
+ family_gallery:
4
+ users:
5
+ show:
6
+ show_user: Show user
7
+ tagged_on: Tagged on
8
+ user_hasnt_been_tagged_on_any_pictures: This user hasn't been tagged on any
9
+ pictures
10
+ uploaded_pictures: Uploaded pictures
@@ -0,0 +1,7 @@
1
+ ---
2
+ da:
3
+ family_gallery:
4
+ welcome:
5
+ index:
6
+ welcome: Velkommen
7
+ latest_updated_groups: Seneste opdaterede grupper
@@ -0,0 +1,7 @@
1
+ ---
2
+ en:
3
+ family_gallery:
4
+ welcome:
5
+ index:
6
+ welcome: Welcome
7
+ latest_updated_groups: Latest updated groups
@@ -0,0 +1,9 @@
1
+ ---
2
+ da:
3
+ controllers:
4
+ family_gallery:
5
+ resources_controller:
6
+ resource_was_saved: Resource blev gemt.
7
+ resource_was_updated: Resourcen blev opdateret.
8
+ resource_was_deleted: Resourcen blev slettet.
9
+ "@#{StringCases": {}
@@ -0,0 +1,9 @@
1
+ ---
2
+ en:
3
+ controllers:
4
+ family_gallery:
5
+ resources_controller:
6
+ resource_was_saved: Resource was saved.
7
+ resource_was_updated: Resource was updated.
8
+ resource_was_deleted: Resource was deleted.
9
+ "@#{StringCases": {}
@@ -0,0 +1,9 @@
1
+ ---
2
+ da:
3
+ no_results: Ingen resultater
4
+ add_new: Tilføj ny
5
+ actions: Muligheder
6
+ are_you_sure: Er du sikker
7
+ remove: Fjern
8
+ save: Gem
9
+ delete: Slet
@@ -0,0 +1,9 @@
1
+ ---
2
+ en:
3
+ no_results: No results
4
+ add_new: Add new
5
+ actions: Actions
6
+ are_you_sure: Are you sure
7
+ remove: Remove
8
+ save: Save
9
+ delete: Delete
@@ -0,0 +1,26 @@
1
+ ---
2
+ da:
3
+ activerecord:
4
+ models:
5
+ family_gallery:
6
+ group:
7
+ one: Gruppe
8
+ other: Grupper
9
+ family_gallery/group:
10
+ one: Gruppe
11
+ other: Grupper
12
+ attributes:
13
+ family_gallery:
14
+ group:
15
+ id: ID
16
+ created_at: Oprettet d.
17
+ updated_at: Opdateret d.
18
+ translations: Oversættelser
19
+ group_picture_links: Gruppebilledelinks
20
+ pictures: Billeder
21
+ family_gallery/group:
22
+ id: ID
23
+ created_at: Oprettet d.
24
+ updated_at: Opdateret d.
25
+ group_picture_links: Gruppebilledelinks
26
+ pictures: Billeder
@@ -0,0 +1,26 @@
1
+ ---
2
+ en:
3
+ activerecord:
4
+ models:
5
+ family_gallery:
6
+ group:
7
+ one: Group
8
+ other: Groups
9
+ family_gallery/group:
10
+ one: Group
11
+ other: Groups
12
+ attributes:
13
+ family_gallery:
14
+ group:
15
+ id: ID
16
+ created_at: Created at
17
+ updated_at: Updated at
18
+ translations: Translations
19
+ group_picture_links: Group-picture-links
20
+ pictures: Pictures
21
+ family_gallery/group:
22
+ id: ID
23
+ created_at: Created at
24
+ updated_at: Updated at
25
+ group_picture_links: Group picture links
26
+ pictures: Pictures
@@ -0,0 +1,13 @@
1
+ ---
2
+ da:
3
+ activerecord:
4
+ models:
5
+ family_gallery/picture:
6
+ one: Billede
7
+ other: Billeder
8
+ attributes:
9
+ family_gallery/picture:
10
+ width: Bredde
11
+ height: Højde
12
+ created_at: Oprettet d.
13
+ updated_at: Opdateret d.
@@ -0,0 +1,13 @@
1
+ ---
2
+ en:
3
+ activerecord:
4
+ models:
5
+ family_gallery/picture:
6
+ one: Picture
7
+ other: Pictures
8
+ attributes:
9
+ family_gallery/picture:
10
+ width: Width
11
+ height: Height
12
+ created_at: Created at
13
+ updated_at: Updated at
@@ -0,0 +1,14 @@
1
+ ---
2
+ da:
3
+ activerecord:
4
+ models:
5
+ family_gallery/user_tagging:
6
+ one: Brugertagging
7
+ other: Brugertaggings
8
+ attributes:
9
+ family_gallery/user_tagging:
10
+ id: ID
11
+ picture_id: Billede ID
12
+ user_id: Bruger ID
13
+ picture: Billede
14
+ user: Bruger
@@ -0,0 +1,14 @@
1
+ ---
2
+ en:
3
+ activerecord:
4
+ models:
5
+ family_gallery/user_tagging:
6
+ one: User tagging
7
+ other: User taggins
8
+ attributes:
9
+ family_gallery/user_tagging:
10
+ id: ID
11
+ picture_id: Picture ID
12
+ user_id: User ID
13
+ picture: Picture
14
+ user: User
@@ -0,0 +1,12 @@
1
+ ---
2
+ da:
3
+ add_new: Tilføj ny
4
+ family_gallery:
5
+ groups:
6
+ edit:
7
+ edit_group: Rediger gruppe
8
+ new:
9
+ new_group: Ny gruppe
10
+ show:
11
+ new_picture: Nyt billede
12
+ edit_group: Rediger gruppe
@@ -0,0 +1,9 @@
1
+ ---
2
+ en:
3
+ add_new: Add new
4
+ family_gallery:
5
+ groups:
6
+ edit:
7
+ edit_group: Edit group
8
+ new: {}
9
+ show: {}
@@ -0,0 +1,13 @@
1
+ ---
2
+ da:
3
+ family_gallery:
4
+ pictures:
5
+ edit:
6
+ edit_picture: 'Rediger billede: %{title}'
7
+ form:
8
+ delete: Slet
9
+ new:
10
+ add_new_picture: Tilføj nyt billede
11
+ show:
12
+ show_picture: 'Vis billede: %{title}'
13
+ edit_picture: Rediger billede
@@ -0,0 +1,13 @@
1
+ ---
2
+ en:
3
+ family_gallery:
4
+ pictures:
5
+ edit:
6
+ edit_picture: 'Edit picture: %{title}'
7
+ form:
8
+ delete: Delete
9
+ new:
10
+ add_new_picture: Add new picture
11
+ show:
12
+ show_picture: 'Show picture: %{title}'
13
+ edit_picture: Edit picture
@@ -0,0 +1,9 @@
1
+ ---
2
+ da:
3
+ layouts:
4
+ family_gallery:
5
+ application:
6
+ frontpage: Forside
7
+ sign_in: Log ind
8
+ sign_out: Log ud
9
+ translations: Oversættelser
@@ -0,0 +1,9 @@
1
+ ---
2
+ en:
3
+ layouts:
4
+ family_gallery:
5
+ application:
6
+ frontpage: Frontpage
7
+ sign_in: Sign in
8
+ sign_out: Sign out
9
+ translations: Translations
@@ -0,0 +1,60 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid email or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid email address or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password has been changed successfully. You are now signed in."
34
+ updated_not_active: "Your password has been changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
42
+ updated: "Your account has been updated successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ already_signed_out: "Signed out successfully."
47
+ unlocks:
48
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
49
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
50
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
51
+ errors:
52
+ messages:
53
+ already_confirmed: "was already confirmed, please try signing in"
54
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
55
+ expired: "has expired, please request a new one"
56
+ not_found: "not found"
57
+ not_locked: "was not locked"
58
+ not_saved:
59
+ one: "1 error prohibited this %{resource} from being saved:"
60
+ other: "%{count} errors prohibited this %{resource} from being saved:"
data/config/routes.rb ADDED
@@ -0,0 +1,19 @@
1
+ FamilyGallery::Engine.routes.draw do
2
+ mount AwesomeTranslations::Engine => "/awesome_translations" if Rails.env.development?
3
+
4
+ devise_for "family_gallery/users"
5
+
6
+ resources :groups do
7
+ resources :pictures
8
+ end
9
+
10
+ resources :locales, only: :create
11
+
12
+ resources :pictures do
13
+ resources :user_taggings
14
+ end
15
+
16
+ resources :users
17
+
18
+ root "welcome#index"
19
+ end
@@ -0,0 +1,46 @@
1
+ class CreateFamilyGalleryUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :family_gallery_users do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+
7
+ ## Database authenticatable
8
+ t.string :email, null: false, default: ""
9
+ t.string :encrypted_password, null: false, default: ""
10
+
11
+ ## Recoverable
12
+ t.string :reset_password_token
13
+ t.datetime :reset_password_sent_at
14
+
15
+ ## Rememberable
16
+ t.datetime :remember_created_at
17
+
18
+ ## Trackable
19
+ t.integer :sign_in_count, default: 0, null: false
20
+ t.datetime :current_sign_in_at
21
+ t.datetime :last_sign_in_at
22
+ t.string :current_sign_in_ip
23
+ t.string :last_sign_in_ip
24
+
25
+ ## Confirmable
26
+ t.string :confirmation_token
27
+ t.datetime :confirmed_at
28
+ t.datetime :confirmation_sent_at
29
+ t.string :unconfirmed_email # Only if using reconfirmable
30
+
31
+ ## Lockable
32
+ t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
33
+ t.string :unlock_token # Only if unlock strategy is :email or :both
34
+ t.datetime :locked_at
35
+
36
+
37
+ # Uncomment below if timestamps were not included in your original model.
38
+ t.timestamps
39
+ end
40
+
41
+ add_index :family_gallery_users, :email, unique: true
42
+ add_index :family_gallery_users, :reset_password_token, unique: true
43
+ add_index :family_gallery_users, :confirmation_token, unique: true
44
+ add_index :family_gallery_users, :unlock_token, unique: true
45
+ end
46
+ end
@@ -0,0 +1,14 @@
1
+ class CreateFamilyGalleryGroups < ActiveRecord::Migration
2
+ def up
3
+ create_table :family_gallery_groups do |t|
4
+ t.timestamps
5
+ end
6
+
7
+ FamilyGallery::Group.create_translation_table! name: :string, description: :text
8
+ end
9
+
10
+ def down
11
+ drop_table :family_gallery_groups
12
+ FamilyGallery::Group.drop_translation_table!
13
+ end
14
+ end
@@ -0,0 +1,29 @@
1
+ class CreateFamilyGalleryPictures < ActiveRecord::Migration
2
+ def up
3
+ create_table :family_gallery_pictures do |t|
4
+ t.integer :user_owner_id
5
+ t.integer :user_uploaded_id
6
+ t.datetime :taken_at
7
+ t.integer :width
8
+ t.integer :height
9
+ t.decimal :latitude, precision: 12, scale: 3
10
+ t.decimal :longitude, precision: 12, scale: 3
11
+ t.timestamps
12
+ end
13
+
14
+ add_index :family_gallery_pictures, :user_owner_id
15
+ add_index :family_gallery_pictures, :user_uploaded_id
16
+ add_index :family_gallery_pictures, :taken_at
17
+ add_index :family_gallery_pictures, :latitude
18
+ add_index :family_gallery_pictures, :longitude
19
+
20
+ add_attachment :family_gallery_pictures, :image
21
+
22
+ FamilyGallery::Picture.create_translation_table! title: :string, description: :text
23
+ end
24
+
25
+ def down
26
+ drop_table :family_gallery_pictures
27
+ FamilyGallery::Picture.drop_translation_table!
28
+ end
29
+ end
@@ -0,0 +1,12 @@
1
+ class CreateFamilyGalleryUserRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :family_gallery_user_roles do |t|
4
+ t.belongs_to :user
5
+ t.string :role
6
+ t.timestamps
7
+ end
8
+
9
+ add_index :family_gallery_user_roles, :user_id
10
+ add_index :family_gallery_user_roles, [:user_id, :role], unique: true
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreateFamilyGalleryGroupPictureLinks < ActiveRecord::Migration
2
+ def change
3
+ create_table :family_gallery_group_picture_links do |t|
4
+ t.belongs_to :group
5
+ t.belongs_to :picture
6
+ t.timestamps
7
+ end
8
+
9
+ add_index :family_gallery_group_picture_links, :group_id
10
+ add_index :family_gallery_group_picture_links, :picture_id
11
+ add_index :family_gallery_group_picture_links, [:group_id, :picture_id], unique: true, name: "unique_group_and_picture"
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ class CreateFamilyGalleryUserTaggings < ActiveRecord::Migration
2
+ def change
3
+ create_table :family_gallery_user_taggings do |t|
4
+ t.belongs_to :picture
5
+ t.belongs_to :user
6
+ t.belongs_to :tagged_by
7
+ t.decimal :position_top, precision: 10, scale: 2
8
+ t.decimal :position_left, precision: 10, scale: 2
9
+ t.timestamps
10
+ end
11
+
12
+ add_index :family_gallery_user_taggings, :picture_id
13
+ add_index :family_gallery_user_taggings, :user_id
14
+ add_index :family_gallery_user_taggings, :tagged_by_id
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreateUserTaggings < ActiveRecord::Migration
2
+ def change
3
+ create_table :user_taggings do |t|
4
+ t.belongs_to :picture
5
+ t.belongs_to :user
6
+ t.belongs_to :tagged_by
7
+ t.decimal :position_top, precision: 10, scale: 2
8
+ t.decimal :position_left, precision: 10, scale: 2
9
+ t.timestamps
10
+ end
11
+
12
+ add_index :user_taggings, :picture_id
13
+ add_index :user_taggings, :user_id
14
+ add_index :user_taggings, :tagged_by_id
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ module FamilyGallery::BaseFamilyGalleryController
2
+ def current_ability
3
+ @current_ability ||= FamilyGallery::Ability.new(current_user)
4
+ end
5
+
6
+ def current_user
7
+ current_family_gallery_user
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module FamilyGallery
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace FamilyGallery
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module FamilyGallery
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,20 @@
1
+ require "family_gallery/engine"
2
+ require "awesome_translations"
3
+ require "devise"
4
+ require "haml-rails"
5
+ require "plugin_migrator"
6
+ require "globalize"
7
+ require "coffee-rails"
8
+ require "jquery-rails"
9
+ require "cancancan"
10
+ require "omniauth"
11
+ require "omniauth-facebook"
12
+ require "ransack"
13
+ require "simple_form"
14
+ require "paperclip"
15
+
16
+ module FamilyGallery
17
+ extend ActiveSupport::Autoload
18
+
19
+ autoload :BaseFamilyGalleryController
20
+ end
@@ -0,0 +1,3 @@
1
+ namespace :family_gallery do
2
+ task "dbreset" => ["db:drop", "db:create", "db:migrate", "plugin_migrator:migrate"]
3
+ end
@@ -0,0 +1,14 @@
1
+ namespace :family_gallery do
2
+ task "seed" => :environment do
3
+ puts "Creating user: admin@example.com"
4
+ admin_user = FamilyGallery::User.find_or_initialize_by(email: "admin@example.com")
5
+ admin_user.assign_attributes(
6
+ first_name: "Admin",
7
+ last_name: "User",
8
+ password: "password"
9
+ )
10
+ admin_user.save!
11
+
12
+ admin_role = admin_user.user_roles.find_or_initialize_by(role: "administrator").save!
13
+ end
14
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :family_gallery do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,20 @@
1
+ require "spec_helper"
2
+
3
+ describe FamilyGallery::PicturesController do
4
+ let(:group) { create :group }
5
+ let(:admin) { create :admin }
6
+
7
+ before do
8
+ sign_in admin
9
+ end
10
+
11
+ it "#create" do
12
+ post :create, use_route: :family_gallery, picture: {title: "Test title", description: "Test test", image: fixture_file_upload("#{Rails.root}/../../spec/test_pictures/sigrid.jpg", "image/jpeg")}, group_id: group.id
13
+ last_picture = assigns(:picture)
14
+ last_picture.errors.to_a.should eq []
15
+ response.should redirect_to last_picture
16
+ last_picture.width.should_not eq nil
17
+ last_picture.groups.should eq [group]
18
+ last_picture.user_uploaded.should eq admin
19
+ end
20
+ end