parent
ad5df5e35f
commit
838530bb88
13 changed files with 395 additions and 193 deletions
@ -1,10 +1,16 @@ |
||||
<div class="trademark-search-nice-busy"> |
||||
<h2>«{{ keyword|title }}» нельзя использовать в следующих сферах</h2> |
||||
<h2>«{{ keyword|title }}» уже используется в следующих сферах</h2> |
||||
|
||||
<ul class="trademark-search-available-classes list-unstyled"> |
||||
{% for class in nice_busy %} |
||||
<li> <button class="btn btn-xs btn-default">{{ class.nice_id }}</button> {{ class.title }}</li> |
||||
<ul class="list-unstyled"> |
||||
{% for product in products_busy %} |
||||
{% if product.titles %} |
||||
<li class="trademark-search-nice-busy-product"><button class="btn btn-xs btn-default" popover="{% if product.nice.description %}{{ product.nice.description }}{% else %}{{ product.nice.title }}{% endif %}" popover-title="{{ product.nice.title }}" popover-trigger="mouseenter" popover-placement="bottom">{{ product.nice.nice_id }} класс</button> <button class="btn btn-xs btn-default trademark-search-show-products" product-id="{{ product.id }}">{{ product.titles|length }} категорий <span class="caret"> </span></button> {{ product.nice.title }}</li> |
||||
<ul class="trademark-search-nice-busy-products row" style="display: none;" product-id="{{ product.id }}">{% for title in product.titles %}<li class="col-xs-6">{{ title }}</li>{% endfor %}</ul> |
||||
{% else %} |
||||
<li class="trademark-search-nice-busy-product"><button class="btn btn-xs btn-default" popover="{% if product.nice.description %}{{ product.nice.description }}{% else %}{{ product.nice.title }}{% endif %}" popover-title="{{ product.nice.title }}" popover-trigger="mouseenter" popover-placement="bottom">{{ product.nice.nice_id }} класс</button> {{ product.cap_title }}</li> |
||||
{% endif %} |
||||
{% endfor %} |
||||
|
||||
|
||||
</ul> |
||||
</div> |
||||
@ -0,0 +1,8 @@ |
||||
<li class="trademark-search-result-contains trademark-search-result" trademark-id='{{ tm.id }}'> |
||||
<div class='trademark-search-result-image' style="background-image: url({{ tm.image_url }});"> |
||||
{% if not tm.image_url %} |
||||
<h4>{{ tm.title|title }}</h4> |
||||
{% endif %} |
||||
</div> |
||||
<p>{{ tm.title|title }}</p> |
||||
</li> |
||||
@ -0,0 +1,55 @@ |
||||
{% extends "trademark/base.html" %} |
||||
|
||||
{% block trademark_content %} |
||||
<div class="row"> |
||||
<div class="col-xs-12 col-sm-8"> |
||||
<h1>Товарный знак «{{ tm.title }}»</h1> |
||||
<ul class="list-unstyled row"> |
||||
<li class='col-xs-4'> |
||||
<h2>Подана заявка <nobr>{{ tm.application_at }}</nobr></h2> |
||||
<p>Номер <nobr>№ {{ tm.application_id }}</nobr></p> |
||||
</li> |
||||
<li class='col-xs-2 trademark-detail-arrow'> |
||||
→ |
||||
</li> |
||||
<li class='col-xs-6'> |
||||
<h2>Регистрация <nobr>{{ tm.registration_at }}</nobr></h2> |
||||
<p>Номер свидетельства № {{ tm.cert_id }}</p> |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="trademark-detail-description row"> |
||||
<div class="col-xs-6 trademark-detail-description-visual"> |
||||
<h4>Изобразительный знак:</h3> |
||||
<img src="{{ tm.image_url }}"/> |
||||
</div> |
||||
<div class="col-xs-6 trademark-detail-text"> |
||||
<h4>Правообладатель:</h3> |
||||
<p>{{ tm.owner }}</p> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
{% include 'trademark/nice_block_busy.html' with keyword=tm.title nice_busy=tm.nices.all products_busy=tm.products.all %} |
||||
|
||||
<h4>Данные ФИПС <small>Федеральной службы по интеллектуальной собственности</small></h4> |
||||
<small>{{ tm.source_url }}</small> |
||||
<div class="trademark-detail-fips-wrap"> |
||||
<iframe class="frame" src="{{ tm.source_url }}"></iframe> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div class="col-xs-12 col-sm-4"> |
||||
<div class="trademark-search-block"> |
||||
<h2>Попробуйте проверить другой товарный знак</h2> |
||||
{% include 'trademark/form.html' %} |
||||
</div> |
||||
|
||||
{% if nice_available.count > 0 %} |
||||
{% include 'trademark/registration.html' with trademark_title=tm.title nice_available=nice_available nice_busy=tm.nices %} |
||||
{% endif %} |
||||
|
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
@ -0,0 +1,157 @@ |
||||
$(function(){ |
||||
// SearchForm
|
||||
function send () { |
||||
var request = $("#trademark-search-request").val(), |
||||
$form = $('.trademark-search-form'), |
||||
$loading = $('.trademark-search-loading'), |
||||
$status_list = $('.trademark-search-loading-status'), |
||||
$count = $('#trademark-search-count'), |
||||
$title = $('#trademark-search-request-value'), |
||||
$sending = $('#trademark-search-sending'), |
||||
$identity = $('#trademark-search-identity'), |
||||
$contains = $('#trademark-search-contains'), |
||||
$similar = $('#trademark-search-similar'), |
||||
$wait = $('#trademark-search-wait'), |
||||
slug = '', |
||||
iteration = 0; |
||||
|
||||
function update_status(data) { |
||||
var identity = data['identity'], |
||||
contains = data['contains'], |
||||
similar = data['similar'], |
||||
completed = identity['status'] == 'finished' && contains['status'] == 'finished' && similar['status'] == 'finished', |
||||
almost_completed = identity['status'] == 'finished' && contains['status'] == 'finished' && identity['count'] > 0, |
||||
show_link = identity['status'] == 'finished' || contains['status'] == 'finished' || similar['status'] == 'finished', |
||||
tm_url = '/ru/trademarks/online-search/results/' + slug + '/'; |
||||
|
||||
if(identity['status'] == 'finished') { |
||||
var count = identity['count']; |
||||
if(count > 0) { |
||||
$identity.text(GetNoun(count, 'Найден', 'Найдены', 'Найдено') + ' '+ count + ' ' + GetAdj(count, 'такой', 'таких') + ' ' + GetNoun(count, 'знак', 'знака', 'знаков')+ ' в ' + identity['nices'] + ' ' + GetNoun(identity['nices'], 'классе', 'классах', 'классах')); |
||||
} else { |
||||
$identity.text('Точно таких же знаков не найдено'); |
||||
} |
||||
} |
||||
|
||||
if(contains['status'] == 'finished') { |
||||
var count = contains['count']; |
||||
if(count > 0) { |
||||
$contains.text(GetNoun(count, 'Обнаружен', 'Обнаружены', 'Обнаружено') + ' ' + count + ' ' + GetAdj(count, 'похожий', 'похожих') + ' ' + GetNoun(count, 'знак', 'знака', 'знаков')); |
||||
} else { |
||||
$contains.text('Похожих знаков не обнаружено'); |
||||
} |
||||
} |
||||
|
||||
if(similar['status'] == 'finished') { |
||||
var count = similar['count']; |
||||
if(count > 0) { |
||||
$similar.text(GetNoun(count, 'Подобран', 'Подобраны', 'Подобрано') + ' ' + count + ' ' + GetAdj(count, 'производный', 'производных') + ' ' + GetNoun(count, 'знак', 'знака', 'знаков')); |
||||
} else { |
||||
$similar.text('Не удалось подобрать производных знаков'); |
||||
} |
||||
} |
||||
|
||||
if(iteration > 3) { |
||||
$wait.show(500); |
||||
} |
||||
|
||||
if(show_link && iteration > 5) { |
||||
var href = '' |
||||
$wait.html('<a href="' + tm_url + '">Остановить поиск и перейти к результатам</a>'); |
||||
} else { |
||||
console.log(iteration); |
||||
} |
||||
|
||||
if(completed || almost_completed) { |
||||
yaCounter950321.reachGoal('TrademarkSearchResults');
|
||||
ga('send', 'event', 'TrademarkSearch', 'results', document.title); |
||||
|
||||
document.location.href = tm_url; |
||||
} else { |
||||
iteration += 1; |
||||
setTimeout(function () { |
||||
get_status(slug); |
||||
}, 10000); |
||||
}
|
||||
|
||||
} |
||||
|
||||
function get_status(slug) { |
||||
try { |
||||
$.get("/ru/trademarks/online-search/request/" + slug + "/").done(function(data) { |
||||
update_status(data); |
||||
}); |
||||
} catch (err) { |
||||
setTimeout(function () { |
||||
get_status(slug); |
||||
}, 5000); |
||||
} |
||||
} |
||||
|
||||
yaCounter950321.reachGoal('TrademarkSearchClick');
|
||||
ga('send', 'event', 'TrademarkSearch', 'click', document.title); |
||||
|
||||
// Show Loading Block
|
||||
$title.text(request); |
||||
$form.hide(); |
||||
$loading.show(); |
||||
$sending.show(); |
||||
|
||||
$.post("/ru/trademarks/online-search/request/",
|
||||
{ 'keyword': request}).done(function(data) { |
||||
var tm_count = Math.floor(Math.random() * (3000000 - 1000000) + 1000000); |
||||
$('.trademark-search-count').text(tm_count.toLocaleString() + ' знаков') |
||||
$count.show(500); |
||||
$identity.delay(3000).show(500); |
||||
$contains.delay(6000).show(500); |
||||
$similar.delay(12000).show(500); |
||||
|
||||
slug = data['slug']; |
||||
update_status(data); |
||||
|
||||
}) |
||||
.fail(function(data) { |
||||
console.log( "error " ); |
||||
console.log(data); |
||||
}) |
||||
.always(function(data) { |
||||
console.log( "finished" ); |
||||
console.log(data); |
||||
$sending.hide() |
||||
}); |
||||
} |
||||
$('#trademark-search-example').click(function(event) { |
||||
event.preventDefault(); |
||||
$("#trademark-search-request").val('Yandex'); |
||||
}); |
||||
|
||||
$('#trademark-search-request').keypress(function (e) { |
||||
if (e.which == 13) { |
||||
send(); |
||||
return false; //<---- Add this line
|
||||
} |
||||
}); |
||||
$('#trademark-search-submit').click(function(){ |
||||
send(); |
||||
}); |
||||
|
||||
|
||||
|
||||
// Results
|
||||
$('.trademark-search-show-products').each(function() { |
||||
var product_id = $(this).attr('product-id') |
||||
$(this).click(function () { |
||||
var $list = $(''); |
||||
|
||||
$('.trademark-search-nice-busy-products[product-id=' + product_id + ']').slideToggle('slow'); |
||||
}); |
||||
}); |
||||
|
||||
$('.trademark-search-result').click(function() { |
||||
var tm_id = $(this).attr('trademark-id'); |
||||
|
||||
document.location.href = '/ru/trademarks/online-search/trademark/' + tm_id + '/'; |
||||
}); |
||||
|
||||
|
||||
}); |
||||
Loading…
Reference in new issue