symphonia 2.1.7

Sign up to get free protection for your applications and to get access to all the features.
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,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="<%= I18n.locale %>">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
6
+ </head>
7
+ <body>
8
+ <div class="container">
9
+ <%= yield %>
10
+ </div>
11
+
12
+ </body>
13
+ </html>
@@ -0,0 +1,65 @@
1
+ <div class="buttons contextual">
2
+ <% if Symphonia::User.current.admin? %>
3
+ <% controller = account.class.name.underscore.pluralize %>
4
+ <%= link_to(icon('edit', t(:button_edit)), edit_polymorphic_path(account), class: 'btn btn-primary') %>
5
+ <% if use_service_buttons %>
6
+ <% if account.active? %>
7
+ <%= link_to(fa_icon('lock', text: t(:button_archive)), {:controller => controller, :action => 'archive', :id => account, :back_url => polymorphic_path(account)}, :class => 'btn btn-secondary', :data => {:method => 'post', :confirm => t(:text_are_you_sure)}) %>
8
+ <% elsif account.status_new? %>
9
+ <%= link_to(fa_icon('bolt', text: t(:button_active)), {:controller => controller, :action => 'unarchive', :id => account, :back_url => polymorphic_path(account)}, :class => 'btn btn-secondary', :data => {:method => 'post', :confirm => t(:text_are_you_sure) + "\n #{t(:text_confirm_send_unlock_mail)}"}) %>
10
+ <% else %>
11
+ <%= link_to(fa_icon('unlock', text: t(:button_unarchive)), {:controller => controller, :action => 'unarchive', :id => account, :back_url => polymorphic_path(account)}, :class => 'btn btn-secondary', :data => {:method => 'post', :confirm => t(:text_are_you_sure) + "\n #{t(:text_confirm_send_unlock_mail)}"}) %>
12
+ <% end %>
13
+ <%= link_to(fa_icon('delete', text: t(:button_delete)), account, :class => 'btn btn-danger', :method => 'delete', :data => {:confirm => t(:text_are_you_sure)}) %>
14
+ <% end -%>
15
+ <% else %>
16
+ <%= link_to(icon('edit', t(:button_edit)), edit_polymorphic_path(controller_name.singularize, id: account.id), :class => 'btn btn-primary', :remote => true) %>
17
+ <% end %>
18
+ <%= link_to(fa_icon('key'), 'javascript:void(0)', onclick: %q{SymphoniaUserDetail.popup.show()}, class: 'btn') %>
19
+ </div>
20
+
21
+ <%= title(account.name, account.active? && '' || account.format_value(:status, self)) %>
22
+
23
+ <div class="row">
24
+ <div class="col-md-4">
25
+ <div class="row">
26
+ <div class="col-md-6"><b><%= account.class.human_attribute_name(:login) %></b></div>
27
+ <div class="col-md-6"><span ><%= account.login %></span></div>
28
+ </div>
29
+ </div>
30
+ <div class="col-md-4">
31
+ <div class="row">
32
+ <div class="col-md-6"><b><%= account.class.human_attribute_name(:email) %></b></div>
33
+ <div class="col-md-6"><span ><%= account.format_value(:email, self) %></span></div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+
38
+ <div id="customer_detail" style="display: none">
39
+ <div class="clearfix">
40
+ <%= content_tag(:strong, account.class.human_attribute_name(:current_login_at), :class => 'col-xs-6') %>
41
+ <%= content_tag(:div, account.current_login_at ? time_tag(account.current_login_at) : '-', :class => 'col-xs-6') %>
42
+ <%= content_tag(:strong, account.class.human_attribute_name(:current_login_ip), :class => 'col-xs-6') %>
43
+ <%= content_tag(:div, account.current_login_ip || '-', :class => 'col-xs-6') %>
44
+ <%= content_tag(:strong, account.class.human_attribute_name(:last_login_at), :class => 'col-xs-6') %>
45
+ <%= content_tag(:div, account.last_login_at ? time_tag(account.last_login_at.localtime) : '-', :class => 'col-xs-6') %>
46
+ <%= content_tag(:strong, account.class.human_attribute_name(:last_login_ip), :class => 'col-xs-6') %>
47
+ <%= content_tag(:div, account.last_login_ip || '-', :class => 'col-xs-6') %>
48
+ <%= content_tag(:strong, account.class.human_attribute_name(:single_access_token), :class => 'col-xs-6') %>
49
+ <%= content_tag(:div, text_field_tag(:token, account.single_access_token, :style => 'border:none'), :class => 'col-xs-6') %>
50
+ </div>
51
+ </div>
52
+
53
+ <script type="text/javascript">
54
+ SymphoniaUserDetail = {
55
+ popup: {
56
+ dialog: null,
57
+ show: function() {
58
+ if (!this.dialog) {
59
+ this.dialog = new SymphoniaDialog("customer_detail");
60
+ }
61
+ this.dialog.show()
62
+ }
63
+ }
64
+ };
65
+ </script>
@@ -0,0 +1,14 @@
1
+ <div class="row">
2
+ <div class="col-xs-12 col-sm-6 col-md-3"><%= f.text_field :login, required: true %></div>
3
+ <div class="col-xs-12 col-sm-6 col-md-3"><%= f.email_field :mail, required: true %></div>
4
+ <div class="col-xs-12 col-sm-6 col-md-3"><%= f.text_field :first_name, required: true %></div>
5
+ <div class="col-xs-12 col-sm-6 col-md-3"><%= f.text_field :last_name, required: true %></div>
6
+ </div>
7
+ <div class="row">
8
+ <div class="col-xs-12 col-sm-6">
9
+ <%= f.password_field :password, required: f.object.new_record?, prepend: icon('key') %>
10
+ </div>
11
+ <div class="col-xs-12 col-sm-6">
12
+ <%= f.password_field :password_confirmation, required: f.object.new_record? %>
13
+ </div>
14
+ </div>
@@ -0,0 +1,9 @@
1
+ <%= title(@user.name) %>
2
+ <%= symphonia_form_for(@user, :url => {:action => 'update'}) do |f| %>
3
+ <%= render(:partial => @user.form_path, :locals => {:f => f}) %>
4
+
5
+ <div class="buttons">
6
+ <%= link_to_back %>
7
+ <%= f.primary t(:button_update) %>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render_symphonia_dialog(@user.name, large: true) do |m| %>
2
+ <% m.body = proc{ render(template: 'accounts/edit', formats: [:html])} %>
3
+ <% m.submit %>
4
+ <% end %>
5
+ //$("#modal-dialog").find("form")[0].dataset.remote = true;
@@ -0,0 +1,6 @@
1
+ <%= form_tag symphonia.lost_password_account_path do %>
2
+ <div class="form-group required">
3
+ <%= label_tag(:mail, t(:'attributes.mail'), required: true, class: 'sr-only') %>
4
+ <%= email_field_tag(:mail, nil, autofocus: true, placeholder: t(:'attributes.mail'), required: true, size: 35, class: 'form-control') %>
5
+ </div>
6
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= render_modal title: t(:label_reset_password) do %>
2
+ <% render(template: 'symphonia/accounts/lost_password', formats: [:html]) %>
3
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%= content_tag(:h2, t(:label_send_activation_again)) %>
2
+ <%= form_tag({:action => 'resend_activation'}, :class => 'tabular') do %>
3
+ <p>
4
+ <%= label_tag(:mail, Symphonia::User.human_attribute_name(:mail), :required => true) %>
5
+ <%= email_field_tag(:mail, nil, :required => true, :size => 35) %>
6
+ </p>
7
+
8
+ <p class="buttons">
9
+ <%= submit_tag(t(:button_submit)) %>
10
+ </p>
11
+ <% end %>
@@ -0,0 +1,6 @@
1
+ $("#modal-dialog").html('<%= escape_javascript(render(:template => 'accounts/new_activation', :formats => 'html')) %>');
2
+ modalTitle= $("#modal-dialog h2").text();
3
+ $("#modal-dialog h2").remove();
4
+ $("#modal-dialog .tabular").removeClass('tabular');
5
+ $("#modal-dialog").dialog({modal:true, title: modalTitle, width: 'auto'});
6
+ $("#modal-dialog input[type=email]").first().focus();
@@ -0,0 +1,20 @@
1
+ <% name = @user.class.name.demodulize.downcase %>
2
+ <%= title(t(:"label_register_new_#{name}")) %>
3
+ <%= symphonia_form_for(@user, url: account_register_path) do |f| %>
4
+ <div style="width:1px;height: 1px;visibility: hidden"><%= check_box_tag :terms, true %></div>
5
+
6
+ <%= render(partial: "symphonia/#{name.pluralize}/form", locals: { f: f }) %>
7
+
8
+ <% if defined? Recaptcha %>
9
+ <fieldset>
10
+ <%= content_tag(:legend, t(:text_explanation_recaptcha)) %>
11
+ <div class="form-group">
12
+ <div class="col-sm-offset-4 col-sm-5">
13
+ <%#= invisible_recaptcha_tags %>
14
+ <%= recaptcha_tags(:display => {:theme => 'white'}) %>
15
+ </div>
16
+ </div>
17
+ </fieldset>
18
+ <% end %>
19
+ <%= f.primary t(:button_register) %>
20
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <div class="row">
2
+ <div class="col-md-6 col-xs-12 mx-auto">
3
+ <div class="card w-75 mx-auto">
4
+ <div class="card-body">
5
+ <h4 class="card-title"><%= t(:label_reset_password) %></h4>
6
+ <%= symphonia_form_tag(url: reset_password_account_path(params[:id]), method: 'put') do |f| %>
7
+ <%= f.error_messages %>
8
+ <%= f.password_field(:password, label: t(:'attributes.password'), required: true, wrapper_class: 'required') -%>
9
+ <%= f.password_field(:password_confirmation, label: t(:'attributes.password_confirmation'), required: true, wrapper_class: 'required') -%>
10
+
11
+ <%= f.submit(t(:button_submit), class: 'btn btn-primary btn-block') -%>
12
+
13
+ <% end %>
14
+
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </div>
@@ -0,0 +1 @@
1
+ $("#modal-dialog").modal('hide');
@@ -0,0 +1,15 @@
1
+ <%= title 'Administrace' %>
2
+ <% @admin_modules.each_with_index do |admin_module, _index| %>
3
+ <div class="col-lg-<%= @modules_count == 1 ? '12' : '6' %>" id="<%= dom_id(admin_module) %>">
4
+ <h3><%= t(admin_module.title, scope: [:admin_module, :titles], default: admin_module.title) %></h3>
5
+ <% if admin_module.body_path.is_a?(Symbol) %>
6
+ <%= render(partial: "admin_modules/#{admin_module.body_path}", locals: { admin_module: admin_module }) -%>
7
+ <% else %>
8
+ <%= format_text(admin_module.body_path) -%>
9
+ <% end -%>
10
+ </div>
11
+ <% end -%>
12
+
13
+ <%= content_for :meta_tags do %>
14
+ <meta name="turbolinks-root" content="/admin">
15
+ <% end %>
@@ -0,0 +1 @@
1
+ $("#<%= dom_id(@attachment) -%>").remove()
@@ -0,0 +1,12 @@
1
+ <div id="editable_images" class="row">
2
+ <% images.order(:position, :attachment_file_name).each_with_index do |image, _index| %>
3
+ <div class="entity-edit-image col-sm-4 col-lg-2 text-center" data-id="<%= image.id %>">
4
+ <div class="card" id="<%= dom_id(image) %>">
5
+ <%= image_tag(image.attachment.url(:thumb), class: 'card-img-top') %>
6
+ <div class="card-link">
7
+ <%= link_to(icon('del'), symphonia.destroy_attachment_path(image), method: :delete, remote: true, data: { confirm: t(:text_are_you_sure) }, title: t(:button_delete)) %>
8
+ </div>
9
+ </div>
10
+ </div>
11
+ <% end -%>
12
+ </div>
@@ -0,0 +1,23 @@
1
+ <% if @query %>
2
+ <%#= bootstrap_form_tag(url: {set_filter: 1}, method: :get, class: 'form-horizontal', id: 'symphonia_filters_form') do |f| %>
3
+ <div class="row hidden-print">
4
+ <% if @query.search? %>
5
+ <div class="col-sm-12">
6
+ <div class="input-group input-group-sm">
7
+ <%= search_field_tag(:q, params[:q], class: 'form-control input-sm', id: 'symphonia_query_q', placeholder: t(:label_search), autofocus: params[:q].present? || nil, data: {remote: local_assigns[:remote]}, onchange: 'submitSymphoniaQueryQ(this)') %>
8
+ <div class="input-group-append">
9
+ <div class="input-group-text">
10
+ <%= link_to(fa_icon('search'), 'javascript:void(0)', {onclick: 'Symphonia.filters.search(document.getElementById("symphonia_query_q"))', title: t(:button_search)}) %>
11
+ <%= link_to(fa_icon('filter'), symphonia.filters_options_path(@query.model.name, @query.to_params.merge(path: j(request.url))), remote: true, title: t(:title_advanced_filters)) unless local_assigns.key?(:hide_advanced_filter) %>
12
+ <%= link_to(fa_icon('false'), 'javascript:void(0)', onclick: 'Symphonia.filters.resetSearch(document.getElementById("symphonia_query_q"))') if params[:q] %>
13
+ </div>
14
+
15
+ </div>
16
+ </div>
17
+ </div>
18
+ <% end %>
19
+ </div>
20
+ <%# end %>
21
+ <% else %>
22
+ <%= content_tag(:p, t(:text_error_query_not_init), class: 'no-data') %>
23
+ <% end -%>
@@ -0,0 +1,16 @@
1
+ <% options ||= {} %>
2
+ <% if I18n.available_locales.count > 1 %>
3
+ <ul class="nav nav-pills form-horizontal" id="symphonia_locale_changer" data-inactive="<%= entity.new_record? -%>" data-url="<%= url %>" data-remote="<%= options[:remote] == true %>">
4
+ <% I18n.available_locales.sort.each do |locale| %>
5
+ <li class="nav-item radio">
6
+ <%= link_to('javascript:void(0)', class: "nav-link #{'active' if @locale == locale}", data: { locale: locale }) do %>
7
+ <%= label_tag("locale_#{locale}") do %>
8
+ <%= radio_button_tag(:locale, locale, @locale == locale) -%>
9
+ <%= t(:general_locale, locale: locale)%>
10
+ <% end -%>
11
+ <% end -%>
12
+ </li>
13
+ <% end -%>
14
+ </ul>
15
+ <br />
16
+ <% end -%>
@@ -0,0 +1,5 @@
1
+ <span class="share-buttons">
2
+ <%= link_to(fa_icon("facebook-square #{icon_css}"), "http://www.facebook.com/share.php?u=#{url}&title=#{name}", :title => t(:facebook, :scope => [:share_on, :title]), :target => '_blank') %>
3
+ <%= link_to(fa_icon("twitter-square #{icon_css}"), "http://twitter.com/home?status=#{name}+#{url}", :title => t(:twitter, :scope => [:share_on, :title]), :target => '_blank') %>
4
+ <%= link_to(fa_icon("google-plus-square #{icon_css}"), "https://plus.google.com/share?url=#{url}", :title => t(:google_plus, :scope => [:share_on, :title]), :target => '_blank') %>
5
+ </span>
@@ -0,0 +1,36 @@
1
+ <%= symphonia_form_tag(url: params.require(:path), method: :get, html: { id: 'symphonia_query_options_form' }) do |f| %>
2
+ <% if true #false # TODO: Move to inline-table UI %>
3
+ <fieldset class="symphonia-query-filters-selector">
4
+ <legend><%= t('query_options.filters') %></legend>
5
+ <div class="row">
6
+
7
+ <%= hidden_field_tag(:set_filter, '1') %>
8
+ <% @query.render_filters do |xf| %>
9
+ <div class="form-group col-6">
10
+ <%= label_tag("filters_#{xf.name}", t(xf.caption, default: xf.caption), class: 'control-label') %>
11
+ <%= xf.form_field(self) %>
12
+ </div>
13
+ <% end -%>
14
+ </div>
15
+
16
+ </fieldset>
17
+ <% end %>
18
+ <fieldset class="clearfix symphonia-query-column-selector">
19
+ <legend><%= t('query_options.columns') %></legend>
20
+ <% (@query.columns + (@query.columns(true) - @query.columns)).each do |column| # reordering %>
21
+ <div class="column reorder">
22
+ <%= f.check_box(column.name, label: column.title, checked: @query.column_names.include?(column.name)) %>
23
+ </div>
24
+ <% end %>
25
+ </fieldset>
26
+
27
+ <% unless request.xhr? %>
28
+ <div class="buttons">
29
+ <%= link_to(t(:button_reset), 'javascript:void(0)', onclick: %q{window.location = window.location.protocol + '//' + window.location.host + window.location.pathname + '?set_filter=0'}, class: 'btn btn-danger pull-left') %>
30
+ <%= link_to(t(:button_submit), %q{javascript:window.symphoniaFiltersForm.submit()}, class: 'btn btn-primary') %>
31
+ </div>
32
+ <% end %>
33
+ <% end %>
34
+ <script type="text/javascript">
35
+ window.symphoniaFiltersForm = new SymphoniaFilter('symphonia_query_options_form')
36
+ </script>
@@ -0,0 +1,9 @@
1
+ <%= render_modal id: 'query_options_modal', title: t(:title_advanced_filters), large: true do %>
2
+ <% render(template: 'symphonia/filters/options', formats: [:html]) %>
3
+ <% end %>
4
+ window.symphoniaFiltersForm = new SymphoniaFilter('symphonia_query_options_form')
5
+ var $m = $(renderModal["query_options_modal"].footer);
6
+ $m.prepend($("<%=j link_to(t(:button_reset), 'javascript:void(0)', onclick: %q{window.location = window.location.protocol + '//' + window.location.host + window.location.pathname + '?set_filter=0'}, class: 'btn btn-danger pull-left') %>"))
7
+ $m.find("button")[0].onclick = window.symphoniaFiltersForm.submit;
8
+
9
+ //initDatepicker(".symphonia-query-filters-selector .datepicker")
@@ -0,0 +1,21 @@
1
+ <%# if entities.any? %>
2
+ <div id="query_data">
3
+ <table class="table <%= query.entity.name.pluralize.underscore %> table-striped">
4
+ <thead>
5
+ <tr>
6
+ <%= table_header_tag_for(query.model) do |t|
7
+ query.columns.each{|c| c.header(t)}
8
+ end %>
9
+ <th></th>
10
+ </tr>
11
+ </thead>
12
+ <tbody>
13
+ <%= tbody %>
14
+ </tbody>
15
+ </table>
16
+
17
+ <%#= will_paginate entities %>
18
+ </div>
19
+ <%# else %>
20
+ <%#= render_no_data %>
21
+ <%# end %>
@@ -0,0 +1,19 @@
1
+ <%= f.error_messages %>
2
+ <%= hidden_field_tag(:back_url, params[:back_url].presence || request.env['HTTP_REFERER'].presence || session[:back_url]) %>
3
+ <%= f.text_field :login, required: true, autofocus: true %>
4
+
5
+ <%= f.password_field :password, required: true %>
6
+
7
+ <%= f.form_group :remember_me do %>
8
+ <%= f.check_box :remember_me %>
9
+ <% end %>
10
+
11
+ <%= f.form_group class: 'text-center' do %>
12
+ <%= f.submit t(:button_login), class: 'btn btn-primary btn-block' %>
13
+ <% if f.object.is_a?(Symphonia::User) %>
14
+ <%= link_to(t(:label_reset_password), lost_password_account_path, remote: true, class: 'btn btn-link btn-sm ') %>
15
+ <% if Symphonia.config[:allow_registrations] %>
16
+ <%= link_to(t(:button_register), register_path, class: 'btn btn-link btn-sm ') %>
17
+ <% end %>
18
+ <% end %>
19
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <div class="row">
2
+ <div class="col-md-6 col-xs-12 mx-auto">
3
+ <div class="card w-75 mx-auto">
4
+ <div class="card-body">
5
+ <%= symphonia_form_for(@model_session, as: :login_session, html: { id: 'login-form' }) do |f| %>
6
+ <%= render('form', f: f) %>
7
+ <% end %>
8
+ </div>
9
+ </div>
10
+ </div>
11
+ </div>
@@ -0,0 +1 @@
1
+ <%= render(template: 'login/new') -%>
@@ -0,0 +1,7 @@
1
+ <p>
2
+ <%= t(:'mailer.text_html_activation_account') %>
3
+ </p>
4
+ <p>
5
+ <% activation_url = symphonia.new_activation_account_url(@user.perishable_token) %>
6
+ <%= link_to(activation_url, activation_url) %>
7
+ </p>
@@ -0,0 +1,3 @@
1
+ <%= t(:'mailer.text_html_activation_account') %>
2
+
3
+ <%= symphonia.new_activation_account_url(@user.perishable_token) %>
@@ -0,0 +1,7 @@
1
+ <p>
2
+ <%= t(:text_html_reset_password, :scope => :mailer) %>
3
+ </p>
4
+ <p>
5
+ <% activation_url = symphonia.reset_password_url(id: @user.perishable_token) %>
6
+ <%= link_to(activation_url, activation_url) %>
7
+ </p>
@@ -0,0 +1,3 @@
1
+ <%= t(:'mailer.text_html_reset_password') %>
2
+
3
+ <%=symphonia.reset_password_url(id: @user.perishable_token) %>
@@ -0,0 +1,2 @@
1
+ <%= format_text('Testing _mail_ from *Symphonia* system') %>
2
+ <%= link_to(root_url, root_url) %>
@@ -0,0 +1,3 @@
1
+ Testing mail from Symphonia system
2
+
3
+ <%= root_url %>
@@ -0,0 +1,3 @@
1
+ <p>
2
+ Váš účet je nyní aktivován. Můžete se přihlásit <%= link_to('zde', symphonia.user_url(@user)) %>.
3
+ </p>
@@ -0,0 +1 @@
1
+ Váš účet je nyní aktiván. Přihlásit se můžete zde: <%= symphonia.user_url(@user) %>
@@ -0,0 +1,13 @@
1
+ <p>
2
+ <%= t(:'mailer.text_html_user_created') %>
3
+ -
4
+ <%= time_tag(Time.now) %>
5
+ </p>
6
+ <p>
7
+ <%= content_tag(:span, Symphonia::User.human_attribute_name(:first_name)) %>:
8
+ <%= content_tag(:strong, link_to(@user.name, symphonia.user_url(@user))) %>
9
+ </p>
10
+ <p>
11
+ <%= content_tag(:span, Symphonia::User.human_attribute_name(:email)) %>:
12
+ <%= content_tag(:strong, mail_to(@user.email)) %>
13
+ </p>
@@ -0,0 +1,8 @@
1
+ <%= t(:'mailer.text_html_user_created') %>
2
+
3
+ <%= Time.now.to_s %>
4
+
5
+
6
+ <%= Symphonia::User.human_attribute_name(:first_name) %>: <%= @user.name %>
7
+
8
+ <%= Symphonia::User.human_attribute_name(:email) %>: <%= @user.mail %>
@@ -0,0 +1,30 @@
1
+ <%= symphonia_form_for(@role) do |f| %>
2
+
3
+ <%= f.text_field :name, required: true %>
4
+ <%= f.text_area :description, size: '50x5' %>
5
+
6
+ <div class="panel panel-default">
7
+ <div class="panel-heading">
8
+ <div class="pull-right">
9
+ <%= link_to(fa_icon('check lg'), 'javascript:void(0)', onclick: "$(this).closest('.panel').find('input:checkbox').trigger('click')") -%>
10
+ </div>
11
+ <%= content_tag(:h3, Symphonia::Role.human_attribute_name(:permissions), :class => 'panel-title') %>
12
+ </div>
13
+ <div class="panel-body">
14
+ <%= f.form_group(:permissions) do %>
15
+ <% @permissions.each do |perm| %>
16
+ <div class="col-md-4">
17
+ <label class="checkbox-inline">
18
+ <%= check_box_tag('permissions[]', perm, @role.permission_names.include?(perm.name), id: perm, class: '') %>
19
+ <%= t(perm.name, :scope => [:permissions], :default => perm.to_s.humanize) %>
20
+ </label>
21
+ </div>
22
+ <% end %>
23
+ <% end -%>
24
+ </div>
25
+ </div>
26
+
27
+ <p class="buttons">
28
+ <%= f.primary %>
29
+ </p>
30
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= title(t(:button_edit), @role.name) do %>
2
+ <%= content_tag(:p, link_to_back, class: 'contextual') %>
3
+ <% end %>
4
+
5
+ <%= render(partial: 'form') %>
@@ -0,0 +1,6 @@
1
+ <%= title(:label_roles) do %>
2
+ <%= link_to_new_entity %>
3
+ <% end %>
4
+
5
+ <%= render('symphonia/common/filters', remote: true) %>
6
+ <%= render_symphonia_table(@query) %>
@@ -0,0 +1,4 @@
1
+ <%= title(t(:label_role_new)) do %>
2
+ <%= content_tag(:p, link_to_back, class: 'contextual') %>
3
+ <% end %>
4
+ <%= render(partial: 'form') %>
@@ -0,0 +1,5 @@
1
+ <%= title(@role.name, back: true) %>
2
+
3
+ <div class="formatted-text">
4
+ <%= format_text @role.description %>
5
+ </div>
@@ -0,0 +1,13 @@
1
+ <%= render(partial: 'symphonia/accounts/form', locals: {f: f}) %>
2
+ <div class="row">
3
+ <% if Symphonia::User.current.admin? %>
4
+ <div class="col-sm-6">
5
+ <%= f.check_box :admin, id: 'user_admin', layout: :inline %>
6
+ </div>
7
+ <% if @roles.any? %>
8
+ <div class="col-sm-6">
9
+ <%= f.select(:role_id, options_from_collection_for_select(@roles, :id, :name, selected: @user.role_id), include_blank: true, layout: :horizontal) %>
10
+ </div>
11
+ <% end -%>
12
+ <% end %>
13
+ </div>
@@ -0,0 +1,26 @@
1
+ <%= title(t(:label_edit), @user.name, back: !request.xhr?) %>
2
+
3
+ <%= symphonia_form_for(@user) do |f| %>
4
+ <%= render(partial: 'form', locals: { f: f }) %>
5
+
6
+ <% if @user && !@user.new_record? && Symphonia::User.current.logged_in? && (prefs = Symphonia::EmailPreference.visible.to_a).any? %>
7
+ <%= hidden_field_tag 'user[preference_ids][]' %>
8
+ <fieldset id="users-notifications-map" class="clearfix">
9
+ <%= content_tag(:legend, t(:label_user_notifications)) %>
10
+ <div class="row">
11
+ <% prefs.each do |pref| %>
12
+ <div class="col-md-3 col-sm-6">
13
+ <div class="form-check">
14
+ <label class="form-check-label">
15
+ <%= check_box_tag('user[preference_ids][]', pref.id, @user.preference_ids.include?(pref.id), class: 'form-check-input') %>
16
+ <%= t(pref.name, scope: :preferences) %>
17
+ </label>
18
+ </div>
19
+ </div>
20
+ <% end %>
21
+ </div>
22
+ </fieldset>
23
+ <% end %>
24
+
25
+ <%= f.primary unless request.xhr? %>
26
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= render_modal large: true do %>
2
+ <% render(template: 'symphonia/users/edit', formats: [:html]) %>
3
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= content_tag(:h1, @user.name) %>
2
+ <%= form_for(@user, :url => user_current_path, :html => {:class => 'tabular'}) do |f| %>
3
+ <%= render(:partial => 'form', :locals => {:f => f}) %>
4
+ <p class="buttons">
5
+ <%= f.submit %>
6
+ </p>
7
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= title(:label_users) do %>
2
+ <%= link_to_new_entity %>
3
+ <% end %>
4
+ <%= render('symphonia/common/filters', remote: true) %>
5
+ <%= render_symphonia_table(@query) %>
@@ -0,0 +1,8 @@
1
+ <%= title(t(:label_user_new), back: true) %>
2
+
3
+ <%= symphonia_form_for(@user, html: {novalidate: true}) do |f| %>
4
+ <%= render(partial: 'form', locals: {f: f}) %>
5
+ <%= f.form_group do %>
6
+ <%= f.primary(t(:button_create)) %>
7
+ <% end %>
8
+ <% end %>