|
1 |
| -// * Top section * // |
| 1 | +// * Import string splitter code * // |
2 | 2 |
|
3 |
| -@if $show_top_section_for_staff_only == "true" { |
4 |
| - .sidebar-section-wrapper.sidebar-section[data-section-name="community"] { |
5 |
| - display: none; |
6 |
| - } |
7 |
| - |
8 |
| - .staff .sidebar-section-wrapper.sidebar-section[data-section-name="community"] { |
9 |
| - display: block; |
10 |
| - } |
11 |
| -} |
| 3 | +@import "str-to-list"; |
12 | 4 |
|
13 |
| -@if $show_top_section_for_logged-in_only == "true" { |
14 |
| - .anon .sidebar-section-wrapper.sidebar-section[data-section-name="community"] { |
15 |
| - display: none; |
16 |
| - } |
17 |
| -} |
18 | 5 |
|
19 |
| -@if $hide_top_section_for_all == "true" { |
20 |
| - .sidebar-section-wrapper.sidebar-section[data-section-name="community"] { |
21 |
| - display: none; |
22 |
| - } |
23 |
| -} |
24 |
| - |
25 |
| - |
26 |
| -// * More drop down section * // |
| 6 | +// * Top section * // |
27 | 7 |
|
28 |
| -@if $show_more_for_staff_only == "true" { |
29 |
| - .btn-flat.sidebar-more-section-links-details-summary, |
30 |
| - .sidebar-more-section-links-details-summary.json-editor-btn-collapse { |
31 |
| - display: none; |
32 |
| - } |
33 |
| - .staff .btn-flat.sidebar-more-section-links-details-summary, |
34 |
| - .staff .sidebar-more-section-links-details-summary.json-editor-btn-collapse { |
35 |
| - display: flex; |
36 |
| - } |
37 |
| -} |
38 | 8 |
|
39 |
| -@if $show_more_for_logged-in_only == "true" { |
40 |
| - .anon .btn-flat.sidebar-more-section-links-details-summary, |
41 |
| - .anon .sidebar-more-section-links-details-summary.json-editor-btn-collapse { |
42 |
| - display: none; |
43 |
| - } |
44 |
| -} |
| 9 | +@if $show_these_sections_for_staff_only !="" { |
45 | 10 |
|
| 11 | + $staff_sections: str-to-list("#{$show_these_sections_for_staff_only}", "|"); |
46 | 12 |
|
47 |
| -// * More drop-down sections * // |
| 13 | + @each $staff_section in $staff_sections { |
48 | 14 |
|
49 |
| -@if $show_anniversaries_for_staff_only == "true" { |
50 |
| - .sidebar-section-link-wrapper { |
51 |
| - .sidebar-section-link { |
52 |
| - &[data-link-name="anniversaries"] { |
53 |
| - display: none; |
54 |
| - } |
| 15 | + .sidebar-section-wrapper.sidebar-section[data-section-name="#{$staff_section}"] { |
| 16 | + display: none; |
55 | 17 | }
|
56 |
| - } |
57 | 18 |
|
58 |
| - .sidebar-section-link-wrapper { |
59 |
| - .staff .sidebar-section-link { |
60 |
| - &[data-link-name="anniversaries"] { |
61 |
| - display: block; |
62 |
| - } |
| 19 | + .staff .sidebar-section-wrapper.sidebar-section[data-section-name="#{$staff_section}"] { |
| 20 | + display: block; |
63 | 21 | }
|
64 | 22 | }
|
65 | 23 | }
|
66 | 24 |
|
67 |
| -@if $show_birthdays_for_staff_only == "true" { |
68 |
| - .sidebar-section-link-wrapper { |
69 |
| - .sidebar-section-link { |
70 |
| - &[data-link-name="birthdays"] { |
71 |
| - display: none; |
72 |
| - } |
73 |
| - } |
74 |
| - } |
| 25 | +@if $show_these_sections_for_logged-in_only !="" { |
75 | 26 |
|
76 |
| - .sidebar-section-link-wrapper { |
77 |
| - .staff .sidebar-section-link { |
78 |
| - &[data-link-name="birthdays"] { |
79 |
| - display: block; |
80 |
| - } |
81 |
| - } |
82 |
| - } |
83 |
| -} |
| 27 | + $user_sections: str-to-list("#{$show_these_sections_for_logged-in_only}", "|"); |
84 | 28 |
|
| 29 | + @each $user_section in $user_sections { |
85 | 30 |
|
86 |
| -@if $show_docs_for_staff_only == "true" { |
87 |
| - .sidebar-section-link-wrapper { |
88 |
| - .sidebar-section-link { |
89 |
| - &[data-link-name="docs"] { |
90 |
| - display: none; |
91 |
| - } |
| 31 | + .sidebar-section-wrapper.sidebar-section[data-section-name="#{$user_section}"] { |
| 32 | + display: block; |
92 | 33 | }
|
93 |
| - } |
94 | 34 |
|
95 |
| - .sidebar-section-link-wrapper { |
96 |
| - .staff .sidebar-section-link { |
97 |
| - &[data-link-name="docs"] { |
98 |
| - display: block; |
99 |
| - } |
| 35 | + .anon .sidebar-section-wrapper.sidebar-section[data-section-name="#{$user_section}"] { |
| 36 | + display: none; |
100 | 37 | }
|
101 | 38 | }
|
102 | 39 | }
|
103 | 40 |
|
104 |
| -// * Categories and Tags sections * // |
105 |
| - |
106 |
| -@if $show_categories_for_staff_only == "true" { |
107 |
| - .sidebar-section-wrapper.sidebar-section[data-section-name="categories"] { |
108 |
| - display: none; |
109 |
| - } |
110 |
| - |
111 |
| - .staff .sidebar-section-wrapper.sidebar-section[data-section-name="categories"] { |
112 |
| - display: block; |
113 |
| - } |
114 |
| -} |
115 |
| - |
116 |
| -@if $show_categories_for_logged-in_only == "true" { |
117 |
| - .anon .sidebar-section-wrapper.sidebar-section[data-section-name="categories"] { |
118 |
| - display: none; |
119 |
| - } |
120 |
| -} |
| 41 | +@if $show_these_links_for_staff_only !="" { |
121 | 42 |
|
122 |
| -@if $show_tags_for_staff_only == "true" { |
123 |
| - .sidebar-section-wrapper.sidebar-section[data-section-name="tags"] { |
124 |
| - display: none; |
125 |
| - } |
| 43 | + $staff_links: str-to-list("#{$show_these_links_for_staff_only}", "|"); |
126 | 44 |
|
127 |
| - .staff .sidebar-section-wrapper.sidebar-section[data-section-name="tags"] { |
128 |
| - display: block; |
129 |
| - } |
130 |
| -} |
| 45 | + @each $staff_link in $staff_links { |
131 | 46 |
|
132 |
| -@if $show_tags_for_logged-in_only == "true" { |
133 |
| - .anon .sidebar-section-wrapper.sidebar-section[data-section-name="tags"] { |
134 |
| - display: none; |
135 |
| - } |
136 |
| -} |
137 |
| - |
138 |
| -// * Messages Section * // |
139 |
| - |
140 |
| -@if $show_messages_for_staff_only == "true" { |
141 |
| - .sidebar-section-wrapper.sidebar-section[data-section-name="messages"] { |
142 |
| - display: none; |
143 |
| - } |
| 47 | + .sidebar-section-link-wrapper[data-list-item-name="#{$staff_link}"] { |
| 48 | + display: none; |
| 49 | + } |
144 | 50 |
|
145 |
| - .staff .sidebar-section-wrapper.sidebar-section[data-section-name="messages"] { |
146 |
| - display: block; |
| 51 | + .staff .sidebar-section-link-wrapper[data-list-item-name="#{$staff_link}"] { |
| 52 | + display: block; |
| 53 | + } |
147 | 54 | }
|
148 | 55 | }
|
149 | 56 |
|
150 |
| -@if $show_messages_for_logged-in_only == "true" { |
151 |
| - .anon .sidebar-section-wrapper.sidebar-section[data-section-name="messages"] { |
152 |
| - display: none; |
153 |
| - } |
154 |
| -} |
| 57 | +@if $show_these_links_for_logged-in_only !="" { |
155 | 58 |
|
156 |
| -// * Channels Section * |
| 59 | + $user_links: str-to-list("#{$show_these_links_for_logged-in_only}", "|"); |
157 | 60 |
|
158 |
| -@if $show_channels_for_staff_only == "true" { |
159 |
| - .sidebar-section-wrapper.sidebar-section[data-section-name="chat-channels"] { |
160 |
| - display: none; |
161 |
| - } |
| 61 | + @each $user_link in $user_link { |
162 | 62 |
|
163 |
| - .staff .sidebar-section-wrapper.sidebar-section[data-section-name="chat-channels"] { |
164 |
| - display: block; |
165 |
| - } |
166 |
| -} |
| 63 | + .sidebar-section-link-wrapper[data-list-item-name="#{$user_link}"] { |
| 64 | + display: block; |
| 65 | + } |
167 | 66 |
|
168 |
| -@if $show_channels_for_logged-in_only == "true" { |
169 |
| - .anon .sidebar-section-wrapper.sidebar-section[data-section-name="chat-channels"] { |
170 |
| - display: none; |
| 67 | + .anon .sidebar-section-link-wrapper[data-list-item-name="#{$user_link}"] { |
| 68 | + display: none; |
| 69 | + } |
171 | 70 | }
|
172 | 71 | }
|
173 | 72 |
|
174 |
| -// * Chat Section * |
| 73 | +// * More drop down section * // |
175 | 74 |
|
176 |
| -@if $show_chat_for_staff_only == "true" { |
177 |
| - .sidebar-section-wrapper.sidebar-section[data-section-name="chat-dms"] { |
| 75 | +@if $show_more_for_staff_only =="true" { |
| 76 | + .btn-flat.sidebar-more-section-links-details-summary { |
178 | 77 | display: none;
|
179 | 78 | }
|
180 | 79 |
|
181 |
| - .staff .sidebar-section-wrapper.sidebar-section[data-section-name="chat-dms"] { |
182 |
| - display: block; |
| 80 | + .staff .btn-flat.sidebar-more-section-links-details-summary { |
| 81 | + display: flex; |
183 | 82 | }
|
184 | 83 | }
|
185 | 84 |
|
186 |
| -@if $show_chat_for_logged-in_only == "true" { |
187 |
| - .anon .sidebar-section-wrapper.sidebar-section[data-section-name="chat-dms"] { |
| 85 | +@if $show_more_for_logged-in_only =="true" { |
| 86 | + .anon .btn-flat.sidebar-more-section-links-details-summary { |
188 | 87 | display: none;
|
189 | 88 | }
|
190 | 89 | }
|
|
0 commit comments