dashboard.twig (13002B)
1 {{ header }}{{ column_left }} 2 <div id="content"> 3 <div class="page-header"> 4 <div class="container-fluid"> 5 <div class="form-inline pull-right"> 6 {% if (stores|length > 1) %} 7 <select class="form-control" onChange="location='{{ href_dashboard }}&store_id='+$(this).val()"> 8 {% for store in stores %} 9 {% if (store['store_id'] == store_id) %} 10 <option value="{{ store['store_id'] }}" selected="selected">{{ store['name'] }}</option> 11 {% else %} 12 <option value="{{ store['store_id'] }}">{{ store['name'] }}</option> 13 {% endif %} 14 {% endfor %} 15 </select> 16 {% endif %} 17 <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a> 18 </div> 19 <h1>{{ heading_title }} {{ version }}</h1> 20 <ul class="breadcrumb"> 21 {% for breadcrumb in breadcrumbs %} 22 <li><a href="{{ breadcrumb['href'] }}">{{ breadcrumb['text'] }}</a></li> 23 {% endfor %} 24 </ul> 25 </div> 26 </div> 27 <div class="container-fluid"> 28 {% if error['warning'] %} 29 <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i><button type="button" class="close" data-dismiss="alert">×</button> {{ error['warning'] }}</div> 30 {% endif %} 31 {% if success %} 32 <div class="alert alert-success"><i class="fa fa-exclamation-circle"></i><button type="button" class="close" data-dismiss="alert">×</button> {{ success }}</div> 33 {% endif %} 34 <div class="shopunity-widget-update"></div> 35 {% if d_seo_module_pack %} 36 {{ d_seo_module_pack['info'] }} 37 {% endif %} 38 </div> 39 <div class="container-fluid {% if d_shopunity and d_seo_module_pack %}col-sm-9{% endif %}"> 40 <div class="panel panel-default panel-resizable"> 41 <div class="panel-heading"> 42 <h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_edit }}</h3> 43 </div> 44 <div class="panel-body"> 45 <ul class="nav nav-tabs"> 46 <li class="active"> 47 <a href="{{ href_dashboard }}"><span class="fa fa-home"></span> {{ text_dashboard }}</a> 48 </li> 49 <li> 50 <a href="{{ href_setting }}"><span class="fa fa-cog"></span> {{ text_settings }}</a> 51 </li> 52 <li> 53 <a href="{{ href_multi_store_field }}"><span class="fa fa-list-alt"></span> {{ text_multi_store_fields }}</a> 54 </li> 55 <li> 56 <a href="{{ href_target_keyword }}"><span class="fa fa-key"></span> {{ text_target_keywords }}</a> 57 </li> 58 <li> 59 <a href="{{ href_export_import }}"><span class="fa fa-exchange"></span> {{ text_export_import }}</a> 60 </li> 61 <li> 62 <a href="{{ href_instruction }}"><span class="fa fa-graduation-cap"></span> {{ text_instructions }}</a> 63 </li> 64 </ul> 65 66 <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form"> 67 <div class="col-md-12 m-b-xl"> 68 {% if control_extensions %} 69 <div class="page-header"> 70 <h3><strong>{{ text_seo_extensions }}</strong> <span class="info-window-item" data-href="https://opencartseomodule.com/seo-module-dashboard"><i class="fa fa-question"></i></span></h3> 71 </div> 72 <div class="control-extensions"> 73 {% for control_extension in control_extensions %} 74 {% if control_extension['installed'] %} 75 <div class="control-extension installed text-center"> 76 <img src="view/image/{{ control_extension['image'] }}" title="{{ control_extension['name'] }}" alt="{{ control_extension['name'] }}" class="image"/> 77 <h4 class="name m-b-md">{{ control_extension['name'] }}</h4> 78 <a href="{{ control_extension['href'] }}" class="btn btn-primary"><i class="fa fa-search"></i> {{ button_view }}</a> 79 </div> 80 {% else %} 81 <div class="control-extension text-center"> 82 <img src="view/image/{{ control_extension['image'] }}" title="{{ control_extension['name'] }}" alt="{{ control_extension['name'] }}" class="image"/> 83 <h4 class="name m-b-md">{{ control_extension['name'] }}</h4> 84 <a action="{{ control_extension['install_href'] }}" class="button-install btn btn-success"><i class="fa fa-cog"></i><i class="fa fa-refresh rotate hide"></i> {{ button_install }}</a> 85 </div> 86 {% endif %} 87 {% endfor %} 88 <br class="clear"/> 89 </div> 90 {% endif %} 91 </div> 92 <div class="table-responsive col-md-6"> 93 <table class="table table-bordered table-hover control-elements"> 94 <thead> 95 <tr class="fields"> 96 <td class="field"> 97 <h4 class="m-b-none"><span class="fa fa-rocket"></span> {{ text_quick_setup }} <span class="info-window-item" data-href="https://opencartseomodule.com/quick-setup"><i class="fa fa-question"></i></span></h4> 98 </td> 99 </tr> 100 </thead> 101 <tbody class="control-elements"> 102 {% if quick_setup_total %} 103 {% for control_element in control_elements %} 104 {% if control_element['implemented'] == 0 %} 105 <tr class="control-element"> 106 <td class="field"> 107 <div class="row"> 108 <div class="col-xs-3 text-center"> 109 <a action="{{ control_element['edit_href'] }}" confirm="{{ control_element['confirm'] }}" class="button-edit btn btn-sm btn-success"><i class="fa fa-cog"></i><i class="fa fa-refresh rotate hide"></i> {{ button_setup }}</a> 110 </div> 111 <div class="col-xs-9"> 112 <h4 class="name m-b-sm"><label class="control-label p-n text-left"><span data-toggle="tooltip" title="{{ control_element['description'] }}">{{ control_element['name'] }}</span></label></h4> 113 <p class="extension-name">{{ control_element['extension_name'] }}</p> 114 <a href="{{ control_element['href'] }}" target="_blank" class="details">{{ text_details }}</a> 115 <br class="clear"/> 116 </div> 117 </div> 118 </td> 119 </tr> 120 {% endif %} 121 {% endfor %} 122 {% else %} 123 <tr class="control-element"> 124 <td class="field">{{ text_no_control_elements }}</td> 125 </tr> 126 {% endif %} 127 </tbody> 128 </table> 129 </div> 130 <div class="table-responsive col-md-6"> 131 <table class="table table-bordered table-hover control-elements"> 132 <thead> 133 <tr class="fields"> 134 <td class="field"> 135 <h4 class="m-b-none"><span class="fa fa-refresh"></span> {{ text_implemented }}</h4> 136 </td> 137 </tr> 138 </thead> 139 <tbody> 140 {% if implemented_total %} 141 {% for control_element in control_elements %} 142 {% if control_element['implemented'] == 1 %} 143 <tr class="control-element"> 144 <td class="field"> 145 <div class="row"> 146 <div class="col-xs-3 text-center"> 147 <a action="{{ control_element['edit_href'] }}" confirm="{{ control_element['confirm'] }}" class="button-edit btn btn-sm btn-primary"><i class="fa fa-cog"></i><i class="fa fa-refresh rotate hide"></i> {{ button_reset }}</a> 148 </div> 149 <div class="col-xs-9"> 150 <h4 class="name m-b-sm"><label class="control-label p-n text-left"><span data-toggle="tooltip" title="{{ control_element['description'] }}">{{ control_element['name'] }}</span></label></h4> 151 <p class="extension-name">{{ control_element['extension_name'] }}</p> 152 <a href="{{ control_element['href'] }}" target="_blank" class="details">{{ text_details }}</a> 153 <br class="clear"/> 154 </div> 155 </div> 156 </td> 157 </tr> 158 {% endif %} 159 {% endfor %} 160 {% else %} 161 <tr class="control-element"> 162 <td class="field">{{ text_no_control_elements }}</td> 163 </tr> 164 {% endif %} 165 </tbody> 166 </table> 167 </div> 168 </form> 169 <br class="clear" /> 170 <div class="p-lg text-center">{{ text_powered_by }}</div> 171 </div> 172 </div> 173 <div class="info-window"> 174 <div class="info-window-wrap"> 175 <div class="info-window-block"> 176 <div class="info-window-close"><i class="fa fa-close"></i></div> 177 <div class="info-window-description"></div> 178 </div> 179 </div> 180 </div> 181 <br class="clear" /> 182 </div> 183 {% if d_shopunity and d_seo_module_pack %} 184 <div class="container-fluid col-sm-3"> 185 <div class="shopunity-widget-seo-module-pack"></div> 186 </div> 187 <br class="clear" /> 188 {% endif %} 189 </div> 190 {% if d_shopunity %} 191 <script src="view/javascript/d_shopunity/d_shopunity_widget.js" type="text/javascript"></script> 192 <script type="text/javascript"> 193 194 var d_shopunity_widget_update = jQuery.extend(true, {}, d_shopunity_widget); 195 196 d_shopunity_widget_update.init({ 197 class: '.shopunity-widget-update', 198 token: '{{ (url_token|split('='))|last }}', 199 action: 'loadUpdate', 200 extension_id: '{{ extension_id }}' 201 }); 202 203 </script> 204 {% if d_seo_module_pack %} 205 <script type="text/javascript"> 206 207 var d_shopunity_widget_seo_module_pack = jQuery.extend(true, {}, d_shopunity_widget); 208 209 d_shopunity_widget_seo_module_pack.init({ 210 class: '.shopunity-widget-seo-module-pack', 211 token: '{{ (url_token|split('='))|last }}', 212 extension_id: '{{ d_seo_module_pack['extension_id'] }}' 213 }); 214 215 </script> 216 {% endif %} 217 {% endif %} 218 <script type="text/javascript"> 219 220 var info_window = { 221 'item' : new Array(), 222 'current_url' : '' 223 } 224 225 $.each($('.info-window-item'), function(key, value) { 226 var url = $(this).attr('data-href'); 227 228 if (url) { 229 $.getJSON(url + '?format=json&callback=?', function(data) { 230 info_window.item[url] = data['description']; 231 }); 232 } 233 }); 234 235 $('.info-window-item').on('click', function() { 236 var url = $(this).attr('data-href'); 237 238 if (url == info_window.current_url) { 239 info_window.current_url = ''; 240 $('.info-window').removeClass('resized'); 241 $('.panel-resizable').removeClass('resized'); 242 } else { 243 info_window.current_url = url; 244 $('.info-window .info-window-description').html(info_window.item[url]); 245 $('.panel-resizable').addClass('resized'); 246 $('.info-window').addClass('resized'); 247 } 248 }); 249 250 $('.info-window .info-window-close').on('click', function() { 251 info_window.current_url = ''; 252 $('.info-window').removeClass('resized'); 253 $('.panel-resizable').removeClass('resized'); 254 }); 255 256 function refresh() { 257 var url = 'index.php?route={{ route }}/dashboard&{{ url_token }}&store_id={{ store_id }}'; 258 259 $('#form').load(url + ' #form >'); 260 } 261 262 function showAlert(json) { 263 $('.alert, .text-danger').remove(); 264 $('.form-group').removeClass('has-error'); 265 266 if (json['error']) { 267 if (json['error']['warning']) { 268 $('#content > .container-fluid').first().prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i><button type="button" class="close" data-dismiss="alert">×</button> ' + json['error']['warning'] + '</div>'); 269 } 270 271 for (i in json['error']) { 272 var element = $('#input_' + i); 273 274 if (element.parent().hasClass('input-group')) { 275 $(element).parent().after('<div class="text-danger">' + json['error'][i] + '</div>'); 276 } else { 277 $(element).after('<div class="text-danger">' + json['error'][i] + '</div>'); 278 } 279 } 280 281 $('.text-danger').parents('.form-group').addClass('has-error'); 282 } 283 284 if (json['success']) { 285 $('#content > .container-fluid').first().prepend('<div class="alert alert-success"><i class="fa fa-check-circle"></i><button type="button" class="close" data-dismiss="alert">×</button> ' + json['success'] + '</div>'); 286 } 287 } 288 289 </script> 290 <script type="text/javascript"> 291 292 $('body').on('click', '.button-install', function() { 293 var button_install = $(this); 294 295 $.ajax({ 296 type: 'post', 297 url: $(this).attr('action'), 298 data: '', 299 dataType: 'json', 300 beforeSend: function() { 301 button_install.children('.fa-refresh').removeClass('hide'); 302 button_install.children('.fa-cog').addClass('hide'); 303 }, 304 complete: function() { 305 button_install.children('.fa-refresh').addClass('hide'); 306 button_install.children('.fa-cog').removeClass('hide'); 307 }, 308 success: function(json) { 309 showAlert(json); 310 311 if (json['success']) { 312 refresh(); 313 } 314 }, 315 error: function(xhr, ajaxOptions, thrownError) { 316 console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 317 } 318 }); 319 }); 320 321 $('body').on('click', '.button-edit', function() { 322 var button_edit = $(this); 323 var validate = false; 324 325 if ($(this).attr('confirm')) { 326 if (confirm($(this).attr('confirm'))) { 327 validate = true; 328 } 329 } else { 330 validate = true; 331 } 332 333 if (validate) { 334 $.ajax({ 335 type: 'post', 336 url: $(this).attr('action'), 337 data: '', 338 dataType: 'json', 339 beforeSend: function() { 340 button_edit.children('.fa-refresh').removeClass('hide'); 341 button_edit.children('.fa-cog').addClass('hide'); 342 }, 343 complete: function() { 344 button_edit.children('.fa-refresh').addClass('hide'); 345 button_edit.children('.fa-cog').removeClass('hide'); 346 }, 347 success: function(json) { 348 showAlert(json); 349 350 if (json['success']) { 351 refresh(); 352 } 353 }, 354 error: function(xhr, ajaxOptions, thrownError) { 355 console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 356 } 357 }); 358 } 359 }); 360 361 </script> 362 {{ footer }}