symphonia 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +674 -0
- data/README.md +16 -0
- data/Rakefile +44 -0
- data/app/assets/images/bg-checker.png +0 -0
- data/app/assets/images/bullet.gif +0 -0
- data/app/assets/images/close.png +0 -0
- data/app/assets/images/loading.gif +0 -0
- data/app/assets/images/next.png +0 -0
- data/app/assets/images/prev.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +232 -0
- data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +102 -0
- data/app/assets/javascripts/ckeditor/plugins/image_chooser/icons/addimage.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image_chooser/plugin.js +15 -0
- data/app/assets/javascripts/symphonia/Sortable.js +1249 -0
- data/app/assets/javascripts/symphonia/_core.js +45 -0
- data/app/assets/javascripts/symphonia/application.js.erb +147 -0
- data/app/assets/javascripts/symphonia/filters.js +44 -0
- data/app/assets/javascripts/symphonia/symphonia_bootstrap_dialog.js +136 -0
- data/app/assets/javascripts/symphonia/symphonia_ckeditor.js +55 -0
- data/app/assets/stylesheets/symphonia/application.css +4 -0
- data/app/assets/stylesheets/symphonia/basic.scss +218 -0
- data/app/assets/stylesheets/symphonia/filters.scss +19 -0
- data/app/assets/stylesheets/symphonia/symphonia_bootstrap.scss +56 -0
- data/app/channels/application_cable/channel.rb +5 -0
- data/app/controllers/symphonia/accounts_controller.rb +169 -0
- data/app/controllers/symphonia/admin_controller.rb +22 -0
- data/app/controllers/symphonia/api_controller.rb +64 -0
- data/app/controllers/symphonia/application_controller.rb +8 -0
- data/app/controllers/symphonia/attachments_controller.rb +37 -0
- data/app/controllers/symphonia/filters_controller.rb +23 -0
- data/app/controllers/symphonia/images_controller.rb +16 -0
- data/app/controllers/symphonia/login_controller.rb +80 -0
- data/app/controllers/symphonia/roles_controller.rb +100 -0
- data/app/controllers/symphonia/user_sessions_controller.rb +16 -0
- data/app/controllers/symphonia/users_controller.rb +168 -0
- data/app/helpers/symphonia/application_helper.rb +422 -0
- data/app/helpers/symphonia/bootstrap_modal_helper.rb +59 -0
- data/app/helpers/symphonia/form_helper.rb +50 -0
- data/app/helpers/symphonia/renderer_helper.rb +85 -0
- data/app/mailers/symphonia/application_mailer.rb +6 -0
- data/app/mailers/symphonia/notifier.rb +42 -0
- data/app/models/symphonia/admin_module.rb +18 -0
- data/app/models/symphonia/application_record.rb +14 -0
- data/app/models/symphonia/attachment.rb +16 -0
- data/app/models/symphonia/common_file.rb +9 -0
- data/app/models/symphonia/email_preference.rb +5 -0
- data/app/models/symphonia/image.rb +46 -0
- data/app/models/symphonia/preference.rb +12 -0
- data/app/models/symphonia/role.rb +55 -0
- data/app/models/symphonia/swagger/error_model.rb +19 -0
- data/app/models/symphonia/swagger/responses.rb +27 -0
- data/app/models/symphonia/user.rb +141 -0
- data/app/models/symphonia/user_session.rb +19 -0
- data/app/views/common/403.html.erb +5 -0
- data/app/views/common/404.html.erb +2 -0
- data/app/views/layouts/symphonia/_modal.html.erb +19 -0
- data/app/views/layouts/symphonia/_query.html.erb +51 -0
- data/app/views/layouts/symphonia/application.html.erb +45 -0
- data/app/views/layouts/symphonia/application.pdf.erb +15 -0
- data/app/views/layouts/symphonia/mailer.html.erb +13 -0
- data/app/views/symphonia/accounts/_detail.html.erb +65 -0
- data/app/views/symphonia/accounts/_form.html.erb +14 -0
- data/app/views/symphonia/accounts/edit.html.erb +9 -0
- data/app/views/symphonia/accounts/edit.js.erb +5 -0
- data/app/views/symphonia/accounts/lost_password.html.erb +6 -0
- data/app/views/symphonia/accounts/lost_password.js.erb +3 -0
- data/app/views/symphonia/accounts/new_activation.html.erb +11 -0
- data/app/views/symphonia/accounts/new_activation.js.erb +6 -0
- data/app/views/symphonia/accounts/register.html.erb +20 -0
- data/app/views/symphonia/accounts/reset_password.html.erb +18 -0
- data/app/views/symphonia/accounts/update.js.erb +1 -0
- data/app/views/symphonia/admin/index.html.erb +15 -0
- data/app/views/symphonia/attachments/destroy.js.erb +1 -0
- data/app/views/symphonia/common/_editable_images_grid.html.erb +12 -0
- data/app/views/symphonia/common/_filters.html.erb +23 -0
- data/app/views/symphonia/common/_locale_chooser.html.erb +16 -0
- data/app/views/symphonia/common/_share_links.html.erb +5 -0
- data/app/views/symphonia/filters/options.html.erb +36 -0
- data/app/views/symphonia/filters/options.js.erb +9 -0
- data/app/views/symphonia/filters/table.html.erb +21 -0
- data/app/views/symphonia/login/_form.html.erb +19 -0
- data/app/views/symphonia/login/new.html.erb +11 -0
- data/app/views/symphonia/login_sessions/new.html.erb +1 -0
- data/app/views/symphonia/notifier/activation_user.html.erb +7 -0
- data/app/views/symphonia/notifier/activation_user.text.erb +3 -0
- data/app/views/symphonia/notifier/reset_password_user.html.erb +7 -0
- data/app/views/symphonia/notifier/reset_password_user.text.erb +3 -0
- data/app/views/symphonia/notifier/test_mail.html.erb +2 -0
- data/app/views/symphonia/notifier/test_mail.text.erb +3 -0
- data/app/views/symphonia/notifier/user_change_to_active.html.erb +3 -0
- data/app/views/symphonia/notifier/user_change_to_active.text.erb +1 -0
- data/app/views/symphonia/notifier/user_registered.html.erb +13 -0
- data/app/views/symphonia/notifier/user_registered.text.erb +8 -0
- data/app/views/symphonia/roles/_form.html.erb +30 -0
- data/app/views/symphonia/roles/edit.html.erb +5 -0
- data/app/views/symphonia/roles/index.html.erb +6 -0
- data/app/views/symphonia/roles/new.html.erb +4 -0
- data/app/views/symphonia/roles/show.html.erb +5 -0
- data/app/views/symphonia/users/_form.html.erb +13 -0
- data/app/views/symphonia/users/edit.html.erb +26 -0
- data/app/views/symphonia/users/edit.js.erb +3 -0
- data/app/views/symphonia/users/edit_current.html.erb +7 -0
- data/app/views/symphonia/users/index.html.erb +5 -0
- data/app/views/symphonia/users/new.html.erb +8 -0
- data/app/views/symphonia/users/show.html.erb +63 -0
- data/config/locales/cs.yml +233 -0
- data/config/locales/en.yml +47 -0
- data/config/routes.rb +52 -0
- data/db/migrate/20130714140500_create_users.rb +49 -0
- data/db/migrate/20130714140501_create_roles.rb +16 -0
- data/db/migrate/20130714140502_create_preferences.rb +26 -0
- data/db/migrate/20130828175114_create_attachments.rb +20 -0
- data/db/migrate/20141213204351_create_admin_modules.rb +20 -0
- data/db/seeds.rb +12 -0
- data/lib/generators/symphonia/entity_controller/entity_controller_generator.rb +48 -0
- data/lib/generators/symphonia/entity_controller/templates/controller.rb +100 -0
- data/lib/generators/symphonia/query/query_generator.rb +37 -0
- data/lib/generators/symphonia/setup/setup_generator.rb +52 -0
- data/lib/generators/symphonia/setup/templates/404.html +26 -0
- data/lib/generators/symphonia/setup/templates/500.html +37 -0
- data/lib/generators/symphonia/setup/templates/Gemfile +18 -0
- data/lib/generators/symphonia/setup/templates/base_layout.html.erb +46 -0
- data/lib/generators/symphonia/setup/templates/design.scss +4 -0
- data/lib/generators/symphonia/setup/templates/settings.rb +65 -0
- data/lib/generators/symphonia/setup/templates/spec_helper.rb +18 -0
- data/lib/symphonia/action_cable/connection.rb +31 -0
- data/lib/symphonia/admin_constraint.rb +9 -0
- data/lib/symphonia/attachable.rb +35 -0
- data/lib/symphonia/base_controller.rb +96 -0
- data/lib/symphonia/bootstrap_link_render.rb +69 -0
- data/lib/symphonia/controller_extensions.rb +200 -0
- data/lib/symphonia/engine.rb +137 -0
- data/lib/symphonia/form_builder.rb +137 -0
- data/lib/symphonia/menu_manager.rb +23 -0
- data/lib/symphonia/model_attributes/attribute.rb +137 -0
- data/lib/symphonia/model_attributes.rb +102 -0
- data/lib/symphonia/model_filters/base.rb +82 -0
- data/lib/symphonia/model_filters/boolean_filter.rb +26 -0
- data/lib/symphonia/model_filters/date_filter.rb +81 -0
- data/lib/symphonia/model_filters/integer_filter.rb +18 -0
- data/lib/symphonia/model_filters/select_filter.rb +48 -0
- data/lib/symphonia/model_filters/string_filter.rb +18 -0
- data/lib/symphonia/model_filters.rb +10 -0
- data/lib/symphonia/object.rb +31 -0
- data/lib/symphonia/permissions.rb +93 -0
- data/lib/symphonia/query.rb +275 -0
- data/lib/symphonia/query_columns/attribute_column.rb +43 -0
- data/lib/symphonia/query_columns/generic_column.rb +165 -0
- data/lib/symphonia/query_columns.rb +8 -0
- data/lib/symphonia/spec_helper.rb +4 -0
- data/lib/symphonia/user_management.rb +58 -0
- data/lib/symphonia/version.rb +4 -0
- data/lib/symphonia.rb +20 -0
- data/spec/controllers/account_controller_spec.rb +90 -0
- data/spec/controllers/admin_controller_spec.rb +35 -0
- data/spec/controllers/api_controller_spec.rb +9 -0
- data/spec/controllers/filters_controller_spec.rb +35 -0
- data/spec/controllers/images_controller_spec.rb +5 -0
- data/spec/controllers/login_controller_spec.rb +20 -0
- data/spec/controllers/roles_controller_spec.rb +12 -0
- data/spec/controllers/users_controller_spec.rb +47 -0
- data/spec/factories/factories.rb +52 -0
- data/spec/helpers/symphonia/application_helper_spec.rb +62 -0
- data/spec/mailers/previews/symphonia/notifier_preview.rb +27 -0
- data/spec/mailers/symphonia/notifier_spec.rb +76 -0
- data/spec/models/attachment_spec.rb +22 -0
- data/spec/models/query/attribute_spec.rb +8 -0
- data/spec/models/query/symphonia_query_spec.rb +70 -0
- data/spec/models/role_spec.rb +13 -0
- data/spec/models/user_spec.rb +10 -0
- data/spec/rails_helper.rb +13 -0
- data/spec/requests/accounts_spec.rb +118 -0
- data/spec/requests/attachments_controller_spec.rb +23 -0
- data/spec/requests/login_spec.rb +26 -0
- data/spec/requests/roles_spec.rb +10 -0
- data/spec/requests/users_spec.rb +50 -0
- data/spec/spec_helper.rb +101 -0
- data/spec/support/common_file.txt +2 -0
- data/spec/support/query.rb +36 -0
- data/spec/support/shared.rb +62 -0
- data/spec/support/shared_controllers.rb +31 -0
- data/spec/support/stub_users.rb +32 -0
- data/spec/support/symphonia.jpg +0 -0
- data/spec/support/wait_for_ajax.rb +15 -0
- data/spec/version_spec.rb +5 -0
- data/spec/views/filters/options.html.erb_spec.rb +14 -0
- metadata +697 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
String.prototype.parameterize = function () {
|
2
|
+
return this.trim().replace(/[^a-zA-Z0-9-\s]/g, '').replace(/[^a-zA-Z0-9-]/g, '-').toLowerCase();
|
3
|
+
};
|
4
|
+
Number.prototype.pad = function (size) {
|
5
|
+
var s = String(this);
|
6
|
+
while (s.length < (size || 2)) {
|
7
|
+
s = "0" + s;
|
8
|
+
}
|
9
|
+
return s;
|
10
|
+
};
|
11
|
+
|
12
|
+
$(document).on('ajaxSend', function (event, request, settings) {
|
13
|
+
$('#ajax-indicator').fadeIn('fast');
|
14
|
+
});
|
15
|
+
|
16
|
+
$(document).on('ajaxComplete', function (event, request, settings) {
|
17
|
+
$('#ajax-indicator').fadeOut('fast');
|
18
|
+
});
|
19
|
+
window.Symphonia = {
|
20
|
+
routes: {},
|
21
|
+
|
22
|
+
toggle: function (element, state) {
|
23
|
+
if (typeof(state) === 'boolean') {
|
24
|
+
if (state) {
|
25
|
+
element.style.display = null;
|
26
|
+
} else {
|
27
|
+
element.style.display = 'none'
|
28
|
+
}
|
29
|
+
} else {
|
30
|
+
window.Symphonia.toggle(element, (element.style.display === 'none'));
|
31
|
+
}
|
32
|
+
},
|
33
|
+
renderFlash: function (message, type) {
|
34
|
+
var container = document.getElementById("flash_messages");
|
35
|
+
container.innerHTML = "";
|
36
|
+
var c = document.createElement("div");
|
37
|
+
c.setAttribute("class", "alert alert-" + (type || "success"));
|
38
|
+
c.innerText = message.body || message.title;
|
39
|
+
var b = document.createElement("button");
|
40
|
+
b.setAttribute("class", "fa fa-times-circle-o close");
|
41
|
+
b.dataset.dismiss = "alert";
|
42
|
+
c.appendChild(b);
|
43
|
+
container.appendChild(c)
|
44
|
+
}
|
45
|
+
}
|
@@ -0,0 +1,147 @@
|
|
1
|
+
//= require rails-ujs
|
2
|
+
//= require turbolinks
|
3
|
+
//= require jquery3
|
4
|
+
//= require popper
|
5
|
+
//= require bootstrap-sprockets
|
6
|
+
|
7
|
+
//= require symphonia/_core
|
8
|
+
//= require symphonia/Sortable
|
9
|
+
|
10
|
+
//= require bootstrap-datepicker/core
|
11
|
+
//= require bootstrap-datepicker/locales/bootstrap-datepicker.cs.js
|
12
|
+
|
13
|
+
//= require_self
|
14
|
+
//= require symphonia/symphonia_bootstrap_dialog
|
15
|
+
//= require symphonia/filters
|
16
|
+
|
17
|
+
document.addEventListener("turbolinks:load", initDatepicker);
|
18
|
+
$(document).on("ready turbolinks:load", function () {
|
19
|
+
var item = document.getElementsByTagName("body")[0].dataset.menuItem;
|
20
|
+
var menuItem = document.querySelector("header ul.nav li." + item);
|
21
|
+
if (menuItem) {
|
22
|
+
$("header ul.nav li").removeClass('active');
|
23
|
+
menuItem.className += ' active';
|
24
|
+
}
|
25
|
+
if (typeof($.colorbox) === "function") {
|
26
|
+
$.colorbox.remove();
|
27
|
+
$('a.symphonia-lightbox[data-lightbox="true"]').colorbox({rel: 'gallery', maxHeight: '80%', photo: true});
|
28
|
+
}
|
29
|
+
var images = document.getElementById("editable_images");
|
30
|
+
if (images) {
|
31
|
+
new Sortable(images, {
|
32
|
+
animation: 0,
|
33
|
+
draggable: ".entity-edit-image",
|
34
|
+
scroll: true,
|
35
|
+
onUpdate: function (event) {
|
36
|
+
$.ajax({
|
37
|
+
url: Symphonia.routes.reorderImagesPath,
|
38
|
+
data: {
|
39
|
+
position: event.newIndex + 1,
|
40
|
+
id: event.item.dataset.id
|
41
|
+
},
|
42
|
+
type: 'PATCH'
|
43
|
+
});
|
44
|
+
}
|
45
|
+
})
|
46
|
+
}
|
47
|
+
});
|
48
|
+
$(document).on('click', '.share-buttons a', function (event) {
|
49
|
+
event.preventDefault();
|
50
|
+
window.open(this.href, this.title, 'toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=no,width=620,height=320px');
|
51
|
+
});
|
52
|
+
|
53
|
+
function toggleMultiSelect(select) {
|
54
|
+
var $select = $(select);
|
55
|
+
$select.prop("multiple", !$select.prop("multiple"));
|
56
|
+
}
|
57
|
+
function initDatepicker(input) {
|
58
|
+
var selector = 'input[type=text].datepicker';
|
59
|
+
if (typeof input === 'string') {
|
60
|
+
selector = input;
|
61
|
+
}
|
62
|
+
$(selector).each(function (index, item) {
|
63
|
+
var $item = $(item);
|
64
|
+
$item.datepicker({
|
65
|
+
'language': (item.dataset.datepickerLocale || 'cs'),
|
66
|
+
format: 'yyyy-mm-dd',
|
67
|
+
autoclose: true
|
68
|
+
});
|
69
|
+
var c = item.nextElementSibling;
|
70
|
+
if (c) {
|
71
|
+
c.onclick = function () {
|
72
|
+
$item.datepicker('show')
|
73
|
+
}
|
74
|
+
}
|
75
|
+
})
|
76
|
+
}
|
77
|
+
$(document).on('click', 'input.symphonia-query-submit-button', function (event) {
|
78
|
+
event.preventDefault();
|
79
|
+
var form = $(event.target).closest('form');
|
80
|
+
form.find('input, select').each(function (index, i) {
|
81
|
+
if (i.value.length === 0) {
|
82
|
+
i.disabled = true;
|
83
|
+
}
|
84
|
+
});
|
85
|
+
form.submit();
|
86
|
+
});
|
87
|
+
Symphonia.filters = {
|
88
|
+
search: function (el) {
|
89
|
+
if (!!el.value) {
|
90
|
+
if (el.dataset.remote) {
|
91
|
+
var data = {};
|
92
|
+
data[el.name] = el.value;
|
93
|
+
$.get(window.location.pathname, data, function (response) {
|
94
|
+
document.getElementById("main").innerHTML = response;
|
95
|
+
})
|
96
|
+
} else {
|
97
|
+
window.location.search = "?" + el.name + "=" + encodeURIComponent(el.value);
|
98
|
+
}
|
99
|
+
|
100
|
+
}
|
101
|
+
},
|
102
|
+
resetSearch: function (el) {
|
103
|
+
if (el.dataset.remote) {
|
104
|
+
$.get(window.location.pathname, {}, function (response) {
|
105
|
+
document.getElementById("main").innerHTML = response;
|
106
|
+
})
|
107
|
+
} else {
|
108
|
+
window.location.search = '';
|
109
|
+
}
|
110
|
+
},
|
111
|
+
removeRow: function(id) {
|
112
|
+
var el = document.getElementById(id);
|
113
|
+
el.remove();
|
114
|
+
}
|
115
|
+
}
|
116
|
+
function submitSymphoniaForm(formId) {
|
117
|
+
console.debug('submitSymphoniaForm in window will remove');
|
118
|
+
SymphoniaFilters.submit(formId);
|
119
|
+
}
|
120
|
+
function submitSymphoniaQueryQ(el) {
|
121
|
+
console.debug('submitSymphoniaQueryQ in window will remove');
|
122
|
+
Symphonia.filters.search(el);
|
123
|
+
}
|
124
|
+
$(document).on("change", "#query_data input:checkbox", function (event) {
|
125
|
+
SymphoniaCheckboxes.toggle(event.target, !event.target.checked)
|
126
|
+
});
|
127
|
+
SymphoniaCheckboxes = {
|
128
|
+
toggleAll: function (toggler) {
|
129
|
+
var isChecked = toggler.dataset.checked == 'true';
|
130
|
+
var inputs = toggler.querySelectorAll("input[type=checkbox]");
|
131
|
+
for (var i = 0; i < inputs.length; i++) {
|
132
|
+
this.toggle(inputs[i], isChecked)
|
133
|
+
}
|
134
|
+
toggler.dataset.checked = !isChecked;
|
135
|
+
},
|
136
|
+
toggle: function (input, isChecked) {
|
137
|
+
if (typeof(isChecked) === "undefined")
|
138
|
+
isChecked = input.checked;
|
139
|
+
|
140
|
+
input.checked = !isChecked;
|
141
|
+
|
142
|
+
var tr = input.closest("tr");
|
143
|
+
tr && tr.classList.toggle("info", !isChecked);
|
144
|
+
|
145
|
+
return input;
|
146
|
+
}
|
147
|
+
};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
SymphoniaFilter = function(filtersForm) {
|
2
|
+
var form = document.getElementById(filtersForm);
|
3
|
+
|
4
|
+
$(document).ready(function() {
|
5
|
+
var n = form.querySelector(".symphonia-query-column-selector");
|
6
|
+
if (n) {
|
7
|
+
new Sortable(n, {
|
8
|
+
animation: 0,
|
9
|
+
draggable: "div.column",
|
10
|
+
scroll: false
|
11
|
+
})
|
12
|
+
}
|
13
|
+
initDatepicker(filtersForm + ' .filter-custom-date > .datepicker');
|
14
|
+
});
|
15
|
+
|
16
|
+
this.submit = function() {
|
17
|
+
var cols = document.querySelectorAll("#" + form.id + " .column input:checked");
|
18
|
+
var params = [];
|
19
|
+
for (var i=0;i < cols.length; i++) {
|
20
|
+
params.push(cols[i].name.replace(/\[|\]/g, ""))
|
21
|
+
}
|
22
|
+
var uri = form.action.replace(/[\?&]column_names=.*&?/, "");
|
23
|
+
if (!uri.includes("?")) {
|
24
|
+
uri = uri + "?"
|
25
|
+
}
|
26
|
+
if (params.length > 0) {
|
27
|
+
uri = uri + "&column_names=" + params.join("|")
|
28
|
+
}
|
29
|
+
var $filters = $("#"+form.id+" .symphonia-query-filters-selector").find("input, select");
|
30
|
+
$filters.each(function(_index, item) {
|
31
|
+
if (item.value && item.value !== "" && (item.type !== 'checkbox' || item.checked)) {
|
32
|
+
uri = uri + "&" + item.name + "=" + item.value;
|
33
|
+
}
|
34
|
+
});
|
35
|
+
window.location = uri
|
36
|
+
}
|
37
|
+
};
|
38
|
+
SymphoniaFilter.prototype.dateFilterCallback = function(element) {
|
39
|
+
if (element.value === 'custom') {
|
40
|
+
window.Symphonia.toggle(element.nextElementSibling)
|
41
|
+
} else {
|
42
|
+
window.Symphonia.toggle(element.nextElementSibling, false)
|
43
|
+
}
|
44
|
+
};
|
@@ -0,0 +1,136 @@
|
|
1
|
+
/**
|
2
|
+
* Symphonia modal dialog pop-up.
|
3
|
+
* @param {String} id
|
4
|
+
* @param {Object} options
|
5
|
+
* @param {String} options.title - Title of dialog window.
|
6
|
+
* @param {Boolean} options.force - If dialog element exists, will remove and replace new one.
|
7
|
+
* @param {String} options.text - Text for body of dialog window.
|
8
|
+
* @param {String} options.html - Content (html) for body of dialog window.
|
9
|
+
* @param {String} options.submit - Text of submit button. If provided generate submit button.
|
10
|
+
* @param {Boolean} options.large - Use Large modal
|
11
|
+
*/
|
12
|
+
SymphoniaDialog = function (id, options) {
|
13
|
+
var options = $.extend(options, {});
|
14
|
+
if (options["force"] === undefined)
|
15
|
+
options["force"] = true;
|
16
|
+
|
17
|
+
this.id = id || 'ajax_modal';
|
18
|
+
var m = document.getElementById(this.id);
|
19
|
+
|
20
|
+
// var currentDialog = document.getElementById(this.id + "__symphonia_dialog");
|
21
|
+
// if (currentDialog) {
|
22
|
+
// currentDialog.remove();
|
23
|
+
// }
|
24
|
+
|
25
|
+
var dialog = document.createElement("div");
|
26
|
+
var modalDialog = document.createElement("div");
|
27
|
+
modalDialog.className = "modal-dialog";
|
28
|
+
if (options["large"]) {
|
29
|
+
modalDialog.classList.add("modal-lg")
|
30
|
+
}
|
31
|
+
dialog.setAttribute("role", "document");
|
32
|
+
|
33
|
+
var content = document.createElement("div");
|
34
|
+
content.className = "modal-content";
|
35
|
+
var heading = document.createElement("div");
|
36
|
+
heading.className = "modal-header";
|
37
|
+
var modalTitle = document.createElement("h5");
|
38
|
+
modalTitle.className = "modal-title";
|
39
|
+
var body = document.createElement("div");
|
40
|
+
|
41
|
+
body.className = "modal-body";
|
42
|
+
dialog.id = this.id;
|
43
|
+
dialog.className = "modal fade";
|
44
|
+
dialog.setAttribute("role", "dialog");
|
45
|
+
|
46
|
+
// =-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
|
47
|
+
|
48
|
+
this.appendSubmitButton = function (label) {
|
49
|
+
var submitButton = document.createElement('button');
|
50
|
+
submitButton.onclick = this.submit;
|
51
|
+
submitButton.innerText = (label === true) && 'Submit' || label;
|
52
|
+
submitButton.className = "btn btn-primary";
|
53
|
+
footer.appendChild(submitButton);
|
54
|
+
return submitButton;
|
55
|
+
};
|
56
|
+
this.submit = function () {
|
57
|
+
var form = dialog.querySelector("form");
|
58
|
+
if (form)
|
59
|
+
form.submit();
|
60
|
+
};
|
61
|
+
this.show = function () {
|
62
|
+
// dialog.find(".modal-body > .modal-content-inner-container").css({'max-height': window.innerHeight - 200});
|
63
|
+
// dialog.find(".modal-body > .modal-content-inner-container").css({'max-height': window.innerHeight - 200});
|
64
|
+
var t = dialog.querySelector(".title");
|
65
|
+
if (t && t.innerHTML === '') {
|
66
|
+
this.title = modalTitle.innerHTML;
|
67
|
+
t.remove();
|
68
|
+
}
|
69
|
+
$(dialog).modal({keyboard: true}).find("input:last").focus();
|
70
|
+
};
|
71
|
+
this.hide = function () {
|
72
|
+
$(dialog).modal("hide");
|
73
|
+
};
|
74
|
+
this.destroy = function () {
|
75
|
+
this.hide();
|
76
|
+
dialog.remove()
|
77
|
+
};
|
78
|
+
this.setMaxHeightOfContent = function() {
|
79
|
+
body.style.overflowY = 'auto';
|
80
|
+
body.style.maxHeight = window.innerHeight - 200 + "px";
|
81
|
+
};
|
82
|
+
// =-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
|
83
|
+
|
84
|
+
modalTitle.innerText = options.title || '';
|
85
|
+
|
86
|
+
var closeButton = document.createElement("button");
|
87
|
+
closeButton.className = "close fa fa-times";
|
88
|
+
closeButton.dataset['dismiss'] = "modal";
|
89
|
+
heading.appendChild(modalTitle);
|
90
|
+
heading.appendChild(closeButton);
|
91
|
+
|
92
|
+
if (options.text)
|
93
|
+
body.innerText = options.text;
|
94
|
+
if (options.html)
|
95
|
+
body.innerHTML = options.html;
|
96
|
+
|
97
|
+
if (m) {
|
98
|
+
if (body.innerHTML === '')
|
99
|
+
body.innerHTML = m.innerHTML;
|
100
|
+
// m.remove();
|
101
|
+
dialog.id = this.id + '__symphonia_dialog';
|
102
|
+
}
|
103
|
+
|
104
|
+
var footer = document.createElement("div");
|
105
|
+
footer.className = "modal-footer";
|
106
|
+
if (options.submit) {
|
107
|
+
this.appendSubmitButton(options.submit);
|
108
|
+
}
|
109
|
+
|
110
|
+
content.appendChild(heading);
|
111
|
+
content.appendChild(body);
|
112
|
+
content.appendChild(footer);
|
113
|
+
modalDialog.appendChild(content);
|
114
|
+
dialog.appendChild(modalDialog);
|
115
|
+
|
116
|
+
if (options.force) {
|
117
|
+
var currentDialog = document.getElementById(dialog.id);
|
118
|
+
if (currentDialog)
|
119
|
+
currentDialog.remove();
|
120
|
+
}
|
121
|
+
document.body.appendChild(dialog);
|
122
|
+
|
123
|
+
this.container = modalDialog;
|
124
|
+
this.title = modalTitle;
|
125
|
+
this.body = body;
|
126
|
+
this.footer = footer;
|
127
|
+
};
|
128
|
+
SymphoniaDialog.prototype.close = function () {
|
129
|
+
this.hide();
|
130
|
+
};
|
131
|
+
window.Symphonia.dialog = {
|
132
|
+
show: function(IDcontainer, options) {
|
133
|
+
var modal = new SymphoniaDialog(IDcontainer, options);
|
134
|
+
modal.show();
|
135
|
+
}
|
136
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
//= require ckeditor-jquery
|
2
|
+
//= require_self
|
3
|
+
|
4
|
+
CKEDITOR.editorConfig = function( config )
|
5
|
+
{
|
6
|
+
config.resize_enabled = true;
|
7
|
+
config.toolbarStartupExpanded = true;
|
8
|
+
config.extraAllowedContent = 'blockquote table pre code big small img section a i span; *[id](*); *[class](*); *[style](*)';
|
9
|
+
config.keystrokes = [
|
10
|
+
[ CKEDITOR.CTRL + 76, null ] // CTRL + L
|
11
|
+
];
|
12
|
+
// config.allowedContent = true;
|
13
|
+
config.tabSpaces = 4;
|
14
|
+
config.toolbar_Full = [
|
15
|
+
['Bold','Italic','Underline','Strike','NumberedList','BulletedList','Subscript','Superscript','-','Outdent','Indent','Blockquote'],
|
16
|
+
['Styles','Format','Font','FontSize'],
|
17
|
+
['TextColor','BGColor'],
|
18
|
+
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
|
19
|
+
['Link','Unlink','Anchor'],
|
20
|
+
['Image','Table','HorizontalRule','Smiley','SpecialChar','-','Maximize', 'ShowBlocks'],
|
21
|
+
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker'],
|
22
|
+
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
|
23
|
+
['Source','Preview','Templates']
|
24
|
+
];
|
25
|
+
|
26
|
+
config.toolbar_Extended = [
|
27
|
+
['Bold','Italic','Underline','Strike'],['TextColor','BGColor','Link','Unlink'],
|
28
|
+
['NumberedList','BulletedList'],['Image','PasteFromWord','Table','Source'],
|
29
|
+
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
|
30
|
+
['Format','Font','FontSize'],
|
31
|
+
['Table','HorizontalRule'],
|
32
|
+
['Cut','Copy','Paste','PasteText']
|
33
|
+
];
|
34
|
+
|
35
|
+
config.toolbar_Basic = [
|
36
|
+
['Bold','Italic','Underline','Strike'],['TextColor','BGColor','Link','Unlink'],
|
37
|
+
['NumberedList','BulletedList'],['Image','PasteFromWord','Table','Source']
|
38
|
+
];
|
39
|
+
|
40
|
+
};
|
41
|
+
|
42
|
+
|
43
|
+
SymphoniaCKeditor = {
|
44
|
+
insertHtml: function(id) {
|
45
|
+
var inputs = document.querySelectorAll("input.image:checked");
|
46
|
+
for (var i=(inputs.length - 1); i >= 0; i--){
|
47
|
+
var input = inputs[i];
|
48
|
+
var img = document.createElement("img");
|
49
|
+
img.src = input.dataset.path; img.title = input.title;
|
50
|
+
img.style.maxWidth = "400px";
|
51
|
+
CKEDITOR.instances[id].insertHtml(img.outerHTML);
|
52
|
+
}
|
53
|
+
return this;
|
54
|
+
}
|
55
|
+
};
|
@@ -0,0 +1,218 @@
|
|
1
|
+
@import 'font-awesome';
|
2
|
+
/* Font awesome aliases */
|
3
|
+
.fa-add {
|
4
|
+
//@extend .fa-plus-circle:before;
|
5
|
+
@extend .fa-plus-circle !optional;
|
6
|
+
}
|
7
|
+
.fa-delete, .fa-del {
|
8
|
+
@extend .fa-trash-o !optional;
|
9
|
+
}
|
10
|
+
.fa-back {
|
11
|
+
@extend .fa-chevron-left !optional;
|
12
|
+
}
|
13
|
+
.fa-true {
|
14
|
+
@extend .fa-check !optional;
|
15
|
+
}
|
16
|
+
.fa-false {
|
17
|
+
@extend .fa-times !optional;
|
18
|
+
}
|
19
|
+
|
20
|
+
.fa-notice {
|
21
|
+
@extend .fa-check-circle !optional;
|
22
|
+
}
|
23
|
+
.fa-error {
|
24
|
+
@extend .fa-times-circle !optional;
|
25
|
+
}
|
26
|
+
.alert .fa-info {
|
27
|
+
@extend .fa-info-circle !optional;
|
28
|
+
}
|
29
|
+
[class^="fa-"]:before, [class*=" fa-"]:before {
|
30
|
+
//padding-right: 5px;
|
31
|
+
}
|
32
|
+
[class^="fa-"]:before:hover, a[class*=" fa-"]:before:hover {
|
33
|
+
text-decoration: none
|
34
|
+
}
|
35
|
+
.page-header.title, .page-header.title h1 {
|
36
|
+
margin-top: 0;
|
37
|
+
}
|
38
|
+
@mixin inactive-row {
|
39
|
+
opacity: 0.5
|
40
|
+
}
|
41
|
+
.reorder, .reorder label {
|
42
|
+
cursor: move;
|
43
|
+
cursor: -webkit-grabbing;
|
44
|
+
}
|
45
|
+
|
46
|
+
.flash {
|
47
|
+
border: 1px solid;
|
48
|
+
margin: 10px 0px;
|
49
|
+
padding:15px 10px 15px 10px;
|
50
|
+
background-repeat: no-repeat;
|
51
|
+
background-position: 10px center;
|
52
|
+
position:relative;
|
53
|
+
line-height: 30px;
|
54
|
+
&>i.icon:first-child {
|
55
|
+
font-family: FontAwesome;
|
56
|
+
font-size: 30px;
|
57
|
+
|
58
|
+
font-style: normal;
|
59
|
+
position:absolute;
|
60
|
+
top: 50%;
|
61
|
+
margin-top: -15px;
|
62
|
+
}
|
63
|
+
&>span.flash-content {
|
64
|
+
padding-left: 35px;
|
65
|
+
|
66
|
+
}
|
67
|
+
}
|
68
|
+
.info {
|
69
|
+
color: #00529B;
|
70
|
+
background-color: #BDE5F8;
|
71
|
+
}
|
72
|
+
.notice {
|
73
|
+
color: #4F8A10;
|
74
|
+
background-color: #DFF2BF;
|
75
|
+
&>i.icon:first-child:before {
|
76
|
+
content: "\f05d"
|
77
|
+
}
|
78
|
+
}
|
79
|
+
flash.recaptcha_error {
|
80
|
+
display: none;
|
81
|
+
}
|
82
|
+
.nodata, .no-data {
|
83
|
+
@extend .flash;
|
84
|
+
@extend .info;
|
85
|
+
text-align: center;
|
86
|
+
border-width: 3px;
|
87
|
+
}
|
88
|
+
|
89
|
+
div.error_explanation {
|
90
|
+
color: #D63301;
|
91
|
+
background-color: #FFCCBA;
|
92
|
+
border: 1px solid rgba(255,0,0,0.5);
|
93
|
+
position: relative;
|
94
|
+
margin: 0 0 25px 0;
|
95
|
+
h2 {
|
96
|
+
display: none;
|
97
|
+
}
|
98
|
+
ul {
|
99
|
+
margin: 0;
|
100
|
+
li {
|
101
|
+
line-height: 25px;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
&>p {
|
105
|
+
background-color: rgba(255,255,255,0.5);
|
106
|
+
margin: 0;
|
107
|
+
padding: 5px;
|
108
|
+
text-shadow: 0 0 5px #FFFFFF;
|
109
|
+
}
|
110
|
+
&>p:before {
|
111
|
+
font-family: FontAwesome;
|
112
|
+
margin-right: 5px;
|
113
|
+
font-size: 20px;
|
114
|
+
content: "\f071";
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
#account-extra-details {
|
119
|
+
dt {
|
120
|
+
width: 40%;
|
121
|
+
}
|
122
|
+
dd {
|
123
|
+
margin-left: 50%;
|
124
|
+
}
|
125
|
+
}
|
126
|
+
td.buttons {
|
127
|
+
white-space: nowrap;
|
128
|
+
a {
|
129
|
+
margin: 0 5px;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
#ajax-indicator {
|
133
|
+
position: fixed;
|
134
|
+
width: 100px;
|
135
|
+
left: 50%;
|
136
|
+
top: 50%;
|
137
|
+
z-index: 999999;
|
138
|
+
box-shadow: 0 0 20px #ccc;
|
139
|
+
text-align: center;
|
140
|
+
margin-left: -50px;
|
141
|
+
margin-top: -50px;
|
142
|
+
background-color: rgba(255,255,255,0.5);
|
143
|
+
i {
|
144
|
+
margin: 0;
|
145
|
+
padding: 0;
|
146
|
+
font-size: 50px;
|
147
|
+
line-height: 100px;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
.contextual {@extend .pull-right !optional}
|
151
|
+
.contextual input, .contextual select {font-size:0.9em;}
|
152
|
+
|
153
|
+
.required label, label[required], label.required, .has-error {color: red !important;}
|
154
|
+
.required label:after, label[required]:after, label.required:after { content: '* '}
|
155
|
+
textarea {width: 99%;}
|
156
|
+
|
157
|
+
#internal_static_page_sign {
|
158
|
+
font-size: 10em;
|
159
|
+
}
|
160
|
+
.entity-edit-image {
|
161
|
+
@extend .reorder
|
162
|
+
}
|
163
|
+
.nowrap {
|
164
|
+
white-space: nowrap;
|
165
|
+
}
|
166
|
+
.modal-content {
|
167
|
+
.modal-title {
|
168
|
+
h1, h2, h3 {
|
169
|
+
margin: 0;
|
170
|
+
padding: 0;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
.modal-body {
|
174
|
+
.modal-content-inner-container {
|
175
|
+
overflow-x: visible;
|
176
|
+
overflow-y: auto;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
td.price {
|
181
|
+
text-align: right;
|
182
|
+
}
|
183
|
+
table.table {
|
184
|
+
th a.asc {
|
185
|
+
&:after {
|
186
|
+
content: "\2191";
|
187
|
+
}
|
188
|
+
}
|
189
|
+
th a.desc {
|
190
|
+
&:after {
|
191
|
+
content: "\2193";
|
192
|
+
}
|
193
|
+
}
|
194
|
+
tr.lock, tr.inactive, tr.archived {
|
195
|
+
@include inactive-row;
|
196
|
+
}
|
197
|
+
.buttons {
|
198
|
+
text-align: right;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
.highlight {
|
203
|
+
animation-duration: 1s;
|
204
|
+
animation-name: highlight;
|
205
|
+
}
|
206
|
+
.rails-bootstrap-forms-date-select {
|
207
|
+
select {
|
208
|
+
display: inline-block;
|
209
|
+
width: auto
|
210
|
+
}
|
211
|
+
}
|
212
|
+
.sortable-handle {
|
213
|
+
@extend .reorder;
|
214
|
+
}
|
215
|
+
.sortable-ghost {
|
216
|
+
//border: 2px solid black;
|
217
|
+
box-shadow: inset 0 0 5px #000000;
|
218
|
+
}
|