Skip to content

Commit

Permalink
fixed grunt conflicts and corrected the lang key
Browse files Browse the repository at this point in the history
  • Loading branch information
SrS2225a committed Aug 14, 2023
1 parent c8fac0a commit c8c540f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion resources/templates/dashboard/grid.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{% else %}
<a class="btn btn-sm btn-info publish-toggle" data-toggle="tooltip" title="{{ lang('publish') }}" data-id="{{ media.id }}" data-published="{{ media.published }}"><i class="fas fa-check-circle"></i></a>
{% endif %}
<button class="btn btn-info btn-sm public-vanity" data-link="{{ route('upload.delete', {'id': media.id}) }}" data-id="{{ media.id }}" data-toggle="tooltip" title="{{ lang('vanity') }}"><i class="fas fa-star"></i></button>
<button class="btn btn-info btn-sm public-vanity" data-id="{{ media.id }}" data-toggle="tooltip" title="{{ lang('vanity_url') }}"><i class="fas fa-star"></i></button>
<button type="button" class="btn btn-sm btn-danger media-delete" data-link="{{ route('upload.delete', {'id': media.id}) }}" data-id="{{ media.id }}" data-toggle="tooltip" title="{{ lang('delete') }}">
<i class="fas fa-trash"></i>
</button>
Expand Down
2 changes: 1 addition & 1 deletion resources/templates/dashboard/list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
{% else %}
<a href="javascript:void(0)" class="btn btn-sm btn-outline-info publish-toggle" data-toggle="tooltip" title="{{ lang('publish') }}" data-id="{{ media.id }}" data-published="{{ media.published }}"><i class="fas fa-check-circle"></i></a>
{% endif %}
<a href="javascript:void(0)" class="btn btn-sm btn-outline-info public-vanity" data-id="{{ media.id }}" data-toggle="tooltip" title="{{ lang('vanity') }}"><i class="fas fa-star"></i></a>
<a href="javascript:void(0)" class="btn btn-sm btn-outline-info public-vanity" data-id="{{ media.id }}" data-toggle="tooltip" title="{{ lang('vanity_url') }}"><i class="fas fa-star"></i></a>
<a href="javascript:void(0)" class="btn btn-sm btn-outline-danger media-delete" data-link="{{ route('upload.delete', {'id': media.id}) }}" data-id="{{ media.id }}" data-toggle="tooltip" title="{{ lang('delete') }}"><i class="fas fa-trash"></i></a>
</div>
</td>
Expand Down
15 changes: 7 additions & 8 deletions src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,24 @@ var app = {
$('#modalVanity').modal('show');
$('#modalVanity-link').click(function () {
var $callerButton = $(this);
$.post(window.AppConfig.base_url + '/upload/' + id + '/vanity', {vanity: $('#modalVanity-input').val()}, function (data, status) {
$.post(window.AppConfig.base_url + '/upload/' + id + '/vanity', {vanity: $('#modalVanity-input').val()}, function (responseData, status) {
$callerButton.tooltip('dispose');
$('#modalVanity').modal('hide');
$('#modalVanity-input').val('');
var data = JSON.parse(data);
if ($('#media_' + id).find('.btn-group').length >0) {
var parsedData = JSON.parse(responseData);
if ($('#media_' + id).find('.btn-group').length > 0) {
$('#media_' + id).find('.btn-group').find('a').each(function (item) {
var oldUrl = $(this).attr('href');
var newUrl = oldUrl.replace(oldUrl.substr(oldUrl.lastIndexOf('/') + 1), data.code);
var newUrl = oldUrl.replace(oldUrl.substr(oldUrl.lastIndexOf('/') + 1), parsedData.code.code);
$(this).attr('href', newUrl);
})
});
} else {
var oldUrl = window.location.href;
var newUrl = oldUrl.replace(oldUrl.substr(oldUrl.lastIndexOf('/') + 1), data.code);
var newUrl = oldUrl.replace(oldUrl.substr(oldUrl.lastIndexOf('/') + 1), parsedData.code.code);
window.location.href = newUrl;

}
});
})
});
},
publishToggle: function () {
var id = $(this).data('id');
Expand Down

0 comments on commit c8c540f

Please sign in to comment.