Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use radio buttons for selecting templates #3238

Conversation

bjorvack
Copy link
Contributor

Type

  • Enhancement

Pull request description

Renders the template choices using radiobuttons

@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #3238 (fbd7cf3) into page-template-choice-preview (6dd9a11) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##             page-template-choice-preview    #3238   +/-   ##
===============================================================
  Coverage                           33.05%   33.06%           
- Complexity                           8774     8775    +1     
===============================================================
  Files                                 663      664    +1     
  Lines                               32454    32458    +4     
===============================================================
+ Hits                                10729    10733    +4     
  Misses                              21725    21725           
Flag Coverage Δ Complexity Δ
functional 26.46% <100.00%> (+<0.01%) 0.00 <1.00> (ø)
installer 4.78% <0.00%> (+<0.01%) 0.00 <1.00> (ø)
unit 12.26% <0.00%> (-0.01%) 0.00 <1.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...Modules/Pages/Domain/Page/Form/PageContentType.php 87.05% <100.00%> (+0.15%) 20.00 <0.00> (ø)
...d/Modules/Pages/Domain/Page/Form/TemplatesType.php 100.00% <100.00%> (ø) 1.00 <1.00> (?)
src/Common/Core/Init.php 81.81% <0.00%> (-9.10%) 6.00% <0.00%> (ø%)
...le/InstallerBundle/Service/RequirementsChecker.php 96.72% <0.00%> (+0.40%) 34.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6dd9a11...96de0a2. Read the comment docs.

<input class="form-check-input" type="radio" name="templateRadios" id="templateRadio2" value="templateName2" checked>
<label class="form-check-label" for="templateRadio2">
Template name <br>
{% for template in form.templateId.children %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not show the visualisation of the template anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, this is done on line 301

<div class="template-visual-small">
{{ selectedTemplate.html|raw }}
{{ template.vars.attr['data-html']|raw }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you add in in the attr field, does it then not also appear on as an attribute on the checkbox?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carakas changed in bd842e9

@carakas
Copy link
Member

carakas commented Nov 27, 2020

I think it is better to create a custom form type and pass it like this https://github.com/forkcms/forkcms/blob/master/src/Backend/Form/Type/MetaType.php#L307 and then use the id of the template as key or something

@carakas carakas added the Restructure Core Issues related to the restructure core branch label Dec 5, 2020
@bjorvack
Copy link
Contributor Author

bjorvack commented Feb 9, 2021

@carakas It wasn't lazy loaded. I've updated the code in 96de0a2

@carakas carakas merged commit cf086ec into forkcms:page-template-choice-preview Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Restructure Core Issues related to the restructure core branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants