Skip to content
Merged

Dev #15

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
Empty file modified .env.example
100644 → 100755
Empty file.
Empty file modified .github/workflows/phpapp.yml
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ database/*
www/static/*
*.pid
.env
data/session/*
data/session/*
node_modules
Empty file modified CODE_OF_CONDUCT.md
100644 → 100755
Empty file.
Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified LICENSE.md
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

```bash
composer install
npm run build
```

4. Run the installer:
Expand Down
3 changes: 0 additions & 3 deletions app/controller/catalog/components.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ public function index() {
$this->meta->setTitle($this->language->get('meta_title'));
$this->meta->setDescription($this->language->get('meta_description'));

$this->response->addStyle('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css');
$this->response->addScript('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js');

$classes = scandir(DIR_CORE . 'classes');

$this->data['classes'] = array();
Expand Down
Empty file modified app/controller/catalog/csrf_protection.php
100644 → 100755
Empty file.
Empty file modified app/controller/catalog/pagination.php
100644 → 100755
Empty file.
Empty file modified app/controller/common/footer.php
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions app/controller/common/header.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public function index() {
$this->data['meta'] = $this->meta->getMetaTags();

$this->data['styles'] = $this->response->getStyles();

$this->response->addScript('/assets/js/app.js');

$scripts = $this->response->getScripts();

Expand All @@ -18,9 +20,7 @@ public function index() {

$this->data['menu'] = $this->load->controller('common/menu');

$this->response->addStyle('https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css');
$this->response->addStyle('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');
$this->response->addStyle($this->staticfile->getUri('css/style.css'));
$this->response->addStyle('/assets/css/app.css');

$this->data['styles'] = $this->response->getStyles();

Expand Down
Empty file modified app/controller/common/menu.php
100644 → 100755
Empty file.
Empty file modified app/controller/common/pagination.php
100644 → 100755
Empty file.
3 changes: 0 additions & 3 deletions app/controller/error/not_found.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ public function index() {

$this->data['heading_title'] = $this->language->get('heading_title');

$this->response->addStyle('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css');
$this->response->addScript('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js');

$this->data['header'] = $this->load->controller('common/header');

$this->data['footer'] = $this->load->controller('common/footer');
Expand Down
Empty file modified app/controller/index.php
100644 → 100755
Empty file.
Empty file modified app/language/en/catalog/components.php
100644 → 100755
Empty file.
Empty file modified app/language/en/catalog/csrf_protection.php
100644 → 100755
Empty file.
Empty file modified app/language/en/catalog/pagination.php
100644 → 100755
Empty file.
Empty file modified app/language/en/common/menu.php
100644 → 100755
Empty file.
Empty file modified app/language/en/en.php
100644 → 100755
Empty file.
Empty file modified app/language/en/error/not_found.php
100644 → 100755
Empty file.
Empty file modified app/model/demo/demo.php
100644 → 100755
Empty file.
43 changes: 26 additions & 17 deletions app/view/catalog/components.twig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
{{ header }}
<div class="container my-5">
<h1>{{ heading_title }}</h1>
<p>{{ text_help }}</p>
<div class="container mx-auto px-4 py-8">
<h1 class="text-4xl font-bold mb-4">{{ heading_title }}</h1>
<p class="text-lg mb-6">{{ text_help }}</p>

<div class="mb-4 bg-light p-4 rounded-3">
<h2>{{ text_classes }}</h2>
{% for name, class in classes %}
<h4 class="mt-4">{{ name }}</h4>
<div class="mb-4">
<pre><code class="lang-json">{{ class }}</code></pre>
<div class="card bg-base-200 shadow-xl mb-6">
<div class="card-body">
<h2 class="card-title text-2xl mb-4">{{ text_classes }}</h2>
{% for name, class in classes %}
<div class="mb-6">
<h4 class="text-xl font-semibold mb-3">{{ name }}</h4>
<div class="mockup-code">
<pre data-prefix=">" class="text-success"><code class="language-json">{{ class }}</code></pre>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
<div class="mb-4 bg-light p-4 rounded-3">
<h2>{{ text_libraries }}</h2>
{% for name, library in libraries %}
<h4 class="mt-4">{{ name }}</h4>
<div class="mb-4">
<pre><code class="lang-json">{{ library }}</code></pre>

<div class="card bg-base-200 shadow-xl mb-6">
<div class="card-body">
<h2 class="card-title text-2xl mb-4">{{ text_libraries }}</h2>
{% for name, library in libraries %}
<div class="mb-6">
<h4 class="text-xl font-semibold mb-3">{{ name }}</h4>
<div class="mockup-code">
<pre data-prefix=">" class="text-success"><code class="language-json">{{ library }}</code></pre>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>

</div>
Expand Down
80 changes: 57 additions & 23 deletions app/view/catalog/csrf_protection.twig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,30 +1,64 @@
{{ header }}
<div class="container my-5">
<h1>{{ heading_title }}</h1>
<p>{{ text_help }}</p>
<div class="container mx-auto px-4 py-8">
<h1 class="text-4xl font-bold mb-4">{{ heading_title }}</h1>
<p class="text-lg mb-6">{{ text_help }}</p>

<form action="{{ action }}" method="post" enctype="multipart/form-data">
{{ csrf }}
<fieldset>
<legend>{{ text_form }}</legend>
<div class="form-floating mb-3">
<input type="email" name="email" value="{{ email }}" placeholder="{{ entry_email }}" class="form-control" required id="entry-email">
<label for="entry-email">{{ entry_email }}</label>

<div class="card bg-base-200 shadow-xl">
<div class="card-body">
<h2 class="card-title text-2xl mb-6">{{ text_form }}</h2>

<div class="form-control mb-4">
<label class="label" for="entry-email">
<span class="label-text">{{ entry_email }}</span>
</label>
<input
type="email"
name="email"
value="{{ email }}"
placeholder="{{ entry_email }}"
class="input input-bordered w-full"
required
id="entry-email"
>
</div>

<div class="form-control mb-6">
<label class="label" for="entry-password">
<span class="label-text">{{ entry_password }}</span>
</label>
<input
type="password"
name="password"
value="{{ password }}"
placeholder="{{ entry_password }}"
class="input input-bordered w-full"
required
id="entry-password"
>
</div>

<div class="flex flex-wrap items-center gap-4">
<button type="submit" class="btn">
{{ button_submit }}
</button>

{% if error %}
<div class="alert alert-error py-2 px-4">
<span class="font-semibold">{{ error }}</span>
</div>
{% endif %}

{% if success %}
<div class="alert alert-success py-2 px-4">
<span class="font-semibold">{{ success }}</span>
</div>
{% endif %}
</div>
</div>
<div class="form-floating mb-3">
<input type="password" name="password" value="{{ password }}" placeholder="{{ entry_password }}" class="form-control" required id="entry-password">
<label for="entry-password">{{ entry_password }}</label>
</div>
<div class="hstack gap-3">
<button type="submit" class="btn btn-warning btn-lg">{{ button_submit }}</button>
{% if error %}
<strong class="text-danger">{{ error }}</strong>
{% endif %}
{% if success %}
<strong class="text-success">{{ success }}</strong>
{% endif %}
</div>
</fieldset>
</div>
</form>
{{ pagination }}
</div>
{{ footer }}
28 changes: 17 additions & 11 deletions app/view/catalog/pagination.twig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{{ header }}
<div class="container my-5">
<h1>{{ heading_title }}</h1>
<div class="table-responsive">
<table class="table table-bordered table-hover">
<div class="container mx-auto px-4 py-8">
<h1 class="text-4xl font-bold mb-6">{{ heading_title }}</h1>

<div class="overflow-x-auto">
<table class="table table-zebra w-full">
<thead>
<tr>
<td colspan="3">{{ total }}( {{ from }} - {{ to }} )</td>
<tr class="bg-base-200">
<th colspan="3" class="text-base font-semibold">
{{ total }} ({{ from }} - {{ to }})
</th>
</tr>
<tr>
<td class="text-center">{{ column_post_id }}</td>
<td class="text-left">{{ column_hash }}</td>
<td class="text-left">{{ column_created_at }}</td>
<th class="text-center">{{ column_post_id }}</th>
<th class="text-left">{{ column_hash }}</th>
<th class="text-left">{{ column_created_at }}</th>
</tr>
</thead>
<tbody>
{% for post in posts %}
<tr>
<tr class="hover">
<td class="text-center">{{ post.post_id }}</td>
<td class="text-left">{{ post.hash }}</td>
<td class="text-left">{{ post.created_at }}</td>
Expand All @@ -24,6 +27,9 @@
</tbody>
</table>
</div>
{{ pagination }}

<div class="mt-6">
{{ pagination }}
</div>
</div>
{{ footer }}
Empty file modified app/view/common/footer.twig
100644 → 100755
Empty file.
Empty file modified app/view/common/header.twig
100644 → 100755
Empty file.
39 changes: 23 additions & 16 deletions app/view/common/menu.twig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
<nav class="navbar navbar-expand-lg navbar-light bg-warning">
<div class="container">
<a class="navbar-brand" href="{{ home }}">PHPapp</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
{% for link in links %}
<li class="nav-item">
<a class="nav-link" href="{{ link.href }}">{{ link.title }}</a>
</li>
{% endfor %}
</ul>
</div>
<div class="navbar bg-base-100 shadow-sm">
<div class="navbar-start">
<div class="dropdown">
<div tabindex="0" role="button" class="btn btn-ghost lg:hidden">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" /> </svg>
</div>
<ul
tabindex="-1"
class="menu menu-sm dropdown-content bg-base-100 rounded-box z-1 mt-3 w-52 p-2 shadow">
{% for link in links %}
<li><a href="{{ link.href }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
</div>
</nav>
<a href="{{ home }}" class="btn btn-ghost text-xl">{{ heading_title }}</a>
</div>
<div class="navbar-center hidden lg:flex">
<ul class="menu menu-horizontal px-1">
{% for link in links %}
<li><a href="{{ link.href }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
</div>
</div>
49 changes: 34 additions & 15 deletions app/view/common/pagination.twig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
<nav aria-label="Page navigation example">
<ul class="pagination">
<nav aria-label="Page navigation">
<div class="join">
{% if first %}
<li class="page-item"><a class="page-link" href="{{ first }}" aria-label="First"><span aria-hidden="true"><i class="bi bi-chevron-double-left"></i></span></a></li>
<a href="{{ first }}" class="join-item btn btn-sm" aria-label="First">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-4">
<path fill-rule="evenodd" d="M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z" clip-rule="evenodd" />
</svg>
</a>
{% endif %}

{% if prev %}
<li class="page-item"><a class="page-link" href="{{ prev }}" aria-label="Previous"><span aria-hidden="true"><i class="bi bi-chevron-left"></i></span></a></li>
<a href="{{ prev }}" class="join-item btn btn-sm" aria-label="Previous">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-4">
<path fill-rule="evenodd" d="M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd" />
</svg>
</a>
{% endif %}

{% for page in pages %}
<li class="page-item">
{% if page.current %}
<span class="page-link active">{{ page.page }}</span>
{% else %}
<a class="page-link" href="{{ page.url }}">{{ page.page }}</a>
{% endif %}
</li>
{% if page.current %}
<button class="join-item btn btn-sm btn-active">{{ page.page }}</button>
{% else %}
<a href="{{ page.url }}" class="join-item btn btn-sm">{{ page.page }}</a>
{% endif %}
{% endfor %}

{% if next %}
<li class="page-item"><a class="page-link" href="{{ next }}" aria-label="Next"><span aria-hidden="true"><i class="bi bi-chevron-right"></i></span></a></li>
<a href="{{ next }}" class="join-item btn btn-sm" aria-label="Next">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-4">
<path fill-rule="evenodd" d="M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" />
</svg>
</a>
{% endif %}

{% if last %}
<li class="page-item"><a class="page-link" href="{{ last }}" aria-label="Last"><span aria-hidden="true"><i class="bi bi-chevron-double-right"></i></span></a></li>
<a href="{{ last }}" class="join-item btn btn-sm" aria-label="Last">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-4">
<path fill-rule="evenodd" d="M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z" clip-rule="evenodd" />
</svg>
</a>
{% endif %}
</ul>
</nav>
</div>
</nav>

19 changes: 10 additions & 9 deletions app/view/error/not_found.twig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{{ header }}
<section class="py-5">
<div class="container">
<h1>{{ heading_title }}</h1>
<pre><code class="language-json">
{
<section class="py-12">
<div class="container mx-auto px-4">
<h1 class="text-4xl font-bold mb-6">{{ heading_title }}</h1>

<div class="mockup-code">
<pre data-prefix=">" class="text-warning"><code class="language-json">{
"controller": "{{ controller }}",
"action": "{{ action }}"
"action": "{{ action }}",
"message": "{{ message }}"
}
</code></pre>
}</code></pre>
</div>
</div>
</section>
{{ footer }}
{{ footer }}
Loading