Responsive and upgrade

This commit is contained in:
Simon Vieille 2015-04-23 14:14:53 +02:00
parent 22f5f80f80
commit a9fbb2ced6
21 changed files with 120 additions and 26 deletions

View file

@ -18,7 +18,7 @@
<link rel="stylesheet" href="{{ asset('/bundles/deblanblog/syntaxhighlighter/styles/shCoreEclipse.css') }}" />
<link rel="stylesheet" href="{{ asset('/bundles/deblanblog/syntaxhighlighter/styles/shThemeEclipse.css') }}" />
{# <link rel="stylesheet" href="//vjs.zencdn.net/4.3/video-js.css" /> #}
<link rel="stylesheet" href="{{ asset('/bundles/deblanblog/css/main.css') }}?v=4" />
<link rel="stylesheet" href="{{ asset('/bundles/deblanblog/css/main.css') }}?v=10" />
{% endblock %}
{{ get_var('CssBlock')|raw }}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@ -205,10 +205,8 @@
{% block javascripts %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="{{ asset('/bundles/deblanblog/bootstrap/js/bootstrap.min.js') }}"></script>
<script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f1bf1591e040670"></script>
<script type="text/javascript" src="{{ asset('/bundles/deblanblog/syntaxhighlighter/scripts/shCore.js') }}"></script>
<script type="text/javascript" src="{{ asset('/bundles/deblanblog/syntaxhighlighter/scripts/shAutoloader.js') }}"></script>
{# <script type="text/javascript" src="//vjs.zencdn.net/4.3/video.js"></script> #}
<script type="text/javascript" src="{{ asset('/bundles/deblanblog/js/main.js?v=7') }}"></script>
<noscript><p><img src="https://piwik.deblan.org/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>

View file

@ -32,7 +32,7 @@ h1 a:hover {
#header {
height: 200px;
background: #333333 url(../img/header.jpg) center center;
background: #333333 url(../img/header.jpg) -1130px 0;
}
#bottom {
@ -427,6 +427,9 @@ aside .glyphicon {
position: relative;
margin-top: -105px;
height: 105px;
margin-left: auto;
margin-right: auto;
width: 990px;
}
#wrap {
@ -437,6 +440,14 @@ aside .glyphicon {
overflow: auto;
padding-bottom: 110px;
min-height: 500px;
margin: auto;
width: 990px;
}
@media (max-width: 990px) {
#bottom, #main {
width: 100%;
}
}
#footer {

View file

@ -2,7 +2,7 @@
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Deblan - Blog</title>
<link>http://www.deblan.tv/</link>
<link>http://www.deblan.io/</link>
<description>Deblan - Blog</description>
<language>fr</language>

Binary file not shown.

View file

@ -35,6 +35,10 @@ class RequestListener
}
}
if (!$event->getRequest()->get('_route')) {
return false;
}
$this->breadcrumbManager->buildCrudBreadcrumbFor($event->getRequest());
return true;

View file

@ -46,6 +46,8 @@ class CrudConfiguration
protected $sort = null;
protected $sortOrder = \Criteria::ASC;
protected $highlighting = 'edit';
protected $rankable = false;
protected $i18nCultures = array();
@ -737,4 +739,16 @@ class CrudConfiguration
{
return $this->collections;
}
public function setHighlighting($highlighting)
{
$this->highlighting = $highlighting;
return $this;
}
public function getHighlighting()
{
return $this->highlighting;
}
}

View file

@ -488,6 +488,7 @@ class BaseAdminController extends Controller
'fields' => $this->getFields(),
'fields_templates' => $this->getConfiguration()->getFieldsTemplates(),
'fields_attrs' => $this->getConfiguration()->getDisplayFieldsAttrs(),
'highlighting' => $this->getConfiguration()->getHighlighting(),
'list_actions' => $this->getConfiguration()->getIndexListActions(),
'index_actions' => $this->getConfiguration()->getIndexActions(),
'batch_actions' => $this->getConfiguration()->getBatchActions(),
@ -512,7 +513,7 @@ class BaseAdminController extends Controller
$response = new Response();
$response->headers->setCookie($cookie);
return $response->send();
return $response->sendHeaders();
}
protected function exportTo($format)
@ -559,9 +560,9 @@ class BaseAdminController extends Controller
$form = $this->getConfiguration()->getFormEdit();
if($this->has($form)){
if ($this->has($form)) {
$form = $this->createForm($this->get($form)->getName(), $object, $this->getConfiguration()->getFormEditOptions());
}else {
} else {
$form = $this->createForm(new $form($this->getConfiguration()->getFormEditOptions()), $object);
}
@ -599,9 +600,9 @@ class BaseAdminController extends Controller
$form = $this->getConfiguration()->getFormNew();
if($this->has($form)){
if ($this->has($form)) {
$form = $this->createForm($this->get($form)->getName(), $object, $this->getConfiguration()->getFormNewOptions());
}else {
} else {
$form = $this->createForm(new $form($this->getConfiguration()->getFormNewOptions()), $object);
}

View file

@ -1301,6 +1301,10 @@ li.item p {
margin-left: 157px;
}
.vars .mce-tinymce.mce-container.mce-panel {
margin-left: 160px;
}
.user_profile_edit:hover {
cursor: pointer;
}

View file

@ -14,7 +14,7 @@
{% for key, field in fields %}
<td class="cols_td">
{% set href = list_actions.edit is defined and key == 0 ? path(route_prefix ~ "edit", { id: object.id }) : false %}
{% set href = list_actions[highlighting] is defined and key == 0 ? path(route_prefix ~ highlighting, { id: object.id }) : false %}
{{ field_render(object, field.method, field.template, href) }}
</td>

View file

@ -27,7 +27,7 @@ class Node extends BaseNode
public function __toString()
{
return (string) $this->getTitle();
return (string)$this->getTitle();
}
public function getHttpMethod()
@ -55,7 +55,7 @@ class Node extends BaseNode
public function getRealRouteName()
{
if ($navId = $this->getNavId()) {
return $this->getNavId().'_'.$this->getRouteName();
return $this->getNavId() . '_' . $this->getRouteName();
}
return $this->getRouteName();
@ -325,7 +325,11 @@ class Node extends BaseNode
continue;
}
if (in_array($param->getName(), $injected_params) && in_array($param->getName(), array_keys($defaults))) {
if (in_array($param->getName(), $injected_params) && in_array(
$param->getName(),
array_keys($defaults)
)
) {
$this->setUrl(preg_replace('`\/{' . $param->getName() . '}`', '', $this->getUrl()));
} elseif (!preg_match('`{' . $param->getName() . '}`', $this->getUrl())) {
$this->setUrl(sprintf('%s/{%s}', $this->getUrl(), $param->getName()));
@ -527,13 +531,15 @@ class Node extends BaseNode
return \PropelQuery::from($this->getPage()->getDataModel());
}
public function getDataModelsCollection()
public function getDataModelsCollection($raw = false)
{
$method = method_exists(
$this->getDataModelQuery(),
'dataModelsCollectionFind'
) ? 'dataModelsCollectionFind' : 'find';
$method = ($raw) ? 'find' : $method;
return $this->layOnDataModels() ? call_user_func(array($this->getDataModelQuery(), $method)) : array();
}
@ -580,7 +586,11 @@ class Node extends BaseNode
public function getRequirements()
{
return '{' . preg_replace('/^\{{1}(.*)\}{1}$/is', '$1', str_replace(array("\r", "\n"), '', parent::getRequirements())) . '}';
return '{' . preg_replace(
'/^\{{1}(.*)\}{1}$/is',
'$1',
str_replace(array("\r", "\n"), '', parent::getRequirements())
) . '}';
}
public function addDefaultParams($params)

View file

@ -1,6 +1,7 @@
<?php
namespace Trinity\Bundle\ContentManagerBundle\Model;
use Symfony\Component\Debug\Exception\FatalErrorException;
use ZendSearch\Lucene\Document;
use ZendSearch\Lucene\Document\Field;
use Trinity\Bundle\ContentManagerBundle\Model\om\BasePage;
@ -194,7 +195,11 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface
protected function getNewBlock($name, $pageId = null)
{
$type = $this->getConfiguration()->getBlock($name)->getType();
$block = $this->getConfiguration()->getBlock($name);
if(!$block){
throw new FatalErrorException($name." block don't exist or is not registered for this page");
}
$type = $block->getType();
$form = new $type();
$formModel = $form->getOption('data_class') ? $form->getOption('data_class') : 'Trinity\Bundle\ContentManagerBundle\Model\Block';

View file

@ -44,6 +44,7 @@ class NotificationCrudConfiguration extends \Trinity\Bundle\AdminBundle\Configur
->setFieldTemplate('is_read', 'TrinityAdminBundle:BaseAdmin:bool.html.twig')
->setFieldTemplate('user_id', 'TrinityNotificationBundle:NotificationAdmin:user.html.twig')
->setFieldTemplate('log_content_render', 'TrinityAdminBundle:BaseAdmin:raw.html.twig')
->setDisplayFieldAttrs('user_id', array('width' => 80))
->setDisplayFieldAttrs('is_read', array('width' => 80))

View file

@ -46,5 +46,13 @@ class NotificationFilterType extends BaseAbstractType
)
)
);
$builder->add(
'logContentRender',
'text',
array(
'required' => false,
)
);
}
}

View file

@ -41,7 +41,7 @@ class TemplateType extends BaseAbstractType
)
);
if ($options['use_ace_editor'] == true) {
if ($options['use_ace_editor'] === true) {
$builder->add(
'content',
'ace_editor',

View file

@ -67,6 +67,16 @@ class EmailNotifier extends AbstractNotifier
'text/html'
);
if (isset($data['attachments']) && is_array($data['attachments']) && !empty($data['attachments'])) {
foreach ($data['attachments'] as $file) {
if (is_object($file) && $file instanceof \Swift_Attachment) {
$message->attach($file);
} elseif (is_string($file) && file_exists($file) && is_readable($file) && !is_dir($file)) {
$message->attach(\Swift_Attachment::fromPath($file));
}
}
}
$this->mailer->send($message);
$this->basicNotifier->notify($template, $data);

View file

@ -50,6 +50,10 @@
<source>Log_content_render</source>
<target>Contenu du log</target>
</trans-unit>
<trans-unit id="13">
<source>Log content render</source>
<target>Contenu du log</target>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -69,17 +69,16 @@
</ul>
<div class="tab-content">
{% for key, tabs in fieldset.tabs %}
<div class="tab-pane {% if loop.first %}active{% endif %}" id="pan-{{ mkey }}-{{ key }}">
<div class="vars tab-pane {% if loop.first %}active{% endif %}" id="pan-{{ mkey }}-{{ key }}">
<fieldset>
<div class="control-group well">
{% for fieldname in tabs.fields %}
<div>
{{ form_label(form[fieldname], fieldname|trans({}, 'TrinityVarsEditorBundle'), { 'label_attr': {'class': 'control-label'} }) }}
{{ form_label(form[fieldname], null, { 'label_attr': {'class': 'control-label'} }) }}
{{ form_errors(form[fieldname]) }}
{{ form_widget(form[fieldname]) }}
</div>
{% endfor %}
</div>
@ -102,3 +101,4 @@
</div>
</div>
{% endblock %}

View file

@ -131,6 +131,30 @@ class Image
return $this;
}
public function autoRotate()
{
$orientation = $this->getTool()->getImageOrientation();
switch ($orientation) {
case \Imagick::ORIENTATION_BOTTOMRIGHT:
$this->getTool()->rotateimage("#000", 180); // rotate 180 degrees
break;
case \Imagick::ORIENTATION_RIGHTTOP:
$this->getTool()->rotateimage("#000", 90); // rotate 90 degrees CW
break;
case \Imagick::ORIENTATION_LEFTBOTTOM:
$this->getTool()->rotateimage("#000", -90); // rotate 90 degrees CCW
break;
}
$this->getTool()->setImageOrientation(\Imagick::ORIENTATION_TOPLEFT);
return $this;
}
public function save($output = null)
{
if (null === $output) {

View file

@ -7,10 +7,10 @@ DirectoryIndex app.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{SERVER_NAME} =www.deblan.tv
RewriteRule .*admin.* https://www.deblan.tv%{REQUEST_URI} [R,L]
RewriteCond %{SERVER_NAME} =www.deblan.io
RewriteRule .*admin.* https://www.deblan.io%{REQUEST_URI} [R,L]
# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper

View file

@ -3,9 +3,9 @@
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
if (!in_array($_SERVER['SERVER_NAME'], ['www.deblan.tv', 'v1.deblan.org', 'localhost'])) {
if (!in_array($_SERVER['SERVER_NAME'], ['www.deblan.io', 'v1.deblan.org', 'localhost'])) {
header("HTTP/1.0 301 Moved Permanently");
header("Location: http://www.deblan.tv".$_SERVER['REQUEST_URI']);
header("Location: http://www.deblan.io".$_SERVER['REQUEST_URI']);
die;
}