mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-02 02:18:20 +00:00
Merge pull request #1078 from vicmosin/issues/509
Introduced bulk edit endpoint for bulk edit of categories and tags
This commit is contained in:
25
public/js/ff/transactions/list.js
vendored
25
public/js/ff/transactions/list.js
vendored
@@ -18,7 +18,7 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** global: edit_selected_txt, delete_selected_txt, token */
|
||||
/** global: edit_selected_txt, edit_bulk_selected_txt, delete_selected_txt, token */
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -45,6 +45,8 @@ $(document).ready(function () {
|
||||
|
||||
// click the edit button:
|
||||
$('.mass_edit').click(goToMassEdit);
|
||||
// click the edit button:
|
||||
$('.mass_edit_bulk').click(goToMassBulkEdit);
|
||||
// click the delete button:
|
||||
$('.mass_delete').click(goToMassDelete);
|
||||
// click reconcile button
|
||||
@@ -100,6 +102,26 @@ function goToMassEdit() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function goToMassBulkEdit() {
|
||||
"use strict";
|
||||
var checkedArray = getCheckboxes();
|
||||
|
||||
// go to specially crafted URL:
|
||||
var bases = document.getElementsByTagName('base');
|
||||
var baseHref = null;
|
||||
|
||||
if (bases.length > 0) {
|
||||
baseHref = bases[0].href;
|
||||
}
|
||||
|
||||
window.location.href = baseHref + '/transactions/mass/edit/bulk/' + checkedArray;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {boolean}
|
||||
@@ -144,6 +166,7 @@ function countChecked() {
|
||||
var checked = $('.select_all_single:checked').length;
|
||||
if (checked > 0) {
|
||||
$('.mass_edit span').text(edit_selected_txt + ' (' + checked + ')');
|
||||
$('.mass_edit_bulk span').text(edit_bulk_selected_txt + ' (' + checked + ')');
|
||||
$('.mass_delete span').text(delete_selected_txt + ' (' + checked + ')');
|
||||
|
||||
// get amount for the transactions:
|
||||
|
43
public/js/ff/transactions/mass/edit-bulk.js
vendored
Normal file
43
public/js/ff/transactions/mass/edit-bulk.js
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* edit.js
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This file is part of Firefly III.
|
||||
*
|
||||
* Firefly III is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Firefly III is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** global: what */
|
||||
|
||||
$(document).ready(function () {
|
||||
"use strict";
|
||||
|
||||
$.getJSON('json/categories').done(function (data) {
|
||||
$('input[name="category"]').typeahead({source: data});
|
||||
});
|
||||
|
||||
$.getJSON('json/tags').done(function (data) {
|
||||
var opt = {
|
||||
typeahead: {
|
||||
source: data,
|
||||
afterSelect: function () {
|
||||
this.$element.val("");
|
||||
}
|
||||
}
|
||||
};
|
||||
$('input[name="tags"]').tagsinput(
|
||||
opt
|
||||
);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user