From fb5d9117aa8c5aa35010f2c5a1b8ef21e1572217 Mon Sep 17 00:00:00 2001 From: s-ohnishi Date: Tue, 14 May 2024 23:39:23 +0900 Subject: [PATCH 1/2] Using the TagFactory class Changed the description in .volt from Tag class to TagFactory class --- themes/invo/companies/edit.volt | 6 ++-- themes/invo/companies/index.volt | 31 +++++++++-------- themes/invo/companies/new.volt | 26 +++++++------- themes/invo/companies/search.volt | 50 +++++++++++++------------- themes/invo/contact/index.volt | 10 +++--- themes/invo/errors/show401.volt | 2 +- themes/invo/errors/show404.volt | 2 +- themes/invo/errors/show500.volt | 2 +- themes/invo/index.volt | 4 +-- themes/invo/index/index.volt | 2 +- themes/invo/invoices/profile.volt | 12 +++---- themes/invo/layouts/main.volt | 24 ++++++------- themes/invo/layouts/patial_tabs.volt | 14 ++++---- themes/invo/products/edit.volt | 26 +++++++------- themes/invo/products/index.volt | 30 ++++++++-------- themes/invo/products/new.volt | 26 +++++++------- themes/invo/products/search.volt | 52 +++++++++++++--------------- themes/invo/producttypes/edit.volt | 30 ++++++++-------- themes/invo/producttypes/index.volt | 8 ++--- themes/invo/producttypes/new.volt | 6 ++-- themes/invo/producttypes/search.volt | 44 +++++++++++------------ themes/invo/register/index.volt | 4 +-- themes/invo/session/index.volt | 14 ++++---- 23 files changed, 210 insertions(+), 215 deletions(-) diff --git a/themes/invo/companies/edit.volt b/themes/invo/companies/edit.volt index de141d22..a999cf57 100644 --- a/themes/invo/companies/edit.volt +++ b/themes/invo/companies/edit.volt @@ -1,10 +1,10 @@ -
+ diff --git a/themes/invo/companies/index.volt b/themes/invo/companies/index.volt index cd24dec5..79579887 100644 --- a/themes/invo/companies/index.volt +++ b/themes/invo/companies/index.volt @@ -3,23 +3,24 @@

Search companies

- {{ link_to("companies/new", "Create Companies", "class": "btn btn-primary") }} + {{ tag.a(url('companies/new'), 'Create Companies', ['class':'btn btn-primary']) }}
- - {% for element in form %} - {% if is_a(element, 'Phalcon\Forms\Element\Hidden') %} - {{ element }} - {% else %} -
- {{ element.label() }} -
- {{ element.setAttribute("class", "form-control") }} -
-
- {% endif %} - {% endfor %} + +{% for element in form %} + {% if is_a(element, 'Phalcon\Forms\Element\Hidden') %} + {{ element }} + {% else %} - {{ submit_button("Search", "class": "btn btn-primary") }} +
+ {{ element.label() }} +
+ {{ element.setAttribute("class", "form-control") }} +
+
+ {% endif %} +{% endfor %} + + {{ tag.inputSubmit('Search', null, ['class': 'btn btn-primary', 'id': null, 'name': null, 'value': 'Search']) }}
diff --git a/themes/invo/companies/new.volt b/themes/invo/companies/new.volt index 406376b1..73fef3b5 100644 --- a/themes/invo/companies/new.volt +++ b/themes/invo/companies/new.volt @@ -1,23 +1,23 @@ -
+
- {% for element in form %} - {% if is_a(element, 'Phalcon\Forms\Element\Hidden') %} - {{ element }} - {% else %} -
- {{ element.label() }} - {{ element.render(['class': 'form-control']) }} -
- {% endif %} - {% endfor %} +{% for element in form %} + {% if is_a(element, 'Phalcon\Forms\Element\Hidden') %} + {{ element }} + {% else %} +
+ {{ element.label() }} + {{ element.render(['class': 'form-control']) }} +
+ {% endif %} +{% endfor %}
diff --git a/themes/invo/companies/search.volt b/themes/invo/companies/search.volt index a45552b1..75c64d9d 100644 --- a/themes/invo/companies/search.volt +++ b/themes/invo/companies/search.volt @@ -1,16 +1,16 @@ {% for company in page.items %} - {% if loop.first %} - - +{% if loop.first %} +
+ @@ -18,35 +18,33 @@ - - {% endif %} + - - - - - - - - - - - {% if loop.last %} - +{% endif %} + + + + + + + + + +{% if loop.last %} - -
Id NameAddress City
{{ company.id }}{{ company.name }}{{ company.telephone }}{{ company.address }}{{ company.city }}{{ link_to("companies/edit/" ~ company.id, ' Edit', "class": "btn btn-default") }}{{ link_to("companies/delete/" ~ company.id, ' Delete', "class": "btn btn-default") }}
{{ company.id }}{{ company.name }}{{ company.telephone }}{{ company.address }}{{ company.city }}{{ tag.a(url('companies/edit/' ~ company.id), " Edit", ['class': 'btn btn-default'], true) }}{{ tag.a(url('companies/delete/' ~ company.id), " Delete", ['class': 'btn btn-default'], true) }}
- {{ link_to("companies/search", ' First', "class": "btn btn-default") }} - {{ link_to("companies/search?page=" ~ page.getPrevious(), ' Previous', "class": "btn btn-default") }} - {{ link_to("companies/search?page=" ~ page.getNext(), ' Next', "class": "btn btn-default") }} - {{ link_to("companies/search?page=" ~ page.getLast(), ' Last', "class": "btn btn-default") }} + {{ tag.a(url('companies/search'), " First", ['class': 'btn btn-default'], true) }} + {{ tag.a(url('companies/search?page=') ~ page.getPrevious(), " Previous", ['class': 'btn btn-default'], true) }} + {{ tag.a(url('companies/search?page=') ~ page.getNext(), " Next", ['class': 'btn btn-default'], true) }} + {{ tag.a(url('companies/search?page=') ~ page.getLast(), " Last", ['class': 'btn btn-default'], true) }} {{ page.getCurrent() }}/{{ page.getLast() }}
- {% endif %} + + +{% endif %} {% else %} No companies were found... {% endfor %} diff --git a/themes/invo/contact/index.volt b/themes/invo/contact/index.volt index de025218..87e15b5e 100644 --- a/themes/invo/contact/index.volt +++ b/themes/invo/contact/index.volt @@ -4,22 +4,22 @@

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.

-
+
{{ form.label('name') }} - {{ form.render('name', ['class': 'form-control']) }} + {{ form.render('name', ['class': 'form-control']) }}
{{ form.label('email') }} - {{ form.render('email', ['class': 'form-control']) }} + {{ form.render('email', ['class': 'form-control']) }}
{{ form.label('comments') }} - {{ form.render('comments', ['class': 'form-control']) }} + {{ form.render('comments', ['class': 'form-control']) }}
- {{ submit_button('Send', 'class': 'btn btn-primary btn-large') }} + {{ tag.inputSubmit('Save', 'Save', ['class': 'btn btn-primary btn-large']) }}
diff --git a/themes/invo/errors/show401.volt b/themes/invo/errors/show401.volt index ad326bf9..790d2a34 100644 --- a/themes/invo/errors/show401.volt +++ b/themes/invo/errors/show401.volt @@ -1,5 +1,5 @@

Unauthorized

You don't have access to this option. Contact an administrator

-

{{ link_to('index', 'Home', 'class': 'btn btn-primary') }}

+

{{ tag.a(url('index'), 'Home', ['class':'btn btn-primary']) }}

diff --git a/themes/invo/errors/show404.volt b/themes/invo/errors/show404.volt index 0b260376..47592394 100644 --- a/themes/invo/errors/show404.volt +++ b/themes/invo/errors/show404.volt @@ -1,5 +1,5 @@

Page not found

Sorry, you have accessed a page that does not exist or was moved

-

{{ link_to('index', 'Home', 'class': 'btn btn-primary') }}

+

{{ tag.a(url('index'), 'Home', ['class':'btn btn-primary']) }}

diff --git a/themes/invo/errors/show500.volt b/themes/invo/errors/show500.volt index b1e4cd38..e0d928d7 100644 --- a/themes/invo/errors/show500.volt +++ b/themes/invo/errors/show500.volt @@ -1,5 +1,5 @@

Internal Error

Something went wrong, if the error continue please contact us

-

{{ link_to('index', 'Home', 'class': 'btn btn-primary') }}

+

{{ tag.a(url('index'), 'Home', ['class':'btn btn-primary']) }}

diff --git a/themes/invo/index.volt b/themes/invo/index.volt index dcd391a6..496d9652 100644 --- a/themes/invo/index.volt +++ b/themes/invo/index.volt @@ -2,7 +2,7 @@ - {{ title() }} + {{ title('') }} @@ -18,6 +18,6 @@ -{{ javascript_include('js/utils.js') }} +{{ tag.script('').add(url('js/utils.js'), ['type':null]) }} diff --git a/themes/invo/index/index.volt b/themes/invo/index/index.volt index 5104f5a4..d0308f4c 100644 --- a/themes/invo/index/index.volt +++ b/themes/invo/index/index.volt @@ -2,7 +2,7 @@

Welcome to INVO

INVO is a revolutionary application to create invoices online for free. Receive online payments from your clients and improve your cash flow

-

{{ link_to('register', 'Try it for Free »', 'class': 'btn btn-primary btn-large btn-success') }}

+

{{ tag.a(url('register'), 'Try it for Free »', ['class':'btn btn-primary btn-large btn-success'], true) }}

diff --git a/themes/invo/invoices/profile.volt b/themes/invo/invoices/profile.volt index 2f39e5d3..773c8965 100644 --- a/themes/invo/invoices/profile.volt +++ b/themes/invo/invoices/profile.volt @@ -1,22 +1,22 @@

Update your profile

-
+
- {{ form.label('name', ['class': 'control-label']) }} - {{ form.render('name', ['class': 'form-control']) }} + {{ form.label('name', ['class': 'control-label']) }} + {{ form.render('name', ['class': 'form-control']) }}
Warning! Please enter your full name
- {{ form.label('email', ['class': 'control-label']) }} - {{ form.render('email', ['class': 'form-control']) }} + {{ form.label('email', ['class': 'control-label']) }} + {{ form.render('email', ['class': 'form-control']) }}
Warning! Please enter your email
- {{ link_to('invoices/index', 'Cancel', "class": "btn btn-default") }} + {{ tag.a(url('invoices/index'), 'Cancel', ['class':'btn btn-default']) }}
diff --git a/themes/invo/layouts/main.volt b/themes/invo/layouts/main.volt index e4cbd371..60764a50 100644 --- a/themes/invo/layouts/main.volt +++ b/themes/invo/layouts/main.volt @@ -22,30 +22,30 @@ ] %}
- {{ link_to("producttypes/new", "Create product types", "class": "btn btn-primary") }} + {{ tag.a(url('producttypes/new'), 'Create product types', ['class':'btn btn-primary']) }}
- {{ numeric_field("id", "size": 10, "maxlength": 10, "class": "form-control") }} + {{ tag.inputNumeric('id', '', ['size': 10, 'maxlength': 10, 'class': 'form-control']) }}
- {{ text_field("name", "size": 24, "maxlength": 70, "class": "form-control") }} + {{ tag.inputText('name', '', ['size': 24, 'maxlength': 70, 'class': 'form-control']) }}
- {{ submit_button("Search", "class": "btn btn-primary") }} + {{ tag.inputSubmit('Search', null, ['class': 'btn btn-primary', 'id': null, 'name': null, 'value': 'Search']) }}
diff --git a/themes/invo/producttypes/new.volt b/themes/invo/producttypes/new.volt index 3c6ba106..7c1932c0 100644 --- a/themes/invo/producttypes/new.volt +++ b/themes/invo/producttypes/new.volt @@ -1,10 +1,10 @@
@@ -13,7 +13,7 @@
- {{ text_field("name", "size": 24, "maxlength": 70) }} + {{ tag.inputText('name', '', ['size': 24, 'maxlength': 70]) }}
diff --git a/themes/invo/producttypes/search.volt b/themes/invo/producttypes/search.volt index 3bbb4571..f37a675f 100644 --- a/themes/invo/producttypes/search.volt +++ b/themes/invo/producttypes/search.volt @@ -1,45 +1,43 @@ {% for producttype in page.items %} - {% if loop.first %} - - +{% if loop.first %} +
+ - - - {% endif %} - - - - - - - {% if loop.last %} - - + + + {% endif %} + + + + + + + {% if loop.last %} - -
Id Name
{{ producttype.id }}{{ producttype.name }}{{ link_to("producttypes/edit/" ~ producttype.id, ' Edit', "class": "btn btn-default") }}{{ link_to("producttypes/delete/" ~ producttype.id, ' Delete', "class": "btn btn-default") }}
{{ producttype.id }}{{ producttype.name }}{{ tag.a(url('producttypes/edit/' ~ producttype.id), " Edit", ['class': 'btn btn-default'], true) }}{{ tag.a(url('producttypes/delete/' ~ producttype.id), " Delete", ['class': 'btn btn-default'], true) }}
- {{ link_to("producttypes/search", ' First', "class": "btn") }} - {{ link_to("producttypes/search?page=" ~ page.getPrevious(), ' Previous', "class": "btn") }} - {{ link_to("producttypes/search?page=" ~ page.getNext(), ' Next', "class": "btn") }} - {{ link_to("producttypes/search?page=" ~ page.getLast(), ' Last', "class": "btn") }} + {{ tag.a(url('producttypes/search'), " First", ['class': 'btn'], true) }} + {{ tag.a(url('producttypes/search?page=') ~ page.getPrevious(), " Previous", ['class': 'btn'], true) }} + {{ tag.a(url('producttypes/search?page=') ~ page.getNext(), " Next", ['class': 'btn'], true) }} + {{ tag.a(url('producttypes/search?page=') ~ page.getLast(), " Last", ['class': 'btn'], true) }} {{ page.getCurrent() }}/{{ page.getLast() }}
+ + {% endif %} {% else %} No product types are recorded diff --git a/themes/invo/register/index.volt b/themes/invo/register/index.volt index ed185c95..7d40f074 100644 --- a/themes/invo/register/index.volt +++ b/themes/invo/register/index.volt @@ -2,7 +2,7 @@

Register for INVO

-
+
{{ form.label('name', ['class': 'control-label']) }} @@ -59,7 +59,7 @@
- {{ submit_button('Register', 'class': 'btn btn-primary', 'onclick': 'return SignUp.validate();') }} + {{ tag.inputSubmit('Register', null, ['class': 'btn btn-primary', 'id': null, 'name': null, 'value': 'Register', 'onclick': 'return SignUp.validate();']) }}

By signing up, you accept terms of use and privacy policy.

diff --git a/themes/invo/session/index.volt b/themes/invo/session/index.volt index 0a7e4198..8ab0b8fa 100644 --- a/themes/invo/session/index.volt +++ b/themes/invo/session/index.volt @@ -4,22 +4,22 @@

Log In

- +
- {{ form.label('email', ['class': 'control-label']) }} + {{ form.label('email', ['class': 'control-label']) }}
- {{ form.render('email', ['class': 'form-control']) }} + {{ form.render('email', ['class': 'form-control']) }}
- {{ form.label('password', ['class': 'control-label']) }} + {{ form.label('password', ['class': 'control-label']) }}
- {{ form.render('password', ['class': 'form-control']) }} + {{ form.render('password', ['class': 'form-control']) }}
- {{ submit_button('Login', 'class': 'btn btn-primary btn-large') }} + {{ tag.inputSubmit('Login', null, ['class': 'btn btn-primary btn-large', 'id': null, 'name': null, 'value': 'Login']) }}
@@ -38,7 +38,7 @@
- {{ link_to('register', 'Sign Up', 'class': 'btn btn-primary btn-large btn-success') }} + {{ tag.a(url('register'), 'Sign Up', ['class':'btn btn-primary btn-large btn-success']) }}
From 6d6d2ae577369209cb7a5eaef0b69469a252c39b Mon Sep 17 00:00:00 2001 From: s-ohnishi Date: Wed, 15 May 2024 00:05:25 +0900 Subject: [PATCH 2/2] Using the url() method In order to increase the flexibility of the deployment destination, use url() instead of writing it directly. --- themes/invo/layouts/main.volt | 4 ++-- themes/invo/layouts/patial_tabs.volt | 12 ++++++------ themes/invo/producttypes/index.volt | 2 +- themes/invo/producttypes/new.volt | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/themes/invo/layouts/main.volt b/themes/invo/layouts/main.volt index 60764a50..4ac62c3e 100644 --- a/themes/invo/layouts/main.volt +++ b/themes/invo/layouts/main.volt @@ -42,9 +42,9 @@ diff --git a/themes/invo/layouts/patial_tabs.volt b/themes/invo/layouts/patial_tabs.volt index 0c0f6f3a..ba19a7c8 100644 --- a/themes/invo/layouts/patial_tabs.volt +++ b/themes/invo/layouts/patial_tabs.volt @@ -3,38 +3,38 @@ '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' ] ] %}