symphonia 2.1.7

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 (188) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +674 -0
  3. data/README.md +16 -0
  4. data/Rakefile +44 -0
  5. data/app/assets/images/bg-checker.png +0 -0
  6. data/app/assets/images/bullet.gif +0 -0
  7. data/app/assets/images/close.png +0 -0
  8. data/app/assets/images/loading.gif +0 -0
  9. data/app/assets/images/next.png +0 -0
  10. data/app/assets/images/prev.png +0 -0
  11. data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +232 -0
  12. data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +102 -0
  13. data/app/assets/javascripts/ckeditor/plugins/image_chooser/icons/addimage.png +0 -0
  14. data/app/assets/javascripts/ckeditor/plugins/image_chooser/plugin.js +15 -0
  15. data/app/assets/javascripts/symphonia/Sortable.js +1249 -0
  16. data/app/assets/javascripts/symphonia/_core.js +45 -0
  17. data/app/assets/javascripts/symphonia/application.js.erb +147 -0
  18. data/app/assets/javascripts/symphonia/filters.js +44 -0
  19. data/app/assets/javascripts/symphonia/symphonia_bootstrap_dialog.js +136 -0
  20. data/app/assets/javascripts/symphonia/symphonia_ckeditor.js +55 -0
  21. data/app/assets/stylesheets/symphonia/application.css +4 -0
  22. data/app/assets/stylesheets/symphonia/basic.scss +218 -0
  23. data/app/assets/stylesheets/symphonia/filters.scss +19 -0
  24. data/app/assets/stylesheets/symphonia/symphonia_bootstrap.scss +56 -0
  25. data/app/channels/application_cable/channel.rb +5 -0
  26. data/app/controllers/symphonia/accounts_controller.rb +169 -0
  27. data/app/controllers/symphonia/admin_controller.rb +22 -0
  28. data/app/controllers/symphonia/api_controller.rb +64 -0
  29. data/app/controllers/symphonia/application_controller.rb +8 -0
  30. data/app/controllers/symphonia/attachments_controller.rb +37 -0
  31. data/app/controllers/symphonia/filters_controller.rb +23 -0
  32. data/app/controllers/symphonia/images_controller.rb +16 -0
  33. data/app/controllers/symphonia/login_controller.rb +80 -0
  34. data/app/controllers/symphonia/roles_controller.rb +100 -0
  35. data/app/controllers/symphonia/user_sessions_controller.rb +16 -0
  36. data/app/controllers/symphonia/users_controller.rb +168 -0
  37. data/app/helpers/symphonia/application_helper.rb +422 -0
  38. data/app/helpers/symphonia/bootstrap_modal_helper.rb +59 -0
  39. data/app/helpers/symphonia/form_helper.rb +50 -0
  40. data/app/helpers/symphonia/renderer_helper.rb +85 -0
  41. data/app/mailers/symphonia/application_mailer.rb +6 -0
  42. data/app/mailers/symphonia/notifier.rb +42 -0
  43. data/app/models/symphonia/admin_module.rb +18 -0
  44. data/app/models/symphonia/application_record.rb +14 -0
  45. data/app/models/symphonia/attachment.rb +16 -0
  46. data/app/models/symphonia/common_file.rb +9 -0
  47. data/app/models/symphonia/email_preference.rb +5 -0
  48. data/app/models/symphonia/image.rb +46 -0
  49. data/app/models/symphonia/preference.rb +12 -0
  50. data/app/models/symphonia/role.rb +55 -0
  51. data/app/models/symphonia/swagger/error_model.rb +19 -0
  52. data/app/models/symphonia/swagger/responses.rb +27 -0
  53. data/app/models/symphonia/user.rb +141 -0
  54. data/app/models/symphonia/user_session.rb +19 -0
  55. data/app/views/common/403.html.erb +5 -0
  56. data/app/views/common/404.html.erb +2 -0
  57. data/app/views/layouts/symphonia/_modal.html.erb +19 -0
  58. data/app/views/layouts/symphonia/_query.html.erb +51 -0
  59. data/app/views/layouts/symphonia/application.html.erb +45 -0
  60. data/app/views/layouts/symphonia/application.pdf.erb +15 -0
  61. data/app/views/layouts/symphonia/mailer.html.erb +13 -0
  62. data/app/views/symphonia/accounts/_detail.html.erb +65 -0
  63. data/app/views/symphonia/accounts/_form.html.erb +14 -0
  64. data/app/views/symphonia/accounts/edit.html.erb +9 -0
  65. data/app/views/symphonia/accounts/edit.js.erb +5 -0
  66. data/app/views/symphonia/accounts/lost_password.html.erb +6 -0
  67. data/app/views/symphonia/accounts/lost_password.js.erb +3 -0
  68. data/app/views/symphonia/accounts/new_activation.html.erb +11 -0
  69. data/app/views/symphonia/accounts/new_activation.js.erb +6 -0
  70. data/app/views/symphonia/accounts/register.html.erb +20 -0
  71. data/app/views/symphonia/accounts/reset_password.html.erb +18 -0
  72. data/app/views/symphonia/accounts/update.js.erb +1 -0
  73. data/app/views/symphonia/admin/index.html.erb +15 -0
  74. data/app/views/symphonia/attachments/destroy.js.erb +1 -0
  75. data/app/views/symphonia/common/_editable_images_grid.html.erb +12 -0
  76. data/app/views/symphonia/common/_filters.html.erb +23 -0
  77. data/app/views/symphonia/common/_locale_chooser.html.erb +16 -0
  78. data/app/views/symphonia/common/_share_links.html.erb +5 -0
  79. data/app/views/symphonia/filters/options.html.erb +36 -0
  80. data/app/views/symphonia/filters/options.js.erb +9 -0
  81. data/app/views/symphonia/filters/table.html.erb +21 -0
  82. data/app/views/symphonia/login/_form.html.erb +19 -0
  83. data/app/views/symphonia/login/new.html.erb +11 -0
  84. data/app/views/symphonia/login_sessions/new.html.erb +1 -0
  85. data/app/views/symphonia/notifier/activation_user.html.erb +7 -0
  86. data/app/views/symphonia/notifier/activation_user.text.erb +3 -0
  87. data/app/views/symphonia/notifier/reset_password_user.html.erb +7 -0
  88. data/app/views/symphonia/notifier/reset_password_user.text.erb +3 -0
  89. data/app/views/symphonia/notifier/test_mail.html.erb +2 -0
  90. data/app/views/symphonia/notifier/test_mail.text.erb +3 -0
  91. data/app/views/symphonia/notifier/user_change_to_active.html.erb +3 -0
  92. data/app/views/symphonia/notifier/user_change_to_active.text.erb +1 -0
  93. data/app/views/symphonia/notifier/user_registered.html.erb +13 -0
  94. data/app/views/symphonia/notifier/user_registered.text.erb +8 -0
  95. data/app/views/symphonia/roles/_form.html.erb +30 -0
  96. data/app/views/symphonia/roles/edit.html.erb +5 -0
  97. data/app/views/symphonia/roles/index.html.erb +6 -0
  98. data/app/views/symphonia/roles/new.html.erb +4 -0
  99. data/app/views/symphonia/roles/show.html.erb +5 -0
  100. data/app/views/symphonia/users/_form.html.erb +13 -0
  101. data/app/views/symphonia/users/edit.html.erb +26 -0
  102. data/app/views/symphonia/users/edit.js.erb +3 -0
  103. data/app/views/symphonia/users/edit_current.html.erb +7 -0
  104. data/app/views/symphonia/users/index.html.erb +5 -0
  105. data/app/views/symphonia/users/new.html.erb +8 -0
  106. data/app/views/symphonia/users/show.html.erb +63 -0
  107. data/config/locales/cs.yml +233 -0
  108. data/config/locales/en.yml +47 -0
  109. data/config/routes.rb +52 -0
  110. data/db/migrate/20130714140500_create_users.rb +49 -0
  111. data/db/migrate/20130714140501_create_roles.rb +16 -0
  112. data/db/migrate/20130714140502_create_preferences.rb +26 -0
  113. data/db/migrate/20130828175114_create_attachments.rb +20 -0
  114. data/db/migrate/20141213204351_create_admin_modules.rb +20 -0
  115. data/db/seeds.rb +12 -0
  116. data/lib/generators/symphonia/entity_controller/entity_controller_generator.rb +48 -0
  117. data/lib/generators/symphonia/entity_controller/templates/controller.rb +100 -0
  118. data/lib/generators/symphonia/query/query_generator.rb +37 -0
  119. data/lib/generators/symphonia/setup/setup_generator.rb +52 -0
  120. data/lib/generators/symphonia/setup/templates/404.html +26 -0
  121. data/lib/generators/symphonia/setup/templates/500.html +37 -0
  122. data/lib/generators/symphonia/setup/templates/Gemfile +18 -0
  123. data/lib/generators/symphonia/setup/templates/base_layout.html.erb +46 -0
  124. data/lib/generators/symphonia/setup/templates/design.scss +4 -0
  125. data/lib/generators/symphonia/setup/templates/settings.rb +65 -0
  126. data/lib/generators/symphonia/setup/templates/spec_helper.rb +18 -0
  127. data/lib/symphonia/action_cable/connection.rb +31 -0
  128. data/lib/symphonia/admin_constraint.rb +9 -0
  129. data/lib/symphonia/attachable.rb +35 -0
  130. data/lib/symphonia/base_controller.rb +96 -0
  131. data/lib/symphonia/bootstrap_link_render.rb +69 -0
  132. data/lib/symphonia/controller_extensions.rb +200 -0
  133. data/lib/symphonia/engine.rb +137 -0
  134. data/lib/symphonia/form_builder.rb +137 -0
  135. data/lib/symphonia/menu_manager.rb +23 -0
  136. data/lib/symphonia/model_attributes/attribute.rb +137 -0
  137. data/lib/symphonia/model_attributes.rb +102 -0
  138. data/lib/symphonia/model_filters/base.rb +82 -0
  139. data/lib/symphonia/model_filters/boolean_filter.rb +26 -0
  140. data/lib/symphonia/model_filters/date_filter.rb +81 -0
  141. data/lib/symphonia/model_filters/integer_filter.rb +18 -0
  142. data/lib/symphonia/model_filters/select_filter.rb +48 -0
  143. data/lib/symphonia/model_filters/string_filter.rb +18 -0
  144. data/lib/symphonia/model_filters.rb +10 -0
  145. data/lib/symphonia/object.rb +31 -0
  146. data/lib/symphonia/permissions.rb +93 -0
  147. data/lib/symphonia/query.rb +275 -0
  148. data/lib/symphonia/query_columns/attribute_column.rb +43 -0
  149. data/lib/symphonia/query_columns/generic_column.rb +165 -0
  150. data/lib/symphonia/query_columns.rb +8 -0
  151. data/lib/symphonia/spec_helper.rb +4 -0
  152. data/lib/symphonia/user_management.rb +58 -0
  153. data/lib/symphonia/version.rb +4 -0
  154. data/lib/symphonia.rb +20 -0
  155. data/spec/controllers/account_controller_spec.rb +90 -0
  156. data/spec/controllers/admin_controller_spec.rb +35 -0
  157. data/spec/controllers/api_controller_spec.rb +9 -0
  158. data/spec/controllers/filters_controller_spec.rb +35 -0
  159. data/spec/controllers/images_controller_spec.rb +5 -0
  160. data/spec/controllers/login_controller_spec.rb +20 -0
  161. data/spec/controllers/roles_controller_spec.rb +12 -0
  162. data/spec/controllers/users_controller_spec.rb +47 -0
  163. data/spec/factories/factories.rb +52 -0
  164. data/spec/helpers/symphonia/application_helper_spec.rb +62 -0
  165. data/spec/mailers/previews/symphonia/notifier_preview.rb +27 -0
  166. data/spec/mailers/symphonia/notifier_spec.rb +76 -0
  167. data/spec/models/attachment_spec.rb +22 -0
  168. data/spec/models/query/attribute_spec.rb +8 -0
  169. data/spec/models/query/symphonia_query_spec.rb +70 -0
  170. data/spec/models/role_spec.rb +13 -0
  171. data/spec/models/user_spec.rb +10 -0
  172. data/spec/rails_helper.rb +13 -0
  173. data/spec/requests/accounts_spec.rb +118 -0
  174. data/spec/requests/attachments_controller_spec.rb +23 -0
  175. data/spec/requests/login_spec.rb +26 -0
  176. data/spec/requests/roles_spec.rb +10 -0
  177. data/spec/requests/users_spec.rb +50 -0
  178. data/spec/spec_helper.rb +101 -0
  179. data/spec/support/common_file.txt +2 -0
  180. data/spec/support/query.rb +36 -0
  181. data/spec/support/shared.rb +62 -0
  182. data/spec/support/shared_controllers.rb +31 -0
  183. data/spec/support/stub_users.rb +32 -0
  184. data/spec/support/symphonia.jpg +0 -0
  185. data/spec/support/wait_for_ajax.rb +15 -0
  186. data/spec/version_spec.rb +5 -0
  187. data/spec/views/filters/options.html.erb_spec.rb +14 -0
  188. metadata +697 -0
@@ -0,0 +1,63 @@
1
+ <%#= render(partial: 'symphonia/accounts/detail', locals: {account: @user, use_service_buttons: Symphonia::User.current != @user}) -%>
2
+
3
+ <div class="card col-md-9 col-xlg-6 mx-auto">
4
+ <div class="card-body">
5
+ <h4 class="card-title"><%= html_title(@user.name).join %></h4>
6
+ <div class="card-text row">
7
+ <div class="col-sm-8">
8
+ <% %i(login email admin).each do |attribute| %>
9
+ <% next if @user.send(attribute).to_s.blank? %>
10
+ <dt><%= @user.class.human_attribute_name attribute %></dt>
11
+ <dd><%= @user.format_value(attribute, self) %></dd>
12
+ <% end %>
13
+
14
+ <% if @user.role %>
15
+ <dt><%= @user.class.human_attribute_name :role %></dt>
16
+ <dd><%= @user.format_value(:role, Symphonia::User.current.admin? && self || nil) %></dd>
17
+ <% end %>
18
+
19
+ <% if @user.preferences.any? %>
20
+ <dt><%= t(:label_user_notifications) %></dt>
21
+ <% @user.preferences.each do |p| %>
22
+ <dd>- <%= (t(p.name, scope: :preferences)) %></dd>
23
+ <% end -%>
24
+ <% end %>
25
+ </div>
26
+ <div class="col-sm-4">
27
+
28
+ <% if Symphonia::User.current.admin? %>
29
+ <%= link_to(icon('edit', t(:button_edit)), edit_user_path(@user), class: 'btn btn-primary btn-block') %>
30
+ <% if true %>
31
+ <% if @user.active? %>
32
+ <%= link_to(icon('lock', t(:button_archive)), archive_user_path(@user, back_url: polymorphic_path(@user)), data: { method: 'post', confirm: t(:text_are_you_sure) }, class: 'btn btn-secondary btn-block') %>
33
+ <% elsif @user.status_new? %>
34
+ <%= link_to(icon('bolt', t(:button_active)), unarchive_user_path(@user, back_url: polymorphic_path(@user)), class: 'btn btn-secondary', data: { method: 'post', confirm: t(:text_are_you_sure) + "\n #{t(:text_confirm_send_unlock_mail)}" }) %>
35
+ <% else %>
36
+ <%= link_to(icon('unlock', t(:button_unarchive)), unarchive_user_path(@user, back_url: polymorphic_path(@user)), class: 'btn btn-secondary btn-block', data: { method: 'post', confirm: t(:text_are_you_sure) + "\n #{t(:text_confirm_send_unlock_mail)}" }) %>
37
+ <% end %>
38
+ <%= link_to(icon('delete', t(:button_delete)), @user, class: 'btn btn-danger btn-block', method: 'delete', data: { confirm: t(:text_are_you_sure) }) %>
39
+ <% end -%>
40
+ <% else %>
41
+ <%= link_to(icon('edit', t(:button_edit)), edit_user_path(@user), class: 'btn btn-primary btn-block', remote: true) %>
42
+ <% end %>
43
+ <%= link_to(icon('key', t(:detail)), 'javascript:void(0)', onclick: %q{Symphonia.dialog.show('customer_detail')}, class: 'btn btn-info btn-block') %>
44
+ </div>
45
+
46
+ </div>
47
+ </div>
48
+ </div>
49
+
50
+ <div id="customer_detail" style="display: none">
51
+ <div class="clearfix">
52
+ <%= content_tag(:strong, @user.class.human_attribute_name(:current_login_at), :class => 'col-xs-6') %>
53
+ <%= content_tag(:div, @user.current_login_at ? time_tag(@user.current_login_at) : '-', :class => 'col-xs-6') %>
54
+ <%= content_tag(:strong, @user.class.human_attribute_name(:current_login_ip), :class => 'col-xs-6') %>
55
+ <%= content_tag(:div, @user.current_login_ip || '-', :class => 'col-xs-6') %>
56
+ <%= content_tag(:strong, @user.class.human_attribute_name(:last_login_at), :class => 'col-xs-6') %>
57
+ <%= content_tag(:div, @user.last_login_at ? time_tag(@user.last_login_at.localtime) : '-', :class => 'col-xs-6') %>
58
+ <%= content_tag(:strong, @user.class.human_attribute_name(:last_login_ip), :class => 'col-xs-6') %>
59
+ <%= content_tag(:div, @user.last_login_ip || '-', :class => 'col-xs-6') %>
60
+ <%= content_tag(:strong, @user.class.human_attribute_name(:single_access_token), :class => 'col-xs-6') %>
61
+ <%= content_tag(:div, text_field_tag(:token, @user.single_access_token, :style => 'border:none'), :class => 'col-xs-6') %>
62
+ </div>
63
+ </div>
@@ -0,0 +1,233 @@
1
+ cs:
2
+ general_locale: Čeština
3
+ authlogic:
4
+ text_login_failed: Přihlášení se nezdařilo
5
+ error_messages:
6
+ # login_blank: can not be blank
7
+ login_not_found: nenalezeno
8
+ login_invalid: obsahuje neplatné znaky
9
+ consecutive_failed_logins_limit_exceeded: Váš účet byl zablokován. Příliš mnoho nezdařených pokusů o přihlášení. Kontaktujte prosím správce.
10
+ email_invalid: není platný
11
+ # password_blank: can not be blank
12
+ password_invalid: je chybné
13
+ not_active: Účet není aktivován
14
+ # not_confirmed: Your account is not confirmed
15
+ # not_approved: Your account is not approved
16
+ # no_authentication_details: You did not provide any details for authentication.
17
+ general_credentials_error: login nebo heslo
18
+ models:
19
+ user_session: Přihlášení
20
+ attributes:
21
+ user_session:
22
+ remember_me: Zapamatovat
23
+ time:
24
+ past: Minulost
25
+ present: Současnot
26
+ future: Budoucnost
27
+ formats:
28
+ default: "%d. %B %Y %H:%M"
29
+ short: "%-d. %-m. %Y %H:%M"
30
+ attributes:
31
+ updated_at: Aktualizováno
32
+ created_at: Vytvořeno
33
+ name: Název
34
+ title: Název
35
+ description: Popis
36
+ content: Obsah
37
+ author: Autor
38
+ mail: 'E-mail'
39
+ note: Poznámka
40
+ status: Stav
41
+ password: Heslo
42
+ password_confirmation: Potvrzení hesla
43
+ login: Login
44
+ activerecord:
45
+ models:
46
+ symphonia/user: 'Uživatel'
47
+ role: 'Role'
48
+ image: 'Obrázek'
49
+ common_file: 'Soubor'
50
+ attachment: Příloha
51
+ errors:
52
+ template:
53
+ body: "Formulář obsahuje chybně vyplněná pole:"
54
+ attributes:
55
+ attachment:
56
+ attachment_file_name: Název souboru
57
+ attachment_content_type: Typ
58
+ attachment_file_size: Velikost
59
+ attachment_updated_at: Aktualizován
60
+ symphonia/user:
61
+ login: Přihlašovací jméno
62
+ name: Jméno
63
+ first_name: Jméno
64
+ last_name: Příjmení
65
+ admin: Administrátor
66
+ status: Stav
67
+ language: Jazyk
68
+ password: 'Heslo'
69
+ password_confirmation: 'Potvrzení hesla'
70
+ single_access_token: 'Přihlašovací klíč'
71
+ login_count: 'Počet přihlášení'
72
+ failed_login_count: 'Počet neúspěšných pokusů o přihlášení'
73
+ current_login_at: 'Součané přihlášení'
74
+ current_login_ip: 'IP adresa současného přihlášení'
75
+ last_login_ip: 'IP adresa posledního přihlášení'
76
+ last_login_at: 'Poslední přihlášení'
77
+ edited_by: 'Upravil'
78
+ edited_at: 'Upraveno'
79
+ role_id: 'Role'
80
+ ssl: Používat SSL?
81
+
82
+ recaptcha:
83
+ errors:
84
+ verification_failed: 'Nesprávný text z obrázku'
85
+
86
+ helpers:
87
+ submit:
88
+ create: Vytvořit
89
+ submit: Uložit
90
+ update: Aktualizovat
91
+
92
+
93
+ meta_title: ''
94
+ meta_description: ''
95
+ meta_keywords: ''
96
+
97
+ "true": 'Ano'
98
+ "false": 'Ne'
99
+ none: 'Žádné'
100
+ nothing: 'Nic'
101
+ language: 'Čeština'
102
+
103
+ button_add: Přidat
104
+ button_edit: Upravit
105
+ button_delete: Smazat
106
+ button_show: Zobrazit
107
+ button_new: Nový
108
+ button_create: Vytvořit
109
+ button_create_and_continue: Vytvořit a pokračovat
110
+ button_submit: Odeslat
111
+ button_submit_and_continue: Uložit a pokračovat
112
+ button_update: Upravit
113
+ button_back: Zpět
114
+ button_cancel: Zrušit
115
+ button_archive: Zamknout
116
+ button_unarchive: Odemknout
117
+ button_active: Aktivovat
118
+ button_login: Přihlásit
119
+ button_logout: Odhlásit
120
+ button_apply_filter: Filtruj
121
+ button_apply: Použit
122
+ button_reset: Vymazat
123
+ button_print: Tisknout
124
+ button_confirm: Potvrdit
125
+ button_save: Uložit
126
+ button_close: Zavřít
127
+ button_continue: Pokračovat
128
+ button_download: Stáhnout
129
+ button_search: Hledej
130
+ button_administration: Administrace
131
+ button_register: Registrovat
132
+ text_are_you_sure: Jsi si jistý?
133
+ text_updated: Uloženo
134
+ text_created: Úspěšně vytvořeno
135
+ text_destroyed: Záznam smazán
136
+ text_successfully_logout: Odhlášen
137
+ text_no_data: Žádné záznamy
138
+ text_access_deny: Přístup odepřen
139
+ text_login_require: Přihlaste se prosím
140
+ text_user_registered: Děkujeme za registraci. Váš účet bude nyní aktivován administrátorem. O dokončení aktivace Vás budeme informovat emailem.
141
+ text_user_not_found_or_token_invalid: Uživatel nenalezen
142
+ text_activation_success: Aktivace proběhla úspěšně
143
+ text_user_alerady_active: Tento účet je již aktivován
144
+ text_user_not_found: Účet nenalezen
145
+ text_activation_resend: Aktivační odkaz odeslán
146
+ text_reset_password_resend: Informace o změně hesla odeslány
147
+ text_explanation_recaptcha: 'Opište prosím tato dvě slova:'
148
+ text_or: nebo
149
+ text_confirm_send_unlock_mail: Po aktivaci účtu bude uživateli zaslán email.
150
+ text_error_no_data_file_input: Nebyl vybrán žádný soubor
151
+ text_image_successfully_destroy: Obrázek byl smazán
152
+ text_common_file_successfully_destroy: Soubor byl smazán
153
+ text_error_query_not_init: Filtry nejsou nastaveny. Registruj query!
154
+ text_error_there_is_no_filters_available: Nejsou zaregistrované žádné validní filtry.
155
+ text_error_login_required: Přihlašte se prosím
156
+
157
+ title_toggle_multiselect: Přepnout multiselect
158
+ title_login: Přihlášení
159
+ title_advanced_filters: Pokročilé filtrování
160
+ title_add_images: Přidat obrázky
161
+
162
+ label_home: Domů
163
+ label_my_account: Můj účet
164
+ label_preferences: Správa
165
+ label_users: Uživatelé
166
+ label_user_new: Nový uživatel
167
+ label_roles: Role
168
+ label_role_new: Nová role
169
+ label_register_new_user: Registrace nového uživatele
170
+ label_filters: Filtry
171
+ label_user_notifications: E-mailová oznámení
172
+ label_reset_password: Zapomenuté heslo
173
+ label_send_activation_again: Zaslat znovu aktivační email
174
+ label_status: Stav
175
+ label_overview: Přehled
176
+ label_edit: Upravit
177
+
178
+ label_images: Obrázky
179
+ label_files: Soubory
180
+
181
+ label_loading: Nahrávám...
182
+
183
+ legend_form_basic_fields: Základní údaje
184
+
185
+ subject_activation_mail: Aktivace účtu
186
+ subject_reset_password_mail: Zapomenuté heslo
187
+ subject_user_registered: Registrován nový uživatel
188
+ mailer:
189
+ text_html_user_created: Byl zaregistrován nový uživatel.
190
+ text_html_reset_password: 'Nové heslo si můžete nastavit zde:'
191
+ text_html_activation_account: "Děkujeme za registraci,\n Váš účet je třeba aktivovat otevřením následujího odkazu:"
192
+
193
+ will_paginate:
194
+ previous_label: Předchozí
195
+ next_label: Další
196
+ page_gap: "&hellip;"
197
+
198
+ symphonia/user:
199
+ statuses:
200
+ active: Aktivní
201
+ pending: Nový
202
+ archived: Archivovaný
203
+
204
+ preferences:
205
+ notify_after_user_registered: 'Po registraci nového uživatele'
206
+
207
+ permissions:
208
+ view_users: 'Zobrazení uživatelů'
209
+ manage_users: 'Správa uživatelů'
210
+ label_total: "Celkem"
211
+ share_on:
212
+ title:
213
+ facebook: Sdílej na Facebooku !
214
+ twitter: Sdílej na Twitteru !
215
+ google_plus: Sdílej na Google Plus !
216
+ label_search: "Hledat"
217
+ query_options:
218
+ columns: Sloupce
219
+ filters: Filtry
220
+ filter_date:
221
+ from: Od
222
+ to: Do
223
+ values:
224
+ today: Dnes
225
+ this_month: Tento měsíc
226
+ this_year: Tento rok
227
+ custom: Vlastní
228
+ status:
229
+ active: Aktivní
230
+ archive: Archivovaný
231
+ change_status:
232
+ active: Aktivovat
233
+ archive: Archivovat
@@ -0,0 +1,47 @@
1
+ en:
2
+ general_locale: English
3
+ authlogic:
4
+ text_login_failed: 'Login failed'
5
+ error_messages:
6
+ # login_blank: can not be blank
7
+ login_not_found: 'not found'
8
+ login_invalid: 'is invalid'
9
+ consecutive_failed_logins_limit_exceeded: 'Your account has been blocked. You trying too many logged in. Please contact administrator.'
10
+ email_invalid: 'is invalid'
11
+ # password_blank: can not be blank
12
+ password_invalid: 'is invalid'
13
+ not_active: 'Account is not activated'
14
+ # not_confirmed: Your account is not confirmed
15
+ # not_approved: Your account is not approved
16
+ # no_authentication_details: You did not provide any details for authentication.
17
+ # general_credentials_error: Login/Password combination is not valid
18
+
19
+ meta_title: ''
20
+ meta_description: ''
21
+ meta_keywords: ''
22
+
23
+ "true": 'Yes'
24
+ "false": 'No'
25
+ none: 'None'
26
+ nothing: 'Nothing'
27
+ language: 'English'
28
+ button_add: Add
29
+ button_edit: Edit
30
+ button_delete: Delete
31
+ button_show: Show
32
+ button_new: New
33
+ button_create: Create
34
+ button_create_and_continue: Create and continue
35
+ button_submit: Odeslat
36
+ button_submit_and_continue: Submit and continue
37
+ button_update: Update
38
+ button_back: Back
39
+ button_save: Save
40
+ text_are_you_sure: "Are you sure?"
41
+ share_on:
42
+ title:
43
+ facebook: Share on Facebooku !
44
+ twitter: Share on Twitteru !
45
+ google_plus: Share on Google Plus !
46
+
47
+ label_search: "Search"
data/config/routes.rb ADDED
@@ -0,0 +1,52 @@
1
+ require 'sidekiq/web'
2
+ require 'symphonia/admin_constraint'
3
+ Symphonia::Engine.routes.draw do
4
+
5
+ get :api, to: 'api#index'
6
+
7
+ get '/login', to: 'user_sessions#new'
8
+ delete '/logout', to: 'user_sessions#destroy'
9
+ get '/register', to: 'accounts#register', as: 'account_register'
10
+ post '/register', to: 'accounts#create'
11
+
12
+ get '/activation/:activation_code', to: 'accounts#activation'
13
+ get '/reset_password/:id', to: 'accounts#reset_password', as: 'reset_password'
14
+
15
+ scope 'admin' do
16
+ get 'user/current', to: 'users#show', as: 'user_current'
17
+
18
+ root 'admin#index'
19
+
20
+ resources :roles
21
+ resources :user_sessions
22
+ resources :users do
23
+ member do
24
+ post :archive
25
+ post :unarchive
26
+ end
27
+ end
28
+ resource :account do
29
+ collection do
30
+ get :new_activation
31
+ get :resend_activation
32
+ post :resend_activation
33
+ get :lost_password
34
+ post :lost_password
35
+ end
36
+ member do
37
+ match :reset_password, via: [:get, :put]
38
+ end
39
+ end
40
+
41
+ get 'filters/:type/options', to: 'filters#options', as: 'filters_options'
42
+
43
+ match 'attachments/:id', to: 'attachments#show', via: [:get, :post], as: 'attachment'
44
+ delete 'attachments/:id', to: 'attachments#destroy', as: 'destroy_attachment'
45
+ patch 'attachments(/:id)/reorder(/:position)', to: 'attachments#reorder', as: 'reorder_attachment'
46
+
47
+ get 'test_mail', to: 'admin#test_mail'
48
+
49
+ mount ::Sidekiq::Web => '/sidekiq', constraints: Symphonia::AdminConstraint.new
50
+ end
51
+
52
+ end
@@ -0,0 +1,49 @@
1
+ class CreateUsers < ActiveRecord::Migration[5.1]
2
+ def up
3
+ create_table :users, force: true do |t|
4
+ t.boolean :admin, null: false, default: false
5
+ t.integer :status, null: false, default: 1, index: true
6
+
7
+ t.string :login, null: false
8
+ t.string :first_name
9
+ t.string :last_name
10
+ t.string :email, null: false
11
+ t.string :language, null: true
12
+ # Authlogic::ActsAsAuthentic::Password
13
+ t.string :crypted_password
14
+ t.string :password_salt
15
+
16
+ # Authlogic::ActsAsAuthentic::PersistenceToken
17
+ t.string :persistence_token
18
+ t.index :persistence_token, unique: true
19
+
20
+ # Authlogic::ActsAsAuthentic::SingleAccessToken
21
+ t.string :single_access_token
22
+ t.index :single_access_token, unique: true
23
+
24
+ # Authlogic::ActsAsAuthentic::PerishableToken
25
+ t.string :perishable_token
26
+ t.index :perishable_token, unique: true
27
+
28
+ # Authlogic::Session::MagicColumns
29
+ t.integer :login_count, default: 0, null: false
30
+ t.integer :failed_login_count, default: 0, null: false
31
+ t.datetime :last_request_at
32
+ t.datetime :current_login_at
33
+ t.datetime :last_login_at
34
+ t.string :current_login_ip
35
+ t.string :last_login_ip
36
+
37
+ t.references :edited_by
38
+ t.datetime :edited_at
39
+
40
+ t.references :role
41
+
42
+ t.timestamps
43
+ end
44
+ end
45
+
46
+ def down
47
+ drop_table :users
48
+ end
49
+ end
@@ -0,0 +1,16 @@
1
+ class CreateRoles < ActiveRecord::Migration[5.1]
2
+ def up
3
+ create_table :roles do |t|
4
+ t.string :name, :null => false
5
+ t.text :description, :null => true
6
+
7
+ t.text :permissions
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def down
14
+ drop_table :roles
15
+ end
16
+ end
@@ -0,0 +1,26 @@
1
+ class CreatePreferences < ActiveRecord::Migration[5.1]
2
+ def up
3
+ create_table :preferences do |t|
4
+ t.string :name, null: false, index: true
5
+ t.string :value
6
+ t.string :type
7
+ t.boolean :restrict, default: false
8
+
9
+ t.timestamps
10
+ end
11
+
12
+ create_table :preferences_users, id: false do |t|
13
+ t.references :user
14
+ t.references :preference
15
+ end
16
+
17
+ add_index :preferences_users, [:user_id, :preference_id]
18
+
19
+ Symphonia::EmailPreference.create(name: 'notify_after_user_registered', restrict: true)
20
+ end
21
+
22
+ def down
23
+ drop_table :preferences
24
+ drop_table :preferences_users
25
+ end
26
+ end
@@ -0,0 +1,20 @@
1
+ class CreateAttachments < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :attachments do |t|
4
+ t.string :type
5
+ t.string :attachment_file_name, null: false
6
+ t.string :attachment_content_type, null: false
7
+ t.integer :attachment_file_size, null: false
8
+ t.datetime :attachment_updated_at, null: false
9
+
10
+ t.references :attachable, polymorphic: true, null: true
11
+
12
+ t.text :description, null: true
13
+ t.integer :position, default: 1, index: true
14
+
15
+ t.timestamps null: false
16
+
17
+ t.index([:type, :attachable_type])
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ class CreateAdminModules < ActiveRecord::Migration[5.1]
2
+ def up
3
+ create_table :admin_modules do |t|
4
+ t.string :type
5
+ t.string :title
6
+ t.text :description
7
+ t.string :panel_type, :default => 'default'
8
+ t.text :settings#, :limit => 100.megabytes
9
+ t.belongs_to :user, :null => true
10
+
11
+ t.integer :position, default: 1, index: true
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+
17
+ def down
18
+ drop_table(:admin_modules)
19
+ end
20
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,12 @@
1
+ u = Symphonia::User.new
2
+ u.attributes = {
3
+ login: 'admin',
4
+ first_name: 'Lukáš',
5
+ last_name: 'Pokorný',
6
+ email: 'luk4s.pokorny@gmail.com',
7
+ password: 'admin',
8
+ password_confirmation: 'admin',
9
+ admin: true
10
+ }
11
+ u.single_access_token = SecureRandom.hex(20)
12
+ u.save!(validate: false)
@@ -0,0 +1,48 @@
1
+ require 'rails/generators/resource_helpers'
2
+ module Symphonia
3
+ module Generators
4
+ class EntityController < Rails::Generators::NamedBase
5
+ include Rails::Generators::ResourceHelpers
6
+
7
+ source_root File.expand_path("../templates", __FILE__)
8
+
9
+ check_class_collision suffix: "Controller"
10
+
11
+ class_option :helper, type: :boolean
12
+ class_option :orm, banner: "NAME", type: :string, required: true,
13
+ desc: "ORM to generate the controller for"
14
+ class_option :api, type: :boolean,
15
+ desc: "Generates API controller"
16
+
17
+ class_option :namespace, type: :string
18
+
19
+ argument :attributes, type: :array, default: [], banner: "field:type field:type"
20
+
21
+ def create_controller_files
22
+ template_file = options.api? ? "api_controller.rb" : "controller.rb"
23
+ template template_file, File.join("app/controllers", controller_class_path, "#{controller_file_name}_controller.rb")
24
+ end
25
+
26
+ hook_for :helper, in: :rails do |invoked|
27
+ invoke invoked, [ controller_name ]
28
+ end
29
+
30
+ def namespace
31
+ options['namespace'] && options['namespace'].safe_constantize || super
32
+ end
33
+
34
+ def show_helper # :doc:
35
+ "#{singular_table_name}_path(@#{singular_table_name})"
36
+ end
37
+
38
+ def edit_helper # :doc:
39
+ "edit_#{show_helper}"
40
+ end
41
+
42
+ def new_helper # :doc:
43
+ "new_#{singular_table_name}_path"
44
+ end
45
+
46
+ end
47
+ end
48
+ end