rails_event 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +36 -0
  4. data/Rakefile +32 -0
  5. data/app/controllers/eventual/admin/base_controller.rb +4 -0
  6. data/app/controllers/eventual/admin/bookings_controller.rb +43 -0
  7. data/app/controllers/eventual/admin/crowd_members_controller.rb +43 -0
  8. data/app/controllers/eventual/admin/crowds_controller.rb +58 -0
  9. data/app/controllers/eventual/admin/event_crowds_controller.rb +71 -0
  10. data/app/controllers/eventual/admin/event_items_controller.rb +58 -0
  11. data/app/controllers/eventual/admin/event_participants_controller.rb +101 -0
  12. data/app/controllers/eventual/admin/event_taxons_controller.rb +55 -0
  13. data/app/controllers/eventual/admin/events_controller.rb +91 -0
  14. data/app/controllers/eventual/admin/place_taxons_controller.rb +57 -0
  15. data/app/controllers/eventual/admin/places_controller.rb +59 -0
  16. data/app/controllers/eventual/admin/plan_attenders_controller.rb +65 -0
  17. data/app/controllers/eventual/admin/plan_items_controller.rb +84 -0
  18. data/app/controllers/eventual/admin/plans_controller.rb +127 -0
  19. data/app/controllers/eventual/admin/seats_controller.rb +58 -0
  20. data/app/controllers/eventual/admin/time_items_controller.rb +82 -0
  21. data/app/controllers/eventual/admin/time_lists_controller.rb +72 -0
  22. data/app/controllers/eventual/base_controller.rb +4 -0
  23. data/app/controllers/eventual/me/base_controller.rb +4 -0
  24. data/app/controllers/eventual/me/plan_items_controller.rb +58 -0
  25. data/app/controllers/eventual/my/base_controller.rb +4 -0
  26. data/app/controllers/eventual/my/plan_items_controller.rb +55 -0
  27. data/app/controllers/eventual/places_controller.rb +27 -0
  28. data/app/controllers/eventual/time_controller.rb +14 -0
  29. data/app/models/eventual/application_record.rb +5 -0
  30. data/app/models/eventual/booking.rb +5 -0
  31. data/app/models/eventual/crowd.rb +5 -0
  32. data/app/models/eventual/crowd_member.rb +5 -0
  33. data/app/models/eventual/event.rb +6 -0
  34. data/app/models/eventual/event_crowd.rb +5 -0
  35. data/app/models/eventual/event_grant.rb +5 -0
  36. data/app/models/eventual/event_item.rb +5 -0
  37. data/app/models/eventual/event_participant.rb +6 -0
  38. data/app/models/eventual/event_taxon.rb +5 -0
  39. data/app/models/eventual/ext/recurrence.rb +86 -0
  40. data/app/models/eventual/model/agency.rb +18 -0
  41. data/app/models/eventual/model/booked.rb +10 -0
  42. data/app/models/eventual/model/booker.rb +15 -0
  43. data/app/models/eventual/model/booking.rb +37 -0
  44. data/app/models/eventual/model/crowd.rb +21 -0
  45. data/app/models/eventual/model/crowd_member.rb +20 -0
  46. data/app/models/eventual/model/event.rb +48 -0
  47. data/app/models/eventual/model/event_crowd.rb +54 -0
  48. data/app/models/eventual/model/event_grant.rb +14 -0
  49. data/app/models/eventual/model/event_item.rb +30 -0
  50. data/app/models/eventual/model/event_participant.rb +63 -0
  51. data/app/models/eventual/model/event_taxon.rb +13 -0
  52. data/app/models/eventual/model/member.rb +18 -0
  53. data/app/models/eventual/model/occurrence.rb +62 -0
  54. data/app/models/eventual/model/place.rb +25 -0
  55. data/app/models/eventual/model/place_taxon.rb +18 -0
  56. data/app/models/eventual/model/plan.rb +147 -0
  57. data/app/models/eventual/model/plan_attender.rb +31 -0
  58. data/app/models/eventual/model/plan_item.rb +84 -0
  59. data/app/models/eventual/model/plan_participant/crowd_participant.rb +17 -0
  60. data/app/models/eventual/model/plan_participant/normal_participant.rb +9 -0
  61. data/app/models/eventual/model/plan_participant.rb +30 -0
  62. data/app/models/eventual/model/planned.rb +11 -0
  63. data/app/models/eventual/model/planning.rb +44 -0
  64. data/app/models/eventual/model/recurrence.rb +64 -0
  65. data/app/models/eventual/model/seat.rb +17 -0
  66. data/app/models/eventual/model/time_item.rb +46 -0
  67. data/app/models/eventual/model/time_list.rb +57 -0
  68. data/app/models/eventual/place.rb +5 -0
  69. data/app/models/eventual/place_taxon.rb +6 -0
  70. data/app/models/eventual/plan.rb +7 -0
  71. data/app/models/eventual/plan_attender.rb +5 -0
  72. data/app/models/eventual/plan_item.rb +6 -0
  73. data/app/models/eventual/plan_participant.rb +5 -0
  74. data/app/models/eventual/seat.rb +5 -0
  75. data/app/models/eventual/time_item.rb +5 -0
  76. data/app/models/eventual/time_list.rb +5 -0
  77. data/app/models/eventual.rb +11 -0
  78. data/app/models/plan_participant/eventual/crowd_participant.rb +5 -0
  79. data/app/models/plan_participant/eventual/normal_participant.rb +5 -0
  80. data/app/views/admin/_event_nav.html.erb +14 -0
  81. data/app/views/admin/_nav_event.html.erb +9 -0
  82. data/app/views/eventual/admin/base/_nav.html.erb +3 -0
  83. data/app/views/eventual/admin/bookings/_booking.json.jbuilder +12 -0
  84. data/app/views/eventual/admin/bookings/_filter.html.erb +6 -0
  85. data/app/views/eventual/admin/bookings/_form.html.erb +8 -0
  86. data/app/views/eventual/admin/bookings/_show.json.jbuilder +1 -0
  87. data/app/views/eventual/admin/bookings/_show_table.html.erb +28 -0
  88. data/app/views/eventual/admin/bookings/index.html.erb +43 -0
  89. data/app/views/eventual/admin/bookings/index.json.jbuilder +1 -0
  90. data/app/views/eventual/admin/crowd_members/_filter_form.html.erb +7 -0
  91. data/app/views/eventual/admin/crowd_members/_form.html.erb +4 -0
  92. data/app/views/eventual/admin/crowd_members/index.html.erb +34 -0
  93. data/app/views/eventual/admin/crowds/_crowd.json.jbuilder +8 -0
  94. data/app/views/eventual/admin/crowds/_edit_form.html.erb +4 -0
  95. data/app/views/eventual/admin/crowds/_filter_form.html.erb +10 -0
  96. data/app/views/eventual/admin/crowds/_form.html.erb +4 -0
  97. data/app/views/eventual/admin/crowds/_index_tbody.html.erb +5 -0
  98. data/app/views/eventual/admin/crowds/_index_thead.html.erb +3 -0
  99. data/app/views/eventual/admin/crowds/_new_form.html.erb +4 -0
  100. data/app/views/eventual/admin/crowds/_show.json.jbuilder +1 -0
  101. data/app/views/eventual/admin/crowds/_show_table.html.erb +20 -0
  102. data/app/views/eventual/admin/crowds/index.html.erb +5 -0
  103. data/app/views/eventual/admin/crowds/index.json.jbuilder +1 -0
  104. data/app/views/eventual/admin/event_crowds/_breadcrumb.html.erb +7 -0
  105. data/app/views/eventual/admin/event_crowds/_crowd_student.html.erb +18 -0
  106. data/app/views/eventual/admin/event_crowds/_edit_form.html.erb +15 -0
  107. data/app/views/eventual/admin/event_crowds/_index_tbody.html.erb +19 -0
  108. data/app/views/eventual/admin/event_crowds/_index_thead.html.erb +10 -0
  109. data/app/views/eventual/admin/event_crowds/_new_form.html.erb +6 -0
  110. data/app/views/eventual/admin/event_crowds/_show_table.html.erb +12 -0
  111. data/app/views/eventual/admin/event_crowds/index.html.erb +2 -0
  112. data/app/views/eventual/admin/event_items/_breadcrumb.html.erb +7 -0
  113. data/app/views/eventual/admin/event_items/_edit_form.html.erb +4 -0
  114. data/app/views/eventual/admin/event_items/_event_item.json.jbuilder +12 -0
  115. data/app/views/eventual/admin/event_items/_filter_form.html.erb +9 -0
  116. data/app/views/eventual/admin/event_items/_form.html.erb +12 -0
  117. data/app/views/eventual/admin/event_items/_index_tbody.html.erb +8 -0
  118. data/app/views/eventual/admin/event_items/_index_thead.html.erb +5 -0
  119. data/app/views/eventual/admin/event_items/_new_form.html.erb +4 -0
  120. data/app/views/eventual/admin/event_items/_show.json.jbuilder +1 -0
  121. data/app/views/eventual/admin/event_items/_show_table.html.erb +12 -0
  122. data/app/views/eventual/admin/event_items/index.html.erb +1 -0
  123. data/app/views/eventual/admin/event_items/index.json.jbuilder +1 -0
  124. data/app/views/eventual/admin/event_participants/_breadcrumb.html.erb +7 -0
  125. data/app/views/eventual/admin/event_participants/_button.html.erb +3 -0
  126. data/app/views/eventual/admin/event_participants/_filter_form.html.erb +9 -0
  127. data/app/views/eventual/admin/event_participants/_filter_table.html.erb +11 -0
  128. data/app/views/eventual/admin/event_participants/_form.html.erb +4 -0
  129. data/app/views/eventual/admin/event_participants/_index_tbody.html.erb +15 -0
  130. data/app/views/eventual/admin/event_participants/_index_thead.html.erb +5 -0
  131. data/app/views/eventual/admin/event_participants/index.html.erb +1 -0
  132. data/app/views/eventual/admin/event_taxons/_breadcrumb.html.erb +6 -0
  133. data/app/views/eventual/admin/event_taxons/_edit_form.html.erb +4 -0
  134. data/app/views/eventual/admin/event_taxons/_event_taxon.json.jbuilder +5 -0
  135. data/app/views/eventual/admin/event_taxons/_filter_form.html.erb +10 -0
  136. data/app/views/eventual/admin/event_taxons/_form.html.erb +2 -0
  137. data/app/views/eventual/admin/event_taxons/_index_tbody.html.erb +1 -0
  138. data/app/views/eventual/admin/event_taxons/_index_thead.html.erb +2 -0
  139. data/app/views/eventual/admin/event_taxons/_new_form.html.erb +4 -0
  140. data/app/views/eventual/admin/event_taxons/_show.json.jbuilder +1 -0
  141. data/app/views/eventual/admin/event_taxons/index.html.erb +5 -0
  142. data/app/views/eventual/admin/event_taxons/index.json.jbuilder +1 -0
  143. data/app/views/eventual/admin/events/_edit_form.html.erb +4 -0
  144. data/app/views/eventual/admin/events/_event.json.jbuilder +17 -0
  145. data/app/views/eventual/admin/events/_filter_form.html.erb +9 -0
  146. data/app/views/eventual/admin/events/_filter_table.html.erb +15 -0
  147. data/app/views/eventual/admin/events/_form.html.erb +11 -0
  148. data/app/views/eventual/admin/events/_index_tbody.html.erb +11 -0
  149. data/app/views/eventual/admin/events/_index_thead.html.erb +10 -0
  150. data/app/views/eventual/admin/events/_new_form.html.erb +4 -0
  151. data/app/views/eventual/admin/events/_show/_breadcrumb.html.erb +7 -0
  152. data/app/views/eventual/admin/events/_show.json.jbuilder +1 -0
  153. data/app/views/eventual/admin/events/create.json.jbuilder +1 -0
  154. data/app/views/eventual/admin/events/index.html.erb +5 -0
  155. data/app/views/eventual/admin/events/index.json.jbuilder +1 -0
  156. data/app/views/eventual/admin/events/repeat_form.js.erb +14 -0
  157. data/app/views/eventual/admin/events/show.html.erb +16 -0
  158. data/app/views/eventual/admin/place_taxons/_breadcrumb.html.erb +6 -0
  159. data/app/views/eventual/admin/place_taxons/_edit_form.html.erb +4 -0
  160. data/app/views/eventual/admin/place_taxons/_filter_form.html.erb +9 -0
  161. data/app/views/eventual/admin/place_taxons/_form.html.erb +6 -0
  162. data/app/views/eventual/admin/place_taxons/_index_tbody.html.erb +17 -0
  163. data/app/views/eventual/admin/place_taxons/_index_thead.html.erb +4 -0
  164. data/app/views/eventual/admin/place_taxons/_new_form.html.erb +4 -0
  165. data/app/views/eventual/admin/place_taxons/_show_table.html.erb +12 -0
  166. data/app/views/eventual/admin/place_taxons/index.html.erb +5 -0
  167. data/app/views/eventual/admin/places/_breadcrumb.html.erb +5 -0
  168. data/app/views/eventual/admin/places/_edit_form.html.erb +4 -0
  169. data/app/views/eventual/admin/places/_filter_form.html.erb +10 -0
  170. data/app/views/eventual/admin/places/_form.html.erb +4 -0
  171. data/app/views/eventual/admin/places/_index_tbody.html.erb +6 -0
  172. data/app/views/eventual/admin/places/_index_thead.html.erb +10 -0
  173. data/app/views/eventual/admin/places/_index_tr.html.erb +19 -0
  174. data/app/views/eventual/admin/places/_new_form.html.erb +4 -0
  175. data/app/views/eventual/admin/places/_place.json.jbuilder +6 -0
  176. data/app/views/eventual/admin/places/_show.json.jbuilder +1 -0
  177. data/app/views/eventual/admin/places/_show_table.html.erb +8 -0
  178. data/app/views/eventual/admin/places/index.html.erb +5 -0
  179. data/app/views/eventual/admin/places/index.json.jbuilder +1 -0
  180. data/app/views/eventual/admin/plan_attenders/_breadcrumb.html.erb +9 -0
  181. data/app/views/eventual/admin/plan_attenders/_course_student.json.jbuilder +11 -0
  182. data/app/views/eventual/admin/plan_attenders/_edit_form.html.erb +4 -0
  183. data/app/views/eventual/admin/plan_attenders/_filter.html.erb +6 -0
  184. data/app/views/eventual/admin/plan_attenders/_form.html.erb +5 -0
  185. data/app/views/eventual/admin/plan_attenders/_new_form.html.erb +4 -0
  186. data/app/views/eventual/admin/plan_attenders/_plan_attender.json.jbuilder +9 -0
  187. data/app/views/eventual/admin/plan_attenders/_show.json.jbuilder +1 -0
  188. data/app/views/eventual/admin/plan_attenders/_show_table.html.erb +16 -0
  189. data/app/views/eventual/admin/plan_attenders/absent.json.jbuilder +0 -0
  190. data/app/views/eventual/admin/plan_attenders/attend.json.jbuilder +0 -0
  191. data/app/views/eventual/admin/plan_attenders/index.html.erb +51 -0
  192. data/app/views/eventual/admin/plan_attenders/index.json.jbuilder +2 -0
  193. data/app/views/eventual/admin/plan_attenders/indexs.json.jbuilder +6 -0
  194. data/app/views/eventual/admin/plan_items/_breadcrumb.html.erb +8 -0
  195. data/app/views/eventual/admin/plan_items/_edit.html.erb +23 -0
  196. data/app/views/eventual/admin/plan_items/_filter.html.erb +11 -0
  197. data/app/views/eventual/admin/plan_items/_menu.html.erb +4 -0
  198. data/app/views/eventual/admin/plan_items/_plan.html.erb +6 -0
  199. data/app/views/eventual/admin/plan_items/_plan_item.json.jbuilder +12 -0
  200. data/app/views/eventual/admin/plan_items/_plan_items.json.jbuilder +13 -0
  201. data/app/views/eventual/admin/plan_items/_show.json.jbuilder +1 -0
  202. data/app/views/eventual/admin/plan_items/_show_table.html.erb +20 -0
  203. data/app/views/eventual/admin/plan_items/index.html.erb +72 -0
  204. data/app/views/eventual/admin/plan_items/index.json.jbuilder +3 -0
  205. data/app/views/eventual/admin/plan_items/qrcode.js.erb +1 -0
  206. data/app/views/eventual/admin/plans/_edit_item.html.erb +24 -0
  207. data/app/views/eventual/admin/plans/_filter.html.erb +8 -0
  208. data/app/views/eventual/admin/plans/_index.html.erb +31 -0
  209. data/app/views/eventual/admin/plans/_plan.json.jbuilder +12 -0
  210. data/app/views/eventual/admin/plans/_select_table.html.erb +30 -0
  211. data/app/views/eventual/admin/plans/_show.json.jbuilder +1 -0
  212. data/app/views/eventual/admin/plans/_show_item.html.erb +22 -0
  213. data/app/views/eventual/admin/plans/_show_table.html.erb +20 -0
  214. data/app/views/eventual/admin/plans/_table.html.erb +34 -0
  215. data/app/views/eventual/admin/plans/calendar.js.erb +12 -0
  216. data/app/views/eventual/admin/plans/index.html.erb +3 -0
  217. data/app/views/eventual/admin/plans/index.js.erb +42 -0
  218. data/app/views/eventual/admin/plans/index.json.jbuilder +1 -0
  219. data/app/views/eventual/admin/plans/show.html.erb +3 -0
  220. data/app/views/eventual/admin/seats/_breadcrumb.html.erb +0 -0
  221. data/app/views/eventual/admin/seats/_edit_form.html.erb +4 -0
  222. data/app/views/eventual/admin/seats/_filter_form.html.erb +9 -0
  223. data/app/views/eventual/admin/seats/_form.html.erb +4 -0
  224. data/app/views/eventual/admin/seats/_index_tbody.html.erb +3 -0
  225. data/app/views/eventual/admin/seats/_index_thead.html.erb +4 -0
  226. data/app/views/eventual/admin/seats/_new_form.html.erb +4 -0
  227. data/app/views/eventual/admin/seats/_show_table.html.erb +12 -0
  228. data/app/views/eventual/admin/seats/index.html.erb +5 -0
  229. data/app/views/eventual/admin/time_items/_edit_form.html.erb +4 -0
  230. data/app/views/eventual/admin/time_items/_form.html.erb +3 -0
  231. data/app/views/eventual/admin/time_items/_new_form.html.erb +4 -0
  232. data/app/views/eventual/admin/time_items/_show.json.jbuilder +1 -0
  233. data/app/views/eventual/admin/time_items/_show_table.html.erb +12 -0
  234. data/app/views/eventual/admin/time_items/_time_item.json.jbuilder +3 -0
  235. data/app/views/eventual/admin/time_items/_time_items_options.html.erb +1 -0
  236. data/app/views/eventual/admin/time_items/default.json.jbuilder +1 -0
  237. data/app/views/eventual/admin/time_items/index.json.jbuilder +1 -0
  238. data/app/views/eventual/admin/time_items/select.js.erb +3 -0
  239. data/app/views/eventual/admin/time_lists/_edit_form.html.erb +4 -0
  240. data/app/views/eventual/admin/time_lists/_filter.html.erb +8 -0
  241. data/app/views/eventual/admin/time_lists/_form.html.erb +4 -0
  242. data/app/views/eventual/admin/time_lists/_index_tbody.html.erb +14 -0
  243. data/app/views/eventual/admin/time_lists/_index_thead.html.erb +8 -0
  244. data/app/views/eventual/admin/time_lists/_index_tr.html.erb +13 -0
  245. data/app/views/eventual/admin/time_lists/_new_form.html.erb +4 -0
  246. data/app/views/eventual/admin/time_lists/_show.json.jbuilder +1 -0
  247. data/app/views/eventual/admin/time_lists/_show_table.html.erb +8 -0
  248. data/app/views/eventual/admin/time_lists/_time_items.html.erb +27 -0
  249. data/app/views/eventual/admin/time_lists/_time_list.json.jbuilder +10 -0
  250. data/app/views/eventual/admin/time_lists/index.html.erb +5 -0
  251. data/app/views/eventual/admin/time_lists/index.json.jbuilder +1 -0
  252. data/app/views/eventual/me/plan_items/_plan_item.json.jbuilder +14 -0
  253. data/app/views/eventual/me/plan_items/index.json.jbuilder +3 -0
  254. data/app/views/eventual/my/plans/_show_table.html.erb +32 -0
  255. data/app/views/eventual/my/plans/_table.html.erb +34 -0
  256. data/app/views/eventual/my/plans/_time_plan.json.jbuilder +8 -0
  257. data/app/views/eventual/my/plans/calendar.js.erb +12 -0
  258. data/app/views/eventual/my/plans/edit.html.erb +9 -0
  259. data/app/views/eventual/my/plans/edit.js.erb +3 -0
  260. data/app/views/eventual/my/plans/index-ready.js +11 -0
  261. data/app/views/eventual/my/plans/index.html.erb +26 -0
  262. data/app/views/eventual/my/plans/index.js +35 -0
  263. data/app/views/eventual/my/plans/index.json.jbuilder +1 -0
  264. data/app/views/eventual/my/plans/new.html.erb +9 -0
  265. data/app/views/eventual/my/plans/show.html.erb +7 -0
  266. data/app/views/eventual/my/plans/show.js.erb +12 -0
  267. data/app/views/eventual/my/plans/show.json.jbuilder +1 -0
  268. data/app/views/eventual/places/_filter_table.html.erb +11 -0
  269. data/app/views/eventual/places/index.html.erb +35 -0
  270. data/app/views/eventual/places/show.html.erb +0 -0
  271. data/app/views/eventual/time/_finish_at.html.erb +1 -0
  272. data/app/views/eventual/time/_finish_at_once.html.erb +1 -0
  273. data/app/views/eventual/time/_form.html.erb +15 -0
  274. data/app/views/eventual/time/_monthly_checkboxes.html.erb +1 -0
  275. data/app/views/eventual/time/_once_date.html.erb +1 -0
  276. data/app/views/eventual/time/_start_at.html.erb +1 -0
  277. data/app/views/eventual/time/_start_at_once.html.erb +1 -0
  278. data/app/views/eventual/time/_weekly_checkboxes.html.erb +1 -0
  279. data/app/views/eventual/time/index.css +5 -0
  280. data/app/views/eventual/time/repeat_form.js.erb +14 -0
  281. data/app/views/eventual/time/show.css +3 -0
  282. data/config/locales/en.enum.yml +8 -0
  283. data/config/locales/zh.attributes.yml +50 -0
  284. data/config/locales/zh.controller.yml +59 -0
  285. data/config/locales/zh.enum.yml +12 -0
  286. data/config/routes.rb +98 -0
  287. data/lib/rails_event/config.rb +13 -0
  288. data/lib/rails_event/engine.rb +29 -0
  289. data/lib/rails_event/version.rb +5 -0
  290. data/lib/rails_event.rb +4 -0
  291. metadata +346 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 87b00e267d1fab1d1a15aa80fe634944eba30b23f0fd8b532ddf22a077f69786
4
+ data.tar.gz: 50b5a0ee9d856c39ef87044585fdb7bea74618eaea0244d68582a9e8ebd5b949
5
+ SHA512:
6
+ metadata.gz: 2bfbeaf66662e9156caa512d997289b8c569cc4dae7bfca6298f5cddb1b0e6d9fbe8fa86e242f2fff4c0816d9bafe0c1919abe6f3e8bf7d133cd2ebe230e271a
7
+ data.tar.gz: b8174d30160f8e357d139e8ecbf0aaf7066604a6a40abb2b9b69693b636be589876855d3d956aeaa7020abe2165055785cec9333cd6225056757dd58d290cdf3
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2018-Present Mingyuan Qin <mingyuan0715@foxmail.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # RailsEvent
2
+
3
+ [![测试](https://github.com/work-design/rails_event/actions/workflows/test.yml/badge.svg)](https://github.com/work-design/rails_event/actions/workflows/test.yml)
4
+ [![Docker构建](https://github.com/work-design/rails_event/actions/workflows/cd.yml/badge.svg)](https://github.com/work-design/rails_event/actions/workflows/cd.yml)
5
+ [![Gem](https://github.com/work-design/rails_event/actions/workflows/gempush.yml/badge.svg)](https://github.com/work-design/rails_event/actions/workflows/gempush.yml)
6
+
7
+ RailsEvent 用于处理基于事件、地点、参与人的业务,如:活动举办、课程。
8
+
9
+
10
+ ## 说明
11
+
12
+ 预约模型由以下几部分组成:
13
+
14
+ * 事件,对应 model: Event
15
+ * 时间与地点,对应 model: Plan
16
+ * 人物,对应model: PlanParticipant(crowd)
17
+
18
+ 当上述配置完成之后,会根据时间的配置信息(如何按每周、每月等重复),生成具体的数据如下:
19
+
20
+ * PlanItem:具体的事件发生的时间(date + time_item_id),地点(place)
21
+ * PlanAttender(出席人): 具体的事件里的参与人,PlanItem + PlanCrowd
22
+
23
+
24
+ ## Installation
25
+
26
+ ```
27
+ yarn add moment
28
+ yarn add moment-timezone
29
+ yarn add @fullcalendar/core
30
+ yarn add @fullcalendar/daygrid
31
+ yarn add @fullcalendar/timegrid
32
+ ```
33
+
34
+
35
+ ## 许可
36
+ 本项目遵循 [MIT](https://opensource.org/licenses/MIT) 协议
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'RailsEvent'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+ load 'rails/tasks/statistics.rake'
21
+
22
+ require 'bundler/gem_tasks'
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'test'
28
+ t.pattern = 'test/**/*_test.rb'
29
+ t.verbose = false
30
+ end
31
+
32
+ task default: :test
@@ -0,0 +1,4 @@
1
+ module Eventual
2
+ class Admin::BaseController < AdminController
3
+ end
4
+ end
@@ -0,0 +1,43 @@
1
+ module Eventual
2
+ class Admin::BookingsController < Admin::BaseController
3
+ before_action :set_plan_item
4
+
5
+ def index
6
+ q_params = {
7
+ }
8
+ q_params.merge! params.permit(:booker_type, :booker_id)
9
+ @bookings = @plan_item.bookings.default_where(q_params).page(params[:page])
10
+ end
11
+
12
+ def new
13
+ @booking = @plan_item.bookings.build
14
+ end
15
+
16
+ def create
17
+ @booking = @plan_item.bookings.find_or_initialize_by(booker_type: params[:booker_type], booker_id: params[:booker_id])
18
+
19
+ unless @booking.save
20
+ render :new, locals: { model: @booking }, status: :unprocessable_entity
21
+ end
22
+ end
23
+
24
+ def destroy
25
+ if params[:id]
26
+ @booking = @plan_item.bookings.find(params[:id])
27
+ elsif params[:booker_type] && params[:booker_id]
28
+ @booking = @plan_item.bookings.find_by(booker_type: params[:booker_type], booker_id: params[:booker_id])
29
+ end
30
+
31
+ @booking.destroy if @booking
32
+ end
33
+
34
+ private
35
+ def set_plan_item
36
+ @plan_item = PlanItem.find params[:plan_item_id]
37
+ end
38
+
39
+ def set_booking
40
+ end
41
+
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ module Eventual
2
+ class Admin::CrowdMembersController < Admin::BaseController
3
+ before_action :set_crowd
4
+
5
+ def index
6
+ @crowd_members = @crowd.crowd_members.page(params[:page])
7
+ end
8
+
9
+ def new
10
+ @crowd_member = @crowd.crowd_members.build
11
+ end
12
+
13
+ def create
14
+ @crowd_member = @crowd.crowd_members.build(crowd_member_params)
15
+
16
+ unless @crowd_member.save
17
+ render :new, locals: { model: @crowd_member }, status: :bad_request
18
+ end
19
+ end
20
+
21
+ def destroy
22
+ if params[:id]
23
+ @crowd_member = @crowd.crowd_members.find(params[:id])
24
+ elsif params[:member_id]
25
+ @crowd_member = @crowd.crowd_members.find_by(member_id: params[:member_id])
26
+ end
27
+
28
+ @crowd_member.destroy if @crowd_member
29
+ end
30
+
31
+ private
32
+ def set_crowd
33
+ @crowd = Crowd.find params[:crowd_id]
34
+ end
35
+
36
+ def crowd_member_params
37
+ params.fetch(:crowd_member, {}).permit(
38
+ :member_id
39
+ )
40
+ end
41
+
42
+ end
43
+ end
@@ -0,0 +1,58 @@
1
+ module Eventual
2
+ class Admin::CrowdsController < Admin::BaseController
3
+ before_action :set_crowd, only: [:show, :edit, :update, :destroy]
4
+
5
+ def index
6
+ q_params = default_params
7
+ q_params.merge! params.permit(:name)
8
+
9
+ @crowds = Crowd.default_where(q_params).page(params[:page])
10
+ end
11
+
12
+ def new
13
+ @crowd = Crowd.new
14
+ end
15
+
16
+ def create
17
+ @crowd = Crowd.new(crowd_params)
18
+
19
+ unless @crowd.save
20
+ render :new, locals: { model: @crowd }, status: :unprocessable_entity
21
+ end
22
+ end
23
+
24
+ def show
25
+ @crowd_members = @crowd.crowd_members.includes(:member)
26
+ end
27
+
28
+ def edit
29
+ end
30
+
31
+ def update
32
+ @crowd.assign_attributes(crowd_params)
33
+
34
+ unless @crowd.save
35
+ render :edit, locals: { model: @crowd }, status: :unprocessable_entity
36
+ end
37
+ end
38
+
39
+ def destroy
40
+ @crowd.destroy
41
+ end
42
+
43
+ private
44
+ def set_crowd
45
+ @crowd = Crowd.find(params[:id])
46
+ end
47
+
48
+ def crowd_params
49
+ p = params.fetch(:crowd, {}).permit(
50
+ :name,
51
+ :logo,
52
+ :member_type
53
+ )
54
+ p.merge! default_form_params
55
+ end
56
+
57
+ end
58
+ end
@@ -0,0 +1,71 @@
1
+ module Eventual
2
+ class Admin::EventCrowdsController < Admin::BaseController
3
+ before_action :set_event
4
+ before_action :set_event_crowds
5
+ before_action :set_event_crowd, only: [:edit, :update, :destroy]
6
+
7
+ def index
8
+ q_params = default_params.merge! params.permit(:id, :name, :email, :department_id)
9
+
10
+ @event_crowds = @event.event_crowds.default_where(q_params).order(id: :asc).includes(crowd: :members)
11
+ end
12
+
13
+ def new
14
+ @event_crowd = @event.event_crowds.build
15
+ @crowds = Crowd.default_where(default_params).where.not(id: @event.crowd_ids)
16
+ @rooms = Room.default_where(default_params)
17
+ end
18
+
19
+ def create
20
+ @event_crowd = @event.event_crowds.find_or_initialize_by(crowd_id: event_crowd_params[:crowd_id])
21
+ @event_crowd.room_id = event_crowd_params[:room_id]
22
+
23
+ unless @event_crowd.save
24
+ render :new, locals: { model: @event_crowd }, status: :unprocessable_entity
25
+ end
26
+ end
27
+
28
+ def edit
29
+ @rooms = Room.default_where(default_params)
30
+ end
31
+
32
+ def update
33
+ @event_crowd.assign_attributes(event_crowd_params)
34
+
35
+ unless @crowd.save
36
+ render :edit, locals: { model: @crowd }, status: :unprocessable_entity
37
+ end
38
+ end
39
+
40
+ def destroy
41
+ @event_crowd.destroy
42
+ end
43
+
44
+ private
45
+ def set_event_crowds
46
+ q_params = {}.with_indifferent_access
47
+ q_params.merge! params.permit(:id, :email, :name, :office_id, :email)
48
+ @event_crowds = @event.event_crowds
49
+ @crowds = Crowd.includes(crowd_members: :member).default_where(q_params).page(params[:page])
50
+
51
+ @event_participants = @event.event_participants.page(params[:page])
52
+ end
53
+
54
+ def set_event
55
+ @event = Event.find(params[:event_id])
56
+ end
57
+
58
+ def set_event_crowd
59
+ @event_crowd = @event.event_crowds.find params[:id]
60
+ end
61
+
62
+ def event_crowd_params
63
+ params.fetch(:event_crowd, {}).permit(
64
+ :crowd_id,
65
+ :teacher_id,
66
+ :room_id
67
+ )
68
+ end
69
+
70
+ end
71
+ end
@@ -0,0 +1,58 @@
1
+ module Eventual
2
+ class Admin::EventItemsController < Admin::BaseController
3
+ before_action :set_event
4
+ before_action :set_event_item, only: [:show, :edit, :update, :destroy]
5
+
6
+ def index
7
+ @event_items = @event.event_items.page(params[:page])
8
+ end
9
+
10
+ def new
11
+ @event_item = @event.event_items.build
12
+ end
13
+
14
+ def create
15
+ @event_item = @event.event_items.build(event_item_params)
16
+
17
+ unless @event_item.save
18
+ render :new, locals: { model: @event_item }, status: :unprocessable_entity
19
+ end
20
+ end
21
+
22
+ def show
23
+ end
24
+
25
+ def edit
26
+ end
27
+
28
+ def update
29
+ @event_item.assign_attributes(event_item_params)
30
+
31
+ unless @event_item.save
32
+ render :edit, locals: { model: @event_item }, status: :unprocessable_entity
33
+ end
34
+ end
35
+
36
+ def destroy
37
+ @event_item.destroy
38
+ end
39
+
40
+ private
41
+ def set_event
42
+ @event = Event.find params[:event_id]
43
+ end
44
+
45
+ def set_event_item
46
+ @event_item = EventItem.find(params[:id])
47
+ end
48
+
49
+ def event_item_params
50
+ params.fetch(:event_item, {}).permit(
51
+ :name,
52
+ videos: [],
53
+ documents: []
54
+ )
55
+ end
56
+
57
+ end
58
+ end
@@ -0,0 +1,101 @@
1
+ module Eventual
2
+ class Admin::EventParticipantsController < Admin::BaseController
3
+ before_action :set_event
4
+ before_action :set_event_participant, only: [:show, :edit, :update]
5
+
6
+ def index
7
+ q_params = {}
8
+ q_params.merge! params.permit(:id, :state)
9
+ @event_participants = @event.event_participants.default_where(q_params).page(params[:page])
10
+ end
11
+
12
+ def new
13
+ @event_participant = EventParticipant.new
14
+ end
15
+
16
+ def create
17
+ @event_participant = @event.event_participants.build(event_participant_params)
18
+
19
+ unless @event_participant.save
20
+ render :new, locals: { model: @event_participant }, status: :unprocessable_entity
21
+ end
22
+ end
23
+
24
+ def update
25
+ @event_participant.assign_attributes(event_participant_params)
26
+
27
+ unless @event_participant.save
28
+ render :edit, locals: { model: @event_participant }, status: :unprocessable_entity
29
+ end
30
+ end
31
+
32
+ def destroy
33
+ @event_participant = @event.event_participants.find_by(crowd_member_id: params[:crowd_member_id])
34
+ @event_participant.destroy
35
+ end
36
+
37
+ def check
38
+ add_ids = params[:add_ids].split(',')
39
+ if add_ids.present?
40
+ members = Member.where(id: add_ids)
41
+ members.each do |member|
42
+ add = @event.event_participants.find_or_initialize_by(member_id: member.id)
43
+ add.save_with_remind
44
+ end
45
+ end
46
+
47
+ remove_ids = params[:remove_ids].split(',')
48
+ if remove_ids.present?
49
+ @event.event_participants.where(member_id: remove_ids).each do |pl|
50
+ pl.destroy
51
+ end
52
+ end
53
+
54
+ redirect_to admin_event_event_participants_url(@event)
55
+ end
56
+
57
+ def attend
58
+ if params[:add_ids].present?
59
+ adds = EventParticipant.where(id: params[:add_ids].split(','))
60
+ adds.update_all attended: true
61
+ end
62
+
63
+ if params[:remove_ids].present?
64
+ removes = EventParticipant.where(id: params[:remove_ids].split(','))
65
+ removes.update_all attended: false
66
+ end
67
+ end
68
+
69
+ def show
70
+ @event_participant = EventParticipant.find_by(id: params[:id])
71
+ @eduing_histories = @event_participant.eduing_histories.order('id desc')
72
+ end
73
+
74
+ def edit
75
+ @title = "Assign Events"
76
+ end
77
+
78
+ def quit
79
+ @event_participant = EventParticipant.find params[:id]
80
+ @event_participant.trigger_to! state: 'quitted'
81
+ redirect_to admin_event_event_participants_url(member_id: @event_participant.member_id)
82
+ end
83
+
84
+ private
85
+ def set_event
86
+ @event = Event.find params[:event_id]
87
+ end
88
+
89
+ def set_event_participant
90
+ @event_participant = EventParticipant.find(params[:id])
91
+ end
92
+
93
+ def event_participant_params
94
+ p = params.fetch(:event_participant, {}).permit(
95
+ :state
96
+ )
97
+ p.merge! params.permit(:member_type, :member_id, :crowd_member_id, :event_crowd_id)
98
+ end
99
+
100
+ end
101
+ end