Skip to content

Commit

Permalink
first public version (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Nov 2, 2021
1 parent b13b7be commit 657ea71
Show file tree
Hide file tree
Showing 112 changed files with 15,020 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [kevinpapst]
custom: https://paypal.me/kevinpapst
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Description
A clear and concise description of what this pull request adds or changes.

## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist
- [ ] I updated the documentation (see [here](https://github.com/kevinpapst/TablerBundle/tree/master/docs))
- [ ] I agree that this code will be published under the [MIT license](https://github.com/kevinpapst/TablerBundle/blob/master/LICENSE)
25 changes: 25 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
pull_request: null
push:
branches:
- master
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.3', '7.4', '8.0']

name: Linting - PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: intl
- run: composer install --no-progress
- run: composer codestyle
- run: composer phpstan
- run: composer tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ yarn.lock
.php_cs
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
9 changes: 2 additions & 7 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,10 @@
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__
__DIR__ . '/src/',
__DIR__ . '/tests/',
])
->name('*.php')
->exclude([
'.github/',
'node_modules/',
'Resources/',
'vendor/',
])
)
->setFormat('checkstyle')
;
Expand Down
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contributing

This Tabler bundle is an open source project and contributions made by the community are welcome.
Send your ideas, code reviews, pull requests and feature requests to help me improve this project.

To make my and your live easier, here are the simple rules for PRs.

## Pull request rules

- Fix your codestyles before pushing with `composer codestyle-fix`
- Fix static code analysis errors, use `composer phpstan`
- Add PHPUnit tests for your changes and execute all tests with `composer tests`
- Verify everything still works (at least in your own project!)
- With sending in a PR, you accept that your contributions/code will be published under MIT license (see [LICENSE](LICENSE))
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Tabler Bundle for Symfony

This repository contains a Symfony bundle, integrating the fantastic [Tabler.io](https://tabler.io) HTML Template into your Symfony project.

It ships with many twig helper (functions, filter, embeds. macros and includes) to speed up your development and simplify future upgrades!

## Introduction

WORK IN PROGRESS

### Minimum requirements

- Symfony >= 4.4
- PHP >= 7.3

## Features

- A main layout for your backend/admin application
- Security layouts for login, forgot password, register account
- Many includes, embeds and macros to help speed up the development

Technical details:

- Webpack-Encore support for building assets
- Event-driven handling of menu entries, tasks and notifications
- ContextHelper for dynamic layout changes (e.g. based on user preferences)
- Translations for: english, german, italian, czech, spanish, russian, arabic, finnish, japanese, swedish, portuguese (brazilian), dutch, french, turkish, danish, chinese, slovakian, basque, polish, esperanto, hebrew, romanian (please help translating it to more languages)
- Based on Bootstrap 5
- Supports FontAwesome 5

## Installation

### Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

```console
composer require kevinpapst/tabler-bundle
```

### Applications that don't use Symfony Flex

#### Step 1: Download the Bundle

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

```console
composer require kevinpapst/tabler-bundle
```

#### Step 2: Configure the Bundle

Copy the default config to your `config/packages/` directory:

```bash
cp vendor/kevinpapst/tabler-bundle/config/packages/tabler.yaml config/packages/
```

#### Step 3: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles
in the `config/bundles.php` file of your project:

```php
// config/bundles.php

return [
// ...
KevinPapst\TablerBundle\TablerBundle::class => ['all' => true],
];
```

## License and contributors

Published under the MIT, read the [LICENSE](LICENSE) file for more information.
3 changes: 3 additions & 0 deletions assets/tabler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require('./tabler.scss');

require('@tabler/core/dist/js/tabler');
8 changes: 8 additions & 0 deletions assets/tabler.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import '~@tabler/core/dist/css/tabler.css';
@import '~@tabler/core/dist/css/tabler-vendors.css';

$fa-font-path: "~@fortawesome/fontawesome-free/webfonts/";
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/regular';
@import '~@fortawesome/fontawesome-free/scss/solid';
@import '~@fortawesome/fontawesome-free/scss/brands';
26 changes: 17 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,31 @@
"require-dev": {
"phpspec/prophecy": "^1.6",
"symfony/framework-bundle" : ">4.3",
"friendsofphp/php-cs-fixer": "^2.10",
"phpunit/phpunit": "^7.3",
"phpstan/phpstan": "^0.12",
"knplabs/knp-menu-bundle": "^2.2",
"phpstan/phpstan-phpunit": "^0.12"
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": "^8.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"knplabs/knp-menu-bundle": "^3.0"
},
"suggest" : {
"knplabs/knp-menu-bundle" : "Allows easy menu integration"
},
"autoload": {
"psr-4": { "KevinPapst\\TablerBundle\\": "" }
"psr-4": {
"KevinPapst\\TablerBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"KevinPapst\\TablerBundle\\Tests\\": "tests/"
}
},
"scripts": {
"tests": "vendor/bin/phpunit Tests/",
"tests": "vendor/bin/phpunit tests/",
"phpstan": [
"vendor/bin/phpstan analyse . --level=5",
"vendor/bin/phpstan analyse -c Tests/phpstan.neon Tests --level=5"
"vendor/bin/phpstan analyse src/ --level=5",
"vendor/bin/phpstan analyse -c tests/phpstan.neon tests/ --level=5"
],
"codestyle": "vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=none",
"codestyle-fix": "vendor/bin/php-cs-fixer fix"
Expand Down
64 changes: 64 additions & 0 deletions config/packages/tabler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# Configuration file for the Tabler bundle
#
# For more information about the bundle settings visit:
# https://github.com/kevinpapst/TablerBundle/blob/master/docs/configurations.md
#
tabler:
options:
# true = dark mode (light colors on dark background), false = normal mode (dark colors on light background)
dark_mode: true
# condensed = one nav-bar, false = two nav-bars
navbar_condensed: true
# true = boxed layout, false = full-screen
boxed_layout: false
# false = left to right, true = right to left
rtl_mode: false
# true = only avatar, false = show username and title as well
user_menu_condensed: true
# url to your company logo (if not with a protocol, the asset() helper will be used to create the url
logo_url: ~

knp_menu:
enable: false
main_menu: tabler_main
breadcrumb_menu: false

routes:
tabler_welcome: home
tabler_login: login
tabler_logout: logout
tabler_login_check: login_check
tabler_registration: registration
tabler_registration_register: registration_register
tabler_password_reset: resetting_request
tabler_password_reset_sent: resetting_send_email

icons:
# used for the action_collapsebutton components
collapse: fas fa-chevron-down
# used for the password-reset template
mail: far fa-envelope
# the following are only ideas to be used in your own templates
about: fas fa-info-circle
admin: fas fa-wrench
back: fas fa-long-arrow-alt-left
bookmark: far fa-star
calendar: far fa-calendar-alt
comment: far fa-comment
copy: far fa-copy
create: far fa-plus-square
dashboard: fas fa-tachometer-alt
delete: far fa-trash-alt
download: fas fa-download
edit: far fa-edit
export: fas fa-file-export
filter: fas fa-filter
help: far fa-question-circle
print: fas fa-print
search: fas fa-search
settings: fas fa-cog
start: fas fa-play
stop: fas fa-stop
upload: fas fa-upload
user: fas fa-user
24 changes: 24 additions & 0 deletions config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
services:

KevinPapst\TablerBundle\Twig\RuntimeExtension:
class: KevinPapst\TablerBundle\Twig\RuntimeExtension
arguments:
- '@event_dispatcher'
- '@tabler_bundle.context_helper'
- '%tabler_bundle.routes%'
- '%tabler_bundle.icons%'
tags:
- { name: twig.runtime }

KevinPapst\TablerBundle\Twig\TablerExtension:
class: KevinPapst\TablerBundle\Twig\TablerExtension
tags:
- { name: twig.extension }

tabler_bundle.context_helper:
class: KevinPapst\TablerBundle\Helper\ContextHelper
arguments:
- '%tabler_bundle.options%'

KevinPapst\TablerBundle\Helper\ContextHelper:
alias: tabler_bundle.context_helper
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"webpack-notifier": "^1.13.0"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"@popperjs/core": "^2.10.2",
"@symfony/webpack-encore": "^1.6.1",
"@tabler/core": "^1.0.0-beta2",
Expand Down
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-symfony/rules.neon

parameters:
excludePaths:
- %rootDir%/../../
12 changes: 12 additions & 0 deletions public/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entrypoints": {
"tabler": {
"js": [
"/bundles/tabler/tabler.js?cf63895eb741faf40197"
],
"css": [
"/bundles/tabler/tabler.css?eae5d178cb9e7831160c"
]
}
}
}
Binary file added public/fonts/fa-brands-400.eot
Binary file not shown.
Binary file added public/fonts/fa-brands-400.ttf
Binary file not shown.
Binary file added public/fonts/fa-brands-400.woff
Binary file not shown.
Binary file added public/fonts/fa-brands-400.woff2
Binary file not shown.
Binary file added public/fonts/fa-regular-400.eot
Binary file not shown.
Binary file added public/fonts/fa-regular-400.ttf
Binary file not shown.
Binary file added public/fonts/fa-regular-400.woff
Binary file not shown.
Binary file added public/fonts/fa-regular-400.woff2
Binary file not shown.
Binary file added public/fonts/fa-solid-900.eot
Binary file not shown.
Binary file added public/fonts/fa-solid-900.ttf
Binary file not shown.
Binary file added public/fonts/fa-solid-900.woff
Binary file not shown.
Binary file added public/fonts/fa-solid-900.woff2
Binary file not shown.
Loading

0 comments on commit 657ea71

Please sign in to comment.