ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,352 @@
|
||||
/**
|
||||
* Olegnax Layered Navigation
|
||||
* Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
*/
|
||||
define([
|
||||
'jquery',
|
||||
'Magento_Theme/js/view/messages',
|
||||
'ko',
|
||||
'jquery-ui-modules/widget',
|
||||
'jquery-ui-modules/core',
|
||||
'oxFormValues'
|
||||
], function ($, messenger, ko) {
|
||||
'use strict';
|
||||
|
||||
$.widget('mage.OXAjaxNav', {
|
||||
options: {
|
||||
filterNavInputClass: '.block.filter .filter-options-content .item input[name^=filter]',
|
||||
filterClearAllClass: '.block.filter .filter-actions a.action.filter-clear',
|
||||
filterCurrentClass: '.block.filter .filter-current .item a.action',
|
||||
filters: [
|
||||
'.block.filter .filter-options-content .item a',
|
||||
'.block.filter .swatch-attribute a'
|
||||
],
|
||||
replaceSelectors: {
|
||||
leftnav: '.sidebar.sidebar-main .block.filter, [data-move-mobile="filtersslideout"] .block.filter.filters-slideout-content.ox-move-item',
|
||||
title: '.column.main .page-title-wrapper',
|
||||
breadcrumbs: '.column.main .breadcrumbs'
|
||||
},
|
||||
replaceContentSelectors: {
|
||||
products: '.column.main .search.results, .column.main'
|
||||
},
|
||||
clearUrl: null,
|
||||
timeout: 300,
|
||||
scrollToTop: true,
|
||||
loaderFilter: false,
|
||||
loaderContent: false,
|
||||
loaderPage: false,
|
||||
abortPrev: true,
|
||||
loaderContentSelector: '',
|
||||
selectedItemClass: 'ox-seleted-item'
|
||||
},
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
this._loader_template_filter = '[data-role="ox-nav-loader-filter"]';
|
||||
this._loader_template_content = '[data-role="ox-nav-loader-content"]';
|
||||
this._loader_template_page = '[data-role="ox-nav-loader-page"]';
|
||||
this._loader_class_filter = '.ox-product-nav-filter';
|
||||
this._loader_class_content = '.ox-product-nav-content';
|
||||
this._loader_class_page = '.ox-product-nav-page';
|
||||
this._disable_class = 'ox-disable-ajax';
|
||||
this._current_count = '.filter-current-count';
|
||||
this._current_item = '.filter-current .item';
|
||||
this._use_url_class = 'ox-nav-use-url';
|
||||
this.timeoutID = null;
|
||||
|
||||
if (!this.options.clearUrl) {
|
||||
this.options.clearUrl = window.location.href;
|
||||
}
|
||||
this.afterUpdate();
|
||||
this._event();
|
||||
},
|
||||
/**
|
||||
* Set events
|
||||
* @private
|
||||
*/
|
||||
_event: function () {
|
||||
var _self = this;
|
||||
this.element.off('filter_apply.OXAjaxNav').on('filter_apply.OXAjaxNav', $.proxy(function (event, values, url) {
|
||||
var _url = url || this.options.clearUrl;
|
||||
this.getDebounceContent(_url, values);
|
||||
}, this));
|
||||
this.element.off('change.OXAjaxNav', this.options.filterNavInputClass).on('change.OXAjaxNav', this.options.filterNavInputClass, $.proxy(function (event) {
|
||||
var $this = $(event.currentTarget),
|
||||
values = _self.getAllFilter(),
|
||||
url;
|
||||
if ($this.hasClass(this._use_url_class)) {
|
||||
url = window.location.href;
|
||||
}
|
||||
$this.closest('li').eq(0).toggleClass(this.options.selectedItemClass, $this.prop('checked'));
|
||||
_self.element.trigger('filter_apply.OXAjaxNav', [values, url]);
|
||||
}, this));
|
||||
this.element.off('click.OXAjaxNav', this.options.filters.join(', ')).on('click.OXAjaxNav', this.options.filters.join(', '), $.proxy(function (event) {
|
||||
var $this = $(event.currentTarget).addClass(this.options.selectedItemClass),
|
||||
url = $this.attr('href');
|
||||
|
||||
if (url && !$this.hasClass(this._disable_class)) {
|
||||
event.preventDefault();
|
||||
var values = this._parseQueryString(url);
|
||||
_self.element.trigger('filter_apply.OXAjaxNav', values);
|
||||
}
|
||||
}, this));
|
||||
this.element.off('click.OXAjaxNav', this.options.filterCurrentClass).on('click.OXAjaxNav', this.options.filterCurrentClass, $.proxy(function (event) {
|
||||
var $this = $(event.currentTarget),
|
||||
url = $this.attr('href');
|
||||
|
||||
if (url && !$this.hasClass(this._disable_class)) {
|
||||
event.preventDefault();
|
||||
var values = this._parseQueryString(url);
|
||||
this.element.trigger('filter_apply.OXAjaxNav', values, url);
|
||||
}
|
||||
}, this));
|
||||
this.element.off('click.OXAjaxNav', this.options.filterClearAllClass).on('click.OXAjaxNav', this.options.filterClearAllClass, $.proxy(function (event) {
|
||||
var $this = $(event.currentTarget),
|
||||
url = $this.attr('href');
|
||||
|
||||
if (url && !$this.hasClass(this._disable_class)) {
|
||||
event.preventDefault();
|
||||
this.element.trigger('filter_apply.OXAjaxNav', null, url);
|
||||
}
|
||||
}, this));
|
||||
},
|
||||
/**
|
||||
* Update url current page
|
||||
* @param string url
|
||||
* @param object data
|
||||
*/
|
||||
updateUrl: function (url, data) {
|
||||
var _url = url || this.options.clearUrl,
|
||||
_data = data || {};
|
||||
|
||||
if (data.hasOwnProperty('navAjax')) {
|
||||
delete data.navAjax;
|
||||
}
|
||||
var new_url = new URL(_url);
|
||||
$.each(_data, function (i, v) {
|
||||
if (Array.isArray(v)) {
|
||||
new_url.searchParams.set(i, v.join(','));
|
||||
} else {
|
||||
new_url.searchParams.set(i, v);
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof history.replaceState === 'function') {
|
||||
history.replaceState(null, null, new_url.toString());
|
||||
}
|
||||
return new_url.toString();
|
||||
},
|
||||
/**
|
||||
* Get url attributes
|
||||
* @param string url
|
||||
* @return string
|
||||
* @private
|
||||
*/
|
||||
_parseQueryString: function (url) {
|
||||
return $.getURLValues(url);
|
||||
},
|
||||
getAllFilter: function () {
|
||||
var values = this.element.find(this.options.filterNavInputClass).getFormValues();
|
||||
if (values.hasOwnProperty('filter')) {
|
||||
values = values.filter;
|
||||
$.each(values, function (i, v) {
|
||||
if ('object' === typeof v) {
|
||||
var _v = [];
|
||||
$.each(v, function (i, v) {
|
||||
_v.push(v);
|
||||
});
|
||||
values[i] = _v.join(',');
|
||||
} else if (!values[i]) {
|
||||
delete values[i];
|
||||
}
|
||||
});
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
return {};
|
||||
},
|
||||
getDebounceContent: function (url, data, timeout) {
|
||||
var _url = url || this.options.clearUrl,
|
||||
_data = data || {},
|
||||
_timeout = timeout || this.options.timeout,
|
||||
_self = this;
|
||||
|
||||
clearTimeout(this.timeoutID);
|
||||
this.timeoutID = setTimeout(function () {
|
||||
_self.getContent.call(_self, _url, _data);
|
||||
}, _timeout);
|
||||
|
||||
},
|
||||
getContent: function (url, data) {
|
||||
this.startLoading();
|
||||
if (this.options.scrollToTop) {
|
||||
$(document).scrollTop(0);
|
||||
}
|
||||
var _url = url || this.options.clearUrl,
|
||||
_data = data || {},
|
||||
_self = this;
|
||||
this.current_filters = _data;
|
||||
_data['navAjax'] = 1;
|
||||
|
||||
var timestamp = new Date().getTime();
|
||||
this.lastTimestamp = timestamp;
|
||||
if (this.options.abortPrev && this.xhr)
|
||||
this.xhr.abort();
|
||||
this.xhr = $.ajax({
|
||||
url: _url,
|
||||
data: _data,
|
||||
cache: true,
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
if (_self.lastUpdate && _self.lastUpdate > timestamp)
|
||||
return;
|
||||
_self.lastUpdate = timestamp;
|
||||
if (response.hasOwnProperty('html')) {
|
||||
_self.replaceHTML(response.html);
|
||||
} else {
|
||||
if (response.hasOwnProperty('msg')) {
|
||||
_self.setMessage({
|
||||
type: 'error',
|
||||
text: response.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.lastTimestamp > timestamp)
|
||||
return;
|
||||
_self.updateUrl(_url, data);
|
||||
_self.afterUpdate();
|
||||
_self.element.trigger('filter_applied.OXAjaxNav', response);
|
||||
$('body').trigger('contentUpdated').trigger('OxInfiniteScroll');
|
||||
_self.stopLoading();
|
||||
},
|
||||
error: function (response) {
|
||||
_self.element.trigger('filter_error.OXAjaxNav', response);
|
||||
_self.setMessage({
|
||||
type: 'error',
|
||||
text: 'Sorry, something went wrong. Please try again later.'
|
||||
});
|
||||
window.location = _self.updateUrl(_url, data);
|
||||
}
|
||||
});
|
||||
},
|
||||
setMessage: function (obj) {
|
||||
messenger().messages({
|
||||
messages: ko.observableArray([obj])
|
||||
});
|
||||
},
|
||||
_createLoader: function (loader, parent) {
|
||||
if (!this.hasOwnProperty('_loader_class_' + loader)) {
|
||||
return;
|
||||
}
|
||||
var parent = parent || 'body',
|
||||
$parent = $(parent),
|
||||
$loader = $parent.children(this['_loader_class_' + loader]);
|
||||
if (!$loader.length) {
|
||||
var content = $(this['_loader_template_' + loader]).html();
|
||||
$(content).prependTo($parent);
|
||||
$loader = $parent.children(this['_loader_class_' + loader]);
|
||||
}
|
||||
return $loader;
|
||||
},
|
||||
|
||||
startLoading: function () {
|
||||
if (this.options.loaderFilter) {
|
||||
this._createLoader('filter', this.options.replaceSelectors.leftnav).show();
|
||||
}
|
||||
if (this.options.loaderContent && this.options.loaderContentSelector) {
|
||||
this._createLoader('content', this.options.loaderContentSelector).show();
|
||||
}
|
||||
if (this.options.loaderPage) {
|
||||
this._createLoader('page').show();
|
||||
}
|
||||
},
|
||||
stopLoading: function () {
|
||||
if (this.options.loaderFilter) {
|
||||
this._createLoader('filter', this.options.replaceSelectors.leftnav).hide();
|
||||
}
|
||||
if (this.options.loaderContent && this.options.loaderContentSelector) {
|
||||
this._createLoader('content', this.options.loaderContentSelector).hide();
|
||||
}
|
||||
if (this.options.loaderPage) {
|
||||
this._createLoader('page').hide();
|
||||
}
|
||||
},
|
||||
replaceHTML: function (data) {
|
||||
$.each(data, $.proxy(function (key, html) {
|
||||
if (this.options.replaceSelectors.hasOwnProperty(key)) {
|
||||
var $element = $(this.options.replaceSelectors[key]);
|
||||
|
||||
if ($element.length) {
|
||||
$element.replaceWith(html);
|
||||
$element.trigger('contentUpdated');
|
||||
}
|
||||
} else if ('_before' === key || '_after' === key) {
|
||||
if ('_before' === key && html) {
|
||||
$(this.options.replaceContentSelectors.products).before(html);
|
||||
} else if (html) {
|
||||
$(this.options.replaceContentSelectors.products).after(html);
|
||||
}
|
||||
} else if (html) {
|
||||
var $elementParent;
|
||||
if (this.options.replaceContentSelectors.hasOwnProperty(key)) {
|
||||
$elementParent = $(this.options.replaceContentSelectors[key]).last();
|
||||
}
|
||||
var createSelector = function (a) {
|
||||
if (!a.prop('tagName'))
|
||||
return;
|
||||
var _id = a.attr('id') || '',
|
||||
_class = (a.attr('class') || '').replace(/\s+/g, ' ').replace(/ /g, '.'),
|
||||
_selector = a.prop('tagName') + (_id ? '#' + _id : '') + (_class ? '.' + _class : '');
|
||||
return _selector;
|
||||
};
|
||||
var items = {},
|
||||
parent,
|
||||
first = true,
|
||||
prevElement;
|
||||
$(html).each(function () {
|
||||
var $html = $(this),
|
||||
selector = createSelector($html);
|
||||
if (!selector)
|
||||
return;
|
||||
if (/^script/i.test(selector)) {
|
||||
$elementParent.append($html);
|
||||
return;
|
||||
}
|
||||
var $element = $(selector);
|
||||
if ($elementParent.length) {
|
||||
$element = $elementParent.find(selector);
|
||||
}
|
||||
if (0 < $element.length) {
|
||||
if (1 == $element.length) {
|
||||
$element.replaceWith($html);
|
||||
prevElement = selector;
|
||||
} else {
|
||||
var $element = $(prevElement);
|
||||
if ($elementParent.length) {
|
||||
$element = $elementParent.find(prevElement);
|
||||
}
|
||||
$element = $element.next(selector);
|
||||
if (0 < $element.length) {
|
||||
$element.replaceWith($html);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$elementParent.append($html);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, this));
|
||||
},
|
||||
afterUpdate: function () {
|
||||
var count = $(this._current_item).length;
|
||||
$(this._current_count).html(count ? count : "");
|
||||
$(this.options.replaceSelectors.leftnav).data('moveDesktopParent', $('.sidebar.sidebar-main').eq(0));
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return $.mage.OXAjaxNav;
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
define([
|
||||
'jquery',
|
||||
], function ($) {
|
||||
'use strict';
|
||||
$.getValues = function (query) {
|
||||
var query = query || '',
|
||||
vars = query.split('&'),
|
||||
result = {},
|
||||
getName = function (name) {
|
||||
var regex;
|
||||
|
||||
if ((regex = /^(.+?)\[(.*?)$/).test(name)) {
|
||||
name = name.match(regex);
|
||||
name[2] = name[2].replace(/\]/g, '').split('[');
|
||||
name[2].unshift(name[1]);
|
||||
name = name[2].map(function (v) {
|
||||
return '' === v ? 0 : v;
|
||||
});
|
||||
} else {
|
||||
name = [name];
|
||||
}
|
||||
|
||||
return name;
|
||||
},
|
||||
setValue = function (form, names, value) {
|
||||
var name = names.shift();
|
||||
|
||||
if (names.length) {
|
||||
var _form = form.hasOwnProperty(name) ? form[name] : {};
|
||||
form[name] = setValue(_form, names, value);
|
||||
} else {
|
||||
if (0 === name) {
|
||||
for (; form.hasOwnProperty(name); name++) {
|
||||
}
|
||||
}
|
||||
form[name] = value;
|
||||
}
|
||||
|
||||
return form
|
||||
};
|
||||
for (var i = 0; i < vars.length; i++)
|
||||
if (vars[i].length) {
|
||||
var pair = vars[i].split('=').map(decodeURIComponent);
|
||||
result = setValue(result, getName(pair[0]), pair[1]);
|
||||
}
|
||||
|
||||
return $.extend(true, {}, result);
|
||||
|
||||
};
|
||||
$.getURLValues = function (href) {
|
||||
var href = href || window.location.href,
|
||||
url = new URL(href);
|
||||
return $.getValues(url.search.replace(/^\?/, ''));
|
||||
};
|
||||
|
||||
$.fn.getFormValues = function () {
|
||||
return $.getValues($(this).serialize());
|
||||
};
|
||||
|
||||
return $.fn.getFormValues;
|
||||
});
|
||||
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Olegnax Layered Navigation - Price Slider
|
||||
* Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
*/
|
||||
define([
|
||||
'jquery',
|
||||
'noUiSlider',
|
||||
'wNumb',
|
||||
'jquery-ui-modules/core',
|
||||
'jquery-ui-modules/widget',
|
||||
], function ($, noUiSlider, wNumb) {
|
||||
'use strict';
|
||||
|
||||
$.widget('mage.OXPriceSlider', {
|
||||
options: {
|
||||
//slider
|
||||
animate: true,
|
||||
min: 0,
|
||||
max: 100,
|
||||
current: null,
|
||||
step: 1,
|
||||
//format
|
||||
formatMoney: {
|
||||
decimals: 2
|
||||
},
|
||||
//html
|
||||
class_slider: ".ox-price-slider",
|
||||
class_value: "input[name='filter[price]']",
|
||||
class_label_scale: ".ox-price-filter__values",
|
||||
class_label: ".ox-price-filter__selected",
|
||||
class_from_label: ".ox-slider-from",
|
||||
class_to_label: ".ox-slider-to",
|
||||
|
||||
},
|
||||
_create: function () {
|
||||
this.slider_element = this.element.find(this.options.class_slider);
|
||||
this.value_element = this.element.find(this.options.class_value);
|
||||
this.label_element = this.element.find(this.options.class_label);
|
||||
this.min_label_element = this.label_element.find(this.options.class_from_label);
|
||||
this.max_label_element = this.label_element.find(this.options.class_to_label);
|
||||
|
||||
var values = this.value_element.val();
|
||||
values = values ? values.split('-').map(parseFloat) : null;
|
||||
|
||||
this.options.min = parseFloat(this.options.min);
|
||||
this.options.max = parseFloat(this.options.max);
|
||||
this.options.step = parseFloat(this.options.step);
|
||||
this.options.current = this.options.current || values || [this.options.min, this.options.max];
|
||||
|
||||
this.element.find('input').hide();
|
||||
|
||||
this.slider_element.show();
|
||||
this.wNumb = wNumb(this.options.formatMoney);
|
||||
var slider = this.slider_element[0];
|
||||
|
||||
|
||||
noUiSlider.create(slider, {
|
||||
start: this.options.current,
|
||||
step: 1,
|
||||
connect: true,
|
||||
range: {
|
||||
'min': this.options.min,
|
||||
'max': this.options.max
|
||||
},
|
||||
tooltips: [true, this.wNumb],
|
||||
pips: {
|
||||
mode: 'positions',
|
||||
values: [0, 100],
|
||||
density: 4,
|
||||
format: this.wNumb
|
||||
}
|
||||
});
|
||||
this.sliderCreate();
|
||||
slider.noUiSlider.on('change.OXPriceSlider', $.proxy(this.sliderChange, this));
|
||||
},
|
||||
sliderCreate: function () {
|
||||
this.change_label(this.options.current);
|
||||
this.element.trigger('price_slider_create', this.options.current);
|
||||
},
|
||||
sliderSlide: function (values) {
|
||||
this.change(values, 'price_slider_slide');
|
||||
},
|
||||
sliderChange: function (values) {
|
||||
this.change(values, 'price_slider_change');
|
||||
},
|
||||
change: function (values, event) {
|
||||
this.change_value(values, 'price_slider_change' === event);
|
||||
this.change_label(values);
|
||||
if ('string' == typeof event && event) {
|
||||
this.element.trigger(event, values);
|
||||
}
|
||||
},
|
||||
change_value: function (values, run) {
|
||||
values = values.join('-');
|
||||
this.value_element.val(values);
|
||||
if (run) {
|
||||
this.value_element.trigger('change');
|
||||
}
|
||||
},
|
||||
|
||||
change_label: function (values) {
|
||||
this.min_label_element.html(this.wNumb.to(values[0]));
|
||||
this.max_label_element.html(this.wNumb.to(values[1]));
|
||||
this.label_element.show();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return $.mage.OXPriceSlider;
|
||||
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
define([
|
||||
'jquery'
|
||||
], function ($) {
|
||||
'use strict';
|
||||
|
||||
return function (widget) {
|
||||
$.widget('mage.SwatchRenderer', widget, {
|
||||
_RenderControls: function () {
|
||||
var container = this.element,
|
||||
classes = this.options.classes;
|
||||
if (container.find('.' + classes.attributeClass).length) {
|
||||
return;
|
||||
}
|
||||
return this._super();
|
||||
}
|
||||
});
|
||||
|
||||
return $.mage.SwatchRenderer;
|
||||
}
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():window.wNumb=e()}(function(){"use strict";var o=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function w(e){return e.split("").reverse().join("")}function h(e,t){return e.substring(0,t.length)===t}function f(e,t,n){if((e[t]||e[n])&&e[t]===e[n])throw new Error(t)}function x(e){return"number"==typeof e&&isFinite(e)}function n(e,t,n,r,i,o,f,u,s,c,a,p){var d,l,h,g=p,v="",m="";return o&&(p=o(p)),!!x(p)&&(!1!==e&&0===parseFloat(p.toFixed(e))&&(p=0),p<0&&(d=!0,p=Math.abs(p)),!1!==e&&(p=function(e,t){return e=e.toString().split("e"),(+((e=(e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t)))).toString().split("e"))[0]+"e"+(e[1]?e[1]-t:-t))).toFixed(t)}(p,e)),-1!==(p=p.toString()).indexOf(".")?(h=(l=p.split("."))[0],n&&(v=n+l[1])):h=p,t&&(h=w((h=w(h).match(/.{1,3}/g)).join(w(t)))),d&&u&&(m+=u),r&&(m+=r),d&&s&&(m+=s),m+=h,m+=v,i&&(m+=i),c&&(m=c(m,g)),m)}function r(e,t,n,r,i,o,f,u,s,c,a,p){var d,l="";return a&&(p=a(p)),!(!p||"string"!=typeof p)&&(u&&h(p,u)&&(p=p.replace(u,""),d=!0),r&&h(p,r)&&(p=p.replace(r,"")),s&&h(p,s)&&(p=p.replace(s,""),d=!0),i&&function(e,t){return e.slice(-1*t.length)===t}(p,i)&&(p=p.slice(0,-1*i.length)),t&&(p=p.split(t).join("")),n&&(p=p.replace(n,".")),d&&(l+="-"),""!==(l=(l+=p).replace(/[^0-9\.\-.]/g,""))&&(l=Number(l),f&&(l=f(l)),!!x(l)&&l))}function i(e,t,n){var r,i=[];for(r=0;r<o.length;r+=1)i.push(e[o[r]]);return i.push(n),t.apply("",i)}return function e(t){if(!(this instanceof e))return new e(t);"object"==typeof t&&(t=function(e){var t,n,r,i={};for(void 0===e.suffix&&(e.suffix=e.postfix),t=0;t<o.length;t+=1)if(void 0===(r=e[n=o[t]]))"negative"!==n||i.negativeBefore?"mark"===n&&"."!==i.thousand?i[n]=".":i[n]=!1:i[n]="-";else if("decimals"===n){if(!(0<=r&&r<8))throw new Error(n);i[n]=r}else if("encoder"===n||"decoder"===n||"edit"===n||"undo"===n){if("function"!=typeof r)throw new Error(n);i[n]=r}else{if("string"!=typeof r)throw new Error(n);i[n]=r}return f(i,"mark","thousand"),f(i,"prefix","negative"),f(i,"prefix","negativeBefore"),i}(t),this.to=function(e){return i(t,n,e)},this.from=function(e){return i(t,r,e)})}});
|
||||
Reference in New Issue
Block a user