Browse Source

improve sonata admin settings - change default pics && versioning && closes #2

tags/Beta-1
Laszlo Lang 2 years ago
parent
commit
f7d57444f4
11 changed files with 248 additions and 1 deletions
  1. +8
    -0
      README.md
  2. +4
    -1
      config/packages/sonata_admin.yaml
  3. +2
    -0
      config/packages/sonata_user.yaml
  4. +5
    -0
      config/packages/twig.yaml
  5. +5
    -0
      config/services.yaml
  6. +35
    -0
      public/admin/layout.html.twig
  7. BIN
      public/images/default_avatar.png
  8. BIN
      public/images/system7-Bear-created-by@100.png
  9. BIN
      public/images/system7-Bear@250.png
  10. +65
    -0
      templates/admin/layout.html.twig
  11. +124
    -0
      templates/bundles/SonataUserBundle/Admin/Security/login.html.twig

+ 8
- 0
README.md View File

@@ -0,0 +1,8 @@
splendidbear
=========

A Symfony project created on August 18., 2018, 10:29 pm.

PROJECT VERSION 1.2.0-20180819-1

### !! DISCLAIMER - USE YARN INSTEAD OF NPM!

+ 4
- 1
config/packages/sonata_admin.yaml View File

@@ -1,5 +1,6 @@
sonata_admin:
title: 'Sonata Admin'
title: '%jotunheimr.title.small%'
title_logo: 'images/system7-Bear@250.png'
dashboard:
blocks:
- { type: sonata.admin.block.admin_list, position: left }
@@ -21,6 +22,8 @@ sonata_admin:
# - sonata.media.admin.media
# - sonata.media.admin.gallery
# roles: [ ROLE_SUPER_ADMIN ]
templates:
layout: admin/layout.html.twig

sonata_block:
blocks:


+ 2
- 0
config/packages/sonata_user.yaml View File

@@ -4,3 +4,5 @@ sonata_user:
class:
user: App\Application\Sonata\UserBundle\Entity\User
group: App\Application\Sonata\UserBundle\Entity\Group
profile:
default_avatar: 'images/default_avatar.png'

+ 5
- 0
config/packages/twig.yaml View File

@@ -2,3 +2,8 @@ twig:
paths: ['%kernel.project_dir%/templates']
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
globals:
jotunTitle: '%jotunheimr.title%'
jotunImage: '%jotunheimr.image%'
jotunImageSign: '%jotunheimr.image.sign%'
jotunVersion: '%jotunheimr.version%'

+ 5
- 0
config/services.yaml View File

@@ -5,6 +5,11 @@
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: 'en'
jotunheimr.title: 'SplendidBear Websites'
jotunheimr.title.small: 'SplendidBear'
jotunheimr.image: '/images/system7-Bear@250.png'
jotunheimr.image.sign: '/images/system7-Bear-created-by@100.png'
jotunheimr.version: 1.2.0-20180819-1
mailer_user: Lang
mailer_email: langlasz@gmail.com



+ 35
- 0
public/admin/layout.html.twig View File

@@ -0,0 +1,35 @@
{% extends '@SonataAdmin/standard_layout.html.twig' %}
{#
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('bundles/sonatatranslation/css/sonata-translation.css') }}"/>
{% endblock %}

{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('build/admin.js') }}"></script>
{% endblock %}
#}

{% block logo %}
{% spaceless %}
<a class="logo" href="{{ path('sonata_admin_dashboard') }}">
{#{% if 'single_image' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
<img src="{{ asset('/images/bear-3@1000.png') }}" alt="{{ sonata_admin.adminPool.title }}" border="0" width="50">
{% endif %}#}
{% if 'single_text' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
<span>{{ jotunTitle }}</span>
{% endif %}
</a>
{% endspaceless %}
{% endblock %}

{% block side_bar_after_nav_content %}
<a href="https://www.laszlolang.com" rel="noreferrer" target="_blank">
<img src="{{ asset('/images/system7-Bear-created-by-light@100.png') }}"
border="0"
alt="www.laszlolang.com"> <br>
www.laszlolang.com &copy; 2010-{{ "now"|date('Y') }} <br>
v{{ jotunVersion }}
</a>
{% endblock %}

BIN
public/images/default_avatar.png View File

Before After
Width: 1050  |  Height: 1050  |  Size: 48KB

BIN
public/images/system7-Bear-created-by@100.png View File

Before After
Width: 100  |  Height: 19  |  Size: 2.7KB

BIN
public/images/system7-Bear@250.png View File

Before After
Width: 250  |  Height: 250  |  Size: 9.8KB

+ 65
- 0
templates/admin/layout.html.twig View File

@@ -0,0 +1,65 @@
{% extends '@SonataAdmin/standard_layout.html.twig' %}
{#
{% block stylesheets %}
{{ parent() }}

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
<link rel="stylesheet" href="{{ asset('build/admin-style.css') }}"/>
<link rel="stylesheet" href="{{ asset('bundles/sonatatranslation/css/sonata-translation.css') }}"/>
{% endblock %}

{% block javascripts %}
{{ parent() }}

<script src="https://cdn.ckeditor.com/ckeditor5/10.0.0/classic/ckeditor.js"></script>
<script type="text/javascript" src="{{ asset('build/admin.js') }}"></script>
{% endblock %}
#}

{% block logo %}
{% spaceless %}
<a class="logo" href="{{ path('sonata_admin_dashboard') }}">
{% if 'single_image' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
<img src="{{ jotunImage }}" alt="{{ sonata_admin.adminPool.title }}" style="max-width:none;max-height:95%;">
{% endif %}
</a>
{% endspaceless %}
{% endblock %}

{% block side_bar_after_nav_content %}
<a href="https://www.laszlolang.com" rel="noreferrer" target="_blank">
www.laszlolang.com &copy; 2010-{{ "now"|date('Y') }} <br>
v{{ jotunVersion }}
</a>
{% endblock %}

{% block sonata_top_nav_menu %}
{% if app.user %}
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
{% block sonata_top_nav_menu_add_block %}
{% if is_granted(sonata_admin.adminPool.getOption('role_admin')) %}
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-plus-square fa-fw" aria-hidden="true"></i>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</a>
{% include get_global_template('add_block') %}
</li>
{% endif %}
{% endblock %}
{% block sonata_top_nav_menu_user_block %}
<li class="dropdown user-menu">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw" aria-hidden="true"></i>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</a>
<ul class="dropdown-menu dropdown-user">
{% include get_global_template('user_block') %}
</ul>
</li>
{% endblock %}
</ul>
</div>
{% endif %}
{% endblock %}

+ 124
- 0
templates/bundles/SonataUserBundle/Admin/Security/login.html.twig View File

@@ -0,0 +1,124 @@
{#

This file is part of the Sonata package.

(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% extends base_template %}

{% block sonata_nav %}
{% endblock sonata_nav %}

{% block logo %}
{% endblock logo %}

{% block sonata_left_side %}
{% endblock sonata_left_side %}

{% block body_attributes %}class="sonata-bc login-page"{% endblock %}

{% block sonata_wrapper %}

<div class="login-box">
{% block login_box_header %}
<div class="login-logo">
<a href="{{ path('sonata_admin_dashboard') }}">
{% if sonata_admin.adminPool.getOption('title_mode') in ['single_image', 'both'] %}
<div>
<img style="width:250px" src="{{ asset(sonata_admin.adminPool.titlelogo) }}" alt="{{ sonata_admin.adminPool.title }}">
</div>
{% endif %}
{% if sonata_admin.adminPool.getOption('title_mode') in ['single_text', 'both'] %}
<span>{{ sonata_admin.adminPool.title }}</span>
{% endif %}
</a>
</div>
{% endblock %}
<div class="login-box-body">
{% block sonata_user_login_form %}
{% block sonata_user_login_error %}
{% if error %}
<div class="alert alert-danger alert-error">
{{ error.messageKey|trans(error.messageData, 'security') }}
</div>
{% endif %}
{% endblock %}
<p class="login-box-msg">{{ 'title_user_authentication'|trans({}, 'SonataUserBundle') }}</p>
{% if qrCodeUrl is defined %}
<div class="row">
<div class="col-xs-12">
<p align="middle"> <img src="{{ qrCodeUrl }}" alt="QR-code"></p>
<p align="middle">{{ 'qr_code_secret'|trans({}, 'SonataUserBundle') }}: {{ qrSecret }}</p>
<p align="middle">
<a href="{{ path('sonata_admin_dashboard') }}">{{ 'qr_go_next'|trans({}, 'SonataUserBundle') }}</a>
</p>
</div>
</div>
{% elseif two_step_submit|default(false) %}
<form method="POST" role="form">
{% if state == 'error' %}
<div class="alert alert-error">{{ 'label_two_step_code_error'|trans({}, 'SonataUserBundle') }}</div>
{% endif %}
<label for="_code">{{ 'label_two_step_code'|trans({}, 'SonataUserBundle') }}</label>
<div class="input-group input-group-lg">
<input type="text" class="form-control" id="_code" name="_code" autocomplete='off' />
<span class="input-group-btn">
<input class="btn btn-primary"
id="_submit"
name="_submit"
type="submit"
value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}" />
</span>
</div>
<span class="help-block sonata-ba-field-help">{{ 'message_two_step_code_help'|trans({}, 'SonataUserBundle') }}</span>
</form>
{% else %}
<form action="{{ path("sonata_user_admin_security_check") }}" method="post" role="form">
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}"/>

<div class="form-group has-feedback">
<input class="form-control"
id="username"
name="_username"
placeholder="{{ 'security.login.username'|trans({}, 'SonataUserBundle') }}"
required="required"
type="text"
value="{{ last_username }}"/>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>

<div class="form-group has-feedback">
<input class="form-control"
id="password"
name="_password"
placeholder="{{ 'security.login.password'|trans({}, 'SonataUserBundle') }}"
required="required"
type="password"/>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>

<div class="row">
<div class="col-xs-8">
<div class="checkbox">
<label>
<input type="checkbox" id="remember_me" name="_remember_me" value="on"/>
{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}
</label>
</div>
</div>
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}</button>
</div>
</div>
</form>
{% endif %}
{% endblock %}
</div>
</div>

{% endblock sonata_wrapper %}

Loading…
Cancel
Save