Add badget for page types

This commit is contained in:
Diego Najar 2019-10-05 21:29:32 +02:00
parent 7dae1725bb
commit ada0b61ee1
4 changed files with 8 additions and 6 deletions

View File

@ -41,7 +41,7 @@
$(document).ready(function() { $(document).ready(function() {
var clippy = $("#jsclippy").select2({ var clippy = $("#jsclippy").select2({
placeholder: "<?php $L->p('Start typing to see a list of suggestions.') ?>", placeholder: "<?php $L->p('Start typing to see a list of suggestions') ?>",
allowClear: true, allowClear: true,
width: "100%", width: "100%",
theme: "bootstrap4", theme: "bootstrap4",
@ -64,7 +64,7 @@
html += '<span class="fa fa-'+data.icon+'"></span>'+data.text+'</div></a>'; html += '<span class="fa fa-'+data.icon+'"></span>'+data.text+'</div></a>';
} else { } else {
html += '<div class="search-suggestion">'; html += '<div class="search-suggestion">';
html += '<div class="search-suggestion-item">'+data.text+'</div>'; html += '<div class="search-suggestion-item">'+data.text+' <span class="badge badge-pill badge-light">'+data.type+'</span></div>';
html += '<div class="search-suggestion-options">'; html += '<div class="search-suggestion-options">';
html += '<a target="_blank" href="http://localhost:8000/testt">View</a>'; html += '<a target="_blank" href="http://localhost:8000/testt">View</a>';
html += '<a class="ml-2" href="http://localhost:8000/admin/edit-content/testt">Edit</a>'; html += '<a class="ml-2" href="http://localhost:8000/admin/edit-content/testt">Edit</a>';

View File

@ -238,7 +238,7 @@ echo Bootstrap::formOpen(array(
templateResult: function(data) { templateResult: function(data) {
var html = data.text var html = data.text
if (data.type=="static") { if (data.type=="static") {
html += " [" + data.type + "]" html += '<span class="badge badge-pill badge-light">'+data.type+'</span>';
} }
return html; return html;
} }

View File

@ -207,9 +207,9 @@ echo Bootstrap::formOpen(array(
return markup; return markup;
}, },
templateResult: function(data) { templateResult: function(data) {
var html = data.text var html = data.text;
if (data.type=="static") { if (data.type=="static") {
html += " [" + data.type + "]" html += '<span class="badge badge-pill badge-light">'+data.type+'</span>';
} }
return html; return html;
} }

View File

@ -389,5 +389,7 @@
"preview": "Preview", "preview": "Preview",
"author-can-write-and-edit-their-own-content": "Author: Can write and edit their own content. Editor: Can write and edit the content of others.", "author-can-write-and-edit-their-own-content": "Author: Can write and edit their own content. Editor: Can write and edit the content of others.",
"custom-fields": "Custom fields", "custom-fields": "Custom fields",
"define-custom-fields-for-the-content": "Define custom fields for the content. Learn more about custom fields in the <a href='https://docs.bludit.com/en/content/custom-fields'>documentation</a>." "define-custom-fields-for-the-content": "Define custom fields for the content. Learn more about custom fields in the <a href='https://docs.bludit.com/en/content/custom-fields'>documentation</a>.",
"start-typing-to-see-a-list-of-suggestions": "Start typing to see a list of suggestions.",
"view": "View"
} }