Added SEO keywords. Added medua upload indicator. Added Khabarovsk default
Build and Publish / Build and Publish Docker Image (push) Successful in 1m17s
Build and Publish / Build and Publish Docker Image (push) Successful in 1m17s
This commit is contained in:
@@ -44,7 +44,64 @@
|
||||
<input class="input" type="text" name="timezone" placeholder="Asia/Vladivostok" value="{% for s in &settings %}{% if s.key == "timezone" %}{{ s.value }}{% endif %}{% endfor %}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">{{ t.settings_seo_keywords }}</label>
|
||||
<div class="control">
|
||||
<textarea id="seoKeywordsInput" class="textarea" name="seo_keywords" rows="3"
|
||||
style="resize:vertical;"
|
||||
placeholder="зооняня Хабаровск, присмотр за питомцем Хабаровск, догситтер Хабаровск">{% for s in &settings %}{% if s.key == "seo_keywords" %}{{ s.value }}{% endif %}{% endfor %}</textarea>
|
||||
</div>
|
||||
<div id="seoPreview" style="margin-top:0.5rem;padding:0.5rem 0.75rem;background:#fafafa;border:1px solid #eee;border-radius:6px;min-height:2rem;line-height:2;font-size:0.85rem;display:none;"></div>
|
||||
<p style="font-size:0.78rem;color:#aaa;margin-top:0.3rem;">Каждая фраза между запятыми — отдельное ключевое слово</p>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="button is-primary">{{ t.settings_save }}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var COLORS = [
|
||||
'rgba(124,108,255,0.18)',
|
||||
'rgba(255,82,135,0.15)',
|
||||
'rgba(255,140,38,0.18)',
|
||||
'rgba(0,180,150,0.15)',
|
||||
'rgba(77,166,255,0.18)',
|
||||
'rgba(255,179,64,0.18)',
|
||||
'rgba(176,108,255,0.16)',
|
||||
'rgba(34,180,130,0.16)',
|
||||
];
|
||||
|
||||
var ta = document.getElementById('seoKeywordsInput');
|
||||
var preview = document.getElementById('seoPreview');
|
||||
|
||||
function esc(s) {
|
||||
return s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
||||
}
|
||||
|
||||
function render() {
|
||||
var text = ta.value.trim();
|
||||
if (!text) { preview.style.display = 'none'; return; }
|
||||
|
||||
var parts = text.split(',');
|
||||
var html = '';
|
||||
parts.forEach(function(part, i) {
|
||||
var word = part.trim();
|
||||
if (word) {
|
||||
var color = COLORS[i % COLORS.length];
|
||||
html += '<span style="background:' + color + ';border-radius:4px;padding:2px 6px;margin:2px;">' + esc(word) + '</span>';
|
||||
}
|
||||
if (i < parts.length - 1) {
|
||||
html += '<span style="color:#ccc;font-size:0.8em;margin:0 1px">,</span>';
|
||||
}
|
||||
});
|
||||
|
||||
preview.innerHTML = html;
|
||||
preview.style.display = 'block';
|
||||
}
|
||||
|
||||
ta.addEventListener('input', render);
|
||||
render();
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user