Skip to content

Commit

Permalink
Added Subtitle for Episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Noël Bossart committed Jan 24, 2012
1 parent 80a66c2 commit 87cb9d6
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 15 deletions.
28 changes: 27 additions & 1 deletion Classes/Domain/Model/Episode.php
Expand Up @@ -43,7 +43,14 @@ class Tx_Podcast_Domain_Model_Episode extends Tx_Extbase_DomainObject_AbstractEn
protected $title;

/**
* Description
* Subtitle
*
* @var string
*/
protected $subtitle;

/**
* Summary
*
* @var string
* @validate NotEmpty
Expand Down Expand Up @@ -121,6 +128,25 @@ public function setTitle($title) {
$this->title = $title;
}

/**
* Returns the subtitle
*
* @return string $subtitle
*/
public function getSubtitle() {
return $this->subtitle;
}

/**
* Sets the subtitle
*
* @param string $subtitle
* @return void
*/
public function setSubtitle($subtitle) {
$this->subtitle = $subtitle;
}

/**
* Returns the description
*
Expand Down
13 changes: 11 additions & 2 deletions Configuration/TCA/Episode.php
Expand Up @@ -4,10 +4,10 @@
$TCA['tx_podcast_domain_model_episode'] = array(
'ctrl' => $TCA['tx_podcast_domain_model_episode']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'title,description,file,publication_date,duration,mime,website,author'
'showRecordFieldList' => 'title,subtitle,description,file,publication_date,duration,mime,website,author'
),
'types' => array(
'1' => array('showitem' => 'title,description,file,publication_date,duration,mime,website,author')
'1' => array('showitem' => 'title,subtitle,description,file,publication_date,duration,mime,website,author')
),
'palettes' => array(
'1' => array('showitem' => '')
Expand Down Expand Up @@ -67,6 +67,15 @@
'eval' => 'trim,required'
)
),
'subtitle' => array(
'exclude' => 0,
'label' => 'LLL:EXT:podcast/Resources/Private/Language/locallang_db.xml:tx_podcast_domain_model_episode.subtitle',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'description' => array(
'exclude' => 0,
'label' => 'LLL:EXT:podcast/Resources/Private/Language/locallang_db.xml:tx_podcast_domain_model_episode.description',
Expand Down
2 changes: 1 addition & 1 deletion ExtensionBuilder.json

Large diffs are not rendered by default.

Expand Up @@ -8,7 +8,8 @@
<data type="array">
<languageKey index="default" type="array">
<label index="title.description">Title</label>
<label index="description.description">Description</label>
<label index="subtitle.description">Subtitle</label>
<label index="description.description">Summary</label>
<label index="file.description">File</label>
<label index="publication_date.description">Publication Date</label>
<label index="duration.description">Duration</label>
Expand Down
4 changes: 3 additions & 1 deletion Resources/Private/Language/locallang_db.xml
Expand Up @@ -20,11 +20,12 @@
<label index="tx_podcast_domain_model_podcast.website">Website</label>
<label index="tx_podcast_domain_model_episode">Episode</label>
<label index="tx_podcast_domain_model_episode.title">Title</label>
<label index="tx_podcast_domain_model_episode.subtitle">Subtitle</label>
<label index="tx_podcast_domain_model_episode.description">Description</label>
<label index="tx_podcast_domain_model_episode.file">File</label>
<label index="tx_podcast_domain_model_episode.publication_date">Publication Date</label>
<label index="tx_podcast_domain_model_episode.duration">Duration</label>
<label index="tx_podcast_domain_model_episode.mime">Mime Type</label>
<label index="tx_podcast_domain_model_episode.mime">Mime</label>
<label index="tx_podcast_domain_model_episode.website">Website</label>
<label index="tx_podcast_domain_model_episode.author">Author</label>
<label index="tx_podcast_domain_model_category">Category</label>
Expand All @@ -35,6 +36,7 @@
<label index="tx_podcast_domain_model_person.e_mail">E Mail</label>
<label index="tx_podcast_domain_model_website">Website</label>
<label index="tx_podcast_domain_model_website.title">Title</label>
<label index="tx_podcast_domain_model_website.link">Link</label>
</languageKey>
</data>
</T3locallang>
18 changes: 11 additions & 7 deletions Resources/Private/Templates/Podcast/list.html
Expand Up @@ -16,14 +16,18 @@
</div>
<div class="description">
<h2><f:link.action action="show" arguments="{podcast : podcast}">{podcast.title}</f:link.action>
<span>
<f:link.action action="show" arguments="{podcast : podcast}" pageType="23456689564">
<f:image src="typo3conf/ext/podcast/Resources/Public/Icons/tx_podcast_domain_model_podcast.gif" alt="<f:translate key='tx_podcast_domain_model_podcast.feed' />" />
<f:translate key="tx_podcast_domain_model_podcast.links.feed" />
</f:link.action>
</span>
<f:if condition="{podcast.episodes}">
<f:then>
<span>
<f:link.action action="show" arguments="{podcast : podcast}" pageType="23456689564">
<f:image src="typo3conf/ext/podcast/Resources/Public/Icons/tx_podcast_domain_model_podcast.gif" alt="<f:translate key='tx_podcast_domain_model_podcast.feed' />" />
<f:translate key="tx_podcast_domain_model_podcast.links.feed" />
</f:link.action>
</span>
</f:then>
</f:if>
</h2>
<p><f:format.nl2br>{podcast.description}</f:format.nl2br> </p>
<h3>{podcast.subtitle}</h3>
</div>
</li>
</f:for>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/Podcast/show.html
Expand Up @@ -6,7 +6,6 @@ <h1>{podcast.title}
<f:link.action action="index"><f:translate key="tx_podcast_domain_model_podcast.links.back" /></f:link.action>
</span>
</h1>
<h2>{podcast.subtitle}</h2>
<div class="info">
<div class="image">
<f:if condition="{podcast.image}">
Expand All @@ -19,6 +18,7 @@ <h2>{podcast.subtitle}</h2>
</f:if>
</div>
<div class="description">
<strong>{podcast.subtitle}</strong>
<f:format.nl2br>{podcast.description}</f:format.nl2br>
<f:if condition="{podcast.episodes}">
<f:then>
Expand Down
4 changes: 3 additions & 1 deletion Resources/Public/Styles/default.css
Expand Up @@ -4,7 +4,9 @@
.modPodcast .info { overflow: hidden; zoom: 1; margin-bottom: 1em; margin-bottom: 2em;}
.modPodcast .podcasts li { overflow: hidden; zoom: 1; margin: 1em 0; }
.modPodcast .podcasts h2 span { float: right; font-weight: normal; font-size: 0.8em; }
.modPodcast .podcasts h2 a img { vertical-align: bottom; }
.modPodcast .podcasts h2 a img { vertical-align: bottom; }
.modPodcast .podcasts h3 { font-weight: normal; font-size: 1em; }


.modPodcast .image { float: left; border: 1px solid #ddd; }
.modPodcast .image img { margin: 1px; vertical-align: bottom; }
Expand Down
17 changes: 17 additions & 0 deletions Tests/Unit/Domain/Model/EpisodeTest.php
Expand Up @@ -68,6 +68,23 @@ public function setTitleForStringSetsTitle() {
);
}

/**
* @test
*/
public function getSubtitleReturnsInitialValueForString() { }

/**
* @test
*/
public function setSubtitleForStringSetsSubtitle() {
$this->fixture->setSubtitle('Conceived at T3CON10');

$this->assertSame(
'Conceived at T3CON10',
$this->fixture->getSubtitle()
);
}

/**
* @test
*/
Expand Down
17 changes: 17 additions & 0 deletions Tests/Unit/Domain/Model/WebsiteTest.php
Expand Up @@ -68,5 +68,22 @@ public function setTitleForStringSetsTitle() {
);
}

/**
* @test
*/
public function getLinkReturnsInitialValueForString() { }

/**
* @test
*/
public function setLinkForStringSetsLink() {
$this->fixture->setLink('Conceived at T3CON10');

$this->assertSame(
'Conceived at T3CON10',
$this->fixture->getLink()
);
}

}
?>
1 change: 1 addition & 0 deletions ext_tables.sql
Expand Up @@ -57,6 +57,7 @@ CREATE TABLE tx_podcast_domain_model_episode (
podcast int(11) unsigned DEFAULT '0' NOT NULL,

title varchar(255) DEFAULT '' NOT NULL,
subtitle varchar(255) DEFAULT '' NOT NULL,
description varchar(255) DEFAULT '' NOT NULL,
file varchar(255) DEFAULT '' NOT NULL,
publication_date int(11) DEFAULT '0' NOT NULL,
Expand Down

0 comments on commit 87cb9d6

Please sign in to comment.