Skip to content

Commit

Permalink
AENV-540 - Make name/title field consistent for playlists api
Browse files Browse the repository at this point in the history
  • Loading branch information
takeit committed Oct 16, 2015
1 parent 3797e0e commit 978cfab
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
24 changes: 18 additions & 6 deletions newscoop/library/Newscoop/Entity/Playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Playlist extends AbstractEntity
*
* @var string
*/
protected $name;
protected $title;

/**
* @ORM\Column(length=1024, name="notes", nullable=true)
Expand Down Expand Up @@ -121,21 +121,33 @@ public function getArticlesLink()
}

/**
* Returns the name of the playlist.
* Returns the title of the playlist.
*/
public function getName()
{
return $this->name;
return $this->title;
}

/**
* Returns the name of the playlist.
* Returns the title of the playlist.
*
* @var string
*/
public function setName($name)
public function setName($title)
{
$this->name = $name;
$this->title = $title;

return $this;
}

public function getTitle()
{
return $this->title;
}

public function setTitle($title)
{
$this->title = $title;

return $this;
}
Expand Down
7 changes: 3 additions & 4 deletions newscoop/src/Newscoop/GimmeBundle/Form/Type/PlaylistType.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

/**
* @package Newscoop\NewscoopBundle
* @author Paweł Mikołajczuk <[email protected]>
* @copyright 2015 Sourcefabric z.ú.
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*/

namespace Newscoop\GimmeBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
Expand All @@ -17,7 +16,7 @@ class PlaylistType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', 'text', array(
->add('title', 'text', array(
'required' => true,
))
->add('notes', 'text', array(
Expand All @@ -36,7 +35,7 @@ public function getName()
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'csrf_protection' => false
'csrf_protection' => false,
));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Newscoop\Entity\Playlist:
type: integer
groups: ["list", "details"]
serialized_name: id
name:
title:
expose: true
read_only: true
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ angular.module('playlistsApp').factory('Playlist', [

var formData = {
playlist: {
name: playlist.title
title: playlist.title
}
};

Expand Down Expand Up @@ -347,7 +347,7 @@ angular.module('playlistsApp').factory('Playlist', [

var formData = {
playlist: {
name: playlist.title
title: playlist.title
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
<script src="{{ asset('/bundles/newscoopnewscoop/js/playlists/services/modal-factory.js') }}"></script>
<script src="{{ asset('/bundles/newscoopnewscoop/js/playlists/services/user-auth.js') }}"></script>
<script src="{{ asset('/bundles/newscoopnewscoop/js/playlists/services/auth-interceptor.js') }}"></script>
<script src="{{ asset('/bundles/newscoopnewscoop/js/playlists/services/playlists.js') }}"></script>
<script src="{{ asset('/bundles/newscoopnewscoop/js/playlists/services/playlists.js') }}?v=1"></script>
<script src="{{ asset('/bundles/newscoopnewscoop/js/playlists/services/filters-service.js') }}"></script>
<script src="{{ url('bazinga_jstranslation_js', { 'domain': 'articles' }) }}"></script>

Expand Down

0 comments on commit 978cfab

Please sign in to comment.