This commit is contained in:
@@ -28,9 +28,8 @@
|
||||
<a href="/budget/list" class="nav-button" style="margin-right: 10px;">
|
||||
Lista
|
||||
</a>
|
||||
<span class="month-label">
|
||||
{{ budget.name }}
|
||||
</span>
|
||||
<span class="month-label" ng-bind="budget.name"></span>
|
||||
|
||||
</div>
|
||||
<div class="menu-container" ng-class="{ 'open': menuOpen }">
|
||||
<button class="icon-button" ng-click="toggleMenu($event)">
|
||||
@@ -203,20 +202,61 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="no-data" ng-if="!loading && budget && budget.categories.length === 0">
|
||||
<p>Det finns ingen budgetdata för
|
||||
<strong>{{ budget.name || (selectedMonth + '/' + selectedYear) }}</strong>.
|
||||
|
||||
<!-- Ingen budget alls -->
|
||||
<div class="no-data" ng-if="!loading && (!budget || !budget.id)">
|
||||
<p>
|
||||
<strong ng-bind="budget && budget.name
|
||||
? 'Budgeten \" ' + budget.name + ' \" finns inte.'
|
||||
: 'Det finns ingen budget för ' + getMonthName(selectedMonth) + ' ' + selectedYear + '.' ">
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
|
||||
<div style="margin-top: 10px;">
|
||||
<!-- Skapa ny budget alltid om budget saknas -->
|
||||
<button ng-click="createEmptyBudget()" style="margin-right: 10px;">
|
||||
Skapa ny budget
|
||||
</button>
|
||||
<button ng-click="copyPreviousMonthSafe()">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Budget finns men inga kategorier -->
|
||||
<div class="no-data" ng-if="!loading && budget && budget.id && (!budget.categories || budget.categories.length === 0)">
|
||||
<p>
|
||||
Budgeten <strong>{{ budget.name || (getMonthName(selectedMonth) + " " + selectedYear) }}</strong> har inga kategorier än.
|
||||
</p>
|
||||
|
||||
<div style="margin-top: 10px;">
|
||||
<button ng-click="createNewCategory()" style="margin-right: 10px;">
|
||||
Skapa ny kategori
|
||||
</button>
|
||||
<button ng-if="!budget.name" ng-click="copyPreviousMonthSafe()" style="margin-right: 10px;">
|
||||
Kopiera föregående månad
|
||||
</button>
|
||||
<button ng-click="copyBudget()" style="margin-right: 10px;">
|
||||
Kopiera befintlig budget
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal-backdrop" ng-show="showCopyModal">
|
||||
<div class="modal-content">
|
||||
<h3>Kopiera budget</h3>
|
||||
<select ng-model="selectedBudgetToCopy"
|
||||
ng-options="b as formatBudgetName(b) for b in budgetList track by b.id">
|
||||
<option value="">Välj budget</option>
|
||||
</select>
|
||||
|
||||
<div style="margin-top: 10px;">
|
||||
<button ng-click="confirmCopyBudget()">Kopiera</button>
|
||||
<button ng-click="showCopyModal = false">Avbryt</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="add-item-popup" ng-show="addPopupVisible" ng-style="addPopupStyle" ng-class="{ 'above': addPopupAbove }">
|
||||
<label>Typ:</label>
|
||||
<select ng-model="addPopupData.newItemType">
|
||||
@@ -283,7 +323,8 @@
|
||||
<script>
|
||||
window.initialYear = @(ViewBag.Year ?? "null");
|
||||
window.initialMonth = @(ViewBag.Month ?? "null");
|
||||
window.initialName = "@(ViewBag.BudgetName ?? "")";
|
||||
window.initialName = "@Html.Raw(ViewBag.BudgetName ?? "")";
|
||||
|
||||
|
||||
</script>
|
||||
<script src="~/js/budget.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user