PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 4.0.4
Responsive Menu – Create Mobile-Friendly Menu v4.0.4
4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 All 90 releases
responsive-menu / views / admin / macros.html.twig

macros.html.twig in Responsive Menu – Create Mobile-Friendly Menu 4.0.4, at views/admin/macros.html.twig

295 lines 15.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {#
2 Responsive Menu Jinja template file.
3 NOT Safe to Copy
4
5 Do Not Copy
6 #}
7
8 {% macro percentage_units(name, value) %}
9 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick is-unit' name='menu[{{ name }}]'>
10 <option value='%' selected='selected'>%</option>
11 <option value='px' disabled data-subtext='[PRO]'>px -</option>
12 <option value='em' disabled data-subtext='[PRO]'>em -</option>
13 <option value='rem' disabled data-subtext='[PRO]'>rem -</option>
14 <option value='vw' disabled data-subtext='[PRO]'>vw -</option>
15 <option value='vh' disabled data-subtext='[PRO]'>vh -</option>
16 </select>
17 {% endmacro %}
18
19 {% macro pixel_units(name, value) %}
20 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' id='responsive-menu-{{ name|replace({'_': '-'}) }}'class='selectpicker show-tick is-unit' name='menu[{{ name }}]'>
21 <option value='px' selected='selected'>px</option>
22 <option value='%' disabled data-subtext='[PRO]'>% -</option>
23 <option value='em' disabled data-subtext='[PRO]'>em -</option>
24 <option value='rem' disabled data-subtext='[PRO]'>rem -</option>
25 <option value='vw' disabled data-subtext='[PRO]'>vw -</option>
26 <option value='vh' disabled data-subtext='[PRO]'>vh -</option>
27 </select>
28 {% endmacro %}
29
30 {% macro pixel_units_auto(name, value) %}
31 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' id='responsive-menu-{{ name|replace({'_': '-'}) }}'class='selectpicker show-tick is-unit' name='menu[{{ name }}]'>
32 <option value='auto' selected='selected'>auto</option>
33 <option value='px' disabled data-subtext='[PRO]'>px</option>
34 <option value='%' disabled data-subtext='[PRO]'>% -</option>
35 <option value='em' disabled data-subtext='[PRO]'>em -</option>
36 <option value='rem' disabled data-subtext='[PRO]'>rem -</option>
37 <option value='vw' disabled data-subtext='[PRO]'>vw -</option>
38 <option value='vh' disabled data-subtext='[PRO]'>vh -</option>
39 </select>
40 {% endmacro %}
41
42 {% macro animation_select(name, value) %}
43 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick' name='menu[{{ name }}]'>
44 <option value='slide'{% if value == 'slide' %} selected='selected'{% endif %}>Slide</option>
45 <option value='push'{% if value == 'push' %} selected='selected'{% endif %}>Push</option>
46 <option value='fade' disabled data-subtext='[PRO]'>Fade -</option>
47 </select>
48 {% endmacro %}
49
50 {% macro select(name, value, choices, class='') %}
51 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick {{' '}} {{ class }}' name='menu[{{ name }}]'>
52 {% for key, display in choices %}
53 <option value='{{ key }}' {% if key == value %}selected='selected'{% endif %}>
54 {{ display }}
55 </option>
56 {% endfor %}
57 </select>
58 {% endmacro %}
59
60 {% macro selectize(name, value, class='') %}
61 <input type="text" value="{{ value }}" id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectize {{ class }}' name='menu[{{ name }}]' />
62 {% endmacro %}
63
64 {% macro font_icon(name, value, type) %}
65 <input type='text' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]' value='{{ value|escape }}' class='form-control font-icon-input {{ ' ' ~ class }}'>
66 <select class='selectpicker show-tick font-icon-select' name='menu[{{ name }}_type]'>
67 <option value='font-awesome' selected='selected'>FontAwesome</option>
68 <option value='glyphicon'>GlyphIcon</option>
69 <option value='custom'>Custom</option>
70 </select>
71 {% endmacro %}
72
73 {% macro button_animation_select(name, value) %}
74 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick' name='menu[{{ name }}]'>
75 <option value='off'{% if value == 'off' %} selected='selected'{% endif %}>Off</option>
76 <option value='boring'{% if value == 'boring' %} selected='selected'{% endif %}>Boring</option>
77 <option value='3dx' disabled data-subtext='[PRO]'>3DX -</option>
78 <option value='3dx-r' disabled data-subtext='[PRO]'>3DX Reverse -</option>
79 <option value='3dy' disabled data-subtext='[PRO]'>3DY -</option>
80 <option value='3dy-r' disabled data-subtext='[PRO]'>3DY Reverse -</option>
81 <option value='arrow' disabled data-subtext='[PRO]'>Arrow -</option>
82 <option value='arrow-r' disabled data-subtext='[PRO]'>Arrow Reverse -</option>
83 <option value='arrowalt' disabled data-subtext='[PRO]'>Arrow Alt -</option>
84 <option value='arrowalt-r' disabled data-subtext='[PRO]'>Arrow Alt Reverse -</option>
85 <option value='collapse' disabled data-subtext='[PRO]'>Collapse -</option>
86 <option value='collapse-r' disabled data-subtext='[PRO]'>Collapse Reverse -</option>
87 <option value='elastic' disabled data-subtext='[PRO]'>Elastic -</option>
88 <option value='elastic-r' disabled data-subtext='[PRO]'>Elastic Reverse -</option>
89 <option value='emphatic' disabled data-subtext='[PRO]'>Emphatic -</option>
90 <option value='emphatic-r' disabled data-subtext='[PRO]'>Emphatic Reverse -</option>
91 <option value='minus' disabled data-subtext='[PRO]'>Minus -</option>
92 <option value='slider' disabled data-subtext='[PRO]'>Slider -</option>
93 <option value='slider-r' disabled data-subtext='[PRO]'>Slider Reverse -</option>
94 <option value='spin' disabled data-subtext='[PRO]'>Spin -</option>
95 <option value='spin-r' disabled data-subtext='[PRO]'>Spin Reverse -</option>
96 <option value='spring' disabled data-subtext='[PRO]'>Spring -</option>
97 <option value='spring-r' disabled data-subtext='[PRO]'>Spring Reverse -</option>
98 <option value='stand' disabled data-subtext='[PRO]'>Stand -</option>
99 <option value='stand-r' disabled data-subtext='[PRO]'>Stand Reverse -</option>
100 <option value='squeeze' disabled data-subtext='[PRO]'>Squeeze -</option>
101 <option value='vortex' disabled data-subtext='[PRO]'>Vortex -</option>
102 <option value='vortex-r' disabled data-subtext='[PRO]'>Vortex Reverse -</option>
103 </select>
104 {% endmacro %}
105
106 {% macro input(name, value, class='') %}
107 <input type='text' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]' value='{{ value|escape }}' class='form-control {{ ' ' ~ class }}'>
108 {% endmacro %}
109
110 {% macro colour(name, value) %}
111 <input type='text' id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='form-control mini-colours' name='menu[{{ name }}]' value='{{ value }}' />
112 {% endmacro %}
113
114 {% macro label(for, title) %}
115 <label for='responsive-menu-{{ for|replace({'_': '-'}) }}' class='control-label'>
116 {{ title }}
117 </label>
118 {% endmacro %}
119
120 {% macro checkbox(name, value) %}
121 <input {% if value == 'on' %} checked='checked' {% endif %} id='responsive-menu-{{ name|replace({'_': '-'}) }}'
122 name='menu[{{ name }}]' data-toggle='toggle' data-onstyle='success' data-offstyle='danger' type='checkbox' value='on' />
123 {% endmacro %}
124
125 {% macro image(name, value) %}
126 <div class='input-group'>
127 <input type='text' class='form-control' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]' value='{{ value }}' />
128 <span class='input-group-btn'>
129 <button type='button' class='image_button btn btn-primary btn-rm' for='responsive-menu-{{ name|replace({'_': '-'}) }}'>Upload Image</button>
130 </span>
131 </div>
132 {% endmacro %}
133
134 {% macro textarea(name, value) %}
135 <textarea class='form-control' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]'>{{ value }}</textarea>
136 {% endmacro %}
137
138 {% macro row(name, title, type, options, errors, class='', pro='', select_type='', unit_type='', sub_title='', unit='', choices=[], sub_sub_title='') %}
139 {% import _self as macros %}
140 <tr class="{% if errors[name] %} danger {% endif %} {% if pro == 'pro' %} pro-row {% endif %}" >
141 <td class='col-left col-md-3'>
142 {{ macros.label(name, title) }}
143 {% if sub_title %}
144 <div class='sub-text'>{{ sub_title|raw }}</div>
145 {% endif %}
146 {% if sub_sub_title %}
147 <div class='sub_sub_title'><br />{{ sub_sub_title|raw }}</div>
148 {% endif %}
149 </td>
150 <td class='col-right {% if pro %} {{ ' ' ~ pro }}{% endif %}'>
151 {% if pro == 'pro' %}
152 <div class="responsive-menu-pro-overlay">
153 <a href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign={{ name }}"
154 target="_blank">Click to upgrade now to use</a>
155 </div>
156 {% endif %}
157 {% if type == 'checkbox' %}
158 {{ macros.checkbox(name, options[name]) }}
159 {% elseif type == 'colour' %}
160 {{ macros.colour(name, options[name]) }}
161 {% elseif type == 'input' %}
162 {{ macros.input(name, options[name], class) }}
163 {% if class == 'has-unit' %}
164 {% if unit_type == 'pixel' %}
165 {{ macros.pixel_units(name ~ '_unit', options[name ~ '_unit']) }}
166 {% elseif unit_type == 'pixel_auto' %}
167 {{ macros.pixel_units_auto(name ~ '_unit', options[name ~ '_unit']) }}
168 {% elseif unit_type == 'percentage' %}
169 {{ macros.percentage_units(name ~ '_unit', options[name ~ '_unit']) }}
170 {% endif %}
171 {% endif %}
172 {% elseif type == 'textarea' %}
173 {{ macros.textarea(name, options[name], class) }}
174 {% elseif type == 'selectize' %}
175 {{ macros.selectize(name, options[name], class) }}
176 {% elseif type == 'select' %}
177 {% if select_type == 'side' %}
178 {% set choices = {
179 'top': 'Top',
180 'left': 'Left',
181 'right': 'Right',
182 'bottom': 'Bottom'
183 } %}
184 {{ macros.select(name, options[name], choices) }}
185 {% elseif select_type == 'left_right' %}
186 {% set choices = {
187 'left': 'Left',
188 'right': 'Right'
189 } %}
190 {{ macros.select(name, options[name], choices) }}
191 {% elseif select_type == 'left_right_with_none' %}
192 {% set choices = {
193 '': 'None',
194 'left': 'Left',
195 'right': 'Right'
196 } %}
197 {{ macros.select(name, options[name], choices) }}
198 {% elseif select_type == 'left_right_centre_with_none' %}
199 {% set choices = {
200 '': 'None',
201 'left': 'Left',
202 'right': 'Right',
203 'centre': 'Centre'
204 } %}
205 {{ macros.select(name, options[name], choices) }}
206 {% elseif select_type == 'mega_standard_menu_animation' %}
207 {% set choices = {
208 'fade': 'Fade',
209 'fadeUp': 'FadeUp',
210 'slideDown': 'SlideDown',
211 'slideUp': 'SlideUp'
212 } %}
213 {{ macros.select(name, options[name], choices, 'is-animation-input') }}
214 {% set choices = {
215 '100ms': '100ms',
216 '200ms': '200ms',
217 '300ms': '300ms',
218 '400ms': '400ms',
219 '500ms': '500ms',
220 '600ms': '600ms',
221 '700ms': '700ms',
222 '800ms': '800ms',
223 '900ms': '900ms',
224 '1000ms': '1000ms',
225 } %}
226 {{ macros.select(name ~ '_speed', options[name ~ '_speed'], choices, 'is-animation-input') }}
227 {% elseif select_type == 'position' %}
228 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick' name='menu[{{ name }}]'>
229 <option data-subtext='Will stay in position as you scroll down the page.' value='fixed' {% if options[name] == 'fixed' %}selected='selected'{% endif %}>Fixed</option>
230 <option data-subtext='Will disappear as you scroll down the page.' value='absolute' {% if options[name] == 'absolute' %}selected='selected'{% endif %}>Absolute</option>
231 <option data-subtext='Will stay in a specific position on your page.' value='relative' {% if options[name] == 'relative' %}selected='selected'{% endif %} >Relative</option>
232 </select>
233 {% elseif select_type == 'animation' %}
234 {{ macros.animation_select(name, options[name]) }}
235 {% elseif select_type == 'depth' %}
236 {% set choices = {
237 '1': '1',
238 '2': '2',
239 '3': '3',
240 '4': '4',
241 '5': '5'
242 } %}
243 {{ macros.select(name, options[name], choices) }}
244 {% elseif select_type == 'alignment' %}
245 {% set choices = {
246 'left': 'Left',
247 'right': 'Right',
248 'center': 'Centered',
249 'justify': 'Justified'
250 } %}
251 {{ macros.select(name, options[name], choices) }}
252 {% elseif select_type == 'link_locations' %}
253 {% set choices = {
254 '_blank': 'New Tab',
255 '_self': 'Same Page',
256 '_parent': 'Parent Page',
257 '_top': 'Full Window Body'
258 } %}
259 {{ macros.select(name, options[name], choices) }}
260 {% elseif select_type == 'theme' %}
261 {% set choices = {
262 'dark': 'Dark',
263 'light': 'Light'
264 } %}
265 {{ macros.select(name, options[name], choices) }}
266 {% elseif select_type == 'custom' %}
267 {{ macros.select(name, options[name], choices) }}
268 {% elseif select_type == 'button_animation' %}
269 {{ macros.button_animation_select(name, options[name]) }}
270 {% elseif select_type == 'menu_theme' %}
271 {% set themes = get_available_themes() %}
272 {% set choices = [] %}
273 {% for theme, config in themes %}
274 {% set choices = choices|merge({(theme): config.name ~ ' (' ~ theme ~ ')'}) %}
275 {% endfor %}
276 {{ macros.select(name, options[name], choices) }}
277 {% endif %}
278 {% elseif type == 'image' %}
279 {{ macros.image(name, options[name]) }}
280 {% elseif type == 'font-icon' %}
281 {{ macros.font_icon(name, options[name], options[name ~ '_type']) }}
282 {% endif %}
283 {% if unit %}
284 <span class='unit'>{{ unit }}</span>
285 {% endif %}
286 </td>
287 </tr>
288 {% endmacro %}
289
290 {% macro header(title, section) %}
291 <div class='panel-body'>
292 {{ title }}
293 <small>{{ section }}</small>
294 </div>
295 {% endmacro %}