PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 3.1.12
Responsive Menu – Create Mobile-Friendly Menu v3.1.12
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 3.1.12, at views/admin/macros.html.twig

256 lines 13.3 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 animation_select(name, value) %}
31 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick' name='menu[{{ name }}]'>
32 <option value='slide'{% if value == 'slide' %} selected='selected'{% endif %}>Slide</option>
33 <option value='push'{% if value == 'push' %} selected='selected'{% endif %}>Push</option>
34 <option value='fade' disabled data-subtext='[PRO]'>Fade -</option>
35 </select>
36 {% endmacro %}
37
38 {% macro select(name, value, choices, class='') %}
39 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick {{ class }}' name='menu[{{ name }}]'>
40 {% for key, display in choices %}
41 <option value='{{ key }}' {% if key == value %}selected='selected'{% endif %}>
42 {{ display }}
43 </option>
44 {% endfor %}
45 </select>
46 {% endmacro %}
47
48 {% macro selectize(name, value, class='') %}
49 <input type="text" value="{{ value }}" id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectize {{ class }}' name='menu[{{ name }}]' />
50 {% endmacro %}
51
52 {% macro font_icon(name, value, type) %}
53 <input type='text' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]' value='{{ value|escape }}' class='form-control font-icon-input {{ class }}'>
54 <select class='selectpicker show-tick font-icon-select' name='menu[{{ name }}_type]'>
55 <option value='font-awesome' selected='selected'>FontAwesome</option>
56 <option value='glyphicon'>GlyphIcon</option>
57 <option value='custom'>Custom</option>
58 </select>
59 {% endmacro %}
60
61 {% macro button_animation_select(name, value) %}
62 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick' name='menu[{{ name }}]'>
63 <option value='off'{% if value == 'off' %} selected='selected'{% endif %}>Off</option>
64 <option value='boring'{% if value == 'boring' %} selected='selected'{% endif %}>Boring</option>
65 <option value='3dx' disabled data-subtext='[PRO]'>3DX -</option>
66 <option value='3dx-r' disabled data-subtext='[PRO]'>3DX Reverse -</option>
67 <option value='3dy' disabled data-subtext='[PRO]'>3DY -</option>
68 <option value='3dy-r' disabled data-subtext='[PRO]'>3DY Reverse -</option>
69 <option value='arrow' disabled data-subtext='[PRO]'>Arrow -</option>
70 <option value='arrow-r' disabled data-subtext='[PRO]'>Arrow Reverse -</option>
71 <option value='arrowalt' disabled data-subtext='[PRO]'>Arrow Alt -</option>
72 <option value='arrowalt-r' disabled data-subtext='[PRO]'>Arrow Alt Reverse -</option>
73 <option value='collapse' disabled data-subtext='[PRO]'>Collapse -</option>
74 <option value='collapse-r' disabled data-subtext='[PRO]'>Collapse Reverse -</option>
75 <option value='elastic' disabled data-subtext='[PRO]'>Elastic -</option>
76 <option value='elastic-r' disabled data-subtext='[PRO]'>Elastic Reverse -</option>
77 <option value='emphatic' disabled data-subtext='[PRO]'>Emphatic -</option>
78 <option value='emphatic-r' disabled data-subtext='[PRO]'>Emphatic Reverse -</option>
79 <option value='minus' disabled data-subtext='[PRO]'>Minus -</option>
80 <option value='slider' disabled data-subtext='[PRO]'>Slider -</option>
81 <option value='slider-r' disabled data-subtext='[PRO]'>Slider Reverse -</option>
82 <option value='spin' disabled data-subtext='[PRO]'>Spin -</option>
83 <option value='spin-r' disabled data-subtext='[PRO]'>Spin Reverse -</option>
84 <option value='spring' disabled data-subtext='[PRO]'>Spring -</option>
85 <option value='spring-r' disabled data-subtext='[PRO]'>Spring Reverse -</option>
86 <option value='stand' disabled data-subtext='[PRO]'>Stand -</option>
87 <option value='stand-r' disabled data-subtext='[PRO]'>Stand Reverse -</option>
88 <option value='squeeze' disabled data-subtext='[PRO]'>Squeeze -</option>
89 <option value='vortex' disabled data-subtext='[PRO]'>Vortex -</option>
90 <option value='vortex-r' disabled data-subtext='[PRO]'>Vortex Reverse -</option>
91 </select>
92 {% endmacro %}
93
94 {% macro input(name, value, class='') %}
95 <input type='text' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]' value='{{ value|escape }}' class='form-control {{ class }}'>
96 {% endmacro %}
97
98 {% macro colour(name, value) %}
99 <input type='text' id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='form-control mini-colours' name='menu[{{ name }}]' value='{{ value }}' />
100 {% endmacro %}
101
102 {% macro label(for, title) %}
103 <label for='responsive-menu-{{ for|replace({'_': '-'}) }}' class='control-label'>
104 {{ title }}
105 </label>
106 {% endmacro %}
107
108 {% macro checkbox(name, value) %}
109 <input {% if value == 'on' %}checked='checked' {% endif %} id='responsive-menu-{{ name|replace({'_': '-'}) }}'
110 name='menu[{{ name }}]' data-toggle='toggle' data-onstyle='success' data-offstyle='danger' type='checkbox' value='on' />
111 {% endmacro %}
112
113 {% macro image(name, value) %}
114 <div class='input-group'>
115 <input type='text' class='form-control' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]' value='{{ value }}' />
116 <span class='input-group-btn'>
117 <button type='button' class='image_button btn btn-primary btn-rm' for='responsive-menu-{{ name|replace({'_': '-'}) }}'>Upload Image</button>
118 </span>
119 </div>
120 {% endmacro %}
121
122 {% macro textarea(name, value) %}
123 <textarea class='form-control' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]'>{{ value }}</textarea>
124 {% endmacro %}
125
126 {% macro row(name, title, type, options, errors, class='', pro='', select_type='', unit_type='', sub_title='', unit='', choices=[], sub_sub_title='') %}
127 {% import _self as macros %}
128 <tr class="{% if errors[name] %} danger {% endif %} {% if pro == 'pro' %} pro-row {% endif %}" >
129 <td class='col-left col-md-3'>
130 {{ macros.label(name, title) }}
131 {% if sub_title %}
132 <div class='sub-text'>{{ sub_title|raw }}</div>
133 {% endif %}
134 {% if sub_sub_title %}
135 <div class='sub_sub_title'><br />{{ sub_sub_title|raw }}</div>
136 {% endif %}
137 </td>
138 <td class='col-right {% if pro %} {{ pro }}{% endif %}'>
139 {% if pro == 'pro' %}
140 <div class="responsive-menu-pro-overlay">
141 <a href="https://responsive.menu?utm_source=free-plugin&utm_medium=option&utm_campaign=free-plugin-option-upgrade#pricing"
142 target="_blank">Click to upgrade now to use</a>
143 </div>
144 {% endif %}
145 {% if type == 'checkbox' %}
146 {{ macros.checkbox(name, options[name]) }}
147 {% elseif type == 'colour' %}
148 {{ macros.colour(name, options[name]) }}
149 {% elseif type == 'input' %}
150 {{ macros.input(name, options[name], class) }}
151 {% if class == 'has-unit' %}
152 {% if unit_type == 'pixel' %}
153 {{ macros.pixel_units(name ~ '_unit', options[name ~ '_unit']) }}
154 {% elseif unit_type == 'percentage' %}
155 {{ macros.percentage_units(name ~ '_unit', options[name ~ '_unit']) }}
156 {% endif %}
157 {% endif %}
158 {% elseif type == 'textarea' %}
159 {{ macros.textarea(name, options[name], class) }}
160 {% elseif type == 'selectize' %}
161 {{ macros.selectize(name, options[name], class) }}
162 {% elseif type == 'select' %}
163 {% if select_type == 'side' %}
164 {% set choices = {
165 'top': 'Top',
166 'left': 'Left',
167 'right': 'Right',
168 'bottom': 'Bottom'
169 } %}
170 {{ macros.select(name, options[name], choices) }}
171 {% elseif select_type == 'left_right' %}
172 {% set choices = {
173 'left': 'Left',
174 'right': 'Right'
175 } %}
176 {{ macros.select(name, options[name], choices) }}
177 {% elseif select_type == 'left_right_with_none' %}
178 {% set choices = {
179 '': 'None',
180 'left': 'Left',
181 'right': 'Right'
182 } %}
183 {{ macros.select(name, options[name], choices) }}
184 {% elseif select_type == 'left_right_centre_with_none' %}
185 {% set choices = {
186 '': 'None',
187 'left': 'Left',
188 'right': 'Right',
189 'centre': 'Centre'
190 } %}
191 {{ macros.select(name, options[name], choices) }}
192 {% elseif select_type == 'position' %}
193 <select id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectpicker show-tick' name='menu[{{ name }}]'>
194 <option data-subtext='Will stay in position as you scroll down the page.' value='fixed' {% if options[name] == 'fixed' %}selected='selected'{% endif %}>Fixed</option>
195 <option data-subtext='Will disappear as you scroll down the page.' value='absolute' {% if options[name] == 'absolute' %}selected='selected'{% endif %}>Absolute</option>
196 <option data-subtext='Will stay in a specific position on your page.' value='relative' {% if options[name] == 'relative' %}selected='selected'{% endif %} >Relative</option>
197 </select>
198 {% elseif select_type == 'animation' %}
199 {{ macros.animation_select(name, options[name]) }}
200 {% elseif select_type == 'depth' %}
201 {% set choices = {
202 '1': '1',
203 '2': '2',
204 '3': '3',
205 '4': '4',
206 '5': '5'
207 } %}
208 {{ macros.select(name, options[name], choices) }}
209 {% elseif select_type == 'alignment' %}
210 {% set choices = {
211 'left': 'Left',
212 'right': 'Right',
213 'center': 'Centered',
214 'justify': 'Justified'
215 } %}
216 {{ macros.select(name, options[name], choices) }}
217 {% elseif select_type == 'link_locations' %}
218 {% set choices = {
219 '_blank': 'New Tab',
220 '_self': 'Same Page',
221 '_parent': 'Parent Page',
222 '_top': 'Full Window Body'
223 } %}
224 {{ macros.select(name, options[name], choices) }}
225 {% elseif select_type == 'theme' %}
226 {% set choices = {
227 'dark': 'Dark',
228 'light': 'Light'
229 } %}
230 {{ macros.select(name, options[name], choices) }}
231 {% elseif select_type == 'custom' %}
232 {{ macros.select(name, options[name], choices) }}
233 {% elseif select_type == 'button_animation' %}
234 {{ macros.button_animation_select(name, options[name]) }}
235 {% endif %}
236 {% elseif type == 'image' %}
237 {{ macros.image(name, options[name]) }}
238 {% elseif type == 'font-icon' %}
239 {{ macros.font_icon(name, options[name], options[name ~ '_type']) }}
240 {% endif %}
241 {% if unit %}
242 <span class='unit'>{{ unit }}</span>
243 {% endif %}
244 </td>
245 </tr>
246 {% endmacro %}
247
248 {% macro header(title, section, url=false) %}
249 <div class='panel-body'>
250 {{ title }}
251 {% if url %}
252 <a class="docs" href="https://responsive.menu/docs/{{ url }}" target="_blank">Docs</a>
253 {% endif %}
254 <small>{{ section }}</small>
255 </div>
256 {% endmacro %}