Skip to content

Commit

Permalink
Merge pull request #31 from endihunter/master
Browse files Browse the repository at this point in the history
Datetime support
Apply Code Style
  • Loading branch information
endihunter authored May 27, 2018
2 parents d50f4ff + 758392a commit 1fa0bf4
Show file tree
Hide file tree
Showing 169 changed files with 1,614 additions and 1,358 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
composer.phar
composer.lock
.DS_Store
.idea
67 changes: 67 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

$config = PhpCsFixer\Config::create()
->setRiskyAllowed(true)
//->setIndent("\t")
->setRules([
'@PHP56Migration' => true,
'@PHPUnit60Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'align_multiline_comment' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_before_statement' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'heredoc_to_nowdoc' => true,
'list_syntax' => ['syntax' => 'long'],
'method_argument_space' => ['ensure_fully_multiline' => true],
'no_extra_consecutive_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
'no_null_property_initialization' => true,
'no_short_echo_tag' => true,
'no_superfluous_elseif' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_scalar' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'phpdoc_indent' => true,
'phpdoc_align' => ['tags' => []],
'phpdoc_types_order' => true,
'phpdoc_annotation_without_dot' => true,
'semicolon_after_instruction' => true,
'single_line_comment_style' => true,
'strict_comparison' => true,
'strict_param' => true,
'yoda_style' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude(['tests/Fixtures', 'node_modules', 'storage'])
->notPath('_ide_helper.php')
->in(__DIR__)
)
;

// special handling of fabbot.io service if it's using too old PHP CS Fixer version
try {
PhpCsFixer\FixerFactory::create()
->registerBuiltInFixers()
->registerCustomFixers($config->getCustomFixers())
->useRuleSet(new PhpCsFixer\RuleSet($config->getRules()));
} catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) {
$config->setRules([]);
} catch (UnexpectedValueException $e) {
$config->setRules([]);
} catch (InvalidArgumentException $e) {
$config->setRules([]);
}
return $config;
1 change: 0 additions & 1 deletion publishes/Dashboard/BlankPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class BlankPanel extends CoreBlankPanel
{
//
}
1 change: 0 additions & 1 deletion publishes/Dashboard/DatabasePanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class DatabasePanel extends CoreDatabasePanel
{
//
}
8 changes: 4 additions & 4 deletions publishes/Dashboard/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ protected function registerPanels()
{
$this->dashboard
->row(function (DashboardRow $row) {
$row->panel(new BlankPanel)->setWidth(12);
$row->panel(new BlankPanel())->setWidth(12);
})
// ->row(function (DashboardRow $row) {
// $row->panel(new GoogleAnalyticsPanel)->setWidth(12);
// })
->row(function (DashboardRow $row) {
$row->panel(new MembersPanel)->setWidth(6);
$row->panel(new DatabasePanel)->setWidth(6);
$row->panel(new MembersPanel())->setWidth(6);
$row->panel(new DatabasePanel())->setWidth(6);
});

return $this->dashboard;
}
}
}
3 changes: 1 addition & 2 deletions publishes/Dashboard/GoogleAnalyticsPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class GoogleAnalyticsPanel extends CoreGoogleAnalyticsPanel
{
//
}
}
1 change: 0 additions & 1 deletion publishes/Dashboard/MembersPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class MembersPanel extends CoreMembersPanel
{
//
}
5 changes: 1 addition & 4 deletions publishes/Modules/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
use Terranet\Administrator\Modules\Users as CoreUsersModule;

/**
* Administrator Users Module
*
* @package Terranet\Administrator
* Administrator Users Module.
*/
class Users extends CoreUsersModule
{
//
}
4 changes: 2 additions & 2 deletions publishes/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function make()
}

/**
* Make SideBar navigation
* Make SideBar navigation.
*/
protected function makeSidebar()
{
Expand Down Expand Up @@ -76,4 +76,4 @@ protected function makeTools()
);
});
}
}
}
64 changes: 32 additions & 32 deletions publishes/config.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

return [
# URL Prefix
// URL Prefix
'prefix' => $prefix = 'cms',

'title' => "<b>Admin</b> Architect",
'title' => '<b>Admin</b> Architect',
'abbreviation' => 'AA',
'welcome' => 'Welcome! Please sign In.',

# Authentication options
// Authentication options
'auth' => [
'identity' => 'email',
'credential' => 'password',
Expand All @@ -17,60 +17,60 @@
],

'paths' => [
# media storage
// media storage
'media' => 'media',

'module' => "Http/Terranet/Administrator/Modules",
'action' => "Http/Terranet/Administrator/Actions",
'action_handler' => "Http/Terranet/Administrator/Actions/Handlers",
'panel' => "Http/Terranet/Administrator/Dashboard",
'finder' => "Http/Terranet/Administrator/Finders",
'saver' => "Http/Terranet/Administrator/Savers",
'column' => "Http/Terranet/Administrator/Decorators",
'template' => "Http/Terranet/Administrator/Templates",
'widget' => "Http/Terranet/Administrator/Widgets",
'badge' => "Http/Terranet/Administrator/Badges",
'breadcrumbs' => "Http/Terranet/Administrator/Breadcrumbs",
'module' => 'Http/Terranet/Administrator/Modules',
'action' => 'Http/Terranet/Administrator/Actions',
'action_handler' => 'Http/Terranet/Administrator/Actions/Handlers',
'panel' => 'Http/Terranet/Administrator/Dashboard',
'finder' => 'Http/Terranet/Administrator/Finders',
'saver' => 'Http/Terranet/Administrator/Savers',
'column' => 'Http/Terranet/Administrator/Decorators',
'template' => 'Http/Terranet/Administrator/Templates',
'widget' => 'Http/Terranet/Administrator/Widgets',
'badge' => 'Http/Terranet/Administrator/Badges',
'breadcrumbs' => 'Http/Terranet/Administrator/Breadcrumbs',
],

# Handle passwords -> Convert plain text to Hash
// Handle passwords -> Convert plain text to Hash
'manage_passwords' => true,

# Enable File Manager
// Enable File Manager
'file_manager' => false,

'gravatar' => false,

# The menu item that should be used as the default landing page of the administrative section
// The menu item that should be used as the default landing page of the administrative section
'home_page' => $prefix,

# Basic user validation Rule
// Basic user validation Rule
'permission' => \Terranet\Administrator\Auth\SuperAdminRule::class,

# Navigation Factory
// Navigation Factory
'menu' => \Terranet\Administrator\Navigation\Factory::class,

# Dashboard Panels Factory
// Dashboard Panels Factory
'dashboard' => \App\Http\Terranet\Administrator\Dashboard\Factory::class,

'resource' => [
# The custom way to resolve module name for custom resources
# when controller missing Router's $module parameter
// The custom way to resolve module name for custom resources
// when controller missing Router's $module parameter
'resolver' => null,

# Default segment for module name resolver
# /admin/pages - admin => 1, pages => 2
// Default segment for module name resolver
// /admin/pages - admin => 1, pages => 2
'segment' => 2,
],

'acl' => [
# Global ACL Manager, which used to control CRUD actions
# in the global way. Can provide optional methods:
# showIf, can(Index|Update|Delete|Create)
// Global ACL Manager, which used to control CRUD actions
// in the global way. Can provide optional methods:
// showIf, can(Index|Update|Delete|Create)
'manager' => null,
],

# main layouts
// main layouts
'layouts' => [
'app' => 'administrator::layouts.app',
'popup' => 'administrator::layouts.popup',
Expand All @@ -86,7 +86,7 @@
],
],

# Exportable formats declaration
// Exportable formats declaration
'export' => [
'default' => ['xml', 'csv', 'json'],
// 'users' => ['csv', 'pdf'],
Expand All @@ -95,9 +95,9 @@
'translations' => [
'enabled' => false,
'filters' => [
# build filters based on specific translation files
// build filters based on specific translation files
'only' => null, // ['auth', 'validation']
# except some translation files from filters
// except some translation files from filters
'except' => null, // ['password', 'pagination']
],
],
Expand Down
22 changes: 9 additions & 13 deletions publishes/resources/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,16 @@ class AdminArchitect {
}

static handleDateControls() {
$('[data-filter-type="date"]').each((i, e) => {
let type = $(e).attr('type');

if ('date' === type) {
$(e).datepicker({
format: 'yyyy-mm-dd',
clearBtn: false,
multidate: false,
});
}
$('[data-filter-type="date"]').datetimepicker({
format: 'YYYY-MM-DD'
});

if ('datetime' === type) {
$(e).datetimepicker();
}
$('[data-filter-type="time"]').datetimepicker({
format: 'hh:mm:ss'
});

$('[data-filter-type="datetime"]').datetimepicker({
format: 'YYYY-MM-DD hh:mm:ss'
});

$('[data-filter-type="daterange"]').daterangepicker({
Expand Down
1 change: 0 additions & 1 deletion publishes/resources/js/vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require('@adminarchitect/bootstrap/js/carousel');
require('@adminarchitect/bootstrap/js/transition');

/* Date/DateRange pickers */
require('@adminarchitect/bootstrap-datepicker');
require('@adminarchitect/bootstrap-datetimepicker');
require('@adminarchitect/bootstrap-daterangepicker');

Expand Down
1 change: 0 additions & 1 deletion publishes/resources/sass/vendor.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '~font-awesome/scss/font-awesome';
@import "~@adminarchitect/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css";
@import "~@adminarchitect/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css";
@import "~@adminarchitect/bootstrap-daterangepicker/daterangepicker";
@import "~selectize/dist/css/selectize.bootstrap3.css";
Expand Down
2 changes: 1 addition & 1 deletion publishes/translations/en/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@

'global' => [
// 'remove_selected' => 'Delete collection'
]
],
];
10 changes: 5 additions & 5 deletions publishes/translations/en/buttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
'logout' => 'Logout',
'batch_actions' => 'Batch Actions',
'clear_filters' => 'Clear',
'media' => 'Media',
'translations' => 'Translations',
'upload' => 'Upload',
'next' => 'Next',
'previous' => 'Previous',
'media' => 'Media',
'translations' => 'Translations',
'upload' => 'Upload',
'next' => 'Next',
'previous' => 'Previous',
];
2 changes: 1 addition & 1 deletion publishes/translations/en/columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
'global' => [
// 'desc' => 'Description',
],
];
];
19 changes: 9 additions & 10 deletions publishes/translations/en/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@

return [
'database' => [
'header' => 'Database stats',
'header_engine' => 'Table / Engine',
'header_rows' => 'Rows',
'header_index' => 'Index Size',
'header' => 'Database stats',
'header_engine' => 'Table / Engine',
'header_rows' => 'Rows',
'header_index' => 'Index Size',
'header_collation' => 'Collation',
],
'members' => [
'header' => 'Members',
'header_total' => 'Total',
'header_signed_last_week' => 'Signed Last Week',
'members' => [
'header' => 'Members',
'header_total' => 'Total',
'header_signed_last_week' => 'Signed Last Week',
'header_signed_last_month' => 'Signed Last Month',
'header_members_per_day' => 'Members per day',

'header_members_per_day' => 'Members per day',
],
];
2 changes: 1 addition & 1 deletion publishes/translations/en/hints.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
'global' => [
// 'desc' => 'Description',
],
];
];
Loading

0 comments on commit 1fa0bf4

Please sign in to comment.