biovision-base 0.7.170709 → 0.8.170916
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -13
- data/app/assets/javascripts/biovision/base/biovision.js +128 -45
- data/app/assets/stylesheets/biovision/base/admin.scss +64 -104
- data/app/assets/stylesheets/biovision/base/biovision.scss +2 -11
- data/app/assets/stylesheets/biovision/base/buttons.scss +156 -52
- data/app/assets/stylesheets/biovision/base/default.scss +2 -37
- data/app/assets/stylesheets/biovision/base/default_admin.scss +1 -0
- data/app/assets/stylesheets/biovision/base/default_application.scss +1 -0
- data/app/assets/stylesheets/biovision/base/layout.scss +64 -2
- data/app/assets/stylesheets/biovision/base/toggleable.scss +71 -0
- data/app/assets/stylesheets/biovision/base/users.scss +77 -13
- data/app/controllers/about_controller.rb +15 -0
- data/app/controllers/admin/stored_values_controller.rb +25 -0
- data/app/controllers/concerns/toggleable_entity.rb +17 -1
- data/app/controllers/index_controller.rb +1 -0
- data/app/controllers/my/profiles_controller.rb +6 -1
- data/app/controllers/stored_values_controller.rb +56 -0
- data/app/controllers/users_controller.rb +6 -0
- data/app/helpers/biovision_users_helper.rb +3 -3
- data/app/helpers/stored_values_helper.rb +6 -0
- data/app/models/central_region.rb +4 -0
- data/app/models/region.rb +5 -0
- data/app/models/stored_value.rb +28 -0
- data/app/models/user.rb +33 -13
- data/app/models/user_profile.rb +21 -0
- data/app/services/user_manager.rb +32 -0
- data/app/views/about/editable.html.erb +11 -0
- data/app/views/admin/index/index.html.erb +1 -0
- data/app/views/admin/login_attempts/entity/_in_list.html.erb +1 -1
- data/app/views/admin/stored_values/_nav_item.html.erb +6 -0
- data/app/views/admin/stored_values/entity/_in_list.html.erb +15 -0
- data/app/views/admin/stored_values/index.html.erb +14 -0
- data/app/views/admin/stored_values/show.html.erb +37 -0
- data/app/views/admin/users/_filter.html.erb +2 -0
- data/app/views/admin/users/codes.html.erb +1 -1
- data/app/views/admin/users/search.jbuilder +4 -2
- data/app/views/admin/users/show.html.erb +11 -11
- data/app/views/authentication/_form.html.erb +2 -2
- data/app/views/authentication/new.html.erb +1 -1
- data/app/views/editable_pages/_editable_page.html.erb +8 -0
- data/app/views/index/index.html.erb +7 -3
- data/app/views/layouts/application/_footer.html.erb +9 -0
- data/app/views/my/confirmations/show.html.erb +21 -15
- data/app/views/my/login_attempts/index.html.erb +1 -1
- data/app/views/my/profiles/edit/_form.html.erb +112 -65
- data/app/views/my/profiles/edit.html.erb +5 -4
- data/app/views/my/profiles/new/_form.html.erb +5 -5
- data/app/views/my/recoveries/show.html.erb +28 -17
- data/app/views/my/tokens/index.html.erb +1 -1
- data/app/views/profiles/_profile.html.erb +34 -40
- data/app/views/shared/admin/_list_with_priority.html.erb +11 -0
- data/app/views/stored_values/_form.html.erb +33 -0
- data/app/views/stored_values/edit.html.erb +17 -0
- data/app/views/stored_values/new.html.erb +15 -0
- data/app/views/users/_form.html.erb +42 -31
- data/app/views/users/new.html.erb +1 -1
- data/config/locales/common-ru.yml +10 -0
- data/config/locales/editable-pages-ru.yml +34 -2
- data/config/locales/users-ru.yml +19 -12
- data/config/routes.rb +7 -0
- data/db/migrate/20170302000001_create_users.rb +1 -5
- data/db/migrate/20170302000002_create_user_profiles.rb +21 -0
- data/db/migrate/{20170302000002_create_tokens.rb → 20170302000003_create_tokens.rb} +0 -0
- data/db/migrate/{20170302000003_create_code_types.rb → 20170302000004_create_code_types.rb} +0 -0
- data/db/migrate/{20170302000004_create_codes.rb → 20170302000005_create_codes.rb} +0 -0
- data/db/migrate/20170320000000_create_editable_pages.rb +4 -0
- data/db/migrate/20170823000001_create_stored_values.rb +19 -0
- data/lib/biovision/base/engine.rb +1 -0
- data/lib/biovision/base/version.rb +1 -1
- data/lib/tasks/regions.rake +37 -2
- metadata +32 -12
@@ -1,3 +1,137 @@
|
|
1
|
+
$button-action-bg-a: #2e3c8e !default;
|
2
|
+
$button-action-bg-b: #3d94f6 !default;
|
3
|
+
$button-action-border-a: .1rem solid #2e3c8e !default;
|
4
|
+
$button-action-border-b: .1rem solid #515da3 !default;
|
5
|
+
$button-action-text-a: #fff !default;
|
6
|
+
$button-action-text-b: #fff !default;
|
7
|
+
|
8
|
+
$button-nav-bg-a: #fff !default;
|
9
|
+
$button-nav-bg-b: #1e62d0 !default;
|
10
|
+
$button-nav-border-a: .1rem solid #2e3c8e !default;
|
11
|
+
$button-nav-border-b: .1rem solid #2e3c8e !default;
|
12
|
+
$button-nav-text-a: #3d94f6 !default;
|
13
|
+
$button-nav-text-b: #fff !default;
|
14
|
+
|
15
|
+
$button-create-bg-a: #68a54b !default;
|
16
|
+
$button-create-bg-b: #5ba337 !default;
|
17
|
+
$button-create-border-a: .1rem solid #3b6e22 !default;
|
18
|
+
$button-create-border-b: .1rem solid #3b6e22 !default;
|
19
|
+
$button-create-text-a: #fff !default;
|
20
|
+
$button-create-text-b: #fff !default;
|
21
|
+
|
22
|
+
$button-destroy-bg-a: #a54b68 !default;
|
23
|
+
$button-destroy-bg-b: #a3375b !default;
|
24
|
+
$button-destroy-border-a: .1rem solid #6e223b !default;
|
25
|
+
$button-destroy-border-b: .1rem solid #6e223b !default;
|
26
|
+
$button-destroy-text-a: #fff !default;
|
27
|
+
$button-destroy-text-b: #fff !default;
|
28
|
+
|
29
|
+
@mixin button($bg-a, $text-a, $border-a, $bg-b, $text-b, $border-b) {
|
30
|
+
background: $bg-a;
|
31
|
+
border: $border-a;
|
32
|
+
border-radius: #{$font-size-normal * .375};
|
33
|
+
box-sizing: border-box;
|
34
|
+
color: $text-a;
|
35
|
+
cursor: pointer;
|
36
|
+
display: inline-block;
|
37
|
+
font: #{$font-size-normal}/1.5 $font-family-main;
|
38
|
+
padding: 0 $font-size-normal;
|
39
|
+
text-decoration: none;
|
40
|
+
transition: .125s;
|
41
|
+
|
42
|
+
&:active,
|
43
|
+
&:focus,
|
44
|
+
&:hover {
|
45
|
+
background: $bg-b;
|
46
|
+
border: $border-b;
|
47
|
+
color: $text-b;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
@mixin button-action {
|
52
|
+
@include button(
|
53
|
+
$button-action-bg-a, $button-action-text-a, $button-action-border-a,
|
54
|
+
$button-action-bg-b, $button-action-text-b, $button-action-border-b
|
55
|
+
)
|
56
|
+
}
|
57
|
+
|
58
|
+
@mixin button-nav {
|
59
|
+
@include button(
|
60
|
+
$button-nav-bg-a, $button-nav-text-a, $button-nav-border-a,
|
61
|
+
$button-nav-bg-b, $button-nav-text-b, $button-nav-border-b
|
62
|
+
)
|
63
|
+
}
|
64
|
+
|
65
|
+
@mixin button-create {
|
66
|
+
@include button(
|
67
|
+
$button-create-bg-a, $button-create-text-a, $button-create-border-a,
|
68
|
+
$button-create-bg-b, $button-create-text-b, $button-create-border-b
|
69
|
+
)
|
70
|
+
}
|
71
|
+
|
72
|
+
@mixin button-destroy {
|
73
|
+
@include button(
|
74
|
+
$button-destroy-bg-a, $button-destroy-text-a, $button-destroy-border-a,
|
75
|
+
$button-destroy-bg-b, $button-destroy-text-b, $button-destroy-border-b
|
76
|
+
)
|
77
|
+
}
|
78
|
+
|
79
|
+
.button-action,
|
80
|
+
a:link.button-action,
|
81
|
+
a:visited.button-action {
|
82
|
+
@include button-action;
|
83
|
+
}
|
84
|
+
|
85
|
+
.button-nav,
|
86
|
+
a:link.button-nav,
|
87
|
+
a:visited.button-nav {
|
88
|
+
@include button-nav;
|
89
|
+
}
|
90
|
+
|
91
|
+
.button-create,
|
92
|
+
a:link.button-create,
|
93
|
+
a:visited.button-create {
|
94
|
+
@include button-create;
|
95
|
+
}
|
96
|
+
|
97
|
+
.button-destroy,
|
98
|
+
a:link.button-destroy,
|
99
|
+
a:visited.button-destroy {
|
100
|
+
@include button-destroy;
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
// То, что ниже, оставлено для обратной совместимости, но это нужно будет убрать
|
106
|
+
|
107
|
+
$button-action-bg-c: #3d94f6 !default;
|
108
|
+
$button-action-bg-d: #1e62d0 !default;
|
109
|
+
$button-action-border-color-a: #2e3c8e !default;
|
110
|
+
$button-action-border-color-b: #515da3 !default;
|
111
|
+
$button-action-text-color-a: #fff !default;
|
112
|
+
$button-action-text-color-b: #fff !default;
|
113
|
+
|
114
|
+
$button-nav-bg-c: #1e62d0 !default;
|
115
|
+
$button-nav-bg-d: #3d94f6 !default;
|
116
|
+
$button-nav-border-color-a: #2e3c8e !default;
|
117
|
+
$button-nav-border-color-b: #2e3c8e !default;
|
118
|
+
$button-nav-text-color-a: #3d94f6 !default;
|
119
|
+
$button-nav-text-color-b: #fff !default;
|
120
|
+
|
121
|
+
$button-create-bg-c: #5ba337 !default;
|
122
|
+
$button-create-bg-d: #59ab33 !default;
|
123
|
+
$button-create-border-color-a: #3b6e22 !default;
|
124
|
+
$button-create-border-color-b: #3b6e22 !default;
|
125
|
+
$button-create-text-color-a: #fff !default;
|
126
|
+
$button-create-text-color-b: #fff !default;
|
127
|
+
|
128
|
+
$button-destroy-bg-c: #a3375b !default;
|
129
|
+
$button-destroy-bg-d: #ab3359 !default;
|
130
|
+
$button-destroy-border-color-a: #6e223b !default;
|
131
|
+
$button-destroy-border-color-b: #6e223b !default;
|
132
|
+
$button-destroy-text-color-a: #fff !default;
|
133
|
+
$button-destroy-text-color-b: #fff !default;
|
134
|
+
|
1
135
|
@mixin styled-button($bg-a, $bg-b, $bg-c, $bg-d, $border-a, $border-b, $text-a, $text-b) {
|
2
136
|
background: $bg-a linear-gradient(to top, $bg-a, $bg-b);
|
3
137
|
border: .1rem solid $border-a;
|
@@ -6,12 +140,10 @@
|
|
6
140
|
color: $text-a;
|
7
141
|
cursor: pointer;
|
8
142
|
display: inline-block;
|
9
|
-
font: $font-size-
|
10
|
-
line-height:
|
11
|
-
margin: 0;
|
143
|
+
font: $font-size-normal $font-family-main;
|
144
|
+
line-height: 1.5;
|
12
145
|
padding: 0 1.6rem;
|
13
146
|
text-decoration: none;
|
14
|
-
//transition: .25s;
|
15
147
|
|
16
148
|
&:active,
|
17
149
|
&:hover,
|
@@ -23,69 +155,41 @@
|
|
23
155
|
}
|
24
156
|
|
25
157
|
@mixin action-button {
|
26
|
-
@include
|
27
|
-
$button-action-bg-a,
|
28
|
-
$button-action-bg-b,
|
29
|
-
$button-action-bg-c,
|
30
|
-
$button-action-bg-d,
|
31
|
-
$button-action-border-color-a,
|
32
|
-
$button-action-border-color-b,
|
33
|
-
$button-action-text-color-a,
|
34
|
-
$button-action-text-color-b
|
35
|
-
);
|
158
|
+
@include button-action;
|
36
159
|
}
|
37
160
|
|
38
161
|
@mixin nav-button {
|
39
|
-
@include
|
40
|
-
$button-nav-bg-a,
|
41
|
-
$button-nav-bg-b,
|
42
|
-
$button-nav-bg-c,
|
43
|
-
$button-nav-bg-d,
|
44
|
-
$button-nav-border-color-a,
|
45
|
-
$button-nav-border-color-b,
|
46
|
-
$button-nav-text-color-a,
|
47
|
-
$button-nav-text-color-b
|
48
|
-
);
|
162
|
+
@include button-nav;
|
49
163
|
}
|
50
164
|
|
51
165
|
@mixin create-button {
|
52
|
-
@include
|
53
|
-
$button-create-bg-a,
|
54
|
-
$button-create-bg-b,
|
55
|
-
$button-create-bg-c,
|
56
|
-
$button-create-bg-d,
|
57
|
-
$button-create-border-color-a,
|
58
|
-
$button-create-border-color-b,
|
59
|
-
$button-create-text-color-a,
|
60
|
-
$button-create-text-color-b
|
61
|
-
);
|
166
|
+
@include button-create;
|
62
167
|
}
|
63
168
|
|
64
169
|
@mixin destroy-button {
|
65
|
-
@include
|
66
|
-
$button-destroy-bg-a,
|
67
|
-
$button-destroy-bg-b,
|
68
|
-
$button-destroy-bg-c,
|
69
|
-
$button-destroy-bg-d,
|
70
|
-
$button-destroy-border-color-a,
|
71
|
-
$button-destroy-border-color-b,
|
72
|
-
$button-destroy-text-color-a,
|
73
|
-
$button-destroy-text-color-b
|
74
|
-
);
|
170
|
+
@include button-destroy;
|
75
171
|
}
|
76
172
|
|
77
|
-
.action-button
|
78
|
-
|
173
|
+
.action-button,
|
174
|
+
a:link.action-button,
|
175
|
+
a:visited.action-button {
|
176
|
+
@include button-action;
|
79
177
|
}
|
80
178
|
|
81
|
-
.nav-button
|
82
|
-
|
179
|
+
.nav-button,
|
180
|
+
a:link.nav-button,
|
181
|
+
a:visited.nav-button {
|
182
|
+
@include button-nav;
|
83
183
|
}
|
84
184
|
|
85
|
-
.create-button
|
86
|
-
|
185
|
+
.create-button,
|
186
|
+
a:link.create-button,
|
187
|
+
a:visited.create-button {
|
188
|
+
@include button-create;
|
87
189
|
}
|
88
190
|
|
89
|
-
.destroy-button
|
90
|
-
|
191
|
+
.destroy-button,
|
192
|
+
a:link.destroy-button,
|
193
|
+
a:visited.destroy-button {
|
194
|
+
@include button-destroy;
|
91
195
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
$font-family-heading: "Cormorant Garamond", serif !default;
|
2
|
-
$font-family-main: "
|
2
|
+
$font-family-main: "Roboto", sans-serif !default;
|
3
3
|
|
4
4
|
$font-size-large: 2rem !default;
|
5
5
|
$font-size-increased: 1.6rem !default;
|
@@ -20,6 +20,7 @@ $text-color-secondary: #777 !default;
|
|
20
20
|
$block-shadow: 0 0 .2rem .2rem rgba(0, 0, 0, .25) !default;
|
21
21
|
|
22
22
|
$border-primary: .1rem solid rgb(192, 192, 192) !default;
|
23
|
+
$border-secondary: .1rem solid rgb(230, 230, 230) !default;
|
23
24
|
|
24
25
|
$background-header: #fff !default;
|
25
26
|
$background-main: #fff !default;
|
@@ -28,39 +29,3 @@ $background-footer: #fff !default;
|
|
28
29
|
$link-color: rgb(20, 127, 255) !default;
|
29
30
|
$link-color-visited: rgb(20, 77, 250) !default;
|
30
31
|
$link-color-hover: rgb(255, 77, 20) !default;
|
31
|
-
|
32
|
-
$button-action-bg-a: #2e3c8e !default;
|
33
|
-
$button-action-bg-b: #515da3 !default;
|
34
|
-
$button-action-bg-c: #3d94f6 !default;
|
35
|
-
$button-action-bg-d: #1e62d0 !default;
|
36
|
-
$button-action-border-color-a: #2e3c8e !default;
|
37
|
-
$button-action-border-color-b: #515da3 !default;
|
38
|
-
$button-action-text-color-a: #fff !default;
|
39
|
-
$button-action-text-color-b: #fff !default;
|
40
|
-
|
41
|
-
$button-nav-bg-a: #fff !default;
|
42
|
-
$button-nav-bg-b: #fafafa !default;
|
43
|
-
$button-nav-bg-c: #1e62d0 !default;
|
44
|
-
$button-nav-bg-d: #3d94f6 !default;
|
45
|
-
$button-nav-border-color-a: #2e3c8e !default;
|
46
|
-
$button-nav-border-color-b: #2e3c8e !default;
|
47
|
-
$button-nav-text-color-a: #3d94f6 !default;
|
48
|
-
$button-nav-text-color-b: #fff !default;
|
49
|
-
|
50
|
-
$button-create-bg-a: #68a54b !default;
|
51
|
-
$button-create-bg-b: #74ad5a !default;
|
52
|
-
$button-create-bg-c: #5ba337 !default;
|
53
|
-
$button-create-bg-d: #59ab33 !default;
|
54
|
-
$button-create-border-color-a: #3b6e22 !default;
|
55
|
-
$button-create-border-color-b: #3b6e22 !default;
|
56
|
-
$button-create-text-color-a: #fff !default;
|
57
|
-
$button-create-text-color-b: #fff !default;
|
58
|
-
|
59
|
-
$button-destroy-bg-a: #a54b68 !default;
|
60
|
-
$button-destroy-bg-b: #ad5a74 !default;
|
61
|
-
$button-destroy-bg-c: #a3375b !default;
|
62
|
-
$button-destroy-bg-d: #ab3359 !default;
|
63
|
-
$button-destroy-border-color-a: #6e223b !default;
|
64
|
-
$button-destroy-border-color-b: #6e223b !default;
|
65
|
-
$button-destroy-text-color-a: #fff !default;
|
66
|
-
$button-destroy-text-color-b: #fff !default;
|
@@ -7,6 +7,10 @@ html {
|
|
7
7
|
-ms-text-size-adjust: none;
|
8
8
|
}
|
9
9
|
|
10
|
+
* {
|
11
|
+
box-sizing: border-box;
|
12
|
+
}
|
13
|
+
|
10
14
|
h1, h2, h3, h4, h6, h6 {
|
11
15
|
color: $text-color-heading;
|
12
16
|
font-family: $font-family-heading;
|
@@ -35,6 +39,14 @@ a:hover {
|
|
35
39
|
text-decoration: underline;
|
36
40
|
}
|
37
41
|
|
42
|
+
figure {
|
43
|
+
margin: 0;
|
44
|
+
}
|
45
|
+
|
46
|
+
img {
|
47
|
+
max-width: 100%;
|
48
|
+
}
|
49
|
+
|
38
50
|
body {
|
39
51
|
color: $text-color-primary;
|
40
52
|
display: flex;
|
@@ -61,14 +73,14 @@ body {
|
|
61
73
|
&.links {
|
62
74
|
a:link,
|
63
75
|
a:visited {
|
64
|
-
@include nav
|
76
|
+
@include button-nav;
|
65
77
|
margin: 0 .4rem;
|
66
78
|
}
|
67
79
|
}
|
68
80
|
|
69
81
|
&.plate {
|
70
82
|
.logout {
|
71
|
-
@include action
|
83
|
+
@include button-action;
|
72
84
|
margin-left: 1rem;
|
73
85
|
}
|
74
86
|
}
|
@@ -98,8 +110,19 @@ body {
|
|
98
110
|
margin: auto 0 0 0;
|
99
111
|
|
100
112
|
> div {
|
113
|
+
align-items: center;
|
101
114
|
color: $text-color-secondary;
|
115
|
+
display: flex;
|
116
|
+
flex-wrap: wrap;
|
102
117
|
font-size: $font-size-decreased;
|
118
|
+
|
119
|
+
.copyright {
|
120
|
+
margin-right: auto;
|
121
|
+
}
|
122
|
+
|
123
|
+
nav {
|
124
|
+
margin: 0 auto;
|
125
|
+
}
|
103
126
|
}
|
104
127
|
}
|
105
128
|
}
|
@@ -111,3 +134,42 @@ body {
|
|
111
134
|
max-width: $content-width;
|
112
135
|
padding: .8rem;
|
113
136
|
}
|
137
|
+
|
138
|
+
form {
|
139
|
+
dl {
|
140
|
+
dt {
|
141
|
+
font: 500 $font-size-increased $font-family-main;
|
142
|
+
|
143
|
+
&:not(:first-of-type) {
|
144
|
+
border-top: $border-secondary;
|
145
|
+
margin: .8rem 0 0 0;
|
146
|
+
padding: .4rem 0 0 0;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
dd {
|
151
|
+
padding: .2rem 0;
|
152
|
+
|
153
|
+
ul {
|
154
|
+
margin: 0 auto;
|
155
|
+
padding: 0;
|
156
|
+
|
157
|
+
li {
|
158
|
+
list-style: none;
|
159
|
+
margin: 0;
|
160
|
+
padding: 0;
|
161
|
+
position: relative;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
}
|
166
|
+
|
167
|
+
input {
|
168
|
+
font-size: $font-size-normal;
|
169
|
+
}
|
170
|
+
|
171
|
+
input:not([type=checkbox]):not([type=radio]):not([type=date]):not([size]),
|
172
|
+
textarea {
|
173
|
+
width: 100%;
|
174
|
+
}
|
175
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
$toggleable-active: #34c749 !default;
|
2
|
+
$toggleable-inactive: #fc605c !default;
|
3
|
+
$toggleable-switch: #fdbc40 !default;
|
4
|
+
$toggleable-unknown: #c0c0c0 !default;
|
5
|
+
$toggleable-background: #fff !default;
|
6
|
+
|
7
|
+
.toggleable {
|
8
|
+
font-size: $font-size-decreased;
|
9
|
+
margin: .8rem;
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Радиус границы в ::before должен быть чуть меньше, чтобы не было щелей,
|
13
|
+
* потому что span фактически толще на две толщины границы
|
14
|
+
*/
|
15
|
+
> span {
|
16
|
+
background-color: $toggleable-background;
|
17
|
+
border: .1rem solid;
|
18
|
+
border-radius: #{$font-size-decreased / 3 * 2};
|
19
|
+
cursor: pointer;
|
20
|
+
display: inline-block;
|
21
|
+
line-height: #{$font-size-decreased * 2};
|
22
|
+
margin: .4rem;
|
23
|
+
padding: 0 #{$font-size-decreased / 3 * 2} 0 0;
|
24
|
+
|
25
|
+
&::before {
|
26
|
+
border-radius: #{$font-size-decreased / 2} 0 0 #{$font-size-decreased / 2};
|
27
|
+
display: inline-block;
|
28
|
+
line-height: #{$font-size-decreased * 2};
|
29
|
+
margin: 0 .4rem 0 0;
|
30
|
+
text-align: center;
|
31
|
+
width: 2.2rem;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
.active {
|
36
|
+
border-color: $toggleable-active;
|
37
|
+
|
38
|
+
&::before {
|
39
|
+
background-color: $toggleable-active;
|
40
|
+
content: '\2611';
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
.inactive {
|
45
|
+
border-color: $toggleable-inactive;
|
46
|
+
|
47
|
+
&::before {
|
48
|
+
background-color: $toggleable-inactive;
|
49
|
+
content: '\2610';
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
.switch {
|
54
|
+
border-color: $toggleable-switch;
|
55
|
+
cursor: not-allowed;
|
56
|
+
|
57
|
+
&::before {
|
58
|
+
background-color: $toggleable-switch;
|
59
|
+
content: '\231B';
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
.unknown {
|
64
|
+
border-color: $toggleable-unknown;
|
65
|
+
|
66
|
+
&::before {
|
67
|
+
background-color: $toggleable-unknown;
|
68
|
+
content: '\26A0';
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
@@ -42,23 +42,87 @@ div.user-search {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
.my-profile-new {
|
45
|
-
|
45
|
+
form {
|
46
|
+
max-width: 50rem;
|
47
|
+
|
48
|
+
.actions {
|
49
|
+
align-items: center;
|
50
|
+
display: flex;
|
51
|
+
flex-wrap: wrap;
|
52
|
+
justify-content: space-between;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
dl {
|
57
|
+
input {
|
58
|
+
max-width: 32rem;
|
59
|
+
|
60
|
+
&:not([size]) {
|
61
|
+
width: calc(100% - 1rem);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
.trap {
|
67
|
+
height: .01rem;
|
68
|
+
left: -300rem;
|
69
|
+
overflow: hidden;
|
70
|
+
position: absolute;
|
71
|
+
width: .01rem;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
.my-confirmation,
|
76
|
+
.my-recovery {
|
77
|
+
section {
|
78
|
+
margin: 1.6rem 0;
|
79
|
+
}
|
80
|
+
|
81
|
+
form {
|
82
|
+
max-width: 32rem;
|
83
|
+
|
46
84
|
dl {
|
47
85
|
input {
|
48
|
-
|
49
|
-
|
50
|
-
&:not([size]) {
|
51
|
-
width: calc(100% - 1rem);
|
52
|
-
}
|
86
|
+
width: calc(100% - 1rem);
|
53
87
|
}
|
54
88
|
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
form.login {
|
93
|
+
max-width: 26rem;
|
94
|
+
|
95
|
+
.fields {
|
96
|
+
> div {
|
97
|
+
align-items: center;
|
98
|
+
display: flex;
|
99
|
+
justify-content: space-between;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
.actions {
|
104
|
+
align-items: center;
|
105
|
+
display: flex;
|
106
|
+
justify-content: space-between;
|
107
|
+
margin-top: .8rem;
|
108
|
+
}
|
109
|
+
}
|
55
110
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
111
|
+
article.user {
|
112
|
+
figure {
|
113
|
+
max-width: 32rem;
|
114
|
+
|
115
|
+
figcaption {
|
116
|
+
font-size: $font-size-large;
|
117
|
+
text-align: center;
|
62
118
|
}
|
63
119
|
}
|
64
|
-
|
120
|
+
|
121
|
+
form {
|
122
|
+
max-width: 40rem;
|
123
|
+
}
|
124
|
+
|
125
|
+
dl {
|
126
|
+
margin-bottom: 2.4rem;
|
127
|
+
}
|
128
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class AboutController < ApplicationController
|
2
|
+
# get /about
|
3
|
+
def index
|
4
|
+
@editable_page = EditablePage.find_by(slug: 'about')
|
5
|
+
|
6
|
+
render :editable
|
7
|
+
end
|
8
|
+
|
9
|
+
# get /tos
|
10
|
+
def tos
|
11
|
+
@editable_page = EditablePage.find_by(slug: 'tos')
|
12
|
+
|
13
|
+
render :editable
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Admin::StoredValuesController < AdminController
|
2
|
+
before_action :set_entity, except: [:index]
|
3
|
+
|
4
|
+
# get /admin/stored_values
|
5
|
+
def index
|
6
|
+
@collection = StoredValue.page_for_administration
|
7
|
+
end
|
8
|
+
|
9
|
+
# get /admin/stored_values/:id
|
10
|
+
def show
|
11
|
+
end
|
12
|
+
|
13
|
+
protected
|
14
|
+
|
15
|
+
def restrict_access
|
16
|
+
require_privilege :administrator
|
17
|
+
end
|
18
|
+
|
19
|
+
def set_entity
|
20
|
+
@entity = StoredValue.find_by(id: params[:id])
|
21
|
+
if @entity.nil?
|
22
|
+
handle_http_404('Cannot find stored_value')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,7 +1,23 @@
|
|
1
1
|
module ToggleableEntity
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
|
+
# Toggle entity flag when allowed
|
4
5
|
def toggle
|
5
|
-
|
6
|
+
if allow_toggle?
|
7
|
+
render json: { data: @entity.toggle_parameter(params[:parameter].to_s) }
|
8
|
+
else
|
9
|
+
head :unauthorized
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
# If entity responds to #editable_by?, it should be editable to be toggled
|
16
|
+
def allow_toggle?
|
17
|
+
if @entity.respond_to?(:editable_by?)
|
18
|
+
@entity.editable_by?(current_user)
|
19
|
+
else
|
20
|
+
true
|
21
|
+
end
|
6
22
|
end
|
7
23
|
end
|
@@ -28,7 +28,8 @@ class My::ProfilesController < ApplicationController
|
|
28
28
|
|
29
29
|
# patch /my/profile
|
30
30
|
def update
|
31
|
-
if current_user.update
|
31
|
+
if current_user.update(user_parameters)
|
32
|
+
current_user.user_profile.update(profile_parameters)
|
32
33
|
redirect_to my_profile_path, notice: t('my.profiles.update.success')
|
33
34
|
else
|
34
35
|
render :edit, status: :bad_request
|
@@ -72,6 +73,10 @@ class My::ProfilesController < ApplicationController
|
|
72
73
|
end
|
73
74
|
end
|
74
75
|
|
76
|
+
def profile_parameters
|
77
|
+
params.require(:user_profile).permit(UserProfile.entity_parameters)
|
78
|
+
end
|
79
|
+
|
75
80
|
def filter_parameters(parameters, sensitive)
|
76
81
|
sensitive.each { |parameter| parameters.except! parameter if parameter.blank? }
|
77
82
|
parameters[:email_confirmed] = false if parameters[:email] && parameters[:email] != current_user.email
|