Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to increase compatibility with v5 #113

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions themes/invo/companies/edit.volt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<form action="/companies/save" role="form" method="post">
<form action="{{ url('companies/save') }}" role="form" method="post">
<ul class="pager">
<li class="previous pull-left">
{{ link_to("companies", "&larr; Go Back") }}
{{ tag.a(url('companies'), '&larr; Go Back', [], true) }}
</li>
<li class="pull-right">
{{ submit_button("Save", "class": "btn btn-success") }}
{{ tag.inputSubmit('Save', 'Save', ['class': 'btn btn-success']) }}
</li>
</ul>

Expand Down
31 changes: 16 additions & 15 deletions themes/invo/companies/index.volt
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
<h2>Search companies</h2>
</div>
<div class="col-xs-12 col-md-6 text-right">
{{ link_to("companies/new", "Create Companies", "class": "btn btn-primary") }}
{{ tag.a(url('companies/new'), 'Create Companies', ['class':'btn btn-primary']) }}
</div>
</div>

<form action="/companies/search" role="form" method="post">
{% for element in form %}
{% if is_a(element, 'Phalcon\Forms\Element\Hidden') %}
{{ element }}
{% else %}
<div class="form-group">
{{ element.label() }}
<div class="controls">
{{ element.setAttribute("class", "form-control") }}
</div>
</div>
{% endif %}
{% endfor %}
<form action="{{ url('companies/search') }}" role="form" method="post">
{% for element in form %}
{% if is_a(element, 'Phalcon\Forms\Element\Hidden') %}
{{ element }}
{% else %}

{{ submit_button("Search", "class": "btn btn-primary") }}
<div class="form-group">
{{ element.label() }}
<div class="controls">
{{ element.setAttribute("class", "form-control") }}
</div>
</div>
{% endif %}
{% endfor %}

{{ tag.inputSubmit('Search', null, ['class': 'btn btn-primary', 'id': null, 'name': null, 'value': 'Search']) }}
</form>
26 changes: 13 additions & 13 deletions themes/invo/companies/new.volt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<form action="/companies/create" role="form" method="post">
<form action="{{ url('companies/create') }}" role="form" method="post">
<ul class="pager">
<li class="previous pull-left">
{{ link_to("products", "&larr; Go Back") }}
{{ tag.a(url('companies'), '&larr; Go Back', [], true) }}
</li>
<li class="pull-right">
{{ submit_button("Save", "class": "btn btn-success") }}
{{ tag.inputSubmit('Save', 'Save', ['class': 'btn btn-success', 'id':null, 'name':null]) }}
</li>
</ul>

<fieldset>
{% for element in form %}
{% if is_a(element, 'Phalcon\Forms\Element\Hidden') %}
{{ element }}
{% else %}
<div class="form-group">
{{ element.label() }}
{{ element.render(['class': 'form-control']) }}
</div>
{% endif %}
{% endfor %}
{% for element in form %}
{% if is_a(element, 'Phalcon\Forms\Element\Hidden') %}
{{ element }}
{% else %}
<div class="form-group">
{{ element.label() }}
{{ element.render(['class': 'form-control']) }}
</div>
{% endif %}
{% endfor %}
</fieldset>
</form>
50 changes: 24 additions & 26 deletions themes/invo/companies/search.volt
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
<ul class="pager">
<li class="previous pull-left">
{{ link_to("companies/index", "&larr; Go Back") }}
{{ tag.a(url('companies'), '&larr; Go Back', [], true) }}
</li>
<li class="pull-right">
{{ link_to("companies/new", "Create companies") }}
{{ tag.a(url('companies/new'), 'Create companies') }}
</li>
</ul>

{% for company in page.items %}
{% if loop.first %}
<table class="table table-bordered table-striped" align="center">
<thead>
{% if loop.first %}
<table class="table table-bordered table-striped" align="center">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Telephone</th>
<th>Address</th>
<th>City</th>
</tr>
</thead>
{% endif %}
</thead>
<tbody>
<tr>
<td>{{ company.id }}</td>
<td>{{ company.name }}</td>
<td>{{ company.telephone }}</td>
<td>{{ company.address }}</td>
<td>{{ company.city }}</td>
<td width="7%">{{ link_to("companies/edit/" ~ company.id, '<i class="glyphicon glyphicon-edit"></i> Edit', "class": "btn btn-default") }}</td>
<td width="7%">{{ link_to("companies/delete/" ~ company.id, '<i class="glyphicon glyphicon-remove"></i> Delete', "class": "btn btn-default") }}</td>
</tr>
</tbody>
{% if loop.last %}
<tbody>
{% endif %}
<tr>
<td>{{ company.id }}</td>
<td>{{ company.name }}</td>
<td>{{ company.telephone }}</td>
<td>{{ company.address }}</td>
<td>{{ company.city }}</td>
<td width="7%">{{ tag.a(url('companies/edit/' ~ company.id), "<i class=\"glyphicon glyphicon-edit\"></i> Edit", ['class': 'btn btn-default'], true) }}</td>
<td width="7%">{{ tag.a(url('companies/delete/' ~ company.id), "<i class=\"glyphicon glyphicon-remove\"></i> Delete", ['class': 'btn btn-default'], true) }}</td>
</tr>
{% if loop.last %}
<tr>
<td colspan="7" align="right">
<div class="btn-group">
{{ link_to("companies/search", '<i class="icon-fast-backward"></i> First', "class": "btn btn-default") }}
{{ link_to("companies/search?page=" ~ page.getPrevious(), '<i class="icon-step-backward"></i> Previous', "class": "btn btn-default") }}
{{ link_to("companies/search?page=" ~ page.getNext(), '<i class="icon-step-forward"></i> Next', "class": "btn btn-default") }}
{{ link_to("companies/search?page=" ~ page.getLast(), '<i class="icon-fast-forward"></i> Last', "class": "btn btn-default") }}
{{ tag.a(url('companies/search'), "<i class=\"icon-fast-backward\"></i> First", ['class': 'btn btn-default'], true) }}
{{ tag.a(url('companies/search?page=') ~ page.getPrevious(), "<i class=\"icon-step-backward\"></i> Previous", ['class': 'btn btn-default'], true) }}
{{ tag.a(url('companies/search?page=') ~ page.getNext(), "<i class=\"icon-step-forward\"></i> Next", ['class': 'btn btn-default'], true) }}
{{ tag.a(url('companies/search?page=') ~ page.getLast(), "<i class=\"icon-fast-forward\"></i> Last", ['class': 'btn btn-default'], true) }}
<span class="help-inline">{{ page.getCurrent() }}/{{ page.getLast() }}</span>
</div>
</td>
</tr>
<tbody>
</table>
{% endif %}
<tbody>
</table>
{% endif %}
{% else %}
No companies were found...
{% endfor %}
10 changes: 5 additions & 5 deletions themes/invo/contact/index.volt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@

<p>Send us a message and let us know how we can help. Please be as descriptive as possible as it will help us serve you better.</p>

<form action="/contact/send" role="form" method="post">
<form action="{{ url('contact/send') }}" role="form" method="post">
<fieldset>
<div class="form-group">
{{ form.label('name') }}
{{ form.render('name', ['class': 'form-control']) }}
{{ form.render('name', ['class': 'form-control']) }}
</div>
<div class="form-group">
{{ form.label('email') }}
{{ form.render('email', ['class': 'form-control']) }}
{{ form.render('email', ['class': 'form-control']) }}
</div>
<div class="form-group">
{{ form.label('comments') }}
{{ form.render('comments', ['class': 'form-control']) }}
{{ form.render('comments', ['class': 'form-control']) }}
</div>
<div class="form-group">
{{ submit_button('Send', 'class': 'btn btn-primary btn-large') }}
{{ tag.inputSubmit('Save', 'Save', ['class': 'btn btn-primary btn-large']) }}
</div>
</fieldset>
</form>
2 changes: 1 addition & 1 deletion themes/invo/errors/show401.volt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="jumbotron">
<h1>Unauthorized</h1>
<p>You don't have access to this option. Contact an administrator</p>
<p>{{ link_to('index', 'Home', 'class': 'btn btn-primary') }}</p>
<p>{{ tag.a(url('index'), 'Home', ['class':'btn btn-primary']) }}</p>
</div>
2 changes: 1 addition & 1 deletion themes/invo/errors/show404.volt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="jumbotron">
<h1>Page not found</h1>
<p>Sorry, you have accessed a page that does not exist or was moved</p>
<p>{{ link_to('index', 'Home', 'class': 'btn btn-primary') }}</p>
<p>{{ tag.a(url('index'), 'Home', ['class':'btn btn-primary']) }}</p>
</div>
2 changes: 1 addition & 1 deletion themes/invo/errors/show500.volt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="jumbotron">
<h1>Internal Error</h1>
<p>Something went wrong, if the error continue please contact us</p>
<p>{{ link_to('index', 'Home', 'class': 'btn btn-primary') }}</p>
<p>{{ tag.a(url('index'), 'Home', ['class':'btn btn-primary']) }}</p>
</div>
4 changes: 2 additions & 2 deletions themes/invo/index.volt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
{{ title() }}
{{ title('') }}

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

Expand All @@ -18,6 +18,6 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>

<!-- Or you can include files via volt function -->
{{ javascript_include('js/utils.js') }}
{{ tag.script('').add(url('js/utils.js'), ['type':null]) }}
</body>
</html>
2 changes: 1 addition & 1 deletion themes/invo/index/index.volt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h1>Welcome to INVO</h1>
<p>INVO is a revolutionary application to create invoices online for free.
Receive online payments from your clients and improve your cash flow</p>
<p>{{ link_to('register', 'Try it for Free &raquo;', 'class': 'btn btn-primary btn-large btn-success') }}</p>
<p>{{ tag.a(url('register'), 'Try it for Free &raquo;', ['class':'btn btn-primary btn-large btn-success'], true) }}</p>
</div>

<div class="row">
Expand Down
12 changes: 6 additions & 6 deletions themes/invo/invoices/profile.volt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<h2 class="mb-3">Update your profile</h2>

<form action="/invoices/profile" role="form" method="post" id="profileForm">
<form action="{{ url('invoices/profile') }}" role="form" method="post" id="profileForm">
<div class="form-group">
{{ form.label('name', ['class': 'control-label']) }}
{{ form.render('name', ['class': 'form-control']) }}
{{ form.label('name', ['class': 'control-label']) }}
{{ form.render('name', ['class': 'form-control']) }}
<div class="alert alert-warning" id="name_alert">
<strong>Warning!</strong> Please enter your full name
</div>
</div>

<div class="form-group">
{{ form.label('email', ['class': 'control-label']) }}
{{ form.render('email', ['class': 'form-control']) }}
{{ form.label('email', ['class': 'control-label']) }}
{{ form.render('email', ['class': 'form-control']) }}
<div class="alert alert-warning" id="email_alert">
<strong>Warning!</strong> Please enter your email
</div>
</div>

<input type="button" value="Update" class="btn btn-primary btn-large btn-info" onclick="Profile.validate()">
{{ link_to('invoices/index', 'Cancel', "class": "btn btn-default") }}
{{ tag.a(url('invoices/index'), 'Cancel', ['class':'btn btn-default']) }}
</form>
28 changes: 14 additions & 14 deletions themes/invo/layouts/main.volt
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@
] %}

<nav class="navbar navbar-expand-lg navbar-dark bg-dark mb-3">
<a class="navbar-brand" href="/">INVO</a>
<a class="navbar-brand" href="{{ url('/') }}">INVO</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
{% for controller, menu in topMenu %}
{% if (session.has('auth') and menu['with_auth'] === true) or menu['with_auth'] === false %}
<li class="nav-item {% if controller == dispatcher.getControllerName()|lower %}active{% endif %}">
<a class="nav-link" href="{{ menu['uri'] }}">{{ menu['title'] }}</a>
</li>
{% endif %}
{% endfor %}
{% for controller, menu in topMenu %}
{% if (session.has('auth') and menu['with_auth'] === true) or menu['with_auth'] === false %}
<li class="nav-item {% if controller == dispatcher.getControllerName()|lower %}active{% endif %}">
<a class="nav-link" href="{{ url(menu['uri']) }}">{{ menu['title'] }}</a>
</li>
{% endif %}
{% endfor %}
</ul>

<div class="my-2 my-lg-0">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
{% if session.has('auth') %}
<a class="nav-link" href="/session/end">Log Out</a>
{% else %}
<a class="nav-link" href="/session/index">Log In/Sign Up</a>
{% endif %}
{% if session.has('auth') %}
<a class="nav-link" href="{{ url('session/end') }}">Log Out</a>
{% else %}
<a class="nav-link" href="{{ url('session/index') }}">Log In/Sign Up</a>
{% endif %}
</li>
</ul>
</div>
Expand All @@ -55,7 +55,7 @@

<div class="container">
{{ flash.output() }}
{{ content() }}
{{ content() }}
<hr>
<footer>
<p>&copy; Company {{ date('Y') }}</p>
Expand Down
24 changes: 12 additions & 12 deletions themes/invo/layouts/patial_tabs.volt
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@
'controller': 'invoices',
'action': 'index',
'title': 'Invoices',
'uri': '/invoices/index'
'uri': 'invoices/index'
],
[
'controller': 'companies',
'action': 'index',
'title': 'Companies',
'uri': '/companies/index'
'uri': 'companies/index'
],
[
'controller': 'products',
'action': 'index',
'title': 'Products',
'uri': '/products/index'
'uri': 'products/index'
],
[
'controller': 'producttypes',
'action': 'index',
'title': 'Product Types',
'uri': '/producttypes/index'
'uri': 'producttypes/index'
],
[
'controller': 'invoices',
'action': 'profile',
'title': 'Your Profile',
'uri': '/invoices/profile'
'uri': 'invoices/profile'
]
] %}

<ul class="nav nav-tabs mb-3">
{% for controller, tab in tabs %}
<li class="nav-item">
<a class="nav-link {% if tab['controller'] == dispatcher.getControllerName()|lower and tab['action'] == dispatcher.getActionName() %}active{% endif %}" href="{{ tab['uri'] }}">
{{ tab['title'] }}
</a>
</li>
{% endfor %}
{% for controller, tab in tabs %}
<li class="nav-item">
<a class="nav-link {% if tab['controller'] == dispatcher.getControllerName()|lower and tab['action'] == dispatcher.getActionName() %}active{% endif %}" href="{{ url(tab['uri']) }}">
{{ tab['title'] }}
</a>
</li>
{% endfor %}
</ul>
Loading
Loading