progress on home page

This commit is contained in:
Hesabix 2025-01-09 14:04:45 +00:00
parent f83ec9ba45
commit ab668caca9
12 changed files with 102 additions and 20 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/img/sp/raddata.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

View file

@ -12,9 +12,11 @@ use Symfony\Component\Routing\Attribute\Route;
class GeneralController extends AbstractController
{
#[Route('/', name: 'app_home')]
public function app_home(): Response
public function app_home(EntityManagerInterface $em): Response
{
return $this->render('general/home.html.twig');
return $this->render('general/home.html.twig', [
'posts' => $em->getRepository(Post::class)->findBycat('blog', 3)
]);
}
#[Route('/sitemap.xml', name: 'app_sitemap')]
@ -23,8 +25,8 @@ class GeneralController extends AbstractController
$response = new Response();
$response->headers->set('Content-Type', 'text/xml');
$posts = $em->getRepository(Post::class)->findAll();
return $this->render('general/sitemap.html.twig',[
'posts'=>$posts
],$response);
return $this->render('general/sitemap.html.twig', [
'posts' => $posts
], $response);
}
}

View file

@ -68,6 +68,9 @@ class Post
#[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'post', orphanRemoval: true)]
private Collection $comments;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $intro = null;
public function __construct()
{
$this->tree = new ArrayCollection();
@ -276,4 +279,16 @@ class Post
return $this;
}
public function getIntro(): ?string
{
return $this->intro;
}
public function setIntro(?string $intro): static
{
$this->intro = $intro;
return $this;
}
}

View file

@ -45,4 +45,16 @@ class PostRepository extends ServiceEntityRepository
->getOneOrNullResult()
;
}
public function findBycat($cat='blog' , $count = 3): array
{
return $this->createQueryBuilder('p')
->innerJoin('p.cat', 'c')
->where('c.code = :cat')
->setParameter('cat', $cat)
->setMaxResults($count)
->orderBy('p.dateSubmit','DESC')
->getQuery()
->getResult()
;
}
}

View file

@ -24,7 +24,7 @@
<body>
<nav class="navbar navbar-expand-lg border-bottom bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="{{path('app_home')}}">
<a class="navbar-brand text-primary" href="{{path('app_home')}}">
<img src="{{asset('/favicon/favicon.svg')}}" alt="نرم افزار حسابداری آنلاین حسابیکس" width="30" height="30">
حسابیکس
</a>
@ -63,16 +63,22 @@
<footer class="py-3 my-4">
<ul class="nav justify-content-center border-bottom pb-3 mb-3">
<li class="nav-item">
<a href="{{path('app_page',{'url':'hsx'})}}" class="nav-link px-2 text-body-secondary">توکن HSX</a>
<a href="{{path('app_page',{'url':'hsx'})}}" class="nav-link px-2">توکن HSX</a>
</li>
<li class="nav-item">
<a href="{{path('app_page',{'url':'contact'})}}" class="nav-link px-2 text-body-secondary">مستندات API</a>
<a href="{{path('app_page',{'url':'contact'})}}" class="nav-link px-2">مستندات API</a>
</li>
<li class="nav-item">
<a href="{{path('app_page',{'url':'terms'})}}" class="nav-link px-2 text-body-secondary">قوانین ارائه خدمات</a>
<a href="https://github.com/morrning" target="_blank" class="nav-link px-2">مخازن کد</a>
</li>
<li class="nav-item">
<a href="{{path('app_page',{'url':'privacy'})}}" class="nav-link px-2 text-body-secondary">حریم خصوصی</a>
<a href="{{path('app_page',{'url':'open-source'})}}" class="nav-link px-2">متن‌باز</a>
</li>
<li class="nav-item">
<a href="{{path('app_page',{'url':'terms'})}}" class="nav-link px-2">قوانین ارائه خدمات</a>
</li>
<li class="nav-item">
<a href="{{path('app_page',{'url':'privacy'})}}" class="nav-link px-2">حریم خصوصی</a>
</li>
</ul>
<p class="text-center text-body-secondary">

View file

@ -6,8 +6,8 @@
<div class="container">
<div class="row">
<div class="col-12 my-3">
<div class="p-1 mb-4 bg-body-primary rounded-3">
<div class="container-fluid py-5">
<div class="p-1 mb-4">
<div class="container-fluid pt-md-5 pt-sm-2">
<div class="row align-items-center">
<div class="col-sm-12 col-md-7 mb-3 text-center">
<h1 class="fs-2 fw-bold text-primary">شروعی ساده و آسان
@ -26,11 +26,11 @@
<div class="col-12">
<div class="card text-bg-light mb-3">
<div class="card-body text-center">
<p class="card-text">
حسابیکس یک پلتفرم مدیریت کسب‌و‌کار که پاسخگوی تمام اهداف تجاری شما از یک فروشگاه کوچک تا یک مجتمع بازگانی بزرگ است
<br>
کافی است گام اول را بردارید،جهت پیشبرد اهدافتان ما در کنار شما هستیم.
</p>
<p class="card-text text-body-secondary">
حسابیکس یک پلتفرم مدیریت کسب‌و‌کار که پاسخگوی تمام اهداف تجاری شما از یک فروشگاه کوچک تا یک مجتمع بازگانی بزرگ است
<br>
کافی است گام اول را بردارید،جهت پیشبرد اهدافتان در کنار شما هستیم.
</p>
</div>
</div>
</div>
@ -38,9 +38,31 @@
</div>
</div>
</div>
<div class="col-12 mb-4">
<div class="container bg-body-tertiary rounded-3 p-4">
<h4 class="text-center mb-4 text-primary">حامیان حسابیکس</h1>
<div class="row row-cols-2 row-cols-md-4 g-4 justify-content-center">
<div class="col">
<div class="card h-100 border-0 shadow-sm">
<img src="{{asset('img/sp/parspack-logo.png')}}" class="card-img-top p-3" alt="Sponsor 1 Logo">
</div>
</div>
<div class="col">
<div class="card h-100 border-0 shadow-sm">
<img src="{{asset('img/sp/melipayamak.png')}}" class="card-img-top p-3" alt="Sponsor 1 Logo">
</div>
</div>
<div class="col">
<div class="card h-100 border-0 shadow-sm">
<img src="{{asset('img/sp/raddata.png')}}" class="card-img-top p-3" alt="Sponsor 1 Logo">
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="p-1 mb-4">
<div class="container-fluid py-5">
<div class="container-fluid">
<div class="row align-items-center">
<div class="col-sm-12 col-md-3 mb-3 text-center">
<img src="{{asset('img/viewMobile.png')}}" class="img-fluid" alt="نرم افزار حسابداری حسابیکس"/>
@ -63,6 +85,31 @@
</div>
</div>
</div>
<div class="col-12">
<div class="p-1 mb-4">
<div class="container-fluid">
<h3 class="text-primary fs-2 text-center py-3">از وبلاگ حسابیکس</h3>
<div class="row">
{% for post in posts %}
<div class="col-sm-12 col-md-4 mb-3">
<div class="card d-flex position-relative">
<img src="{{asset('uploaded/' ~ post.mainPic )}}" class="card-img-top" alt="{{ post.title}}">
<div class="card-body">
<h3 class="card-title text-primary fs-4">{{post.title}}</h3>
<p class="card-text">{{ post.intro }}</p>
<div class="card-text text-start align-items-center">
<small class="text-body-secondary float-end">{{ Jdate.jdate('Y/n/d',post.dateSubmit) }}</small>
<a href="{{path('app_blog_post',{'url':post.url})}}" class="float-start btn btn-primary btn-sm rounded-4 stretched-link">ادامه مطلب</a>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View file

@ -9,10 +9,10 @@
{{ item.plain | raw}}
{% endif %}
{% if item.body is not null %}
<div class="container">
<div class="container mt-3">
<div class="row">
<div class="col">
<h1 class="text-primary">{{item.title}}</h1>
<h1 class="text-primary py-4">{{item.title}}</h1>
{{ item.body | raw}}
</div>
</div>