-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split columns section from radio table settings screen
Issue #116
- Loading branch information
1 parent
09b46dd
commit 45c646a
Showing
12 changed files
with
220 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* columns UI */ | ||
|
||
.JS .radio-table-columns { | ||
margin: 1.2em auto; | ||
} | ||
.JS .radio-table-columns .form-item { | ||
background: #F3F3F3; | ||
box-shadow: inset 2px 2px 2px #DEDEDE; | ||
border: 1px solid #C2C2C2; | ||
padding: 0.5em 1em; | ||
box-sizing: border-box; | ||
display: flex; | ||
align-items: center; | ||
} | ||
.JS .radio-table-columns .form-item label { | ||
margin: 0; | ||
} | ||
.JS .radio-table-columns .form-item > :last-child { | ||
text-align: right; | ||
flex: 1; | ||
} | ||
.JS .radio-table-columns .form-item.hidden-column { | ||
background: #FBFBFB; | ||
box-shadow: inset 2px 2px 2px #efefef; | ||
border-color: #dfdfdf; | ||
} | ||
.JS .radio-table-columns .form-item.hidden-column label { | ||
text-decoration: line-through; | ||
opacity: 0.5; | ||
} | ||
.JS .radio-table-columns .form-item button { | ||
display: inline; | ||
width: auto; | ||
height: 2em; | ||
min-width: 85px; | ||
margin: 0 0 0 0.6em; | ||
white-space: nowrap; | ||
} | ||
.JS .radio-table-columns .form-item button:first-of-type { | ||
margin-left: 0; | ||
} | ||
|
||
@media (max-width: 800px) | ||
{ | ||
.JS .radio-table-columns .form-item { | ||
flex-direction: row; | ||
} | ||
.JS .radio-table-columns .form-item label { | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
@media (max-width: 700px) | ||
{ | ||
.JS .radio-table-columns .form-item { | ||
flex-direction: column; | ||
} | ||
.JS .radio-table-columns .form-item label { | ||
margin-bottom: 0.7em; | ||
} | ||
.JS .radio-table-columns .form-item > :last-child { | ||
text-align: center; | ||
white-space: nowrap; | ||
} | ||
} | ||
@media (max-width: 440px) | ||
{ | ||
.JS .radio-table-columns .form-item button { | ||
min-width: auto; | ||
height: auto; | ||
font-size: 0.8em; | ||
padding-top: 0.6em; | ||
padding-bottom: 0.6em; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import '../css/radio-table-columns.css'; | ||
|
||
import { RadioTableColumnsUI } from './src/RadioTableColumnsUI.js'; | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
new RadioTableColumnsUI(document.querySelector('.radio-table-columns')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Form; | ||
|
||
use App\Entity\RadioTable; | ||
use App\Form\Type\RadioTableColumnsType as RadioTableColumnsUIType; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
class RadioTableColumnsType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilderInterface $builder, array $options): void | ||
{ | ||
$builder | ||
->add('columns', RadioTableColumnsUIType::class, [ | ||
'label_format' => 'column.%name%', | ||
'translation_domain' => 'radio_table', | ||
]) | ||
; | ||
} | ||
|
||
public function configureOptions(OptionsResolver $resolver): void | ||
{ | ||
$resolver->setDefaults([ | ||
'data_class' => RadioTable::class, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{% extends 'layout.html.twig' %} | ||
|
||
{% block page_title %}{{ 'radio_table.columns.title'|trans }}{% endblock %} | ||
|
||
{% block head_closing %} | ||
{{ encore_entry_link_tags('radio-table-columns') }} | ||
{{ encore_entry_script_tags('radio-table-columns') }} | ||
{% endblock %} | ||
|
||
{% block context_menu %} | ||
<ul> | ||
<li> | ||
<a href="{{ path('radio_table.show', {id: radio_table.id}) }}"> | ||
{{ 'radio_table.show.title'|trans }} | ||
</a> | ||
</li> | ||
<li> | ||
<a href="{{ path('radio_table.settings', {id: radio_table.id}) }}"> | ||
{{ 'radio_table.settings.title'|trans }} | ||
</a> | ||
</li> | ||
</ul> | ||
{% endblock %} | ||
|
||
{% block page_content %} | ||
<header> | ||
<h1 class="separated-title"> | ||
<span>{{ 'radio_table.columns.title'|trans }}</span> | ||
<span class="additional">{{ radio_table.name }}</span> | ||
</h1> | ||
</header> | ||
|
||
{{ form_start(form) }} | ||
|
||
<div class="tabbed-ui"> | ||
<div> | ||
<h2>{{ 'radio_table.settings.heading.columns'|trans }}</h2> | ||
|
||
<noscript> | ||
<p class="information"> | ||
{{ 'radio_table.settings.information.columns'|trans }} | ||
</p> | ||
</noscript> | ||
|
||
<div class="radio-table-columns"> | ||
{{ form_row(form.columns) }} | ||
|
||
<template class="radio-table-columns-buttons-template"> | ||
<button type="button" class="toggle" | ||
data-show-label="{{ 'radio_table.columns.columns_ui.action.toggle_show'|trans }}" | ||
data-hide-label="{{ 'radio_table.columns.columns_ui.action.toggle_hide'|trans }}"> | ||
</button> | ||
<button type="button" class="move-up">{{ 'radio_table.columns.columns_ui.action.move_up'|trans }}</button> | ||
<button type="button" class="move-down">{{ 'radio_table.columns.columns_ui.action.move_down'|trans }}</button> | ||
</template> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<button>{{ 'common.action.save'|trans }}</button> | ||
|
||
{{ form_end(form) }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.