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,41 +1,41 @@
|
|
1
|
-
@font-face {
|
2
|
-
font-family: 'Sibu';
|
3
|
-
src: font-url('sibu/Sibu.eot');
|
4
|
-
src: font-url('sibu/Sibu.eot') format('embedded-opentype'), font-url('sibu/Sibu.ttf') format('truetype'),
|
5
|
-
font-url('sibu/Sibu.woff') format('woff'), font-url('sibu/Sibu.svg') format('svg');
|
6
|
-
font-weight: normal;
|
7
|
-
font-style: normal;
|
8
|
-
}
|
9
|
-
|
10
|
-
a[class^="sb-"]:before, a[class*=" sb-"]:before {
|
11
|
-
/* use !important to prevent issues with browser extensions that change fonts */
|
12
|
-
font-family: 'Sibu' !important;
|
13
|
-
speak: none;
|
14
|
-
font-style: normal;
|
15
|
-
font-weight: normal;
|
16
|
-
font-variant: normal;
|
17
|
-
text-transform: none;
|
18
|
-
line-height: 1;
|
19
|
-
display: inline-block;
|
20
|
-
margin-right: 3px;
|
21
|
-
|
22
|
-
/* Better Font Rendering =========== */
|
23
|
-
-webkit-font-smoothing: antialiased;
|
24
|
-
-moz-osx-font-smoothing: grayscale;
|
25
|
-
}
|
26
|
-
|
27
|
-
.sb-facebook:before {
|
28
|
-
content: "\e900";
|
29
|
-
}
|
30
|
-
|
31
|
-
.sb-pinterest:before {
|
32
|
-
content: "\e901";
|
33
|
-
}
|
34
|
-
|
35
|
-
.sb-twitter:before {
|
36
|
-
content: "\e902";
|
37
|
-
}
|
38
|
-
|
39
|
-
.sb-instagram:before {
|
40
|
-
content: "\e903";
|
1
|
+
@font-face {
|
2
|
+
font-family: 'Sibu';
|
3
|
+
src: font-url('sibu/Sibu.eot');
|
4
|
+
src: font-url('sibu/Sibu.eot') format('embedded-opentype'), font-url('sibu/Sibu.ttf') format('truetype'),
|
5
|
+
font-url('sibu/Sibu.woff') format('woff'), font-url('sibu/Sibu.svg') format('svg');
|
6
|
+
font-weight: normal;
|
7
|
+
font-style: normal;
|
8
|
+
}
|
9
|
+
|
10
|
+
a[class^="sb-"]:before, a[class*=" sb-"]:before {
|
11
|
+
/* use !important to prevent issues with browser extensions that change fonts */
|
12
|
+
font-family: 'Sibu' !important;
|
13
|
+
speak: none;
|
14
|
+
font-style: normal;
|
15
|
+
font-weight: normal;
|
16
|
+
font-variant: normal;
|
17
|
+
text-transform: none;
|
18
|
+
line-height: 1;
|
19
|
+
display: inline-block;
|
20
|
+
margin-right: 3px;
|
21
|
+
|
22
|
+
/* Better Font Rendering =========== */
|
23
|
+
-webkit-font-smoothing: antialiased;
|
24
|
+
-moz-osx-font-smoothing: grayscale;
|
25
|
+
}
|
26
|
+
|
27
|
+
.sb-facebook:before {
|
28
|
+
content: "\e900";
|
29
|
+
}
|
30
|
+
|
31
|
+
.sb-pinterest:before {
|
32
|
+
content: "\e901";
|
33
|
+
}
|
34
|
+
|
35
|
+
.sb-twitter:before {
|
36
|
+
content: "\e902";
|
37
|
+
}
|
38
|
+
|
39
|
+
.sb-instagram:before {
|
40
|
+
content: "\e903";
|
41
41
|
}
|
@@ -1,132 +1,132 @@
|
|
1
|
-
/*
|
2
|
-
*= require ../quill/quill.snow
|
3
|
-
*= require_self
|
4
|
-
*/
|
5
|
-
|
6
|
-
.sibu_content_panel {
|
7
|
-
position: relative
|
8
|
-
}
|
9
|
-
|
10
|
-
.sb-editable {
|
11
|
-
cursor: pointer;
|
12
|
-
outline: dashed rgba(94, 219, 255, 0.8) 3px;
|
13
|
-
outline-offset: -3px;
|
14
|
-
}
|
15
|
-
|
16
|
-
.sb-editable[data-type='map'] {
|
17
|
-
border: dashed rgba(94, 219, 255, 0.8) 3px;
|
18
|
-
}
|
19
|
-
|
20
|
-
#edit_mode_overlay {
|
21
|
-
display: none;
|
22
|
-
}
|
23
|
-
|
24
|
-
#edit_mode_overlay > div {
|
25
|
-
position: absolute;
|
26
|
-
z-index: 99;
|
27
|
-
}
|
28
|
-
|
29
|
-
#edit_mode_overlay .overlay_top,
|
30
|
-
#edit_mode_overlay .overlay_bottom,
|
31
|
-
#edit_mode_overlay .overlay_left,
|
32
|
-
#edit_mode_overlay .overlay_right {
|
33
|
-
background-color: rgba(94, 219, 255, 0.5);
|
34
|
-
}
|
35
|
-
|
36
|
-
#edit_mode_overlay > .overlay_top {
|
37
|
-
top: 0;
|
38
|
-
left: 0;
|
39
|
-
width: 100%;
|
40
|
-
}
|
41
|
-
|
42
|
-
#edit_mode_overlay > .overlay_bottom {
|
43
|
-
bottom: 0;
|
44
|
-
left: 0;
|
45
|
-
width: 100%;
|
46
|
-
}
|
47
|
-
|
48
|
-
#edit_mode_overlay > .overlay_left {
|
49
|
-
left: 0;
|
50
|
-
}
|
51
|
-
|
52
|
-
#edit_mode_overlay > .overlay_right {
|
53
|
-
right: 0;
|
54
|
-
}
|
55
|
-
|
56
|
-
#edit_panel, #sections_panel {
|
57
|
-
position: fixed;
|
58
|
-
left: 0;
|
59
|
-
bottom: 0;
|
60
|
-
width: 100%;
|
61
|
-
display: none;
|
62
|
-
z-index: 1000;
|
63
|
-
background-color: white;
|
64
|
-
}
|
65
|
-
|
66
|
-
#element_actions button {
|
67
|
-
display: none;
|
68
|
-
}
|
69
|
-
|
70
|
-
#edit_overlays > * {
|
71
|
-
position: absolute;
|
72
|
-
z-index: 999;
|
73
|
-
background-color: rgba(94, 219, 255, 0.5);
|
74
|
-
opacity: 0;
|
75
|
-
display: flex;
|
76
|
-
justify-content: center;
|
77
|
-
align-items: center;
|
78
|
-
cursor: pointer;
|
79
|
-
}
|
80
|
-
|
81
|
-
.sb-editing [data-type] {
|
82
|
-
min-width: 1em;
|
83
|
-
min-height: 0.5em;
|
84
|
-
}
|
85
|
-
|
86
|
-
.ql-snow .ql-tooltip[data-mode="link"]::before {
|
87
|
-
content: "Adresse du lien :";
|
88
|
-
}
|
89
|
-
|
90
|
-
.ql-snow div.ql-tooltip.ql-editing a.ql-action::after {
|
91
|
-
content: "Enregistrer";
|
92
|
-
}
|
93
|
-
|
94
|
-
.ql-snow div.ql-tooltip::before {
|
95
|
-
content: "Accéder au site :";
|
96
|
-
}
|
97
|
-
|
98
|
-
.ql-snow div.ql-tooltip a.ql-action::after {
|
99
|
-
content: 'Modifier';
|
100
|
-
}
|
101
|
-
|
102
|
-
.ql-snow div.ql-tooltip a.ql-remove::before {
|
103
|
-
content: 'Supprimer';
|
104
|
-
}
|
105
|
-
|
106
|
-
.ql-snow.ql-toolbar button.ql-facebook {
|
107
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3251.088 6300.088 16.219 30'%3E%3Cpath fill='%23444' d='M37.686.006,33.8,0c-4.371,0-7.2,2.9-7.2,7.383v3.4H22.689a.612.612,0,0,0-.612.612v4.932a.612.612,0,0,0,.612.612H26.6V29.388a.612.612,0,0,0,.612.612h5.1a.612.612,0,0,0,.612-.612V16.943H37.5a.612.612,0,0,0,.612-.612l0-4.932a.612.612,0,0,0-.612-.612H32.927V7.9c0-1.387.331-2.091,2.137-2.091h2.621A.612.612,0,0,0,38.3,5.2V.618A.612.612,0,0,0,37.686.006Z' transform='translate%28-3273.165 6300.088%29'/%3E%3C/svg%3E");
|
108
|
-
background-repeat: no-repeat;
|
109
|
-
background-size: 18px 18px;
|
110
|
-
background-position: center;
|
111
|
-
}
|
112
|
-
|
113
|
-
.ql-snow.ql-toolbar button.ql-twitter {
|
114
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3139.088 6300.088 36.933 30'%3E%3Cpath fill='%23444' d='M36.934,60.99a15.13,15.13,0,0,1-4.35,1.193,7.608,7.608,0,0,0,3.33-4.189A15.274,15.274,0,0,1,31.1,59.834a7.582,7.582,0,0,0-12.91,6.907A21.51,21.51,0,0,1,2.574,58.826,7.585,7.585,0,0,0,4.919,68.939a7.577,7.577,0,0,1-3.432-.951v.095a7.584,7.584,0,0,0,6.077,7.429,7.674,7.674,0,0,1-2,.265,7.271,7.271,0,0,1-1.426-.141A7.58,7.58,0,0,0,11.217,80.9a15.2,15.2,0,0,1-9.409,3.238A16.1,16.1,0,0,1,0,84.032a21.416,21.416,0,0,0,11.613,3.409c13.937,0,21.555-11.544,21.555-21.555l-.025-.981A15.13,15.13,0,0,0,36.934,60.99Z' transform='translate%28-3139.089 6242.647%29'/%3E%3C/svg%3E");
|
115
|
-
background-repeat: no-repeat;
|
116
|
-
background-size: 18px 18px;
|
117
|
-
background-position: center;
|
118
|
-
}
|
119
|
-
|
120
|
-
.ql-snow.ql-toolbar button.ql-instagram {
|
121
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3202.088 6300.088 30 30'%3E%3Cg transform='translate%28-4031.088 -1288.912%29'%3E%3Cpath fill='%23444' d='M21.721,0H8.279A8.288,8.288,0,0,0,0,8.279V21.721A8.288,8.288,0,0,0,8.279,30H21.721A8.288,8.288,0,0,0,30,21.721V8.279A8.288,8.288,0,0,0,21.721,0Zm5.618,21.721a5.624,5.624,0,0,1-5.617,5.617H8.279a5.623,5.623,0,0,1-5.617-5.617V8.279A5.624,5.624,0,0,1,8.279,2.662H21.721a5.624,5.624,0,0,1,5.617,5.617V21.721Z' transform='translate%28829 7589%29'/%3E%3Cpath fill='%23444' d='M48.7,40.97a7.73,7.73,0,1,0,7.73,7.73A7.739,7.739,0,0,0,48.7,40.97Zm0,12.8A5.068,5.068,0,1,1,53.767,48.7,5.074,5.074,0,0,1,48.7,53.768Z' transform='translate%28795.302 7555.3%29'/%3E%3Cpath fill='%23444' d='M120.873,28.251a1.951,1.951,0,1,0,1.381.571A1.96,1.96,0,0,0,120.873,28.251Z' transform='translate%28731.181 7565.762%29'/%3E%3C/g%3E%3C/svg%3E");
|
122
|
-
background-repeat: no-repeat;
|
123
|
-
background-size: 18px 18px;
|
124
|
-
background-position: center;
|
125
|
-
}
|
126
|
-
|
127
|
-
.ql-snow.ql-toolbar button.ql-pinterest {
|
128
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3005.088 6300.088 23.579 30'%3E%3Cpath fill='%23444' d='M53.7,3.074A11.5,11.5,0,0,0,45.655,0a12.649,12.649,0,0,0-9.329,3.6,10.629,10.629,0,0,0-3.145,7.367c0,3.339,1.4,5.9,3.736,6.856a1.237,1.237,0,0,0,.47.1,1.045,1.045,0,0,0,1.02-.841c.079-.3.262-1.03.341-1.348a1.265,1.265,0,0,0-.339-1.368,4.36,4.36,0,0,1-.992-2.979,7.5,7.5,0,0,1,7.775-7.548c4.007,0,6.5,2.277,6.5,5.943a12.35,12.35,0,0,1-1.4,6.033,4.15,4.15,0,0,1-3.433,2.4,2.276,2.276,0,0,1-1.81-.827,2.082,2.082,0,0,1-.365-1.808c.179-.756.422-1.545.658-2.307a14.278,14.278,0,0,0,.836-3.757,2.728,2.728,0,0,0-2.746-3c-2.087,0-3.722,2.12-3.722,4.825a7.176,7.176,0,0,0,.512,2.7c-.263,1.114-1.825,7.736-2.122,8.985-.171.729-1.2,6.487.5,6.946,1.92.516,3.636-5.092,3.81-5.725.142-.515.637-2.464.94-3.662a5.8,5.8,0,0,0,3.871,1.5,8.633,8.633,0,0,0,6.932-3.468,13.922,13.922,0,0,0,2.606-8.513A9.816,9.816,0,0,0,53.7,3.074Z' transform='translate%28-3038.269 6300.088%29'/%3E%3C/svg%3E");
|
129
|
-
background-repeat: no-repeat;
|
130
|
-
background-size: 18px 18px;
|
131
|
-
background-position: center;
|
1
|
+
/*
|
2
|
+
*= require ../quill/quill.snow
|
3
|
+
*= require_self
|
4
|
+
*/
|
5
|
+
|
6
|
+
.sibu_content_panel {
|
7
|
+
position: relative
|
8
|
+
}
|
9
|
+
|
10
|
+
.sb-editable {
|
11
|
+
cursor: pointer;
|
12
|
+
outline: dashed rgba(94, 219, 255, 0.8) 3px;
|
13
|
+
outline-offset: -3px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.sb-editable[data-type='map'] {
|
17
|
+
border: dashed rgba(94, 219, 255, 0.8) 3px;
|
18
|
+
}
|
19
|
+
|
20
|
+
#edit_mode_overlay {
|
21
|
+
display: none;
|
22
|
+
}
|
23
|
+
|
24
|
+
#edit_mode_overlay > div {
|
25
|
+
position: absolute;
|
26
|
+
z-index: 99;
|
27
|
+
}
|
28
|
+
|
29
|
+
#edit_mode_overlay .overlay_top,
|
30
|
+
#edit_mode_overlay .overlay_bottom,
|
31
|
+
#edit_mode_overlay .overlay_left,
|
32
|
+
#edit_mode_overlay .overlay_right {
|
33
|
+
background-color: rgba(94, 219, 255, 0.5);
|
34
|
+
}
|
35
|
+
|
36
|
+
#edit_mode_overlay > .overlay_top {
|
37
|
+
top: 0;
|
38
|
+
left: 0;
|
39
|
+
width: 100%;
|
40
|
+
}
|
41
|
+
|
42
|
+
#edit_mode_overlay > .overlay_bottom {
|
43
|
+
bottom: 0;
|
44
|
+
left: 0;
|
45
|
+
width: 100%;
|
46
|
+
}
|
47
|
+
|
48
|
+
#edit_mode_overlay > .overlay_left {
|
49
|
+
left: 0;
|
50
|
+
}
|
51
|
+
|
52
|
+
#edit_mode_overlay > .overlay_right {
|
53
|
+
right: 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
#edit_panel, #sections_panel {
|
57
|
+
position: fixed;
|
58
|
+
left: 0;
|
59
|
+
bottom: 0;
|
60
|
+
width: 100%;
|
61
|
+
display: none;
|
62
|
+
z-index: 1000;
|
63
|
+
background-color: white;
|
64
|
+
}
|
65
|
+
|
66
|
+
#element_actions button {
|
67
|
+
display: none;
|
68
|
+
}
|
69
|
+
|
70
|
+
#edit_overlays > * {
|
71
|
+
position: absolute;
|
72
|
+
z-index: 999;
|
73
|
+
background-color: rgba(94, 219, 255, 0.5);
|
74
|
+
opacity: 0;
|
75
|
+
display: flex;
|
76
|
+
justify-content: center;
|
77
|
+
align-items: center;
|
78
|
+
cursor: pointer;
|
79
|
+
}
|
80
|
+
|
81
|
+
.sb-editing [data-type] {
|
82
|
+
min-width: 1em;
|
83
|
+
min-height: 0.5em;
|
84
|
+
}
|
85
|
+
|
86
|
+
.ql-snow .ql-tooltip[data-mode="link"]::before {
|
87
|
+
content: "Adresse du lien :";
|
88
|
+
}
|
89
|
+
|
90
|
+
.ql-snow div.ql-tooltip.ql-editing a.ql-action::after {
|
91
|
+
content: "Enregistrer";
|
92
|
+
}
|
93
|
+
|
94
|
+
.ql-snow div.ql-tooltip::before {
|
95
|
+
content: "Accéder au site :";
|
96
|
+
}
|
97
|
+
|
98
|
+
.ql-snow div.ql-tooltip a.ql-action::after {
|
99
|
+
content: 'Modifier';
|
100
|
+
}
|
101
|
+
|
102
|
+
.ql-snow div.ql-tooltip a.ql-remove::before {
|
103
|
+
content: 'Supprimer';
|
104
|
+
}
|
105
|
+
|
106
|
+
.ql-snow.ql-toolbar button.ql-facebook {
|
107
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3251.088 6300.088 16.219 30'%3E%3Cpath fill='%23444' d='M37.686.006,33.8,0c-4.371,0-7.2,2.9-7.2,7.383v3.4H22.689a.612.612,0,0,0-.612.612v4.932a.612.612,0,0,0,.612.612H26.6V29.388a.612.612,0,0,0,.612.612h5.1a.612.612,0,0,0,.612-.612V16.943H37.5a.612.612,0,0,0,.612-.612l0-4.932a.612.612,0,0,0-.612-.612H32.927V7.9c0-1.387.331-2.091,2.137-2.091h2.621A.612.612,0,0,0,38.3,5.2V.618A.612.612,0,0,0,37.686.006Z' transform='translate%28-3273.165 6300.088%29'/%3E%3C/svg%3E");
|
108
|
+
background-repeat: no-repeat;
|
109
|
+
background-size: 18px 18px;
|
110
|
+
background-position: center;
|
111
|
+
}
|
112
|
+
|
113
|
+
.ql-snow.ql-toolbar button.ql-twitter {
|
114
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3139.088 6300.088 36.933 30'%3E%3Cpath fill='%23444' d='M36.934,60.99a15.13,15.13,0,0,1-4.35,1.193,7.608,7.608,0,0,0,3.33-4.189A15.274,15.274,0,0,1,31.1,59.834a7.582,7.582,0,0,0-12.91,6.907A21.51,21.51,0,0,1,2.574,58.826,7.585,7.585,0,0,0,4.919,68.939a7.577,7.577,0,0,1-3.432-.951v.095a7.584,7.584,0,0,0,6.077,7.429,7.674,7.674,0,0,1-2,.265,7.271,7.271,0,0,1-1.426-.141A7.58,7.58,0,0,0,11.217,80.9a15.2,15.2,0,0,1-9.409,3.238A16.1,16.1,0,0,1,0,84.032a21.416,21.416,0,0,0,11.613,3.409c13.937,0,21.555-11.544,21.555-21.555l-.025-.981A15.13,15.13,0,0,0,36.934,60.99Z' transform='translate%28-3139.089 6242.647%29'/%3E%3C/svg%3E");
|
115
|
+
background-repeat: no-repeat;
|
116
|
+
background-size: 18px 18px;
|
117
|
+
background-position: center;
|
118
|
+
}
|
119
|
+
|
120
|
+
.ql-snow.ql-toolbar button.ql-instagram {
|
121
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3202.088 6300.088 30 30'%3E%3Cg transform='translate%28-4031.088 -1288.912%29'%3E%3Cpath fill='%23444' d='M21.721,0H8.279A8.288,8.288,0,0,0,0,8.279V21.721A8.288,8.288,0,0,0,8.279,30H21.721A8.288,8.288,0,0,0,30,21.721V8.279A8.288,8.288,0,0,0,21.721,0Zm5.618,21.721a5.624,5.624,0,0,1-5.617,5.617H8.279a5.623,5.623,0,0,1-5.617-5.617V8.279A5.624,5.624,0,0,1,8.279,2.662H21.721a5.624,5.624,0,0,1,5.617,5.617V21.721Z' transform='translate%28829 7589%29'/%3E%3Cpath fill='%23444' d='M48.7,40.97a7.73,7.73,0,1,0,7.73,7.73A7.739,7.739,0,0,0,48.7,40.97Zm0,12.8A5.068,5.068,0,1,1,53.767,48.7,5.074,5.074,0,0,1,48.7,53.768Z' transform='translate%28795.302 7555.3%29'/%3E%3Cpath fill='%23444' d='M120.873,28.251a1.951,1.951,0,1,0,1.381.571A1.96,1.96,0,0,0,120.873,28.251Z' transform='translate%28731.181 7565.762%29'/%3E%3C/g%3E%3C/svg%3E");
|
122
|
+
background-repeat: no-repeat;
|
123
|
+
background-size: 18px 18px;
|
124
|
+
background-position: center;
|
125
|
+
}
|
126
|
+
|
127
|
+
.ql-snow.ql-toolbar button.ql-pinterest {
|
128
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3005.088 6300.088 23.579 30'%3E%3Cpath fill='%23444' d='M53.7,3.074A11.5,11.5,0,0,0,45.655,0a12.649,12.649,0,0,0-9.329,3.6,10.629,10.629,0,0,0-3.145,7.367c0,3.339,1.4,5.9,3.736,6.856a1.237,1.237,0,0,0,.47.1,1.045,1.045,0,0,0,1.02-.841c.079-.3.262-1.03.341-1.348a1.265,1.265,0,0,0-.339-1.368,4.36,4.36,0,0,1-.992-2.979,7.5,7.5,0,0,1,7.775-7.548c4.007,0,6.5,2.277,6.5,5.943a12.35,12.35,0,0,1-1.4,6.033,4.15,4.15,0,0,1-3.433,2.4,2.276,2.276,0,0,1-1.81-.827,2.082,2.082,0,0,1-.365-1.808c.179-.756.422-1.545.658-2.307a14.278,14.278,0,0,0,.836-3.757,2.728,2.728,0,0,0-2.746-3c-2.087,0-3.722,2.12-3.722,4.825a7.176,7.176,0,0,0,.512,2.7c-.263,1.114-1.825,7.736-2.122,8.985-.171.729-1.2,6.487.5,6.946,1.92.516,3.636-5.092,3.81-5.725.142-.515.637-2.464.94-3.662a5.8,5.8,0,0,0,3.871,1.5,8.633,8.633,0,0,0,6.932-3.468,13.922,13.922,0,0,0,2.606-8.513A9.816,9.816,0,0,0,53.7,3.074Z' transform='translate%28-3038.269 6300.088%29'/%3E%3C/svg%3E");
|
129
|
+
background-repeat: no-repeat;
|
130
|
+
background-size: 18px 18px;
|
131
|
+
background-position: center;
|
132
132
|
}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
module Sibu
|
2
|
-
class ApplicationController < ActionController::Base
|
3
|
-
protect_from_forgery with: :exception
|
4
|
-
before_action Rails.application.config.sibu[:auth_filter]
|
5
|
-
|
6
|
-
def conf
|
7
|
-
Rails.application.config.sibu
|
8
|
-
end
|
9
|
-
|
10
|
-
def sibu_user
|
11
|
-
send(conf[:current_user])
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
1
|
+
module Sibu
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
protect_from_forgery with: :exception
|
4
|
+
before_action Rails.application.config.sibu[:auth_filter]
|
5
|
+
|
6
|
+
def conf
|
7
|
+
Rails.application.config.sibu
|
8
|
+
end
|
9
|
+
|
10
|
+
def sibu_user
|
11
|
+
send(conf[:current_user])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
require_dependency "sibu/application_controller"
|
2
|
-
|
3
|
-
module Sibu
|
4
|
-
class DocumentsController < ApplicationController
|
5
|
-
def index
|
6
|
-
@documents = Sibu::Document.for_user(sibu_user)
|
7
|
-
end
|
8
|
-
|
9
|
-
def new
|
10
|
-
@document = Sibu::Document.new(user_id: send(Rails.application.config.sibu[:current_user]).id)
|
11
|
-
end
|
12
|
-
|
13
|
-
def create
|
14
|
-
@document = Sibu::Document.new(document_params)
|
15
|
-
if @document.save
|
16
|
-
redirect_to documents_url, notice: "Le document a bien été téléchargé."
|
17
|
-
else
|
18
|
-
flash.now[:alert] = "Une erreur s'est produite lors du téléchargement du document."
|
19
|
-
render :new
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def destroy
|
24
|
-
@document = Sibu::Document.find(params[:id])
|
25
|
-
@document.destroy
|
26
|
-
redirect_to documents_url, notice: "Le document a bien été supprimé."
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def document_params
|
32
|
-
params.require(:document).permit!
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
1
|
+
require_dependency "sibu/application_controller"
|
2
|
+
|
3
|
+
module Sibu
|
4
|
+
class DocumentsController < ApplicationController
|
5
|
+
def index
|
6
|
+
@documents = Sibu::Document.for_user(sibu_user)
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@document = Sibu::Document.new(user_id: send(Rails.application.config.sibu[:current_user]).id)
|
11
|
+
end
|
12
|
+
|
13
|
+
def create
|
14
|
+
@document = Sibu::Document.new(document_params)
|
15
|
+
if @document.save
|
16
|
+
redirect_to documents_url, notice: "Le document a bien été téléchargé."
|
17
|
+
else
|
18
|
+
flash.now[:alert] = "Une erreur s'est produite lors du téléchargement du document."
|
19
|
+
render :new
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def destroy
|
24
|
+
@document = Sibu::Document.find(params[:id])
|
25
|
+
@document.destroy
|
26
|
+
redirect_to documents_url, notice: "Le document a bien été supprimé."
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def document_params
|
32
|
+
params.require(:document).permit!
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,78 +1,78 @@
|
|
1
|
-
require_dependency "sibu/application_controller"
|
2
|
-
|
3
|
-
module Sibu
|
4
|
-
class ImagesController < ApplicationController
|
5
|
-
before_action :set_image, only: [:edit, :update, :destroy]
|
6
|
-
before_action :set_edition_context, only: [:new, :create]
|
7
|
-
|
8
|
-
def index
|
9
|
-
@images = Sibu::Image.for_user(sibu_user)
|
10
|
-
end
|
11
|
-
|
12
|
-
def new
|
13
|
-
@image = Sibu::Image.new(user_id: send(Rails.application.config.sibu[:current_user]).id)
|
14
|
-
end
|
15
|
-
|
16
|
-
def create
|
17
|
-
@image = Sibu::Image.new(image_params)
|
18
|
-
if @image.save
|
19
|
-
if !@page_id.blank? && !@section_id.blank? && !@element_id.blank? && !@size.blank?
|
20
|
-
p = Sibu::Page.find(@page_id)
|
21
|
-
entity = @entity_type == 'site' ? p.site : p
|
22
|
-
ids = (@section_id.split('|') + @element_id.split('|')).uniq[0...-1]
|
23
|
-
elt = entity.update_element(*ids, {"id" => @img_id, "src" => @image.file_url(@size.to_sym), "alt" => @image.alt})
|
24
|
-
if elt.nil?
|
25
|
-
msg = {alert: "Une erreur s'est produite lors de la mise à jour de l'image."}
|
26
|
-
else
|
27
|
-
msg = {notice: "L'image a bien été mise à jour."}
|
28
|
-
end
|
29
|
-
redirect_to site_page_edit_content_path(p.site_id, @page_id), msg
|
30
|
-
else
|
31
|
-
redirect_to images_url, notice: "L'image a bien été téléchargée."
|
32
|
-
end
|
33
|
-
else
|
34
|
-
flash.now[:alert] = "Une erreur s'est produite lors du téléchargement de l'image."
|
35
|
-
render :new
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def show
|
40
|
-
end
|
41
|
-
|
42
|
-
def edit
|
43
|
-
end
|
44
|
-
|
45
|
-
def update
|
46
|
-
if @image.update(image_params)
|
47
|
-
redirect_to images_url, notice: "L'image a bien été mise à jour."
|
48
|
-
else
|
49
|
-
flash.now[:alert] = "Une erreur s'est produite lors de l'enregistrement de l'image."
|
50
|
-
render :index
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def destroy
|
55
|
-
@image.destroy
|
56
|
-
redirect_to images_url, notice: "L'image a bien été supprimée."
|
57
|
-
end
|
58
|
-
|
59
|
-
private
|
60
|
-
|
61
|
-
def set_image
|
62
|
-
@image = Sibu::Image.find(params[:id])
|
63
|
-
end
|
64
|
-
|
65
|
-
def set_edition_context
|
66
|
-
@page_id = params[:page_id]
|
67
|
-
@entity_type = params[:entity_type]
|
68
|
-
@section_id = params[:section_id]
|
69
|
-
@element_id = params[:element_id]
|
70
|
-
@img_id = params[:img_id]
|
71
|
-
@size = params[:size]
|
72
|
-
end
|
73
|
-
|
74
|
-
def image_params
|
75
|
-
params.require(:image).permit!
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
1
|
+
require_dependency "sibu/application_controller"
|
2
|
+
|
3
|
+
module Sibu
|
4
|
+
class ImagesController < ApplicationController
|
5
|
+
before_action :set_image, only: [:edit, :update, :destroy]
|
6
|
+
before_action :set_edition_context, only: [:new, :create]
|
7
|
+
|
8
|
+
def index
|
9
|
+
@images = Sibu::Image.for_user(sibu_user)
|
10
|
+
end
|
11
|
+
|
12
|
+
def new
|
13
|
+
@image = Sibu::Image.new(user_id: send(Rails.application.config.sibu[:current_user]).id)
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
@image = Sibu::Image.new(image_params)
|
18
|
+
if @image.save
|
19
|
+
if !@page_id.blank? && !@section_id.blank? && !@element_id.blank? && !@size.blank?
|
20
|
+
p = Sibu::Page.find(@page_id)
|
21
|
+
entity = @entity_type == 'site' ? p.site : p
|
22
|
+
ids = (@section_id.split('|') + @element_id.split('|')).uniq[0...-1]
|
23
|
+
elt = entity.update_element(*ids, {"id" => @img_id, "src" => @image.file_url(@size.to_sym), "alt" => @image.alt})
|
24
|
+
if elt.nil?
|
25
|
+
msg = {alert: "Une erreur s'est produite lors de la mise à jour de l'image."}
|
26
|
+
else
|
27
|
+
msg = {notice: "L'image a bien été mise à jour."}
|
28
|
+
end
|
29
|
+
redirect_to site_page_edit_content_path(p.site_id, @page_id), msg
|
30
|
+
else
|
31
|
+
redirect_to images_url, notice: "L'image a bien été téléchargée."
|
32
|
+
end
|
33
|
+
else
|
34
|
+
flash.now[:alert] = "Une erreur s'est produite lors du téléchargement de l'image."
|
35
|
+
render :new
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def show
|
40
|
+
end
|
41
|
+
|
42
|
+
def edit
|
43
|
+
end
|
44
|
+
|
45
|
+
def update
|
46
|
+
if @image.update(image_params)
|
47
|
+
redirect_to images_url, notice: "L'image a bien été mise à jour."
|
48
|
+
else
|
49
|
+
flash.now[:alert] = "Une erreur s'est produite lors de l'enregistrement de l'image."
|
50
|
+
render :index
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def destroy
|
55
|
+
@image.destroy
|
56
|
+
redirect_to images_url, notice: "L'image a bien été supprimée."
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def set_image
|
62
|
+
@image = Sibu::Image.find(params[:id])
|
63
|
+
end
|
64
|
+
|
65
|
+
def set_edition_context
|
66
|
+
@page_id = params[:page_id]
|
67
|
+
@entity_type = params[:entity_type]
|
68
|
+
@section_id = params[:section_id]
|
69
|
+
@element_id = params[:element_id]
|
70
|
+
@img_id = params[:img_id]
|
71
|
+
@size = params[:size]
|
72
|
+
end
|
73
|
+
|
74
|
+
def image_params
|
75
|
+
params.require(:image).permit!
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|