pages_core 3.12.0 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/assets/builds/fonts/661557ef.ttf +0 -0
  4. data/app/assets/builds/fonts/a18fc2d2.woff2 +0 -0
  5. data/app/assets/builds/fonts/b2c7b78f.woff2 +0 -0
  6. data/app/assets/builds/fonts/ceddc204.ttf +0 -0
  7. data/app/assets/builds/pages_core/admin-dist.js +2 -1
  8. data/app/assets/builds/pages_core/admin.css +9233 -0
  9. data/app/assets/images/pages/admin/angle-down-solid.svg +1 -0
  10. data/app/assets/images/pages/admin/icon.svg +1 -0
  11. data/app/assets/stylesheets/pages_core/admin/components/archive.css +6 -0
  12. data/app/assets/stylesheets/{pages/admin/components/attachments.scss → pages_core/admin/components/attachments.css} +35 -28
  13. data/app/assets/stylesheets/{pages/admin.scss → pages_core/admin/components/base.css} +125 -123
  14. data/app/assets/stylesheets/pages_core/admin/components/forms.css +223 -0
  15. data/app/assets/stylesheets/{pages/admin/components/header.scss → pages_core/admin/components/header.css} +76 -46
  16. data/app/assets/stylesheets/{pages/admin/components/image_editor.scss → pages_core/admin/components/image_editor.css} +42 -31
  17. data/app/assets/stylesheets/{pages/admin/components/image_grid.scss → pages_core/admin/components/image_grid.css} +76 -64
  18. data/app/assets/stylesheets/{pages/admin/components/image_uploader.scss → pages_core/admin/components/image_uploader.css} +12 -12
  19. data/app/assets/stylesheets/{pages/admin/components/layout.scss → pages_core/admin/components/layout.css} +13 -9
  20. data/app/assets/stylesheets/pages_core/admin/components/links.css +40 -0
  21. data/app/assets/stylesheets/pages_core/admin/components/list_table.css +66 -0
  22. data/app/assets/stylesheets/{pages/admin/components/login.scss → pages_core/admin/components/login.css} +6 -5
  23. data/app/assets/stylesheets/{pages/admin/components/modal.scss → pages_core/admin/components/modal.css} +10 -12
  24. data/app/assets/stylesheets/{pages/admin/components/page_tree.scss → pages_core/admin/components/page_tree.css} +54 -55
  25. data/app/assets/stylesheets/{pages/admin/components/pagination.scss → pages_core/admin/components/pagination.css} +17 -17
  26. data/app/assets/stylesheets/{pages/admin/components/sidebar.scss → pages_core/admin/components/sidebar.css} +8 -7
  27. data/app/assets/stylesheets/{pages/admin/components/tag_editor.scss → pages_core/admin/components/tag_editor.css} +10 -15
  28. data/app/assets/stylesheets/{pages/admin/components/textarea.scss → pages_core/admin/components/textarea.css} +1 -1
  29. data/app/assets/stylesheets/{pages/admin/components/toast.scss → pages_core/admin/components/toast.css} +5 -3
  30. data/app/assets/stylesheets/{pages/admin/components/toolbar.scss → pages_core/admin/components/toolbar.css} +56 -29
  31. data/app/assets/stylesheets/{pages/admin/controllers/pages.scss → pages_core/admin/controllers/pages.css} +63 -52
  32. data/app/assets/stylesheets/pages_core/admin/controllers/users.css +3 -0
  33. data/app/assets/stylesheets/pages_core/admin/vars.css +34 -0
  34. data/app/assets/stylesheets/pages_core/admin.postcss.css +9 -0
  35. data/app/formatters/pages_core/image_embedder.rb +5 -27
  36. data/app/helpers/admin/calendars_helper.rb +8 -0
  37. data/app/helpers/admin/news_helper.rb +13 -0
  38. data/app/helpers/pages_core/admin/admin_helper.rb +11 -54
  39. data/app/helpers/pages_core/admin/deprecated_admin_helper.rb +40 -0
  40. data/app/helpers/pages_core/images_helper.rb +37 -0
  41. data/app/javascript/components/Attachments/Attachment.jsx +2 -2
  42. data/app/javascript/components/EditableImage.jsx +1 -1
  43. data/app/javascript/components/ImageCropper/Toolbar.jsx +3 -3
  44. data/app/javascript/components/PageTreeNode.jsx +9 -9
  45. data/app/javascript/components/RichTextToolbarButton.jsx +1 -1
  46. data/app/mailers/admin_mailer.rb +1 -0
  47. data/app/models/invite.rb +8 -0
  48. data/app/views/admin/calendars/_sidebar.html.erb +47 -0
  49. data/app/views/admin/calendars/show.html.erb +15 -53
  50. data/app/views/admin/invites/new.html.erb +2 -8
  51. data/app/views/admin/invites/show.html.erb +2 -4
  52. data/app/views/admin/news/_sidebar.html.erb +48 -0
  53. data/app/views/admin/news/index.html.erb +21 -56
  54. data/app/views/admin/pages/deleted.html.erb +10 -8
  55. data/app/views/admin/pages/edit.html.erb +20 -11
  56. data/app/views/admin/pages/index.html.erb +7 -8
  57. data/app/views/admin/pages/new.html.erb +10 -14
  58. data/app/views/admin/password_resets/show.html.erb +3 -5
  59. data/app/views/admin/users/deactivated.html.erb +6 -7
  60. data/app/views/admin/users/edit.html.erb +7 -9
  61. data/app/views/admin/users/index.html.erb +3 -6
  62. data/app/views/admin/users/login.html.erb +4 -5
  63. data/app/views/admin/users/new.html.erb +2 -4
  64. data/app/views/admin/users/new_password.html.erb +4 -5
  65. data/app/views/admin/users/show.html.erb +11 -9
  66. data/app/views/errors/401.html.erb +2 -1
  67. data/app/views/errors/403.html.erb +2 -1
  68. data/app/views/errors/404.html.erb +1 -3
  69. data/app/views/errors/405.html.erb +2 -1
  70. data/app/views/errors/422.html.erb +2 -1
  71. data/app/views/errors/500.html.erb +2 -3
  72. data/app/views/layouts/admin/_header.html.erb +1 -2
  73. data/app/views/layouts/admin/_page_header.html.erb +4 -4
  74. data/app/views/layouts/admin.html.erb +3 -3
  75. data/app/views/layouts/errors.html.erb +127 -4
  76. data/lib/pages_core/engine.rb +4 -3
  77. data/lib/pages_core.rb +0 -1
  78. metadata +39 -196
  79. data/app/assets/images/pages/admin/icon.png +0 -0
  80. data/app/assets/images/pages/admin/image-editor-bg.png +0 -0
  81. data/app/assets/images/pages/admin/list-table-pin-blue.gif +0 -0
  82. data/app/assets/images/pages/admin/list-table-pin-disabled.gif +0 -0
  83. data/app/assets/images/pages/admin/list-table-pin-green.gif +0 -0
  84. data/app/assets/images/pages/admin/list-table-pin-red.gif +0 -0
  85. data/app/assets/images/pages/admin/list-table-pin-yellow.gif +0 -0
  86. data/app/assets/images/pages/admin/loading-modal.gif +0 -0
  87. data/app/assets/images/pages/feed-icon-14x14.png +0 -0
  88. data/app/assets/stylesheets/pages/admin/components/archive.scss +0 -6
  89. data/app/assets/stylesheets/pages/admin/components/buttons.scss +0 -23
  90. data/app/assets/stylesheets/pages/admin/components/forms.scss +0 -169
  91. data/app/assets/stylesheets/pages/admin/components/links.scss +0 -43
  92. data/app/assets/stylesheets/pages/admin/components/list_table.scss +0 -61
  93. data/app/assets/stylesheets/pages/admin/controllers/users.scss +0 -3
  94. data/app/assets/stylesheets/pages/admin/mixins/breakpoints.scss +0 -21
  95. data/app/assets/stylesheets/pages/admin/mixins/clearfix.scss +0 -7
  96. data/app/assets/stylesheets/pages/admin/mixins/gradients.scss +0 -7
  97. data/app/assets/stylesheets/pages/admin/vars.scss +0 -30
  98. data/app/assets/stylesheets/pages/errors.css +0 -128
  99. data/vendor/assets/stylesheets/ReactCrop.css +0 -167
  100. /data/app/assets/stylesheets/{pages/admin/components/tabs.scss → pages_core/admin/components/tabs.css} +0 -0
@@ -2,64 +2,59 @@
2
2
  margin-top: 10px;
3
3
  margin-bottom: 1.5em;
4
4
 
5
- .tags {
5
+ & .tags {
6
6
  line-height: 1.5;
7
7
  }
8
8
 
9
- .tag {
9
+ & .tag {
10
10
  font-size: 13px;
11
11
  cursor: pointer;
12
12
  display: block;
13
13
  float: left;
14
14
  margin: 0 5px 5px 0;
15
15
  padding: 0px;
16
- background: $c-background-disabled;
16
+ background: var(--background-disabled-color);
17
17
  border-radius: 5px;
18
18
  line-height: 26px;
19
19
  line-height: 36px;
20
20
  min-width: 40px;
21
21
  transition: all 200ms ease-out;
22
- -webkit-user-select: none;
23
- -khtml-user-select: none;
24
- -moz-user-select: none;
25
- -ms-user-select: none;
26
22
  user-select: none;
27
23
 
28
- label {
24
+ & label {
29
25
  margin: 0px;
30
26
  padding: 0px 10px;
31
27
  color: inherit;
32
28
  }
33
29
 
34
- input {
30
+ & input {
35
31
  margin: 2px 3px 0 0;
36
32
  }
37
33
 
38
- .name {
34
+ & .name {
39
35
  padding: 1px 5px;
40
36
  margin: 0;
41
37
  }
42
38
 
43
39
  &.enabled {
44
40
  color: #fff;
45
- background: $c-link;
46
- background: $c-blue-dark;
41
+ background: var(--blue-dark);
47
42
  }
48
43
  }
49
44
 
50
- .add-tag-form {
45
+ & .add-tag-form {
51
46
  float: left;
52
47
  width: 178px;
53
48
  white-space: nowrap;
54
49
  }
55
50
 
56
- input.add-tag {
51
+ & input.add-tag {
57
52
  margin-top: 0px;
58
53
  border-radius: 5px;
59
54
  margin: 0 4px 0 0;
60
55
 
61
56
  &.example {
62
- color: $c-text-light;
57
+ color: var(--text-light-color);
63
58
  }
64
59
  }
65
60
  }
@@ -1,6 +1,6 @@
1
1
  textarea.rich {
2
2
  margin-top: -32px;
3
- padding-top: 8px + 32px;
3
+ padding-top: calc(8px + 32px);
4
4
  width: 100%;
5
5
  max-width: none;
6
6
  }
@@ -6,10 +6,10 @@
6
6
  overflow: hidden;
7
7
  z-index: 200;
8
8
 
9
- .toast {
9
+ & .toast {
10
10
  font-size: 14px;
11
11
  display: inline-block;
12
- background: $c-background-invert;
12
+ background: var(--background-invert-color);
13
13
  color: white;
14
14
  margin: 20px auto 0px auto;
15
15
  padding: 15px 30px;
@@ -21,7 +21,7 @@
21
21
  animation-fill-mode: forwards;
22
22
 
23
23
  &.error {
24
- background: $c-red;
24
+ background: var(--red);
25
25
  }
26
26
 
27
27
  &.fadeout {
@@ -36,6 +36,7 @@
36
36
  from {
37
37
  transform: translateZ(0px) translateY(60px);
38
38
  }
39
+
39
40
  to {
40
41
  transform: translateZ(0px) translateY(0px);
41
42
  }
@@ -45,6 +46,7 @@
45
46
  from {
46
47
  transform: translateZ(0px) translateY(0px);
47
48
  }
49
+
48
50
  to {
49
51
  transform: translateZ(0px) translateY(60px);
50
52
  }
@@ -1,36 +1,41 @@
1
1
  .toolbar {
2
- @extend %clearfix;
3
2
  position: relative;
4
3
  display: block;
5
4
  list-style: none;
6
5
  margin: 0px;
7
- border: 1px solid $c-border;
6
+ border: 1px solid var(--border-color);
8
7
  background-color: #fafafa;
9
8
  padding: 0px 10px 0px 0px;
10
9
  line-height: 30px;
11
10
  width: auto;
12
11
 
13
- li {
12
+ &:after {
13
+ content: "";
14
+ display: table;
15
+ clear: both;
16
+ }
17
+
18
+ & li {
14
19
  list-style: none;
15
20
  margin: 0;
16
21
  padding: 0;
17
22
  }
18
23
 
19
- .info {
24
+ & .info {
20
25
  float: right;
21
- color: $c-text-lighter;
26
+ color: var(--text-lighter-color);
22
27
  padding: 0px 10px;
23
28
  }
24
29
 
25
- .label {
30
+ & .label {
26
31
  float: left;
27
32
  padding: 0px 10px;
28
- color: $c-text-light;
29
- border-right: 1px solid $c-border;
33
+ color: var(--text-light-color);
34
+ border-right: 1px solid var(--border-color);
30
35
  }
31
36
 
32
- .button,
33
- button {
37
+ & .button,
38
+ & button {
34
39
  float: left;
35
40
  display: inline;
36
41
  margin: 0px;
@@ -44,58 +49,80 @@
44
49
  min-width: 35px;
45
50
  border: 0px;
46
51
  border-left: 1px solid #fff;
47
- border-right: 1px solid $c-border;
48
- color: $c-text-light;
52
+ border-right: 1px solid var(--border-color);
53
+ color: var(--text-light-color);
49
54
  font-size: 12px;
50
- background-color: $c-button;
55
+ background-color: #f8f8f8;
51
56
  transition: all 200ms ease-out;
52
57
 
53
- i.fa {
58
+ & i.fa {
54
59
  font-size: 14px;
55
60
  }
56
61
 
57
62
  &:focus,
58
63
  &:hover {
59
- color: $c-text;
64
+ color: var(--text-color);
60
65
  background: #fdfdfd;
61
66
  }
62
67
 
63
68
  &[disabled] {
64
69
  opacity: 0.33;
65
70
  cursor: default;
66
- &:focus, &:hover {
67
- color: $c-text-light;
71
+
72
+ &:focus,
73
+ &:hover {
74
+ color: var(--text-light-color);
68
75
  background: inherit;
69
76
  }
70
77
  }
71
78
 
72
79
  &.active {
73
- color: $c-text-invert;
80
+ color: var(--text-invert-color);
74
81
  background: #666;
75
82
  border-left: 1px solid #555;
76
83
  border-right: 1px solid #888;
77
84
  }
78
85
 
79
- // font-awesome doesn't have h1-h6, so we'll apply some tricks
86
+ /* font-awesome doesn't have h1-h6, so we'll apply some tricks */
80
87
  &.header {
81
88
  vertical-align: bottom;
82
- i {
89
+
90
+ & i {
83
91
  margin-left: -6px;
84
92
  }
85
- i:after {
86
- font-family: Helvetica, Georgia, serif;
93
+
94
+ & i:after {
95
+ font-family: var(--font-os-sans);
87
96
  font-weight: bold;
88
97
  font-size: 13px;
89
98
  display: inline-block;
90
99
  position: absolute;
91
- bottom: 3px;
100
+ bottom: 5px;
101
+ }
102
+
103
+ &.h1 i::after {
104
+ content: "1";
105
+ }
106
+
107
+ &.h2 i::after {
108
+ content: "2";
109
+ }
110
+
111
+ &.h3 i::after {
112
+ content: "3";
113
+ }
114
+
115
+ &.h4 i::after {
116
+ content: "4";
117
+ }
118
+
119
+ &.h5 i::after {
120
+ content: "5";
121
+ }
122
+
123
+ &.h6 i::after {
124
+ content: "6";
92
125
  }
93
- &.h1 i::after { content: "1" }
94
- &.h2 i::after { content: "2" }
95
- &.h3 i::after { content: "3" }
96
- &.h4 i::after { content: "4" }
97
- &.h5 i::after { content: "5" }
98
- &.h6 i::after { content: "6" }
99
126
  }
100
127
  }
101
128
 
@@ -6,7 +6,7 @@
6
6
  margin-left: 6px;
7
7
  width: 13px;
8
8
  height: 16px;
9
- background-image: image-url("pages/admin/drag-icon.png");
9
+ background-image: url("pages/admin/drag-icon.png");
10
10
  }
11
11
 
12
12
  td.drag-handle {
@@ -17,48 +17,49 @@ td.drag-handle {
17
17
 
18
18
  .page-list {
19
19
  float: left;
20
- list-style-type: none;
20
+ list-style-type: none;
21
21
  padding: 0;
22
22
  margin: 0;
23
23
  font-size: 1.2em;
24
24
  margin-left: -8px;
25
25
  margin-top: 16px;
26
26
 
27
- .page-listing {
27
+ & .page-listing {
28
28
  border: 1px solid transparent;
29
29
  padding: 3px 8px 2px 8px !important;
30
30
  }
31
31
 
32
- ul {
32
+ & ul {
33
33
  border-left: 1px dotted #ccc !important;
34
34
  margin-left: 12px !important;
35
- padding-left: 8px !important
35
+ padding-left: 8px !important;
36
36
  }
37
37
 
38
- ul li {
38
+ & ul li {
39
39
  overflow: auto;
40
40
  }
41
41
 
42
- .page {
42
+ & .page {
43
43
  padding: 4px 8px;
44
44
  line-height: 17px;
45
45
  float: left;
46
46
 
47
- .status {
47
+ & .status {
48
48
  font-weight: normal;
49
49
  }
50
50
 
51
- a.page-name,
52
- a.page-name:visited {
51
+ & a.page-name,
52
+ & a.page-name:visited {
53
53
  text-decoration: none;
54
54
  color: #222;
55
55
  }
56
- a.page-name:hover {
56
+
57
+ & a.page-name:hover {
57
58
  text-decoration: underline;
58
59
  }
59
60
 
60
61
  &.hidden {
61
- a.page-name {
62
+ & a.page-name {
62
63
  color: #666;
63
64
  }
64
65
  }
@@ -66,42 +67,43 @@ td.drag-handle {
66
67
  &:hover {
67
68
  background: #ffd;
68
69
  border: 1px solid #dda;
69
- .status {
70
+
71
+ & .status {
70
72
  display: none;
71
73
  }
72
74
  }
73
75
  }
74
76
 
75
- .page-without-locale {
77
+ & .page-without-locale {
76
78
  color: #888;
77
79
  }
78
80
 
79
- li {
80
- font-weight: bold;
81
- margin: 0;
81
+ & li {
82
+ font-weight: bold;
83
+ margin: 0;
82
84
  padding: 0;
83
85
  clear: both;
84
86
  }
85
87
 
86
- li li {
88
+ & li li {
87
89
  font-weight: normal;
88
- font-size: 12px;
90
+ font-size: 12px;
89
91
  padding: 0;
90
92
  }
91
93
 
92
- ul {
94
+ & ul {
93
95
  clear: both;
94
- list-style-type: none;
95
- border-left: 1px dashed #ccc;
96
- margin: 0 0 0px 12px;
96
+ list-style-type: none;
97
+ border-left: 1px dashed #ccc;
98
+ margin: 0 0 0px 12px;
97
99
  padding: 0 0 0 12px;
98
100
  }
99
101
 
100
- .hover {
102
+ & .hover {
101
103
  background: #cef;
102
104
  }
103
105
 
104
- .drag-handle {
106
+ & .drag-handle {
105
107
  display: none;
106
108
  }
107
109
 
@@ -112,87 +114,96 @@ td.drag-handle {
112
114
 
113
115
  .news-item-list,
114
116
  .calendar-item-list {
115
- .name {
117
+ & .name {
116
118
  line-height: 1.5;
117
- small {
119
+
120
+ & small {
118
121
  font-weight: normal;
119
122
  }
120
123
  }
121
124
 
122
- .draft,
123
- .hidden,
124
- .autopublish,
125
- .reviewed {
126
- background: $c-background-disabled;
125
+ & .draft,
126
+ & .hidden,
127
+ & .autopublish,
128
+ & .reviewed {
129
+ background: var(--background-disabled-color);
127
130
  }
128
131
 
129
- .pinned .name {
130
- background: transparent image-url("pages/admin/list-table-pin-blue.gif") no-repeat 13px 50%;
132
+ & .pinned .name {
133
+ background: transparent radial-gradient(ellipse at center, #92b6c4 50%, transparent 50%) no-repeat left 12px top 50%;
134
+ background-size: 10px 10px;
131
135
  }
132
136
  }
133
137
 
134
138
  .edit-page {
135
139
  width: auto;
136
140
 
137
- main div.content {
141
+ & main div.content {
138
142
  padding-top: 16px;
139
143
  }
140
144
 
141
- .hidden-options {
145
+ & .hidden-options {
142
146
  display: none;
143
147
  }
144
148
 
145
- .autopublish-notice,
146
- .published-date,
147
- .advanced-options {
149
+ & .autopublish-notice,
150
+ & .published-date,
151
+ & .advanced-options {
148
152
  display: none;
153
+
149
154
  &.show {
150
155
  display: block;
151
156
  }
152
157
  }
153
158
 
154
- main input[type=text],
155
- main textarea {
159
+ & main input[type=text],
160
+ & main textarea {
156
161
  width: 100%;
157
162
  max-width: 100%;
158
163
  }
159
164
 
160
- main input.page_title {
165
+ & main input.page_title {
161
166
  font-weight: bold;
162
167
  font-size: 1.4em;
163
- color: $c-text;
168
+ color: var(--text-color);
164
169
  }
165
170
  }
166
171
 
167
-
168
172
  .file-list {
169
173
  list-style-type: none;
170
174
  margin-left: 0;
171
175
  margin-right: 0;
172
176
  padding: 0;
173
- .embed-code {
177
+
178
+ & .embed-code {
174
179
  display: inline-block;
175
180
  width: 60px;
176
181
  margin-right: 10px;
177
182
  }
178
- li {
183
+
184
+ & li {
179
185
  line-height: 30px;
180
- border-top: 1px solid $c-border;
186
+ border-top: 1px solid var(--border-color);
187
+
181
188
  &:first-child {
182
189
  border-top: 0px;
183
190
  }
184
- .actions {
191
+
192
+ & .actions {
185
193
  float: right;
186
194
  }
187
- .drag-handle {
195
+
196
+ & .drag-handle {
188
197
  margin-right: 10px;
189
198
  }
190
199
  }
191
- .placeholder {
200
+
201
+ & .placeholder {
192
202
  height: 30px;
193
203
  }
194
- .ui-sortable-helper {
195
- border: 1px solid $c-border !important;
204
+
205
+ & .ui-sortable-helper {
206
+ border: 1px solid var(--border-color) !important;
196
207
  background: rgba(250, 250, 250, 0.8);
197
208
  }
198
209
  }
@@ -0,0 +1,3 @@
1
+ table.users tr.invite td {
2
+ color: var(--text-light-color);
3
+ }
@@ -0,0 +1,34 @@
1
+ @custom-media --mobile screen and (max-width: 900px);
2
+ @custom-media --narrow screen and (max-width: 1150px);
3
+
4
+ :root {
5
+ --font-os-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;
6
+
7
+ --red: #c00007;
8
+ --red-transparent: #c0000740;
9
+ --red-hover: #8d0005;
10
+ --red-light: #d6a6a8;
11
+ --red-invert: #fff0f3;
12
+ --blue: #1d7195;
13
+ --blue-hover: #15516a;
14
+ --blue-transparent: #1d719540;
15
+ --blue-dark: #114055;
16
+ --green: #19ac1e;
17
+ --green-hover: #137f16;
18
+ --green-transparent: #19ac1e40;
19
+ --background-color: #fff;
20
+ --background-invert-color: #000;
21
+ --background-disabled-color: #f8f8f8;
22
+ --background-warning-color: #ffdfa0;
23
+ --text-color: #111;
24
+ --text-light-color: #666;
25
+ --text-lighter-color: #999;
26
+ --text-invert-color: #fff;
27
+ --link-color: var(--blue);
28
+ --link-hover-color: var(--blue-hover);
29
+ --border-color: #ddd;
30
+ --border-color-light: #eee;
31
+ --button-border-color: #aaa;
32
+ --button-color: #e8e8e8;
33
+ --button-color-hover: #d8d8d8;
34
+ }
@@ -0,0 +1,9 @@
1
+ @import "normalize.css";
2
+ @import "react-image-crop/dist/ReactCrop";
3
+ @import "@fortawesome/fontawesome-free/css/fontawesome";
4
+ @import "@fortawesome/fontawesome-free/css/solid";
5
+ @import "@fortawesome/fontawesome-free/css/regular";
6
+
7
+ @import "admin/vars";
8
+ @import-glob "admin/components/*.css";
9
+ @import-glob "admin/controllers/*.css";
@@ -21,12 +21,10 @@ module PagesCore
21
21
  end
22
22
 
23
23
  def embed_image(id, size:, class_name:, link:)
24
- image = Image.find(id).localize(I18n.locale)
25
- class_name = ["image", image_class_name(image), class_name].compact
26
- image_tag = dynamic_image_tag(image,
27
- size: size, crop: false, upscale: false)
28
- tag.figure((link ? link_to(image_tag, link) : image_tag) +
29
- image_caption(image), class: class_name)
24
+ image_figure(
25
+ Image.find(id).localize(I18n.locale),
26
+ size: size, class_name: class_name, link: link
27
+ )
30
28
  rescue ActiveRecord::RecordNotFound
31
29
  nil
32
30
  end
@@ -35,30 +33,10 @@ module PagesCore
35
33
  if str =~ /size="(\d*x\d*)"/
36
34
  Regexp.last_match(1)
37
35
  else
38
- "2000x2000"
36
+ default_image_size
39
37
  end
40
38
  end
41
39
 
42
- def image_caption(image)
43
- return unless image.caption?
44
-
45
- tag.figcaption(image.caption)
46
- end
47
-
48
- def image_class_name(image)
49
- if image.size.x == image.size.y
50
- "square"
51
- elsif image.size.x > image.size.y
52
- "landscape"
53
- else
54
- "portrait"
55
- end
56
- end
57
-
58
- def link_to(content, href)
59
- tag.a(content, href: href)
60
- end
61
-
62
40
  def parse_image(str)
63
41
  id = str.match(image_expression)[1]
64
42
  options = str.match(image_expression)[2]
@@ -8,6 +8,14 @@ module Admin
8
8
  ).in_locale(locale)
9
9
  end
10
10
 
11
+ def calendar_page_options(locale)
12
+ options_for_select(
13
+ calendar_pages(locale).map do |p|
14
+ [page_name(p, include_parents: true).gsub("»", "»"), p.id]
15
+ end
16
+ )
17
+ end
18
+
11
19
  def calendar_years_with_count
12
20
  calendar_counts.each_with_object({}) do |entry, obj|
13
21
  obj[entry[:year]] ||= 0
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Admin
4
+ module NewsHelper
5
+ def news_page_options(news_pages)
6
+ options_for_select(
7
+ news_pages.map do |p|
8
+ [news_section_name(p, news_pages).gsub("»", "»"), p.id]
9
+ end
10
+ )
11
+ end
12
+ end
13
+ end