sibu 0.8.1 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -20
- data/README.md +38 -38
- data/Rakefile +36 -36
- data/app/assets/config/sibu_manifest.js +2 -2
- data/app/assets/fonts/sibu/Sibu.eot +0 -0
- data/app/assets/fonts/sibu/Sibu.svg +13 -13
- data/app/assets/fonts/sibu/Sibu.ttf +0 -0
- data/app/assets/fonts/sibu/Sibu.woff +0 -0
- data/app/assets/javascripts/cropper/cropper.js +3694 -3694
- data/app/assets/javascripts/quill/quill.js +11401 -11401
- data/app/assets/javascripts/sibu/common.js +6 -6
- data/app/assets/javascripts/sibu/sibu.js.erb +156 -155
- data/app/assets/javascripts/tabs/van11y-accessible-tab-panel-aria.js +465 -465
- data/app/assets/stylesheets/cropper/cropper.css +304 -304
- data/app/assets/stylesheets/quill/quill.snow.css +945 -945
- data/app/assets/stylesheets/sibu/defaults.scss +317 -336
- data/app/assets/stylesheets/sibu/icons.scss +40 -40
- data/app/assets/stylesheets/sibu/sibu.css +131 -131
- data/app/controllers/sibu/application_controller.rb +14 -14
- data/app/controllers/sibu/documents_controller.rb +35 -35
- data/app/controllers/sibu/images_controller.rb +78 -78
- data/app/controllers/sibu/pages_controller.rb +197 -197
- data/app/controllers/sibu/sites_controller.rb +81 -81
- data/app/helpers/sibu/application_helper.rb +11 -11
- data/app/helpers/sibu/documents_helper.rb +4 -4
- data/app/helpers/sibu/images_helper.rb +4 -4
- data/app/helpers/sibu/pages_helper.rb +217 -194
- data/app/helpers/sibu/sites_helper.rb +23 -23
- data/app/jobs/sibu/application_job.rb +4 -4
- data/app/mailers/sibu/application_mailer.rb +6 -6
- data/app/models/concerns/sibu/document_uploader.rb +8 -8
- data/app/models/concerns/sibu/image_uploader.rb +31 -31
- data/app/models/concerns/sibu/sections_concern.rb +134 -134
- data/app/models/concerns/sibu/style_uploader.rb +1 -1
- data/app/models/concerns/sibu/user_concern.rb +9 -8
- data/app/models/sibu/application_record.rb +5 -5
- data/app/models/sibu/document.rb +16 -16
- data/app/models/sibu/dynamic_style.rb +76 -76
- data/app/models/sibu/image.rb +10 -19
- data/app/models/sibu/page.rb +66 -66
- data/app/models/sibu/site.rb +97 -97
- data/app/models/sibu/site_template.rb +22 -22
- data/app/views/layouts/sibu/application.html.erb +23 -23
- data/app/views/layouts/sibu/edit_content.html.erb +262 -262
- data/app/views/layouts/sibu/site.html.erb +45 -45
- data/app/views/sibu/documents/_form.html.erb +14 -14
- data/app/views/sibu/documents/index.html.erb +37 -37
- data/app/views/sibu/documents/new.html.erb +12 -12
- data/app/views/sibu/images/_edit_form.html.erb +23 -23
- data/app/views/sibu/images/_form.html.erb +34 -34
- data/app/views/sibu/images/edit.js.erb +2 -2
- data/app/views/sibu/images/index.html.erb +31 -13
- data/app/views/sibu/images/new.html.erb +12 -12
- data/app/views/sibu/images/show.html.erb +2 -2
- data/app/views/sibu/pages/_code_edit_panel.html.erb +17 -17
- data/app/views/sibu/pages/_element_actions.html.erb +4 -4
- data/app/views/sibu/pages/_error_panel.html.erb +4 -4
- data/app/views/sibu/pages/_form.html.erb +62 -62
- data/app/views/sibu/pages/_group_edit_panel.html.erb +3 -3
- data/app/views/sibu/pages/_link_edit_panel.html.erb +50 -50
- data/app/views/sibu/pages/_map_edit_panel.html.erb +27 -27
- data/app/views/sibu/pages/_media_edit_panel.html.erb +63 -46
- data/app/views/sibu/pages/_new_section_panel.html.erb +43 -43
- data/app/views/sibu/pages/_paragraph_edit_panel.html.erb +18 -18
- data/app/views/sibu/pages/_text_edit_panel.html.erb +19 -19
- data/app/views/sibu/pages/child_element.js.erb +6 -6
- data/app/views/sibu/pages/clone_element.js.erb +6 -6
- data/app/views/sibu/pages/create_section.js.erb +6 -6
- data/app/views/sibu/pages/delete_element.js.erb +6 -6
- data/app/views/sibu/pages/delete_section.js.erb +6 -6
- data/app/views/sibu/pages/destroy.html.erb +2 -2
- data/app/views/sibu/pages/edit.html.erb +8 -8
- data/app/views/sibu/pages/edit_content.html.erb +3 -3
- data/app/views/sibu/pages/edit_element.js.erb +105 -100
- data/app/views/sibu/pages/edit_section.js.erb +7 -7
- data/app/views/sibu/pages/index.html.erb +40 -40
- data/app/views/sibu/pages/new.html.erb +8 -8
- data/app/views/sibu/pages/new_section.js.erb +19 -19
- data/app/views/sibu/pages/show.html.erb +3 -3
- data/app/views/sibu/pages/update.html.erb +2 -2
- data/app/views/sibu/pages/update_element.js.erb +5 -5
- data/app/views/sibu/pages/update_section.js.erb +5 -5
- data/app/views/sibu/sites/_form.html.erb +125 -125
- data/app/views/sibu/sites/destroy.html.erb +2 -2
- data/app/views/sibu/sites/edit.html.erb +9 -9
- data/app/views/sibu/sites/edit_styles.html.erb +8 -8
- data/app/views/sibu/sites/index.html.erb +41 -41
- data/app/views/sibu/sites/new.html.erb +18 -18
- data/app/views/sibu/sites/update.html.erb +2 -2
- data/config/initializers/constants.rb +2 -2
- data/config/initializers/shrine.rb +18 -18
- data/config/routes.rb +30 -30
- data/config/tinymce.yml +5 -5
- data/db/migrate/20180124095041_create_sibu_sites.rb +12 -12
- data/db/migrate/20180124095213_create_sibu_pages.rb +15 -15
- data/db/migrate/20180124145030_create_sibu_site_templates.rb +10 -10
- data/db/migrate/20180125231638_add_user_id_to_sites.rb +5 -5
- data/db/migrate/20180126114522_rename_url_to_path_in_pages.rb +5 -5
- data/db/migrate/20180126114628_add_domain_to_sites.rb +5 -5
- data/db/migrate/20180127211533_create_sibu_images.rb +11 -11
- data/db/migrate/20180208082317_rename_images_user_id_to_site_id.rb +5 -5
- data/db/migrate/20180208125024_rename_image_data_column.rb +5 -5
- data/db/migrate/20180210181644_add_defaults_to_site_templates.rb +6 -6
- data/db/migrate/20180214134653_add_fields_to_sites.rb +5 -5
- data/db/migrate/20180227151519_add_default_templates_to_site_templates.rb +5 -5
- data/db/migrate/20180301121902_add_style_data_to_sites.rb +5 -5
- data/db/migrate/20180301152101_add_default_styles_to_templates.rb +5 -5
- data/db/migrate/20180321144021_move_images_to_user_level.rb +7 -7
- data/db/migrate/20180321170310_add_version_to_sibu_sites.rb +7 -7
- data/db/migrate/20180405095448_create_sibu_documents.rb +10 -10
- data/db/migrate/20190110204854_add_custom_data_to_sibu_pages.rb +5 -5
- data/lib/sibu.rb +4 -4
- data/lib/sibu/engine.rb +19 -19
- data/lib/sibu/utils.rb +14 -14
- data/lib/sibu/version.rb +3 -3
- data/lib/tasks/sibu_tasks.rake +4 -4
- metadata +7 -7
@@ -1,18 +1,18 @@
|
|
1
|
-
<h2>Modifier le texte</h2>
|
2
|
-
<div id="edit_msg"></div>
|
3
|
-
<%= render 'element_actions' %>
|
4
|
-
<div class="sibu_edit_form">
|
5
|
-
<%= form_tag(update_element_site_page_path(@site.id, @page.id), method: :patch, remote: true) do |f| %>
|
6
|
-
<div id="editor-container"></div>
|
7
|
-
|
8
|
-
<%= hidden_field_tag 'element[text]' %>
|
9
|
-
<%= hidden_field_tag 'element[id]', @element["id"] %>
|
10
|
-
<%= hidden_field_tag :element_id, @element_id %>
|
11
|
-
<%= hidden_field_tag :section_id, @section_id %>
|
12
|
-
<%= hidden_field_tag :entity, @entity_type %>
|
13
|
-
<div class="sibu_actions">
|
14
|
-
<%= submit_tag 'Valider' %>
|
15
|
-
<%= link_to 'Annuler', '#', onclick: 'cancelEdit(); return false;' %>
|
16
|
-
</div>
|
17
|
-
<% end %>
|
18
|
-
</div>
|
1
|
+
<h2>Modifier le texte</h2>
|
2
|
+
<div id="edit_msg"></div>
|
3
|
+
<%= render 'element_actions' %>
|
4
|
+
<div class="sibu_edit_form">
|
5
|
+
<%= form_tag(update_element_site_page_path(@site.id, @page.id), method: :patch, remote: true) do |f| %>
|
6
|
+
<div id="editor-container"></div>
|
7
|
+
|
8
|
+
<%= hidden_field_tag 'element[text]' %>
|
9
|
+
<%= hidden_field_tag 'element[id]', @element["id"] %>
|
10
|
+
<%= hidden_field_tag :element_id, @element_id %>
|
11
|
+
<%= hidden_field_tag :section_id, @section_id %>
|
12
|
+
<%= hidden_field_tag :entity, @entity_type %>
|
13
|
+
<div class="sibu_actions">
|
14
|
+
<%= submit_tag 'Valider' %>
|
15
|
+
<%= link_to 'Annuler', '#', onclick: 'cancelEdit(); return false;' %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
@@ -1,19 +1,19 @@
|
|
1
|
-
<h2>Modifier le texte</h2>
|
2
|
-
<div id="edit_msg"></div>
|
3
|
-
<%= render 'element_actions' %>
|
4
|
-
<div class="sibu_edit_form">
|
5
|
-
<%= form_tag(update_element_site_page_path(@site.id, @page.id), method: :patch, remote: true) do |f| %>
|
6
|
-
<div class="sibu_field">
|
7
|
-
<%= label_tag 'element[text]', 'Texte' %>
|
8
|
-
<%= text_field_tag 'element[text]', @element["text"] %>
|
9
|
-
</div>
|
10
|
-
<%= hidden_field_tag 'element[id]', @element["id"] %>
|
11
|
-
<%= hidden_field_tag :element_id, @element_id %>
|
12
|
-
<%= hidden_field_tag :section_id, @section_id %>
|
13
|
-
<%= hidden_field_tag :entity, @entity_type %>
|
14
|
-
<div class="sibu_actions">
|
15
|
-
<%= submit_tag 'Valider' %>
|
16
|
-
<%= link_to 'Annuler', '#', onclick: 'cancelEdit(); return false;' %>
|
17
|
-
</div>
|
18
|
-
<% end %>
|
19
|
-
</div>
|
1
|
+
<h2>Modifier le texte</h2>
|
2
|
+
<div id="edit_msg"></div>
|
3
|
+
<%= render 'element_actions' %>
|
4
|
+
<div class="sibu_edit_form">
|
5
|
+
<%= form_tag(update_element_site_page_path(@site.id, @page.id), method: :patch, remote: true) do |f| %>
|
6
|
+
<div class="sibu_field">
|
7
|
+
<%= label_tag 'element[text]', 'Texte' %>
|
8
|
+
<%= text_field_tag 'element[text]', @element["text"] %>
|
9
|
+
</div>
|
10
|
+
<%= hidden_field_tag 'element[id]', @element["id"] %>
|
11
|
+
<%= hidden_field_tag :element_id, @element_id %>
|
12
|
+
<%= hidden_field_tag :section_id, @section_id %>
|
13
|
+
<%= hidden_field_tag :entity, @entity_type %>
|
14
|
+
<div class="sibu_actions">
|
15
|
+
<%= submit_tag 'Valider' %>
|
16
|
+
<%= link_to 'Annuler', '#', onclick: 'cancelEdit(); return false;' %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<% if @added.nil? %>
|
2
|
-
$("#edit_panel #edit_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'ajout du sous-menu.</p>");
|
3
|
-
<% else %>
|
4
|
-
$("#edit_panel").slideUp();
|
5
|
-
location.reload(true);
|
6
|
-
<% end %>
|
1
|
+
<% if @added.nil? %>
|
2
|
+
$("#edit_panel #edit_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'ajout du sous-menu.</p>");
|
3
|
+
<% else %>
|
4
|
+
$("#edit_panel").slideUp();
|
5
|
+
location.reload(true);
|
6
|
+
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<% if @cloned.nil? %>
|
2
|
-
$("#edit_panel #edit_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>");
|
3
|
-
<% else %>
|
4
|
-
$("#edit_panel").slideUp();
|
5
|
-
refreshAfterEdit(true, '<%= @section_id %>');
|
6
|
-
<% end %>
|
1
|
+
<% if @cloned.nil? %>
|
2
|
+
$("#edit_panel #edit_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>");
|
3
|
+
<% else %>
|
4
|
+
$("#edit_panel").slideUp();
|
5
|
+
refreshAfterEdit(true, '<%= @section_id %>');
|
6
|
+
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<% if @created %>
|
2
|
-
location.reload(true);
|
3
|
-
<% else %>
|
4
|
-
$("#edit_section_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>");
|
5
|
-
<% end %>
|
6
|
-
|
1
|
+
<% if @created %>
|
2
|
+
location.reload(true);
|
3
|
+
<% else %>
|
4
|
+
$("#edit_section_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>");
|
5
|
+
<% end %>
|
6
|
+
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<% if @deleted %>
|
2
|
-
refreshAfterEdit(true, '<%= @section_id %>');
|
3
|
-
<% else %>
|
4
|
-
$("#edit_section_msg").text("La suppression n'a pas pu être effectuée.");
|
5
|
-
<% end %>
|
6
|
-
|
1
|
+
<% if @deleted %>
|
2
|
+
refreshAfterEdit(true, '<%= @section_id %>');
|
3
|
+
<% else %>
|
4
|
+
$("#edit_section_msg").text("La suppression n'a pas pu être effectuée.");
|
5
|
+
<% end %>
|
6
|
+
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<% if @deleted %>
|
2
|
-
location.reload(true);
|
3
|
-
<% else %>
|
4
|
-
$("#edit_section_msg").text("Une erreur s'est produite lors de la suppression.");
|
5
|
-
<% end %>
|
6
|
-
|
1
|
+
<% if @deleted %>
|
2
|
+
location.reload(true);
|
3
|
+
<% else %>
|
4
|
+
$("#edit_section_msg").text("Une erreur s'est produite lors de la suppression.");
|
5
|
+
<% end %>
|
6
|
+
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<h1>Pages#destroy</h1>
|
2
|
-
<p>Find me in app/views/sibu/pages/destroy.html.erb</p>
|
1
|
+
<h1>Pages#destroy</h1>
|
2
|
+
<p>Find me in app/views/sibu/pages/destroy.html.erb</p>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<div class="sibu_view">
|
2
|
-
<div class="actions">
|
3
|
-
<%= link_to 'Retour', :back %>
|
4
|
-
</div>
|
5
|
-
<h2>Modifier une page</h2>
|
6
|
-
<div class="sibu_form">
|
7
|
-
<%= render 'form' %>
|
8
|
-
</div>
|
1
|
+
<div class="sibu_view">
|
2
|
+
<div class="actions">
|
3
|
+
<%= link_to 'Retour', :back %>
|
4
|
+
</div>
|
5
|
+
<h2>Modifier une page</h2>
|
6
|
+
<div class="sibu_form">
|
7
|
+
<%= render 'form' %>
|
8
|
+
</div>
|
9
9
|
</div>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<div class="edit_content">
|
2
|
-
<%= render "shared/#{@site.site_template.path}/site" %>
|
3
|
-
</div>
|
1
|
+
<div class="edit_content">
|
2
|
+
<%= render "shared/#{@site.site_template.path}/site" %>
|
3
|
+
</div>
|
@@ -1,100 +1,105 @@
|
|
1
|
-
var editPanel = $("#edit_panel");
|
2
|
-
editPanel.html("");
|
3
|
-
<% case @content_type %>
|
4
|
-
<% when 'text' %>
|
5
|
-
editPanel.html("<%= j(render 'text_edit_panel') %>");
|
6
|
-
<% when 'embed' %>
|
7
|
-
editPanel.html("<%= j(render 'code_edit_panel') %>");
|
8
|
-
<% when 'paragraph' %>
|
9
|
-
editPanel.html("<%= j(render 'paragraph_edit_panel') %>");
|
10
|
-
<% when 'media' %>
|
11
|
-
editPanel.html("<%= j(render 'media_edit_panel') %>");
|
12
|
-
<% when 'link' %>
|
13
|
-
editPanel.html("<%= j(render 'link_edit_panel') %>");
|
14
|
-
<% when 'group' %>
|
15
|
-
editPanel.html("<%= j(render 'group_edit_panel') %>");
|
16
|
-
<% when 'map' %>
|
17
|
-
editPanel.html("<%= j(render 'map_edit_panel') %>");
|
18
|
-
<% when /^widget/ %>
|
19
|
-
editPanel.html("<%= j(render "shared/sibu/#{@content_type}_panel") %>");
|
20
|
-
<% else %>
|
21
|
-
editPanel.html("<%= j(render 'error_panel') %>");
|
22
|
-
<% end %>
|
23
|
-
|
24
|
-
|
25
|
-
editPanel.slideDown("fast", function() {
|
26
|
-
<% case @content_type %>
|
27
|
-
<% when 'paragraph' %>
|
28
|
-
var quill = initQuillEditor('#editor-container');
|
29
|
-
quill.root.innerHTML = "<%= j(raw(@element["text"] || 'Texte à modifier')) %>";
|
30
|
-
quill.on('text-change', function() {
|
31
|
-
$("#element_text").val(quill.root.innerHTML);
|
32
|
-
});
|
33
|
-
var wrapper = $("[data-sb-id='<%= @section_id %>']").find("[data-id='<%= @element_id %>']");
|
34
|
-
editPanel.find(".ql-editor").css({
|
35
|
-
"font-family": wrapper.css("font-family"),
|
36
|
-
"font-size": wrapper.css("font-size"),
|
37
|
-
"color": wrapper.css("color"),
|
38
|
-
"text-align": wrapper.css("text-align")
|
39
|
-
});
|
40
|
-
<% when 'media' %>
|
41
|
-
var images = editPanel.find(".sibu_image
|
42
|
-
var customCenter = $("#custom_center")
|
43
|
-
images.click(function() {
|
44
|
-
if(!$(this).hasClass('selected')) {
|
45
|
-
images.removeClass('selected');
|
46
|
-
$(this).addClass('selected');
|
47
|
-
$(
|
48
|
-
$("#
|
49
|
-
|
50
|
-
editPanel.find(".
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
}
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
<% else %>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
1
|
+
var editPanel = $("#edit_panel");
|
2
|
+
editPanel.html("");
|
3
|
+
<% case @content_type %>
|
4
|
+
<% when 'text' %>
|
5
|
+
editPanel.html("<%= j(render 'text_edit_panel') %>");
|
6
|
+
<% when 'embed' %>
|
7
|
+
editPanel.html("<%= j(render 'code_edit_panel') %>");
|
8
|
+
<% when 'paragraph' %>
|
9
|
+
editPanel.html("<%= j(render 'paragraph_edit_panel') %>");
|
10
|
+
<% when 'media' %>
|
11
|
+
editPanel.html("<%= j(render 'media_edit_panel') %>");
|
12
|
+
<% when 'link' %>
|
13
|
+
editPanel.html("<%= j(render 'link_edit_panel') %>");
|
14
|
+
<% when 'group' %>
|
15
|
+
editPanel.html("<%= j(render 'group_edit_panel') %>");
|
16
|
+
<% when 'map' %>
|
17
|
+
editPanel.html("<%= j(render 'map_edit_panel') %>");
|
18
|
+
<% when /^widget/ %>
|
19
|
+
editPanel.html("<%= j(render "shared/sibu/#{@content_type}_panel") %>");
|
20
|
+
<% else %>
|
21
|
+
editPanel.html("<%= j(render 'error_panel') %>");
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
|
25
|
+
editPanel.slideDown("fast", function() {
|
26
|
+
<% case @content_type %>
|
27
|
+
<% when 'paragraph' %>
|
28
|
+
var quill = initQuillEditor('#editor-container');
|
29
|
+
quill.root.innerHTML = "<%= j(raw(@element["text"] || 'Texte à modifier')) %>";
|
30
|
+
quill.on('text-change', function() {
|
31
|
+
$("#element_text").val(quill.root.innerHTML);
|
32
|
+
});
|
33
|
+
var wrapper = $("[data-sb-id='<%= @section_id %>']").find("[data-id='<%= @element_id %>']");
|
34
|
+
editPanel.find(".ql-editor").css({
|
35
|
+
"font-family": wrapper.css("font-family"),
|
36
|
+
"font-size": wrapper.css("font-size"),
|
37
|
+
"color": wrapper.css("color"),
|
38
|
+
"text-align": wrapper.css("text-align")
|
39
|
+
});
|
40
|
+
<% when 'media' %>
|
41
|
+
var images = editPanel.find(".sibu_image");
|
42
|
+
var customCenter = $("#custom_center");
|
43
|
+
images.click(function() {
|
44
|
+
if(!$(this).hasClass('selected')) {
|
45
|
+
images.removeClass('selected');
|
46
|
+
$(this).addClass('selected');
|
47
|
+
var imgElt = $(this).find("img");
|
48
|
+
$("#element_src").val(imgElt.data("src"));
|
49
|
+
$("#element_alt").val(imgElt.data("alt"));
|
50
|
+
editPanel.find(".sibu_center").html(
|
51
|
+
'<img src="' + $("#element_src").val() + '"/>' +
|
52
|
+
'<div id="sibu_center_pos" style="display: none;">✕</div>' +
|
53
|
+
'<div id="sibu_center_desc" style="display: none;"><em>Cliquez sur l\'image pour la recentrer sur un point donné (à utiliser lorsque l\'image est tronquée car la zone d\'affichage est trop petite)</em></div>');
|
54
|
+
editPanel.find(".sibu_selected_image > p:first-child").hide();
|
55
|
+
editPanel.find(".sibu_selected_image").find(".sibu_custom_center").show();
|
56
|
+
editPanel.find(".sibu_selected_image").find(".sibu_field").show();
|
57
|
+
if(customCenter.is(":checked")) {
|
58
|
+
customCenter.removeAttr("checked");
|
59
|
+
$("#element_class").val("");
|
60
|
+
$(".sibu_center").attr("style", "");
|
61
|
+
}
|
62
|
+
}
|
63
|
+
});
|
64
|
+
if(editPanel.find(".sibu_center img").size() > 0) {
|
65
|
+
if(customCenter.is(":checked")) {
|
66
|
+
initCustomCenter("<%= @element_id %>");
|
67
|
+
}
|
68
|
+
}
|
69
|
+
customCenter.change(function() {
|
70
|
+
if($(this).is(":checked")) {
|
71
|
+
initCustomCenter("<%= @element_id %>");
|
72
|
+
} else {
|
73
|
+
$("#element_class").val("");
|
74
|
+
$(".sibu_center").attr("style", "");
|
75
|
+
$(".sibu_center > #sibu_center_pos").hide();
|
76
|
+
$(".sibu_center > #sibu_center_desc").hide();
|
77
|
+
}
|
78
|
+
});
|
79
|
+
<% when 'link' %>
|
80
|
+
$("input[name='mode']").change(function() {
|
81
|
+
var selected = $(this).val();
|
82
|
+
$("#link_" + selected).find("#element_value, #element_target").removeAttr("disabled");
|
83
|
+
$(".sibu_edit_form").find(".link_mode").each(function() {
|
84
|
+
if($(this).attr("id") !== ("link_" + selected)) {
|
85
|
+
$(this).find("#element_value, #element_target").attr("disabled", "disabled");
|
86
|
+
}
|
87
|
+
});
|
88
|
+
});
|
89
|
+
<% else %>
|
90
|
+
<% end %>
|
91
|
+
|
92
|
+
<% if @repeat %>
|
93
|
+
$("#clone_elt, #duplicate_elt").show();
|
94
|
+
<% else %>
|
95
|
+
$("#clone_elt, #duplicate_elt").remove();
|
96
|
+
<% end %>
|
97
|
+
|
98
|
+
<% if @children %>
|
99
|
+
$("#child_elt").show();
|
100
|
+
<% else %>
|
101
|
+
$("#child_elt").remove();
|
102
|
+
<% end %>
|
103
|
+
sibuCallback("editElement", "<%= @content_type %>");
|
104
|
+
});
|
105
|
+
document.body.style.overflow = "hidden";
|
@@ -1,7 +1,7 @@
|
|
1
|
-
var editPanel = $("#edit_panel");
|
2
|
-
editPanel.html("");
|
3
|
-
editPanel.html("<%= j(render conf[:section_form]) %>");
|
4
|
-
editPanel.slideDown("fast", function() {
|
5
|
-
sibuCallback("editSection");
|
6
|
-
});
|
7
|
-
document.body.style.overflow = "hidden";
|
1
|
+
var editPanel = $("#edit_panel");
|
2
|
+
editPanel.html("");
|
3
|
+
editPanel.html("<%= j(render conf[:section_form]) %>");
|
4
|
+
editPanel.slideDown("fast", function() {
|
5
|
+
sibuCallback("editSection");
|
6
|
+
});
|
7
|
+
document.body.style.overflow = "hidden";
|
@@ -1,40 +1,40 @@
|
|
1
|
-
<div id="pages" class="sibu_view">
|
2
|
-
<div class="actions">
|
3
|
-
<%= link_to 'Créer une page', new_site_page_path(@site.id) %> <%= link_to 'Retour', :back %>
|
4
|
-
</div>
|
5
|
-
<h2>Pages du site "<%= @site.name %>"</h2>
|
6
|
-
<table>
|
7
|
-
<thead>
|
8
|
-
<tr>
|
9
|
-
<th>Nom</th>
|
10
|
-
<th>Chemin d'accès</th>
|
11
|
-
<th>Origine</th>
|
12
|
-
<th>Mise à jour</th>
|
13
|
-
<th></th>
|
14
|
-
</tr>
|
15
|
-
</thead>
|
16
|
-
<tbody>
|
17
|
-
<% @pages.each do |p| %>
|
18
|
-
<tr>
|
19
|
-
<td><%= p.name %></td>
|
20
|
-
<td><%= p.path %></td>
|
21
|
-
<td><%= (p.source || '') + (p.external_id.blank? ? '' : " (#{p.external_id})") %></td>
|
22
|
-
<td><%= l p.updated_at %></td>
|
23
|
-
<td>
|
24
|
-
<%= link_to 'Voir', site_page_path(@site.id, p), target: '_blank' %> |
|
25
|
-
<%= link_to 'Editer', site_page_edit_content_path(site_id: @site.id, page_id: p.id) %> |
|
26
|
-
<%= link_to 'Copier', duplicate_site_page_path(@site.id, p), method: :post, data: {confirm: "Copier la page \"#{p.name}\" ?"} %> |
|
27
|
-
<%= link_to 'Paramétrer', edit_site_page_path(@site.id, p) %> |
|
28
|
-
<%= link_to 'Supprimer', site_page_path(@site.id, p), method: :delete, data: {confirm: "Supprimer la page \"#{p.name}\" ?"} %>
|
29
|
-
</td>
|
30
|
-
</tr>
|
31
|
-
<% end %>
|
32
|
-
<% if @pages.empty? %>
|
33
|
-
<tr>
|
34
|
-
<td colspan="4">Aucune page créée pour le moment.</td>
|
35
|
-
</tr>
|
36
|
-
<% end %>
|
37
|
-
</tbody>
|
38
|
-
</table>
|
39
|
-
</div>
|
40
|
-
|
1
|
+
<div id="pages" class="sibu_view">
|
2
|
+
<div class="actions">
|
3
|
+
<%= link_to 'Créer une page', new_site_page_path(@site.id) %> <%= link_to 'Retour', :back %>
|
4
|
+
</div>
|
5
|
+
<h2>Pages du site "<%= @site.name %>"</h2>
|
6
|
+
<table>
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th>Nom</th>
|
10
|
+
<th>Chemin d'accès</th>
|
11
|
+
<th>Origine</th>
|
12
|
+
<th>Mise à jour</th>
|
13
|
+
<th></th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
<% @pages.each do |p| %>
|
18
|
+
<tr>
|
19
|
+
<td><%= p.name %></td>
|
20
|
+
<td><%= p.path %></td>
|
21
|
+
<td><%= (p.source || '') + (p.external_id.blank? ? '' : " (#{p.external_id})") %></td>
|
22
|
+
<td><%= l p.updated_at %></td>
|
23
|
+
<td>
|
24
|
+
<%= link_to 'Voir', site_page_path(@site.id, p), target: '_blank' %> |
|
25
|
+
<%= link_to 'Editer', site_page_edit_content_path(site_id: @site.id, page_id: p.id) %> |
|
26
|
+
<%= link_to 'Copier', duplicate_site_page_path(@site.id, p), method: :post, data: {confirm: "Copier la page \"#{p.name}\" ?"} %> |
|
27
|
+
<%= link_to 'Paramétrer', edit_site_page_path(@site.id, p) %> |
|
28
|
+
<%= link_to 'Supprimer', site_page_path(@site.id, p), method: :delete, data: {confirm: "Supprimer la page \"#{p.name}\" ?"} %>
|
29
|
+
</td>
|
30
|
+
</tr>
|
31
|
+
<% end %>
|
32
|
+
<% if @pages.empty? %>
|
33
|
+
<tr>
|
34
|
+
<td colspan="4">Aucune page créée pour le moment.</td>
|
35
|
+
</tr>
|
36
|
+
<% end %>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
</div>
|
40
|
+
|