Skip to content

Commit

Permalink
added demo version
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Sep 13, 2024
1 parent 6f0779b commit 8c2724a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 10 deletions.
12 changes: 7 additions & 5 deletions app/Http/Controllers/Admin/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ public function save($user, $request)
}

$user->name = $request->input('name');
$user->email = $request->input('email');
if (trim($request->input('password')) != '') {
$user->password = bcrypt($request->input('password'));
if (!config('app.demo')) {
$user->email = $request->input('email');
if (trim($request->input('password')) != '') {
$user->password = bcrypt($request->input('password'));
}
}
$user->mobile = $request->input('mobile');
$user->role = $request->input('role');
Expand Down Expand Up @@ -105,9 +107,9 @@ public function edit(User $item)
}
}
}
unset($routes['home'], $routes['user'], $routes['ckeditor'],$routes['area'],$routes['lang'],$routes['gfx']);
unset($routes['home'], $routes['user'], $routes['ckeditor'], $routes['area'], $routes['lang'], $routes['gfx']);
//
return view($this->formView, compact('item','routes'));
return view($this->formView, compact('item', 'routes'));
}

public function bulk(Request $request)
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'name' => env('APP_NAME', 'Laravel'),
'version' => env('APP_VERSION', '2.0.0-beta-2'),

'demo' => env('APP_DEMO', false),
/*
|--------------------------------------------------------------------------
| Application Environment
Expand Down
3 changes: 2 additions & 1 deletion resources/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "./client-custom/windowLoader.js";
import "../views/segments/preloader/PreloaderCircle/PreloaderCircle.js";
import "../views/segments/menu/RecetMenu/RecetMenu.js";
import "../views/segments/slider/SliderSimple/SliderSimple.js";
import "../views/segments/products/LatestProducts/LatestProducts.js";
import "../views/segments/posts/PostsSlider/PostsSlider.js";
import "../views/segments/posts/PostsIconSimple/PostsIconSimple.js";
import "../views/segments/index/CounterGrid/CounterGrid.js";
import "../views/segments/categories/CategoriesFavImageLinks/CategoriesFavImageLinks.js";
Expand All @@ -26,6 +26,7 @@ import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/card/NsCard/NsCard.js";
import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar.js";
import "../views/segments/product/ProductKaren/ProductKaren.js";
import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar.js";
import "../views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.js";
import "../views/segments/post/PostSidebar/PostSidebar.js";
import "../views/segments/clips_page/ClipListGrid/ClipListGrid.js";
Expand Down
6 changes: 5 additions & 1 deletion resources/lang/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@
"Customer mobile": "",
"Customers": "مشتری‌ها",
"Customers list": "فهرست مشتری‌ها",
"DEMO VERSION": "نگارش آزمایشی",
"Dashboard": "پیشخوان",
"Date": "تاریخ",
"Datetime": "تاریخ و زمان",
"Deattach": "عدم پیوست",
"Default": "پیش‌فرض",
"Default admin email is :E1 (developer) or :E2 (admin) and default password is: :P": "در نگارش آزمایشی رایانامه توسعه دهنده :E1 است و رایانامه مدیر عادی :E2 و گذرواژه هر دو :P است",
"DefaultFooter": "فوتر پیش‌فرض",
"DefaultHeader": "هدر پیش‌فرض",
"Description": "توضیحات",
Expand Down Expand Up @@ -420,8 +422,9 @@
"Tags": "برچسب‌ها",
"Tags list": "فهرست برچسب‌ها",
"Tags, Press enter": "برچسب‌ها، Enter را بزنید",
"The first and\/or second image will be index image": "اولی وی دومی به عنواان تصویر شاخص در نظر گرفته می‌شود",
"The first and\/or second image will be index image": "اولی وی دومی به عنوان تصویر شاخص در نظر گرفته می‌شود",
"Theme": "قالب",
"Theme loaded every :M minutes in demo version": "در نگارش آزمایشی تغییرات ظاهری هر :M دقیقه به روز می‌شوند، پس شکیبا باشید",
"Theme part created successfully: [blade, js, json, scss, php, assets, screenshot]": "",
"There is nothing added to card!": "چیزی در سبد خرید وجود ندارد",
"There is nothing to show!": "اینجا چیزی برای نمایش وجود ندارد",
Expand Down Expand Up @@ -482,6 +485,7 @@
"You can choose one or more image together": "شما می‌توانی یک یا چند عکس را همزمان انتخاب کنید",
"You can create \/ edit clip as draft, publish it when you want": "شما میتوانید کلیپ را ایجاد و ویرایش کنید، هر زمان که خواستید آن را منتشر کنید",
"You can leave the slug empty; it will be generated automatically.": "شما می‌توانید نامک را خالی بگذارید به صورت خودکار ساخته شود",
"You can't change email or password in demo version": "در نگارش آزمایشی امکان تعویض رایانامه یا گذرواژه وجود ندارد",
"You don't have access this action": "شما دسترسی لازم برای این بخش را ندارید",
"You don't have any comments, We are so pleased to hear your look-out": "شما هیچ دیدگاهی تاکنون ارسال نکرده‌اید، از شما تقاضا داریم تجربیات و نگرش خود را برای ما ارسال کنید، چون بسیار ارزشمند است",
"You have some products in your shopping card.": "در سبد خرید شما محصول وجود دارد",
Expand Down
3 changes: 2 additions & 1 deletion resources/sass/client.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $xshop-shadow:2px 2px 4px #777777;
@import "../views/segments/preloader/PreloaderCircle/PreloaderCircle";
@import "../views/segments/menu/RecetMenu/RecetMenu";
@import "../views/segments/slider/SliderSimple/SliderSimple";
@import "../views/segments/products/LatestProducts/LatestProducts";
@import "../views/segments/posts/PostsSlider/PostsSlider";
@import "../views/segments/posts/PostsIconSimple/PostsIconSimple";
@import "../views/segments/index/CounterGrid/CounterGrid";
@import "../views/segments/categories/CategoriesFavImageLinks/CategoriesFavImageLinks";
Expand All @@ -37,6 +37,7 @@ $xshop-shadow:2px 2px 4px #777777;
@import "../views/segments/card/NsCard/NsCard";
@import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar";
@import "../views/segments/product/ProductKaren/ProductKaren";
@import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar";
@import "../views/segments/posts_page/GridPostListSidebar/GridPostListSidebar";
@import "../views/segments/post/PostSidebar/PostSidebar";
@import "../views/segments/clips_page/ClipListGrid/ClipListGrid";
Expand Down
6 changes: 5 additions & 1 deletion resources/views/admin/areas/area-list.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

@extends('layouts.app')

@section('title')
{{__("Area design")}}
@endsection
@section('content')
@if(config('app.demo'))
<div class="alert alert-warning">
{{__("Theme loaded every :M minutes in demo version", ['M' => 5])}}
</div>
@endif
<div class="row">
@foreach($areas as $area)
<div class="col-md-4">
Expand Down
5 changes: 5 additions & 0 deletions resources/views/admin/users/user-form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<li>
{{__("E-mail is unique each users")}}
</li>
@if(config('app.demo'))
<li>
{{__("You can't change email or password in demo version")}}
</li>
@endif
</ul>
</div>

Expand Down
7 changes: 7 additions & 0 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
@section('content')

<div class="forms">
@if(config('app.demo'))
<div class="alert alert-warning mb-5">
{{__("DEMO VERSION")}}
<hr>
{{__("Default admin email is :E1 (developer) or :E2 (admin) and default password is: :P",["E1" => '`[email protected]`','E2' => '`[email protected]`','P' => '`password`' ])}}
</div>
@endif

<div class="card" id="raw-form">
<div class="card-header">
Expand Down

0 comments on commit 8c2724a

Please sign in to comment.