mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
changes
This commit is contained in:
parent
ff8b585edc
commit
5b2bf658df
@ -125,70 +125,43 @@ function addAdsRow(id, href, image, name, formatted_price, city, country, cat1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dropdownRow(id, type) {
|
function dropdownRow(id, type) {
|
||||||
var dropdown = `
|
var dropdown = "<div class='dropdown my-ads-dropdown' data-id='" + id + "'>\n" +
|
||||||
<div class='dropdown my-ads-dropdown' data-id='${id}'>
|
" <button class='dropdown-toggle btn btn-outline-dark' type='button' id='dropdownMenuButton' data-toggle='dropdown'>\n" +
|
||||||
<button class='dropdown-toggle btn btn-outline-dark' type='button' id='dropdownMenuButton'
|
"<i class=\"fas fa-ellipsis-v\"></i>" +
|
||||||
data-toggle='dropdown'>
|
" </button>\n" +
|
||||||
<i class="fas fa-ellipsis-v"></i>
|
" <div class='dropdown-menu' aria-labelledby='dropdownMenuButton'>\n";
|
||||||
</button>
|
|
||||||
<div class='dropdown-menu' aria-labelledby='dropdownMenuButton'>
|
|
||||||
`;
|
|
||||||
if (type == "passive") {
|
if (type == "passive") {
|
||||||
dropdown += `
|
dropdown += "<a class='dropdown-item text-success' href='/advs/status/" + id + ",approved'>" +
|
||||||
<a class='dropdown-item text-success' href='/advs/status/${id},approved'>
|
"<i class='fas fa-eye'></i> " +
|
||||||
<i class='fas fa-eye'></i>
|
approve +
|
||||||
${approve}
|
"</a>\n";
|
||||||
</a>
|
|
||||||
`;
|
|
||||||
} else {
|
} else {
|
||||||
dropdown += `
|
dropdown += "<a class='dropdown-item text-secondary' href='/advs/status/" + id + ",passive'>" +
|
||||||
<a class='dropdown-item text-secondary' href='/advs/status/${id},passive'>
|
"<i class='fas fa-eye-slash'></i> " +
|
||||||
<i class='fas fa-eye-slash'></i>
|
passive +
|
||||||
${passive}
|
"</a>\n";
|
||||||
</a>
|
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dropdown += `
|
dropdown += "<a class='dropdown-item text-primary' href='/advs/edit_advs/" + id + "'>" +
|
||||||
<a class='dropdown-item text-primary' href='/advs/edit_advs/${id}'>
|
"<i class='fas fa-pencil-alt'></i> " +
|
||||||
<i class='fas fa-pencil-alt'></i>
|
edit_ad +
|
||||||
${edit_ad}
|
"</a>\n";
|
||||||
</a>
|
|
||||||
<a class='dropdown-item text-danger' href='/advs/delete/${id}'>
|
dropdown += "<a class='dropdown-item text-danger' href='/advs/delete/" + id + "'>" +
|
||||||
<i class='fas fa-trash'></i>
|
"<i class='fas fa-trash'></i> " +
|
||||||
${delete_ad}
|
delete_ad +
|
||||||
</a>
|
"</a>\n";
|
||||||
<a class='dropdown-item text-info' href='/advs/extend/${id}'>
|
|
||||||
<i class='fas fa-calendar'></i>
|
dropdown += "<a class='dropdown-item text-info' href='/advs/extend/" + id + "'>" +
|
||||||
${extend_ad}
|
"<i class='fas fa-calendar'></i> " +
|
||||||
</a>
|
extend_ad +
|
||||||
<div class="btn-group dropleft">
|
"</a>\n";
|
||||||
<button type="button" class="btn btn-secondary dropdown-toggle adv-status-toggle" data-toggle="dropdown" aria-haspopup="true"
|
|
||||||
aria-expanded="false">
|
dropdown += "</div></div>";
|
||||||
Dropleft
|
|
||||||
</button>
|
|
||||||
<div class="dropdown-menu">
|
|
||||||
<!-- Dropdown menu links -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
return dropdown;
|
return dropdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('click', '.adv-status-toggle', function (e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
if (!$(this).next('div').hasClass('show')) {
|
|
||||||
$(this).next('div').addClass('show');
|
|
||||||
} else {
|
|
||||||
$(this).next('div').removeClass('show');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
function addDropdownBlock() {
|
function addDropdownBlock() {
|
||||||
const dropdowns = $('.my-ads-dropdown')
|
const dropdowns = $('.my-ads-dropdown')
|
||||||
for (let i = 0; i < dropdowns.length; i++) {
|
for (let i = 0; i < dropdowns.length; i++) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user