Skip to content

Commit 72bf95e

Browse files
committed
WIP
1 parent a359428 commit 72bf95e

File tree

159 files changed

+6483
-17565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+6483
-17565
lines changed

.editorconfig

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ root = true
66

77
# Unix-style newlines with a newline ending every file
88
[*]
9-
end_of_line = lf
10-
insert_final_newline = true
119
charset = utf-8
10+
end_of_line = LF
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
1213

13-
[*.php]
14+
[*.{php,html,twig,json,yml,yaml,vue}]
1415
indent_style = space
1516
indent_size = 4
1617

17-
[{package.json, composer.json}]
18-
indent_size = 2
19-
2018
[*.md]
21-
trim_trailing_whitespace = false
19+
max_line_length = 80

.env

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
# This file is a "template" of which env vars need to be defined for your application
2-
# Copy this file to .env file for development, create environment variables when deploying to production
3-
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
1+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
2+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
43

54
###> symfony/framework-bundle ###
65
APP_ENV=prod
76
APP_SECRET=52a9ee6241c958598f23df444ffdb03c
87
###< symfony/framework-bundle ###
98

109
###> doctrine/doctrine-bundle ###
11-
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
12-
DATABASE_URL=mysql://root:[email protected]:3306/pdadmin
10+
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
11+
# DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7"
12+
DATABASE_URL="postgresql://db_user:[email protected]:5432/db_name?serverVersion=13&charset=utf8"
1313
###< doctrine/doctrine-bundle ###
1414

1515
###> symfony/mailer ###
16+
#MAILER_DSN=smtp://[email protected]:[email protected]:465?encryption=ssl&auth_mode=login
1617
MAILER_DSN=smtp://localhost
1718
###< symfony/mailer ###
1819

20+
###> symfony/messenger ###
21+
# Choose one of the transports below
22+
# MESSENGER_TRANSPORT_DSN=doctrine://default
23+
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
24+
MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
25+
###< symfony/messenger ###
26+
1927
###> Project Configuration ###
2028
UPLOAD_DIR="public/uploads/"
2129
MAILER_FROM_EMAIL=[email protected]

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ src/*/Entity/*/*~
2828
node_modules
2929
.idea
3030
/build/
31-
.DS_Store
31+
.DS_Store
32+
npm-debug.log
33+
yarn-error.log

.php-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Ramazan APAYDIN
3+
Copyright (c) 2021 Ramazan APAYDIN
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22

33
![page-admin](https://user-images.githubusercontent.com/8649070/42580601-9e100496-8533-11e8-93bf-9d74e721ccd5.png)
44

5-
pdAdmin
5+
pdAdmin
66
=========
7-
Symfony Powerful Dashboard & Admin. Developed with **Symfony 5** framework.
7+
Supported **PHP8 and Composer 2**
88

9-
No changes were made to the symfony structure, the current directory structure is used. A custom namespace for Admin has been created. This field is used for all administrator operations.
9+
Symfony Powerful Dashboard & Admin. Developed with **Symfony 5**, **Vue 3**, **Bootstrap 5** framework.
1010

11-
The interface is designed to be responsive using Twitter Bootstrap. The least possible dependency was tried to be used.
11+
No changes were made to the symfony structure, the current directory structure is used. A custom namespace for Admin has been created. This field is used for all administrator operations.
12+
13+
The interface is designed to be responsive using Twitter Bootstrap. The least possible dependency was tried to be used.
1214

1315
Installation
1416
--------------------
1517
1. Download pdAdmin
1618
```
17-
composer create-project appaydin/pd-admin pdadmin
19+
composer create-project appaydin/pd-admin pdadmin
1820
```
1921
2. Create and configure the `.env` file.
2022
@@ -24,7 +26,7 @@ Installation
2426
```
2527
4. Run built-in web server
2628
```
27-
bin/console server:start
29+
symfony server:start --no-tls
2830
```
2931
5. Install & Build assets
3032
```
@@ -82,7 +84,7 @@ Clear the cache after changes to system settings, otherwise the new settings wil
8284
For general settings, you can add it to __src/Admin/Forms/System/GeneralForm__
8385
8486
__Add New Menu to Settings__:
85-
```php
87+
```php
8688
<?php
8789
//src/Admin/Menu/SettingsMenu.php
8890
@@ -98,42 +100,42 @@ class SettingsMenu extends Menu
98100
// Create Root Item
99101
$menu = $this->createRoot('settings_menu')->setChildAttr([
100102
'class' => 'nav nav-pills',
101-
'data-parent' => 'admin_settings_general',
103+
'data-parent' => 'admin_config_general',
102104
]);
103105
104106
// Create Menu Items
105107
$menu->addChild('nav_config_general')
106108
->setLabel('nav_config_general')
107-
->setRoute('admin_settings_general')
109+
->setRoute('admin_config_general')
108110
->setLinkAttr(['class' => 'nav-item'])
109-
->setRoles(['ROLE_SETTINGS_GENERAL'])
111+
->setRoles(['ROLE_CONFIG_GENERAL'])
110112
// Contact
111113
->addChildParent('nav_config_contact')
112114
->setLabel('nav_config_contact')
113-
->setRoute('admin_settings_contact')
115+
->setRoute('admin_config_contact')
114116
->setLinkAttr(['class' => 'nav-item'])
115-
->setRoles(['ROLE_SETTINGS_CONTACT'])
117+
->setRoles(['ROLE_CONFIG_CONTACT'])
116118
// Email
117119
->addChildParent('nav_config_email')
118120
->setLabel('nav_config_email')
119121
->setRoute('admin_settings_email')
120122
->setLinkAttr(['class' => 'nav-item'])
121123
->setRoles(['ROLE_SETTINGS_EMAIL']);
122-
124+
123125
return $menu;
124126
}
125-
}
127+
}
126128
```
127129

128130
### Mail Manager
129-
Mail Manager is made as Symfony Mailer plugin. With Mailer, the log of all mail is stored.
130-
In addition, it is a template manager. You can create custom templates (Email Template) for your posts and provide a compilation that includes submissions.
131-
The Mail Template is multi-language supported. You can create templates for different languages.
132-
Package installation __packages/pd_mailer.yaml__ located in the file.
131+
Mail Manager is made as Symfony Mailer plugin. With Mailer, the log of all mail is stored.
132+
In addition, it is a template manager. You can create custom templates (Email Template) for your posts and provide a compilation that includes submissions.
133+
The Mail Template is multi-language supported. You can create templates for different languages.
134+
Package installation __packages/pd_mailer.yaml__ located in the file.
133135
For further information please contact [pd-mailer](https://github.com/appaydin/pd-mailer)
134136

135137
Send Email:
136-
```php
138+
```php
137139
// Create Message
138140
$email = new Email();
139141
$email
@@ -150,8 +152,8 @@ $this->get('mailer')->send($email);
150152
```
151153

152154
### Create New Widget
153-
Widget system was created with Symfony "EventDispatcher Component".
154-
It has an adjustable structure for each user and it can be specially designed with "Twig Template" engine.
155+
Widget system was created with Symfony "EventDispatcher Component".
156+
It has an adjustable structure for each user and it can be specially designed with "Twig Template" engine.
155157
For more information visit [pd-widget](https://github.com/appaydin/pd-widget)
156158

157159
Create New Admin Widget:
@@ -240,8 +242,8 @@ class AccountWidget
240242
```
241243

242244
### Create New Menu
243-
The menu system was created with Symfony "EventDispatcher Component".
244-
For each menu created, Event is generated by default, can be turned off by menu configuration.
245+
The menu system was created with Symfony "EventDispatcher Component".
246+
For each menu created, Event is generated by default, can be turned off by menu configuration.
245247
For more information visit the [pd-menu](https://github.com/appaydin/pd-menu)
246248

247249
Create Menu:

assets/admin/_variables.scss

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*======================================================
2+
Override Bootstrap Variables
3+
=======================================================*/
4+
$font-family-sans-serif: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
5+
$body-color: #4a5073;
6+
$headings-color: #262b40;
7+
$link-decoration: none;
8+
$link-color: #262b40;
9+
$border-radius: .3rem;
10+
$input-btn-focus-width: .2rem;
11+
$form-check-input-width: 1.2em;
12+
$form-check-input-border-radius: .2rem;
13+
$headings-font-weight: 500;
14+
$form-label-font-weight: 500;
15+
$line-height-base: 1.7;
16+
$alert-padding-y: .5rem;
17+
$alert-padding-x: 1rem;
18+
$font-size-base: .9rem;
19+
$transition-base: all .15s ease-in-out;
20+
$grid-gutter-width: 1rem;
21+
$small-font-size: .85em;
22+
$font-weight-bold: 500;
23+
$btn-close-focus-shadow: none;
24+
$primary: #5d52fd;
25+
$green: #8fd48f;
26+
$cyan: #07adcb;
27+
$btn-close-width: .75em;
28+
$dropdown-item-padding-x: 1rem;
29+
$dropdown-item-padding-y: 1.2rem / 4;
30+
$dropdown-divider-margin-y: 1rem / 3;
31+
$dropdown-border-color: #dee2e6;
32+
$dropdown-link-hover-bg: #e9ecef;
33+
$dropdown-border-width: 0;
34+
$dropdown-padding-x: 0;
35+
$dropdown-padding-y: 0;
36+
$modal-header-padding-y: .85rem;
37+
$modal-header-padding-x: $modal-header-padding-y * 1.5;
38+
$modal-header-border-width: 0;
39+
$modal-footer-border-width: 0;
40+
$modal-content-border-width: 0;
41+
$table-cell-padding-x: .75rem;
42+
43+
$popover-border-width: 0;
44+
$popover-header-bg: $primary;
45+
$popover-header-color: #FFF;
46+
$popover-font-size: $font-size-base;
47+
$popover-body-padding-y: 1rem / 2;
48+
49+
@import "~bootstrap/scss/functions";
50+
@import "~bootstrap/scss/variables";
51+
@import "~bootstrap/scss/mixins";
52+

assets/admin/app.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import * as Vue from 'vue/dist/vue.esm-bundler'
2+
import {onMounted, getCurrentInstance, ref} from 'vue'
3+
4+
/**
5+
* ============
6+
* Init Vue & Core
7+
* ============
8+
*/
9+
let appConfig = {
10+
...{delimiters: ['${', '}']},
11+
...(window.vueApp || {}),
12+
...{
13+
setup(props, context) {
14+
let forms = ref({});
15+
const app = getCurrentInstance().ctx;
16+
17+
// Flash Message
18+
onMounted(() => {
19+
app.msg.showBag(window.flashBag);
20+
})
21+
22+
return {
23+
forms
24+
}
25+
},
26+
}
27+
}
28+
29+
/**
30+
* ============
31+
* Create APP
32+
* ============
33+
*/
34+
window.Root = Vue.createApp(appConfig)
35+
.use(require('./core/index').default)
36+
.use(require('./src/index').default)
37+
.mount('#app');

0 commit comments

Comments
 (0)