Skip to content

Commit

Permalink
Merge pull request #197 from loic425/features/fresh-admin
Browse files Browse the repository at this point in the history
Apply new fresh admin panel
  • Loading branch information
loic425 committed Jul 17, 2019
2 parents f3fa0df + 7312617 commit a4f946f
Show file tree
Hide file tree
Showing 8 changed files with 399 additions and 2 deletions.
38 changes: 38 additions & 0 deletions assets/backend/img/admin-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
230 changes: 230 additions & 0 deletions assets/backend/sass/_ui.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
$app-brand-color: #1abb9c;
$segment-spacing: 1.8em;
$segment-title-spacing: 1.2em 1.8em;
$accordion-title-spacing: 1.2em 1.8em;

// ----------------------------------
// ------------ Globals
// ----------------------------------

.ui.inverted.menu {
background: #1d212b;
}

body.pushable .pusher {
background: #f9f9f9;
}

#wrapper.full.height {
padding: 64px 12px 0 12px;
}

a {
color: $app-brand-color;
&:hover { color: $app-brand-color; }
}

// ----------------------------------
// ------------ Buttons
// ----------------------------------

.ui.button {
font-weight: 400;
}

.ui.primary.button {
background-color: $app-brand-color;
&:hover, &:focus { background-color: #279c7f; }
}

.ui.labeled.icon.button {
padding-left: 2.8em !important;
}

.ui.labeled.icon.button>.icon,
.ui.labeled.icon.buttons>.button>.icon {
width: 2.8em !important;
background: none !important;
padding-left: .2em;
}

// ----------------------------------
// ------------ Forms
// ----------------------------------

.ui.form .field > label {
margin: 0 0 .5rem 0;
color: rgba(0,0,0,.8);
font-weight: 400;
}

.ui.form .field > input:focus,
.ui.form .field > textarea:focus {
border-color: rgba($app-brand-color, .4);
}

// ----------------------------------
// ------------ Sidebar menu
// ----------------------------------

#sidebar.ui.sidebar.vertical.menu {
> .item:first-child {
margin-bottom: 10px;
}

> .item:not(:first-child) {
margin-right: 10px;
}

.item > .header {
text-transform: uppercase;
font-size: 11px;
margin-bottom: 16px;
}

.item > i.icon {
float: none !important;
margin: 2px 10px 2px 0 !important;
opacity: .5;
}

.item::before {
display: none;
}

.item.active {
font-weight: inherit !important;
background: $app-brand-color !important;
border-radius: 0 99px 99px 0 !important;
}
}

// ----------------------------------
// ------------ Header
// ----------------------------------

.ui.header {
.content {
padding-left: 1.3rem !important;
}

.content .sub.header {
font-size: 1rem;
color: #9a9a9a;
padding-top: 3px;
}

.circular.icon {
width: 2.5em !important;
height: 2.5em !important;
font-size: 1em;
color: $app-brand-color;
background: rgba($app-brand-color, .1);
box-shadow: none;
}
}

// ----------------------------------
// ------------ Breadcrumb
// ----------------------------------

.ui.breadcrumb {
.active {
color: #9a9a9a;
font-weight: 400 !important;
}

a {
color: #9a9a9a;
&:hover { color: $app-brand-color; }
}

.divider {
opacity: .4;
}
}

// ----------------------------------
// ------------ Segment
// ----------------------------------

.ui.segment,
.ui.attached.segment {
box-shadow: 0 2px 4px 0 rgba(34,36,38,.03);
border: 1px solid rgba(34,36,38,.1);
padding: $segment-spacing;
width: 100%;
}

.ui.attached.segment {
margin-left: 0;
margin-right: 0;
}

.ui.attached.header {
padding: $segment-title-spacing;
margin: 0;
box-shadow: 0 2px 4px 0 rgba(34,36,38,.03);
border: 1px solid rgba(34,36,38,.1);
border-bottom: 1px solid #eaeaea;
font-size: inherit;
}

.segment.spaceless {
padding: 0 !important;
}

// ----------------------------------
// ------------ Accordion
// ----------------------------------

.ui.styled.accordion {
box-shadow: 0 2px 4px 0 rgba(34,36,38,.03);
border: 1px solid rgba(34,36,38,.1);

.title {
padding: $accordion-title-spacing;
border-top: none;
}

.content {
padding: $segment-spacing;
border-top: 1px solid #eaeaea;
}
}

// ----------------------------------
// ------------ Pagination / Menu
// ----------------------------------

.ui.menu {
box-shadow: 0 2px 4px 0 rgba(34,36,38,.03);
border: 1px solid rgba(34,36,38,.1);
}

// ----------------------------------
// ------------ Table
// ----------------------------------

.sylius-grid-table-wrapper {
.ui.sortable.table {
thead th {
padding-top: 20px;
padding-bottom: 20px;

&.sorted {
background: inherit;
color: $app-brand-color;
}
}
}
}

// ----------------------------------
// ------------ Toggle
// ----------------------------------

.ui.toggle.checkbox input:checked~.box:before, .ui.toggle.checkbox input:checked~label:before,
.ui.toggle.checkbox input:focus:checked~.box:before, .ui.toggle.checkbox input:focus:checked~label:before {
background-color: $app-brand-color !important;
}
1 change: 1 addition & 0 deletions assets/backend/sass/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "ui";
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../../bash/common.li

prepare_for_behat_with_js() {
# Configure display
run_command "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16"
run_command "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 2880x1800x16"
run_command "export DISPLAY=:99"

# Download and configure ChromeDriver
Expand Down
2 changes: 2 additions & 0 deletions src/Behat/Resources/config/profiles/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ default:
- "start-fullscreen"
- "start-maximized"
- "no-sandbox"
extra_capabilities:
unexpectedAlertBehaviour: accept

FriendsOfBehat\SymfonyExtension: ~

Expand Down
6 changes: 5 additions & 1 deletion templates/backend/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
{% endblock %}

{% block sidebar %}
<a class="item" href="{{ path('app_backend_dashboard') }}"><b>AppName</b></a>
<a class="item" href="{{ path('app_backend_dashboard') }}" style="padding: 13px 0;">
<div style="max-width: 90px; margin: 0 auto;">
<img src="{{ asset('assets/backend/img/admin-logo.svg') }}" class="ui fluid image">
</div>
</a>
{{ knp_menu_render('app.admin.main', {'template': 'SyliusUiBundle:Menu:sidebar.html.twig'}) }}
{% endblock %}

Expand Down
88 changes: 88 additions & 0 deletions templates/bundles/SyliusUiBundle/Grid/_default.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}
{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}
{% import '@SyliusUi/Macro/messages.html.twig' as messages %}
{% import '@SyliusUi/Macro/table.html.twig' as table %}

{% set definition = grid.definition %}
{% set data = grid.data %}

{% set path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}

{% if definition.enabledFilters|length > 0 %}
<div class="ui hidden divider"></div>
<div class="ui styled fluid accordion">
<div class="title active">
<i class="dropdown icon"></i>
{{ 'sylius.ui.filters'|trans }}
</div>
<div class="content active">
<form method="get" action="{{ path }}" class="ui loadable form">
<div class="two fields">
{% for filter in definition.enabledFilters|sort_by('position') if filter.enabled %}
{{ sylius_grid_render_filter(grid, filter) }}

{% if loop.index0 % 2 %}
</div>
<div class="two fields">
{% endif %}
{% endfor %}
</div>
{{ buttons.filter() }}
{{ buttons.resetFilters(path) }}
</form>
</div>
</div>
{% endif %}

{% if data|length > 0 and definition.actionGroups.bulk is defined and definition.getEnabledActions('bulk')|length > 0 %}
<div class="ui hidden divider"></div>
<div class="ui styled fluid accordion">
<div class="title active">
<i class="dropdown icon"></i>
{{ 'sylius.ui.bulk_actions'|trans }}
</div>
<div class="content active">
{% for action in definition.getEnabledActions('bulk') %}
{{ sylius_grid_render_bulk_action(grid, action, null) }}
{% endfor %}
</div>
</div>
{% endif %}

<div class="ui hidden divider"></div>
<div class="sylius-grid-wrapper">
{% if definition.limits|length > 1 and data|length > min(definition.limits) %}
<div class="sylius-grid-nav">
<div class="sylius-grid-nav__pagination">
{{ pagination.simple(data) }}
</div>
<div class="sylius-grid-nav__perpage">
<div class="ui fluid one menu sylius-paginate">
{{ pagination.perPage(data, definition.limits) }}
</div>
</div>
</div>
{% else %}
{{ pagination.simple(data) }}
{% endif %}

{% if data|length > 0 %}
<div class="ui segment spaceless sylius-grid-table-wrapper">
<table class="ui sortable stackable very basic celled table">
<thead>
<tr>
{{ table.headers(grid, definition, app.request.attributes) }}
</tr>
</thead>
<tbody>
{% for row in data %}
{{ table.row(grid, definition, row) }}
{% endfor %}
</tbody>
</table>
</div>
{% else %}
{{ messages.info('sylius.ui.no_results_to_display') }}
{% endif %}
{{ pagination.simple(data) }}
</div>

0 comments on commit a4f946f

Please sign in to comment.