├── Resources
├── doc
│ ├── index.md
│ ├── search.md
│ ├── sphinx.md
│ └── installation
│ │ └── index.md
├── public
│ ├── css
│ │ ├── admin.css
│ │ ├── main.css
│ │ └── admin-login.css
│ ├── img
│ │ ├── like.png
│ │ ├── default.png
│ │ ├── not-like.png
│ │ ├── social
│ │ │ ├── rss.png
│ │ │ ├── digg.png
│ │ │ ├── dzone.png
│ │ │ ├── gmail.png
│ │ │ ├── home.png
│ │ │ ├── mail.png
│ │ │ ├── vimeo.png
│ │ │ ├── zabox.png
│ │ │ ├── behance.png
│ │ │ ├── blogger.png
│ │ │ ├── dribbble.png
│ │ │ ├── facebook.png
│ │ │ ├── flickr.png
│ │ │ ├── forrst.png
│ │ │ ├── google+.png
│ │ │ ├── joyoge.png
│ │ │ ├── lastfm.png
│ │ │ ├── linkedin.png
│ │ │ ├── netvibes.png
│ │ │ ├── newsvine.png
│ │ │ ├── picasa.png
│ │ │ ├── reddit.png
│ │ │ ├── tumblr.png
│ │ │ ├── twitter.png
│ │ │ ├── webblend.png
│ │ │ ├── youtube.png
│ │ │ ├── delicious.png
│ │ │ ├── designbump.png
│ │ │ ├── feedburner.png
│ │ │ ├── friendfeed.png
│ │ │ ├── friendster.png
│ │ │ ├── pinterest.png
│ │ │ ├── posterous.png
│ │ │ ├── technorati.png
│ │ │ ├── wordpress.png
│ │ │ ├── designfloat.png
│ │ │ ├── grooveshark.png
│ │ │ ├── livejournal.png
│ │ │ └── stumbleupon.png
│ │ └── ajax-loader.gif
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
│ └── js
│ │ ├── admin.js
│ │ ├── cookie.js
│ │ └── blog.js
├── views
│ ├── layout.flash.html.twig
│ ├── Post
│ │ ├── view.botton.html.twig
│ │ ├── view.related.html.twig
│ │ ├── view.header.html.twig
│ │ ├── view.tags.html.twig
│ │ ├── index.item.html.twig
│ │ ├── tag.html.twig
│ │ ├── view.comment.html.twig
│ │ ├── view.social.html.twig
│ │ ├── index.html.twig
│ │ └── view.html.twig
│ ├── SiteMap
│ │ ├── search.xml.twig
│ │ ├── tag.xml.twig
│ │ ├── post.xml.twig
│ │ ├── archive.xml.twig
│ │ └── index.xml.twig
│ ├── Pagination
│ │ ├── sortable_link.html.twig
│ │ └── sliding.html.twig
│ ├── Widget
│ │ ├── banner.html.twig
│ │ ├── links.html.twig
│ │ ├── tags.html.twig
│ │ ├── most.html.twig
│ │ ├── latestPostRelated.html.twig
│ │ ├── latestPost.html.twig
│ │ ├── latestComment.html.twig
│ │ ├── latestCommentRelated.html.twig
│ │ └── postViewRelated.html.twig
│ ├── Page
│ │ ├── faq.html.twig
│ │ ├── about.html.twig
│ │ └── cookies.html.twig
│ ├── Comment
│ │ ├── index.html.twig
│ │ ├── message.html.twig
│ │ └── form.html.twig
│ ├── Tag
│ │ ├── all.html.twig
│ │ └── index.html.twig
│ ├── Search
│ │ ├── form.html.twig
│ │ └── index.html.twig
│ ├── Report
│ │ ├── mostViewed.html.twig
│ │ ├── mostCommented.html.twig
│ │ ├── mostRated.html.twig
│ │ └── postedItems.html.twig
│ ├── Feed
│ │ └── index.xml.twig
│ ├── Archive
│ │ ├── index.html.twig
│ │ └── page.html.twig
│ ├── Profile
│ │ └── edit.html.twig
│ └── User
│ │ └── register.html.twig
└── config
│ ├── sphinx.xml
│ ├── imagine.xml
│ ├── twig.xml
│ ├── manager.xml
│ └── search.xml
├── .gitignore
├── .travis.yml
├── Tests
└── Functional
│ └── PostControllerTest.php
├── .formatter.yml
├── Event
├── PostEvents.php
├── RatingEvents.php
├── PostEvent.php
└── RatingEvent.php
├── BlogBundle.php
├── Model
├── CommentStatus.php
├── Gravatar.php
├── LinkStatus.php
└── PostStatus.php
├── Entity
├── Repository
│ ├── ImageRepository.php
│ ├── AuthorRepository.php
│ ├── PostHistoryRepository.php
│ ├── PostClickRepository.php
│ ├── PostViewRepository.php
│ ├── BannerRepository.php
│ ├── LinkRepository.php
│ └── CommentRepository.php
├── User.php
├── Image.php
├── Profile.php
├── Author.php
├── Tag.php
├── Comment.php
├── PostHistory.php
└── Banner.php
├── composer.json
├── EventListener
├── PostListener.php
└── RatingPostListener.php
├── phpunit.xml.dist
├── Twig
└── TwigExtension.php
├── Form
├── Model
│ ├── CommentModel.php
│ ├── SearchModel.php
│ └── ProfileModel.php
├── Type
│ ├── CommentType.php
│ ├── SearchType.php
│ └── ProfileType.php
└── Handler
│ ├── SearchHandler.php
│ ├── ProfileHandler.php
│ └── CommentHandler.php
├── Search
├── SearchInterface.php
├── AbstractSearch.php
├── MySQL.php
└── Sphinx.php
├── Controller
├── PageController.php
├── RatingController.php
├── RedirectController.php
├── SearchController.php
├── ProfileController.php
├── CommentController.php
├── FeedController.php
├── WidgetController.php
├── TagController.php
├── SiteMapController.php
├── ArchiveController.php
└── PostController.php
├── Manager
├── SanitizerManager.php
├── ProfileManager.php
├── RatingManager.php
├── PostManager.php
├── SearchManager.php
└── AbstractManager.php
├── README.md
├── .scrutinizer.yml
└── DependencyInjection
├── BlogExtension.php
└── Configuration.php
/Resources/doc/index.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Resources/public/css/admin.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Resources/public/css/main.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Resources/public/css/admin-login.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Resources/views/layout.flash.html.twig:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Resources/views/Post/view.botton.html.twig:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Resources/views/SiteMap/search.xml.twig:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Resources/public/img/like.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/like.png
--------------------------------------------------------------------------------
/Resources/public/img/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/default.png
--------------------------------------------------------------------------------
/Resources/public/img/not-like.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/not-like.png
--------------------------------------------------------------------------------
/Resources/public/img/social/rss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/rss.png
--------------------------------------------------------------------------------
/Resources/public/img/ajax-loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/ajax-loader.gif
--------------------------------------------------------------------------------
/Resources/public/img/social/digg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/digg.png
--------------------------------------------------------------------------------
/Resources/public/img/social/dzone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/dzone.png
--------------------------------------------------------------------------------
/Resources/public/img/social/gmail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/gmail.png
--------------------------------------------------------------------------------
/Resources/public/img/social/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/home.png
--------------------------------------------------------------------------------
/Resources/public/img/social/mail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/mail.png
--------------------------------------------------------------------------------
/Resources/public/img/social/vimeo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/vimeo.png
--------------------------------------------------------------------------------
/Resources/public/img/social/zabox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/zabox.png
--------------------------------------------------------------------------------
/Resources/public/img/social/behance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/behance.png
--------------------------------------------------------------------------------
/Resources/public/img/social/blogger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/blogger.png
--------------------------------------------------------------------------------
/Resources/public/img/social/dribbble.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/dribbble.png
--------------------------------------------------------------------------------
/Resources/public/img/social/facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/facebook.png
--------------------------------------------------------------------------------
/Resources/public/img/social/flickr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/flickr.png
--------------------------------------------------------------------------------
/Resources/public/img/social/forrst.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/forrst.png
--------------------------------------------------------------------------------
/Resources/public/img/social/google+.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/google+.png
--------------------------------------------------------------------------------
/Resources/public/img/social/joyoge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/joyoge.png
--------------------------------------------------------------------------------
/Resources/public/img/social/lastfm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/lastfm.png
--------------------------------------------------------------------------------
/Resources/public/img/social/linkedin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/linkedin.png
--------------------------------------------------------------------------------
/Resources/public/img/social/netvibes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/netvibes.png
--------------------------------------------------------------------------------
/Resources/public/img/social/newsvine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/newsvine.png
--------------------------------------------------------------------------------
/Resources/public/img/social/picasa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/picasa.png
--------------------------------------------------------------------------------
/Resources/public/img/social/reddit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/reddit.png
--------------------------------------------------------------------------------
/Resources/public/img/social/tumblr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/tumblr.png
--------------------------------------------------------------------------------
/Resources/public/img/social/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/twitter.png
--------------------------------------------------------------------------------
/Resources/public/img/social/webblend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/webblend.png
--------------------------------------------------------------------------------
/Resources/public/img/social/youtube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/youtube.png
--------------------------------------------------------------------------------
/Resources/public/img/social/delicious.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/delicious.png
--------------------------------------------------------------------------------
/Resources/public/img/social/designbump.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/designbump.png
--------------------------------------------------------------------------------
/Resources/public/img/social/feedburner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/feedburner.png
--------------------------------------------------------------------------------
/Resources/public/img/social/friendfeed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/friendfeed.png
--------------------------------------------------------------------------------
/Resources/public/img/social/friendster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/friendster.png
--------------------------------------------------------------------------------
/Resources/public/img/social/pinterest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/pinterest.png
--------------------------------------------------------------------------------
/Resources/public/img/social/posterous.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/posterous.png
--------------------------------------------------------------------------------
/Resources/public/img/social/technorati.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/technorati.png
--------------------------------------------------------------------------------
/Resources/public/img/social/wordpress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/wordpress.png
--------------------------------------------------------------------------------
/Resources/views/Pagination/sortable_link.html.twig:
--------------------------------------------------------------------------------
1 | {{ title }}
2 |
--------------------------------------------------------------------------------
/Resources/public/img/social/designfloat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/designfloat.png
--------------------------------------------------------------------------------
/Resources/public/img/social/grooveshark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/grooveshark.png
--------------------------------------------------------------------------------
/Resources/public/img/social/livejournal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/livejournal.png
--------------------------------------------------------------------------------
/Resources/public/img/social/stumbleupon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/img/social/stumbleupon.png
--------------------------------------------------------------------------------
/Resources/public/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Resources/public/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/desarrolla2/BlogBundle/HEAD/Resources/public/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Resources/views/Widget/banner.html.twig:
--------------------------------------------------------------------------------
1 | {% if banner %}
2 |
Please redefine this template
8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /Resources/views/Page/about.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BlogBundle::layout.html.twig" %} 2 | {% block title %} About US {% endblock %} 3 | {% block main %} 4 |Please redefine this template
8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /Resources/views/Comment/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BlogBundle::layout.html.twig" %} 2 | {% block title %} Añade un comentario {% endblock %} 3 | {% block meta_robots %}noindex{% endblock %} 4 | {% block main %} 5 | {% include 'BlogBundle:/Comment:form.html.twig' with {'form': form, 'post': post } %} 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /Resources/views/Page/cookies.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BlogBundle::layout.html.twig" %} 2 | {% block title %} Politica de cookies {% endblock %} 3 | {% block main %} 4 |Please redefine this template
8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /Resources/views/Widget/tags.html.twig: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.3 5 | - 5.4 6 | - 5.5 7 | - 5.6 8 | - hhvm 9 | 10 | notifications: 11 | email: 12 | - daniel@desarrolla2.com 13 | 14 | before_script: 15 | - composer update --prefer-source --dev --verbose --optimize-autoloader --profile 16 | - cp phpunit.xml.dist phpunit.xml 17 | -------------------------------------------------------------------------------- /Resources/views/Widget/most.html.twig: -------------------------------------------------------------------------------- 1 |8 | Hemos recibido tu comentario, un administrador lo examinará para 9 | aprobarlo lo antes posible, puedes continuar navegando por los últimos 10 | elementos publicados en el sitio. 11 |
12 | {{ render(controller('BlogBundle:\\Widget:latestPost')) }} 13 |Fuente: 10 | {{ post }} 12 |
13 | {% endif %} 14 | 17 |No hay elementos
8 | {% endfor %} 9 | 10 | 13 | {% endblock %} 14 | 15 | {% block rss %} 16 | 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /Resources/views/Widget/postViewRelated.html.twig: -------------------------------------------------------------------------------- 1 | {% if related %} 2 |No hay elementos
16 | {% endfor %} 17 |Los campos marcados con (*) son obligatorios
23 | -------------------------------------------------------------------------------- /Model/LinkStatus.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Model; 15 | 16 | /** 17 | * 18 | * Description of LinkStatus 19 | * 20 | * @author : Daniel González Cerviño20 | Estás son las entradas más vistas durante {{ period }}. 21 |
22 |No hay elementos
28 | {% endfor %} 29 | 30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /Resources/views/Post/view.social.html.twig: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /Form/Model/CommentModel.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Form\Model; 15 | 16 | use Desarrolla2\Bundle\BlogBundle\Entity\Comment; 17 | use Symfony\Component\Validator\Constraints as Assert; 18 | 19 | /** 20 | * CommentModel 21 | */ 22 | class CommentModel 23 | { 24 | /** 25 | * @Assert\NotBlank() 26 | * @Assert\Length( min=5 ) 27 | */ 28 | protected $content; 29 | 30 | /** 31 | * @param Comment $comment 32 | */ 33 | public function __construct(Comment $comment) 34 | { 35 | $this->setContent($comment->getContent()); 36 | } 37 | 38 | /** 39 | * @return string 40 | */ 41 | public function getContent() 42 | { 43 | return $this->content; 44 | } 45 | 46 | /** 47 | * @param string $content 48 | */ 49 | public function setContent($content) 50 | { 51 | $this->content = $content; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Search/SearchInterface.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Search; 15 | 16 | use Desarrolla2\Bundle\BlogBundle\Entity\Post; 17 | use Knp\Component\Pager\Pagination\PaginationInterface; 18 | 19 | /** 20 | * 21 | * Description of SearchInterface 22 | * 23 | * @author : Daniel González20 | Estas son las entradas que fueron más comentadas {{ period }}. 21 |
22 |No hay elementos
28 | {% endfor %} 29 | 30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /Resources/views/Report/mostRated.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BlogBundle::layout.html.twig" %} 2 | {% block title %} Elementos más valorados {{ period }} {% endblock %} 3 | 4 | {% block main %} 5 | 6 |20 | Estas son las entradas que fueron mejor valoradas {{ period }}, solo se cuentan los votos obtenidos 21 | durante {{ period }}. 22 |
23 |No hay elementos
29 | {% endfor %} 30 | 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /Manager/SanitizerManager.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Manager; 15 | 16 | /** 17 | * SanitizerManager 18 | */ 19 | class SanitizerManager 20 | { 21 | /** 22 | * @param null $cacheDirectory 23 | * 24 | * @throws \InvalidArgumentException 25 | */ 26 | public function __construct($cacheDirectory = null) 27 | { 28 | if (!$cacheDirectory) { 29 | $cacheDirectory = realpath(sys_get_temp_dir()); 30 | } 31 | 32 | if (!is_writable($cacheDirectory)) { 33 | throw new \InvalidArgumentException($cacheDirectory.' is not writable'); 34 | } 35 | // require to configure some CONSTANST 36 | new \HTMLPurifier_Bootstrap(); 37 | $config = \HTMLPurifier_Config::createDefault(); 38 | $config->set('Cache.SerializerPath', $cacheDirectory); 39 | $this->purifier = new \HTMLPurifier($config); 40 | } 41 | 42 | public function doClean($string) 43 | { 44 | return $this->purifier->purify($string); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Entity/User.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Entity; 15 | 16 | use Doctrine\ORM\Mapping as ORM; 17 | use FOS\UserBundle\Model\User as BaseUser; 18 | 19 | /** 20 | * @ORM\Entity 21 | * @ORM\Table(name="fos_user") 22 | */ 23 | class User extends BaseUser 24 | { 25 | /** 26 | * @ORM\Id 27 | * @ORM\Column(type="integer") 28 | * @ORM\GeneratedValue(strategy="AUTO") 29 | */ 30 | protected $id; 31 | 32 | /** 33 | * @ORM\OneToOne(targetEntity="Profile", mappedBy="user", cascade={"persist", "remove"}) 34 | **/ 35 | protected $profile; 36 | 37 | /** 38 | * Get id 39 | * 40 | * @return integer 41 | */ 42 | public function getId() 43 | { 44 | return $this->id; 45 | } 46 | 47 | /** 48 | * @return Profile 49 | */ 50 | public function getProfile() 51 | { 52 | return $this->profile; 53 | } 54 | 55 | /** 56 | * @param Profile $profile 57 | */ 58 | public function setProfile(Profile $profile) 59 | { 60 | $this->profile = $profile; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Resources/views/Pagination/sliding.html.twig: -------------------------------------------------------------------------------- 1 | {% if pageCount > 1 %} 2 |No hay elementos
27 | {% endfor %} 28 || 13 | | Entradas | 14 |Comentarios | 15 |Enlaces | 16 |
|---|---|---|---|
| Última dia | 20 |{{ post.last_day }} | 21 |{{ comment.last_day }} | 22 |{{ link.last_day }} | 23 |
| Última semana | 26 |{{ post.last_week }} | 27 |{{ comment.last_week }} | 28 |{{ link.last_week }} | 29 |
| Último mes | 32 |{{ post.last_month }} | 33 |{{ comment.last_month }} | 34 |{{ link.last_month }} | 35 |
| Último año | 38 |{{ post.last_year }} | 39 |{{ comment.last_year }} | 40 |{{ link.last_year }} | 41 |
| Total | 44 |{{ post.total }} | 45 |{{ comment.total }} | 46 |{{ link.total }} | 47 |
Enlace a la fuente original: 24 | {{ post }} 26 |
27 | {% endif %} 28 | 31 | {% include 'BlogBundle:Post:view.tags.html.twig' with {'tags': post.tags } %} 32 | {% include 'BlogBundle:Post:view.social.html.twig' with {'url': url('_blog_view', { 'slug' : post.slug }) } %} 33 | {% include 'BlogBundle:Post:view.related.html.twig' with {'post': post } %} 34 | {#{% include 'BlogBundle:Post:view.comment.html.twig' with {'form': form, 'comments': comments } %}#} 35 |
');
15 | $.post($(this).data('url'))
16 | .done(function (data) {
17 | $parent.html(data);
18 | });
19 | });
20 | })();
21 |
22 | (function () {
23 | var $p = $('a#post-view');
24 | if (!$p.length) {
25 | return;
26 | }
27 | $.post("/view" + $p.attr('href'), function () {
28 | });
29 | })();
30 |
31 | (function () {
32 | var cookieLaw = Cookie.get('accepted-cookie-law');
33 |
34 | if (cookieLaw !== 'yes') {
35 | var $body = $('body');
36 | $body.append(
37 | ''
45 | );
46 |
47 | $('div.cookie-law a.accept').click(function (e) {
48 | e.preventDefault();
49 | Cookie.set('accepted-cookie-law', 'yes', 365 * 10);
50 | $('div.cookie-law').hide();
51 | });
52 | }
53 | })();
54 | });
--------------------------------------------------------------------------------
/Resources/views/Archive/index.html.twig:
--------------------------------------------------------------------------------
1 | {% extends "BlogBundle::layout.html.twig" %}
2 | {% block title %} Archivo del sitio | {{ parent() }}{% endblock %}
3 | {% block canonical %}
4 | {% endblock %}
5 | {% block meta_description %} Puedes encontrar todas las entradas del sitio ordenadas por fecha {% endblock %}
6 | {% block meta_og %}
7 | {{ parent() }}
8 |
9 |
10 |
11 | {% endblock %}
12 | {% block meta_twiter %}
13 | {{ parent() }}
14 |
15 |
16 | {% endblock %}
17 | {% block main %}
18 | Puedes encontrar todas las entradas del sitio ordenadas por fecha.
23 |No hay elementos
35 | {% endfor %} 36 | 37 | 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /Entity/Repository/LinkRepository.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Entity\Repository; 15 | 16 | use DateTime; 17 | use Desarrolla2\Bundle\BlogBundle\Model\LinkStatus; 18 | use Doctrine\ORM\EntityRepository; 19 | 20 | /** 21 | * LinkRepository 22 | */ 23 | class LinkRepository extends EntityRepository 24 | { 25 | /** 26 | * @return array 27 | */ 28 | public function getActive() 29 | { 30 | $query = $this->getQueryForGetActive(); 31 | 32 | return $query->getResult(); 33 | } 34 | 35 | /** 36 | * @return \Doctrine\ORM\Query 37 | */ 38 | public function getQueryForGetActive() 39 | { 40 | $em = $this->getEntityManager(); 41 | $query = $em->createQuery( 42 | ' SELECT l FROM BlogBundle:Link l '. 43 | ' WHERE l.isPublished = '.LinkStatus::PUBLISHED. 44 | ' ORDER BY l.createdAt DESC ' 45 | ); 46 | 47 | return $query; 48 | } 49 | 50 | /** 51 | * @return array 52 | */ 53 | public function getActiveOrdered() 54 | { 55 | $query = $this->getQueryForGetActiveOrdered(); 56 | 57 | return $query->getResult(); 58 | } 59 | 60 | /** 61 | * @return \Doctrine\ORM\Query 62 | */ 63 | public function getQueryForGetActiveOrdered() 64 | { 65 | $em = $this->getEntityManager(); 66 | $query = $em->createQuery( 67 | ' SELECT l FROM BlogBundle:Link l '. 68 | ' WHERE l.isPublished = '.LinkStatus::PUBLISHED. 69 | ' ORDER BY l.name ASC ' 70 | ); 71 | 72 | return $query; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Search/AbstractSearch.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Search; 15 | 16 | use Knp\Component\Pager\Pagination\PaginationInterface; 17 | use Knp\Component\Pager\Paginator; 18 | 19 | /** 20 | * Class AbstractSearch 21 | * 22 | * @author Daniel GonzálezMostrar mi información personal en mi perfil público:
36 | {{ form_widget(form.show_public_profile , {label: 'Marcar para mostrar mi información'}) }} 37 |45 | 46 | Ir a modificar contraseña 47 |
48 |Los campos marcados con (*) son obligatorios
69 | 70 | {{ form_rest(form) }} 71 | {% endblock %} 72 | -------------------------------------------------------------------------------- /Form/Handler/CommentHandler.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Form\Handler; 15 | 16 | use Desarrolla2\Bundle\BlogBundle\Entity\Comment; 17 | use Desarrolla2\Bundle\BlogBundle\Manager\SanitizerManager; 18 | use Doctrine\ORM\EntityManager; 19 | use Symfony\Component\Form\Form; 20 | use Symfony\Component\HttpFoundation\Request; 21 | 22 | /** 23 | * CommentHandler 24 | */ 25 | class CommentHandler 26 | { 27 | /** 28 | * @var \Symfony\Component\Form\Form 29 | */ 30 | protected $form; 31 | 32 | /** 33 | * @var \Symfony\Component\HttpFoundation\Request 34 | */ 35 | protected $request; 36 | 37 | /** 38 | * @var \Doctrine\ORM\EntityManager 39 | */ 40 | protected $em; 41 | 42 | /** 43 | * 44 | * @var SanitizerManager 45 | */ 46 | protected $sanitizer; 47 | 48 | /** 49 | * @var \Desarrolla2\Bundle\BlogBundle\Entity\Comment 50 | */ 51 | protected $entity; 52 | 53 | /** 54 | * @param Form $form 55 | * @param Request $request 56 | * @param EntityManager $em 57 | * @param SanitizerManager $sanitizer 58 | * @param Comment $comment 59 | */ 60 | public function __construct( 61 | Form $form, 62 | Request $request, 63 | EntityManager $em, 64 | SanitizerManager $sanitizer, 65 | Comment $comment 66 | ) { 67 | $this->form = $form; 68 | $this->request = $request; 69 | $this->entity = $comment; 70 | $this->em = $em; 71 | $this->sanitizer = $sanitizer; 72 | } 73 | 74 | /** 75 | * @return boolean 76 | */ 77 | public function process() 78 | { 79 | $this->form->submit($this->request); 80 | 81 | if ($this->form->isValid()) { 82 | $entityModel = $this->form->getData(); 83 | 84 | $this->entity->setContent( 85 | $this->sanitizer->doClean( 86 | $entityModel->getContent() 87 | ) 88 | ); 89 | 90 | $this->em->persist($this->entity); 91 | $this->em->flush(); 92 | 93 | return true; 94 | } 95 | 96 | return false; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Controller/CommentController.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Controller; 15 | 16 | use Desarrolla2\Bundle\BlogBundle\Entity\Comment; 17 | use Desarrolla2\Bundle\BlogBundle\Form\Handler\CommentHandler; 18 | use Desarrolla2\Bundle\BlogBundle\Form\Model\CommentModel; 19 | use Desarrolla2\Bundle\BlogBundle\Form\Type\CommentType; 20 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; 21 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 22 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; 23 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; 24 | use Symfony\Component\HttpFoundation\Request; 25 | 26 | /** 27 | * Comment controller. 28 | * 29 | * @Route("/comment") 30 | */ 31 | class CommentController extends Controller 32 | { 33 | /** 34 | * Creates a new Comment entity. 35 | * 36 | * @Route("/{post_id}", name="_blog_comment_create", requirements={"post_id" = "\d+"}, defaults={"post_id" = "1" }) 37 | * @Method({"GET", "POST"}) 38 | * @Template() 39 | */ 40 | public function indexAction(Request $request) 41 | { 42 | $em = $this->getDoctrine()->getManager(); 43 | $post = $em->getRepository('BlogBundle:Post')->find($request->get('post_id', false)); 44 | if (!$post) { 45 | throw $this->createNotFoundException('Unable to find post.'); 46 | } 47 | 48 | $comment = new Comment(); 49 | $comment->setPost($post); 50 | $form = $this->createForm(new CommentType(), new CommentModel($comment)); 51 | if ($request->getMethod() == 'POST') { 52 | $formHandler = new CommentHandler($form, $request, $em, $this->container->get('blog.sanitizer.manager'), $comment); 53 | 54 | if ($formHandler->process()) { 55 | return $this->redirect($this->generateUrl('_comment_message')); 56 | } 57 | } 58 | 59 | return array( 60 | 'form' => $form->createView(), 61 | 'post' => $post, 62 | ); 63 | } 64 | 65 | /** 66 | * 67 | * @Route("/message/", name="_comment_message") 68 | * @Method("GET") 69 | * @Template() 70 | */ 71 | public function messageAction(Request $request) 72 | { 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Form/Model/ProfileModel.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | namespace Desarrolla2\Bundle\BlogBundle\Form\Model; 15 | 16 | use Desarrolla2\Bundle\BlogBundle\Entity\Profile; 17 | use Symfony\Component\Validator\Constraints as Assert; 18 | 19 | /** 20 | * ProfileModel 21 | */ 22 | class ProfileModel 23 | { 24 | /** 25 | * @Assert\Length( min=5, max=100 ) 26 | */ 27 | protected $name; 28 | 29 | /** 30 | * @Assert\Length( min=5, max=100 ) 31 | */ 32 | protected $address; 33 | 34 | /** 35 | * @Assert\Length( min=5, max=1000 ) 36 | */ 37 | protected $description; 38 | 39 | /** 40 | * @var bool 41 | */ 42 | protected $showPublicProfile; 43 | 44 | /** 45 | * @param Profile $profile 46 | */ 47 | public function __construct(Profile $profile) 48 | { 49 | $this->name = $profile->getName(); 50 | $this->address = $profile->getAddress(); 51 | $this->description = $profile->getDescription(); 52 | $this->showPublicProfile = false; 53 | } 54 | 55 | /** 56 | * @return string 57 | */ 58 | public function getName() 59 | { 60 | return $this->name; 61 | } 62 | 63 | /** 64 | * @param string $name 65 | */ 66 | public function setName($name) 67 | { 68 | $this->name = $name; 69 | } 70 | 71 | /** 72 | * @return string 73 | */ 74 | public function getAddress() 75 | { 76 | return $this->address; 77 | } 78 | 79 | /** 80 | * @param string $address 81 | */ 82 | public function setAddress($address) 83 | { 84 | $this->address = $address; 85 | } 86 | 87 | /** 88 | * @return string 89 | */ 90 | public function getDescription() 91 | { 92 | return $this->description; 93 | } 94 | 95 | /** 96 | * @param string $description 97 | */ 98 | public function setDescription($description) 99 | { 100 | $this->description = $description; 101 | } 102 | 103 | /** 104 | * @return boolean 105 | */ 106 | public function isShowPublicProfile() 107 | { 108 | return $this->showPublicProfile; 109 | } 110 | 111 | /** 112 | * @param boolean $showPublicProfile 113 | */ 114 | public function setShowPublicProfile($showPublicProfile) 115 | { 116 | $this->showPublicProfile = $showPublicProfile; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /Resources/views/Archive/page.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "BlogBundle::layout.html.twig" %} 2 | {% block title %} 3 | Archivo del sitio {{ pagination.current.item.publishedAt | date('F') | capitalize }} 4 | {% if page != 1 %}| Página {{ page }} | {% endif %} {{ parent() }} 5 | {% endblock %} 6 | {% block canonical %} 7 | 8 | {% endblock %} 9 | {% block meta_description %}{{ pagination.current.item.intro | striptags | truncate(150) }}{% endblock %} 10 | {% block meta_keywords %}{% for tag in pagination.current.item.tags %}{{ tag }}, {% endfor %}{% endblock %} 11 | {% block meta_og %} 12 | {{ parent() }} 13 | 15 | 16 | 17 | {% if pagination.current.item.hasImage %} 18 | 19 | {% endif %} 20 | {% endblock %} 21 | {% block meta_twiter %} 22 | {{ parent() }} 23 | 25 | 26 | {% if pagination.current.item.hasImage %} 27 | 28 | {% endif %} 29 | {% endblock %} 30 | {% block main %} 31 |Puedes encontrar todas las entradas del sitio ordenadas por fecha
41 |
9 | {{ comment.userName }} 10 | 13 | {{ comment | raw }} 14 |
15 |