Skip to content

Commit

Permalink
Revert "Feat-58"
Browse files Browse the repository at this point in the history
This reverts commit 1e14315.
  • Loading branch information
Florent Gallardo committed Jun 13, 2014
1 parent 1e14315 commit eed6f7c
Show file tree
Hide file tree
Showing 9 changed files with 261 additions and 140 deletions.
1 change: 0 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function getConfigTreeBuilder()
->prototype('array')
->children()
->scalarNode('class')->end()
->scalarNode('label')->end()
->arrayNode('sub_templates')
->prototype('scalar')->end()
->end()
Expand Down
21 changes: 0 additions & 21 deletions Form/Type/TemplateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
{
$templates = $options['data'];

$this->toArrayTemplates($templates);

$builder
->add(
'template',
Expand Down Expand Up @@ -68,25 +66,6 @@ public function toStringTemplates($templates)

asort($nTemplates);

return $nTemplates;
}

public function toArrayTemplates($templates)
{
$nTemplates = array();

foreach ($templates as $key => $template) {
$nTemplates[$key] = array(
"label" => isset($template['label']) ? $template['label'] : '',
"subTemplates" => array()
);
foreach ($template['sub_templates'] as $subTemplates => $label) {
$nTemplates[$key]['subTemplates'][$subTemplates] = $label;
}
}

asort($nTemplates);

$this->templates = $nTemplates;

return $nTemplates;
Expand Down
233 changes: 217 additions & 16 deletions Resources/public/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,224 @@
div#templates {margin-bottom: 15px}
div#templates .group-title {display: block; text-align: center; height: 40px; line-height: 40px;border-bottom: 1px solid #000;margin-bottom: 10px;text-transform:uppercase;}
div#templates .icon-ok { margin-top: -3px }
div#dashboard_actions {width:100%;height:30px;clear:both;}
div#dashboard_actions div {
background-color: #f8f8f8;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2));
background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -o-linear-gradient(top, #f8f8f8, #f2f2f2);
background: linear-gradient(top, #f8f8f8, #f2f2f2);
border-top-right-radius: 3px;
border-top-left-radius: 3px;
text-shadow: 0px 1px #fff;
border: 1px solid #ccc;
color: #666;
font-size: 11px;
font-weight: bold;
padding: 3px 5px;
text-align:center;
float:left;
margin:10px 20px;
}

div#templates .item-template { width: 20%;border: 1px solid #333; border-radius: 5px;margin: 2px 0 0 2px}
div#templates .item-template .template-row { width: 100%;display:inline-block;}
div#widget_sc_container {
border: 1px solid #c9c9c9;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
border-radius: 3px;
margin: 10px 0 20px 10px;
width: 50%;
float:left;
}

div#widget_sc_container div#header_widget_sc_container {
background-color: #f8f8f8;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2));
background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -o-linear-gradient(top, #f8f8f8, #f2f2f2);
background: linear-gradient(top, #f8f8f8, #f2f2f2);
border-top-right-radius: 3px;
border-top-left-radius: 3px;
text-shadow: 0px 1px #fff;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
color: #666;
font-size: 13px;
font-weight: bold;
padding: 8px 15px;
text-align:center;
}

div#templates .item-template.w2 { width: 40%; }
div#templates .item-template.w2 .template-row { width: 49%;display:inline-block;}
div#widget_sc_container div#body_widget_sc_container {background-color:#fff;width:100%;min-height:100px;height:auto !important;height:100px;float:left;border-left: 1px solid #ccc;border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;}
div#widget_sc_container div#body_widget_sc_container div.widget_elt {
background-color: #f8f8f8;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2));
background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -o-linear-gradient(top, #f8f8f8, #f2f2f2);
background: linear-gradient(top, #f8f8f8, #f2f2f2);
border-top-right-radius: 3px;
border-top-left-radius: 3px;
text-shadow: 0px 1px #fff;
border: 1px solid #ccc;
color: #666;
font-size: 11px;
font-weight: bold;
padding: 3px 5px;
text-align:center;
float:left;
margin:10px 20px;
}

div#templates .item-template.w3 { width: 60%; }
div#templates .item-template.w3 .template-row { width: 32%;display:inline-block;}
div#sidebar_container {
border: 1px solid #c9c9c9;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
border-radius: 3px;
margin: 10px 0 20px 20px;
width: 45%;
float:left;
}

div#templates .item-template.w4 { width: 80%; }
div#templates .item-template.w4 .template-row { width: 24%;display:inline-block;}
div#sidebar_container div#header_sidebar_container {
background-color: #f8f8f8;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2));
background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -o-linear-gradient(top, #f8f8f8, #f2f2f2);
background: linear-gradient(top, #f8f8f8, #f2f2f2);
border-top-right-radius: 3px;
border-top-left-radius: 3px;
text-shadow: 0px 1px #fff;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
color: #666;
font-size: 13px;
font-weight: bold;
padding: 8px 15px;
text-align:center;
position:relative;
}
div#sidebar_container div#header_sidebar_container span {position:absolute;top:0;right:0;margin:9px 12px 0 0;}

div#templates .item-template.w5 { width: 100%; }
div#templates .item-template.w5 .template-row { width: 19%;display:inline-block;}
div#body_sidebar_container {background-color:#fff;width:100%;min-height:100px;height:auto !important;height:100px;float:left;border-left: 1px solid #ccc;border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;}

div#sidebar_container div.sidebar_elt {width:80%;margin:10px auto;border:1px solid #ccc;background-color:#fff;}

div#sidebar_container div.header_sidebar_elt {
background-color: #f8f8f8;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2));
background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -o-linear-gradient(top, #f8f8f8, #f2f2f2);
background: linear-gradient(top, #f8f8f8, #f2f2f2);
border-top-right-radius: 3px;
border-top-left-radius: 3px;
text-shadow: 0px 1px #fff;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
color: #666;
font-size: 12px;
font-weight: bold;
padding: 4px 15px;
text-align:center;
position:relative;
}

div#sidebar_container div.header_sidebar_elt span {position:absolute;top:0;right:0;margin:5px 12px 0 0;}
div#sidebar_container div.header_sidebar_elt span.glyphicon-pencil,
div#sidebar_container div.header_sidebar_elt span.glyphicon-edit {margin:5px 30px 0 0;}
div#sidebar_container div.header_sidebar_elt span.glyphicon-magnet {margin:5px 87% 0 0;}

div#sidebar_container div.body_sidebar_elt {background-color: #fff;min-height:50px;height:auto !important;height:50px;}

div#sidebar_container div.body_sidebar_elt form {padding:10px;}

div#sidebar_container div.body_sidebar_elt div.form_widget_element {width:80%;margin:10px auto;border:1px solid #ccc;postion:relative;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.header_form_widget_element {
background-color: #f8f8f8;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2));
background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -o-linear-gradient(top, #f8f8f8, #f2f2f2);
background: linear-gradient(top, #f8f8f8, #f2f2f2);
border-top-right-radius: 3px;
border-top-left-radius: 3px;
text-shadow: 0px 1px #fff;
border-top: 1px solid #fff;
color: #666;
font-size: 12px;
font-weight: bold;
padding: 4px 15px;
text-align:center;
cursor:pointer;
position:relative;
}

div#sidebar_container div.body_sidebar_elt div.form_widget_element div.header_form_widget_element a {position:absolute;top:0;right:0;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.header_form_widget_element span {position:absolute;top:0;right:0;margin:5px 12px 0 0;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.header_form_widget_element span.glyphicon-pencil,
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.header_form_widget_element span.glyphicon-edit {margin:5px 30px 0 0;}

div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element {background-color: #fff;display:none;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element .sidebar_select {display:none;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element .chosen-single {display:none;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element .chosen-drop {display:none;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element div.widget-body {border-top:1px solid #CCC;}

div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element div.form-group label {width:95%;padding-left:5%;text-align:left;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element div.form-group label {width:95%;padding-left:5%;text-align:left;}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element div.form-group input,
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element div.form-group textarea{
width:90%;margin-left:5%;
}
div#sidebar_container div.body_sidebar_elt div.form_widget_element div.body_form_widget_element div.form-group label[for="bigfoot_bundle_contentbundle_staticcontenttype_template"] {display:none;}

div#sidebar_container div#sidebar_filter {width:95%;float:left;margin: 10px 0 20px 20px;}

div#sidebar_container div.sidebar_category {
border: 1px solid #c9c9c9;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
border-radius: 3px;
margin: 10px 0 20px 20px;
width:95%;
float:left;
}

div#sidebar_container div.sidebar_category div.sidebar_category_header {
background-color: #f8f8f8;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2));
background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2);
background: -o-linear-gradient(top, #f8f8f8, #f2f2f2);
background: linear-gradient(top, #f8f8f8, #f2f2f2);
border-top-right-radius: 3px;
border-top-left-radius: 3px;
text-shadow: 0px 1px #fff;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
color: #666;
font-size: 13px;
font-weight: bold;
padding: 8px 15px;
text-align:center;
position:relative;
}

div#sidebar_container div.sidebar_category div.sidebar_category_header span {position:absolute;top:0;right:0;margin:9px 12px 0 0;}

div#sidebar_container div.sidebar_category div.sidebar_category_header span.glyphicon-pencil,
div#sidebar_container div.sidebar_category div.sidebar_category_header span.glyphicon-edit {margin:9px 30px 0 0;}

div#sidebar_container div.sidebar_category div.sidebar_category_body {background-color:#e2e0e0;width:100%;min-height:100px;height:auto !important;height:100px;float:left;border-left: 1px solid #ccc;border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;}

div#templates .template-row { text-align: center;position:relative;}
div#templates .template-row:after {content:"";width:1px;height:60%;background:#acacac;position:absolute;top:27px;right:0; }
div#templates .template-row:last-child:after {background:#fff;visibility: hidden;}
9 changes: 0 additions & 9 deletions Resources/public/js/content.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
$(function() {

$( ".template-row" ).each(function() {
var $radio = $(this).find('input[type=radio]');
$radio.click(function() {
$('.template-row i.icon-ok').hide();
$(this).parent().parent().find('i.icon-ok').show();
});

});

/**
* Handle modal response
*/
Expand Down
9 changes: 0 additions & 9 deletions Resources/public/js/masonry.pkgd.min.js

This file was deleted.

35 changes: 13 additions & 22 deletions Resources/views/Block/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
{% form_theme form bigfoot_theme_bundle ~ ':content:form/page/blocks.html.twig' bigfoot_theme_bundle ~ ':content:form/page/sidebars.html.twig' %}

{% block form %}

<div id="templates">
<div class="item-template w{{ form.content.template|length }}" style="width: 100%">
<span class="group-title">{{ form.content.vars.label }}</span>
{% for template in form.content.template %}
<div class="template-row">
<label style="text-align:center;">
{{ form_widget(template) }}
<img src="{{ asset('images/template/block/' ~ template.vars.value ~ '.svg') }}"><br />
<span style="font-size:9px;">{{ template.vars.label }}</span>
<i class="icon-ok bigger-110 bigger-160 green" {% if not template.vars.checked %}style="display: none"{% endif %}></i>
</label>
</div>
{% endfor %}
</div>
</div>
{{ form_label(form.content.template) }}

<ul>
{% for template in form.content.template %}
<li class="template-row inline" style="margin-right:10px;">
<label style="text-align:center;">
{{ form_widget(template) }}
<img src="{{ asset('images/template/block/' ~ template.vars.value ~ '.svg') }}"><br />
<span style="font-size:9px;">{{ template.vars.label }}</span>
</label>
</li>
{% endfor %}
</ul>

{{ form_rest(form) }}
{% endblock %}
Expand All @@ -27,10 +24,4 @@
{{ parent() }}

<script src="{{ asset('bundles/bigfootcontent/js/content.js') }}"></script>
{% endblock %}

{% block stylesheets %}
{{ parent() }}

<link rel="stylesheet" href="{{ asset('bundles/bigfootcontent/css/styles.css') }}" />
{% endblock %}
35 changes: 13 additions & 22 deletions Resources/views/Page/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@
bigfoot_theme_bundle ~ ':content:form/page/sidebars.html.twig' %}

{% block form %}

<div id="templates">
<div class="item-template w{{ form.content.template|length }}" style="width: 100%">
<span class="group-title">{{ form.content.vars.label }}</span>
{% for template in form.content.template %}
<div class="template-row">
<label style="text-align:center;">
{{ form_widget(template) }}
<img src="{{ asset('images/template/page/' ~ template.vars.value ~ '.svg') }}"><br />
<span style="font-size:9px;">{{ template.vars.label }}</span>
<i class="icon-ok bigger-110 bigger-160 green" {% if not template.vars.checked %}style="display: none"{% endif %}></i>
</label>
</div>
{% endfor %}
</div>
</div>
{{ form_label(form.content.template) }}

<ul>
{% for template in form.content.template %}
<li class="template-row inline" style="margin-right:10px;">
<label style="text-align:center;">
{{ form_widget(template) }}
<img src="{{ asset('images/template/page/' ~ template.vars.value ~ '.svg') }}"><br />
<span style="font-size:9px;">{{ template.vars.label }}</span>
</label>
</li>
{% endfor %}
</ul>

{{ form_rest(form) }}
{% endblock %}
Expand All @@ -31,10 +28,4 @@
<script src="{{ asset('bundles/bigfootcontent/js/page.js') }}"></script>
<script src="{{ asset('bundles/bigfootcontent/js/block.js') }}"></script>
<script src="{{ asset('bundles/bigfootcontent/js/content.js') }}"></script>
{% endblock %}

{% block stylesheets %}
{{ parent() }}

<link rel="stylesheet" href="{{ asset('bundles/bigfootcontent/css/styles.css') }}" />
{% endblock %}
Loading

0 comments on commit eed6f7c

Please sign in to comment.