Commit af71752c authored by Hermann Mayer's avatar Hermann Mayer

Page Entity now uses Sluggable Doctrine Extension. Added a help popover (styled…

Page Entity now uses Sluggable Doctrine Extension. Added a help popover (styled and configured in jity.js) to the slug field on the PageType.
parent 627cc4a2
......@@ -52,6 +52,7 @@ stof_doctrine_extensions:
orm:
default:
sortable: true
sluggable: true
# Swiftmailer Configuration
swiftmailer:
......
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" && cd "${DIR}/.."
php app/console doctrine:database:drop --force
php app/console doctrine:database:create
php app/console doctrine:schema:create
yes | php app/console doctrine:fixtures:load
rm -rf app/cache/dev
deploy @ 8ff3c33d
Subproject commit 7bd58d17b9eb3e999c0376af18ff0438db251f3e
Subproject commit 8ff3c33d5f0f0bd24bdca9c7a62c78a4bf78de67
......@@ -30,7 +30,6 @@ class LoadPageData extends AbstractFixture implements OrderedFixtureInterface
// Build Home Page
$home = new Page();
$home
->setSlug('about')
->setTitle('Über mich')
->setContent('<img src="{{ asset("bundles/jityhomepage/img/myself-cc3-300px.png") }}" alt="" class="img-polaroid pull-left" />
Mein Name ist Hermann Mayer, ich wurde am 02. August im Jahre 1992 in Berlin geboren und bin
......@@ -78,7 +77,6 @@ zusätzliche Arbeit bedeutet.
// Build Impress Page
$impress = new Page();
$impress
->setSlug('impressum')
->setTitle('Impressum')
->setContent('')
->setCategory($this->getReference('default-category'))
......@@ -96,7 +94,6 @@ zusätzliche Arbeit bedeutet.
// Build Contact Page
$contact = new Page();
$contact
->setSlug('kontakt')
->setTitle('Kontakt')
->setContent('')
->setCategory($this->getReference('default-category'))
......
......@@ -2,11 +2,17 @@
namespace Jity\HomepageBundle\Entity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="page")
* @ORM\Table(
* name="page",
* indexes={
* @ORM\Index(name="slug_idx", columns={"slug"})
* }
* )
*/
class Page
{
......@@ -18,7 +24,8 @@ class Page
protected $id;
/**
* @ORM\Column(type="string", length=100, unique=true)
* @Gedmo\Slug(fields={"title"})
* @ORM\Column(type="string", length=200)
*/
protected $slug;
......@@ -287,3 +294,4 @@ class Page
return $this->service;
}
}
......@@ -26,12 +26,18 @@ class PageType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('slug', null, array(
'label' => 'Schlagzeile (für die Url)'
))
->add('title', null, array(
'label' => 'Titel der Seite'
))
->add('slug', null, array(
'label' => 'Schlagzeile (für die Url)',
'attr' => array(
'rel' => 'popover',
'data-trigger' => 'focus',
'data-original-title' => 'Information',
'data-content' => 'Der Slug wird automatisch aus dem Titel generiert. Sie können ihn aber auch manuell festgelegt.'
)
))
->add('icon', null, array(
'attr' => array(
'data-target' => '#icons_modal',
......@@ -41,38 +47,38 @@ class PageType extends AbstractType
))
->add('content', null, array(
'attr' => array(
'rows' => '6',
'class' => 'span4',
'rows' => '6',
'class' => 'span4',
'data-target' => '#editor_modal',
'data-toggle' => 'modal'
),
'label' => 'Inhalt'
))
->add('service', 'entity', array(
'class'=>'Jity\HomepageBundle\Entity\Service',
'class' => 'Jity\HomepageBundle\Entity\Service',
'property' => 'title',
'required' => false,
'label' => 'Service'
'label' => 'Service'
))
->add('category', 'entity', array(
'class'=>'Jity\HomepageBundle\Entity\Category',
'class' => 'Jity\HomepageBundle\Entity\Category',
'property' => 'name',
'label' => 'Kategorie'
'label' => 'Kategorie'
))
->add('sidebar', 'entity', array(
'class'=>'Jity\HomepageBundle\Entity\Sidebar',
'class' => 'Jity\HomepageBundle\Entity\Sidebar',
'property' => 'name',
'label' => 'Sidebar'
'label' => 'Sidebar'
))
->add('navigation', 'entity', array(
'class'=>'Jity\HomepageBundle\Entity\Navigation',
'class' => 'Jity\HomepageBundle\Entity\Navigation',
'property' => 'name',
'label' => 'Navigation'
'label' => 'Navigation'
))
->add('author', 'entity', array(
'class'=>'Jity\HomepageBundle\Entity\User',
'class' => 'Jity\HomepageBundle\Entity\User',
'property' => 'email',
'label' => 'Autor'
'label' => 'Autor'
))
;
}
......
......@@ -324,6 +324,21 @@ input[type="url"], input[type="search"], input[type="tel"], input[type="color"],
box-shadow: 0 1px 0 #4D4945 inset;
}
.popover-title {
background-color: #3D3D3B;
border-bottom-color: #B54718;
color: #89827B;
}
.popover {
background-color: #313130;
color: #8F8F8F;
}
.popover.right .arrow {
border-right-color: #313130;
}
input::-moz-focus-inner, button::-moz-focus-inner {
border: 0;
}
......
$(document).ready(function() {
// Init google prettify
prettyPrint();
prettyPrint();
// Start popover on all rel elements
$("*[rel=popover]").popover();
});
......@@ -6,5 +6,5 @@
#</IfModule>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ maintenance/info.html [QSA,L]
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment