Code to catch empty lists and nudge user in the right direction.

This commit is contained in:
James Cole
2017-02-23 07:24:05 +01:00
parent b3df1f3d26
commit 563c668e3f
11 changed files with 309 additions and 228 deletions
+1 -1
View File
@@ -85,7 +85,7 @@
</div>
</div>
{% if budgets.count == 0 and inactive.count == 0 %}
{% include 'empty.budgets' %}
{% include 'partials.empty' with {what: 'default', type: 'budgets',route: route('budgets.create')} %}
{% endif %}
<div class="row">
{% for budget in budgets %}
+21 -22
View File
@@ -5,38 +5,37 @@
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'categories'|_ }}</h3>
{% if categories.count > 0 %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'categories'|_ }}</h3>
<!-- ACTIONS MENU -->
<div class="box-tools pull-right">
<div class="btn-group">
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ route('categories.create') }}"><i class="fa fa-plus fa-fw"></i> {{ 'new_category'|_ }}</a></li>
</ul>
<!-- ACTIONS MENU -->
<div class="box-tools pull-right">
<div class="btn-group">
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ route('categories.create') }}"><i class="fa fa-plus fa-fw"></i> {{ 'new_category'|_ }}</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="box-body no-padding">
{% include 'list/categories' %}
</div>
<div class="box-body no-padding">
{% include 'list/categories' %}
</div>
</div>
</div>
</div>
</div>
{% else %}
{% include 'partials.empty' with {what: 'default', type: 'categories',route: route('categories.create')} %}
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="css/bootstrap-sortable.css" type="text/css" media="all"/>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>
<script type="text/javascript" src="js/ff/charts.defaults.js"></script>
<script type="text/javascript" src="js/ff/charts.js"></script>
<script type="text/javascript" src="js/lib/bootstrap-sortable.js"></script>
<script type="text/javascript" src="js/ff/categories/index.js"></script>
{% endblock %}
+4 -4
View File
@@ -2,19 +2,19 @@
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 col-lg-offset-3 col-md-offset-3">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ ('empty_accounts_title_'~what)|_ }}</h3>
<h3 class="box-title">{{ ('no_'~type~'_title_'~what)|_ }}</h3>
</div>
<div class="box-body table-responsive">
<p>
{{ ('empty_accounts_intro_'~what)|_ }}
{{ ('no_'~type~'_intro_'~what)|_ }}
</p>
<p>
{{ ('empty_accounts_imperative_'~what)|_ }}
{{ ('no_'~type~'_imperative_'~what)|_ }}
</p>
<p style="text-align: center;">
<a class="btn btn-lg btn-success" href="{{ route('accounts.create', [what]) }}">{{ ('empty_accounts_create_'~what)|_ }}</a>
<a class="btn btn-lg btn-success" href="{{ route }}">{{ ('no_'~type~'_create_'~what)|_ }}</a>
</p>
</div>
+33 -30
View File
@@ -30,46 +30,49 @@
</div>
</div>
</div>
<div class="row">
{% for type in types %}
<div class="col-lg-4">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ ('tag_title_'~type)|_ }}</h3>
</div>
<div class="box-body">
{% for year,months in collection[type] %}
<h4>{{ year }}</h4>
{% if count == 0 %}
{% include 'partials.empty' with {what: 'default', type: 'tags',route: route('tags.create')} %}
{% else %}
<div class="row">
{% for type in types %}
<div class="col-lg-4">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ ('tag_title_'~type)|_ }}</h3>
</div>
<div class="box-body">
{% for year,months in collection[type] %}
<h4>{{ year }}</h4>
{% for month,tags in months %}
<h5>{{ month }}</h5>
<p style="line-height: 200%;">
{% for tag in tags %}
<span style="display: inline;"><a style="font-size:100%;font-weight:normal;" class="label label-success"
href="{{ route('tags.show',tag.id) }}">
{% for month,tags in months %}
<h5>{{ month }}</h5>
<p style="line-height: 200%;">
{% for tag in tags %}
<span style="display: inline;"><a style="font-size:100%;font-weight:normal;" class="label label-success"
href="{{ route('tags.show',tag.id) }}">
{% if tag.tagMode == 'nothing' %}
<i class="fa fa-fw fa-tag"></i>
{% endif %}
{% if tag.tagMode == 'balancingAct' %}
<i class="fa fa-fw fa-refresh"></i>
{% endif %}
{% if tag.tagMode == 'advancePayment' %}
<i class="fa fa-fw fa-sort-numeric-desc"></i>
{% endif %}
{{ tag.tag }}</a>
{% if tag.tagMode == 'balancingAct' %}
<i class="fa fa-fw fa-refresh"></i>
{% endif %}
{% if tag.tagMode == 'advancePayment' %}
<i class="fa fa-fw fa-sort-numeric-desc"></i>
{% endif %}
{{ tag.tag }}</a>
</span>
{% endfor %}
</p>
{% endfor %}
</p>
{% endfor %}
{% endfor %}
{% endfor %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% block scripts %}
+13 -9
View File
@@ -5,18 +5,22 @@
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
{% include 'list.journals-tasker' %}
{% if journals.count == 0 %}
{% include 'partials.empty' with {what: what, type: 'transactions',route: route('transactions.create', [what])} %}
{% else %}
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
{% include 'list.journals-tasker' %}
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/ff/transactions/list.js"></script>
+19 -9
View File
@@ -5,18 +5,28 @@
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
{% include 'list.journals-tasker' %}
{% if journals.count == 0 %}
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<p class="well">
{{ 'no_transactions_in_period'|_ }}
</p>
</div>
</div>
{% else %}
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
{% include 'list.journals-tasker' %}
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/ff/transactions/list.js"></script>
+32 -26
View File
@@ -5,40 +5,46 @@
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-10 col-md-10 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
{% include 'list.journals-tasker' %}
<p>
<i class="fa fa-calendar" aria-hidden="true"></i>
<a href="{{ route('transactions.index.all', [what]) }}">
{{ 'show_all_no_filter'|_ }}
</a>
</p>
</div>
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% for entry in entries %}
{% if journals.count == 0 %}
{% include 'partials.empty' with {what: what, type: 'transactions',route: route('transactions.create', [what])} %}
{% else %}
<div class="row">
<div class="col-lg-10 col-md-10 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
<a href="{{ route('transactions.index.date',[what,entry[0]]) }}">{{ entry[1] }}</a>
</h3>
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
&nbsp;
{% include 'list.journals-tasker' %}
<p>
<i class="fa fa-calendar" aria-hidden="true"></i>
<a href="{{ route('transactions.index.all', [what]) }}">
{{ 'show_all_no_filter'|_ }}
</a>
</p>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% for entry in entries %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
<a href="{{ route('transactions.index.date',[what,entry[0]]) }}">{{ entry[1] }}</a>
</h3>
</div>
<div class="box-body">
&nbsp;
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/ff/transactions/list.js"></script>