Fix rendering of the carousel inside of a Story. Fixes bug #12386

This commit is contained in:
Colin Kuskie 2012-09-20 14:00:57 -07:00
parent 50c7634800
commit e046e5a8ce
8 changed files with 55 additions and 4 deletions

View file

@ -10,6 +10,7 @@
- fixed: UpdateAssetSubscribers workflow activity ERRORs if the group cannot be found. - fixed: UpdateAssetSubscribers workflow activity ERRORs if the group cannot be found.
- fixed: EMS has issues showing badges WITHOUT related badge groups. - fixed: EMS has issues showing badges WITHOUT related badge groups.
- fixed: It's okay to paste assets which are archived, because if you don't they stay in the clipboard forever. - fixed: It's okay to paste assets which are archived, because if you don't they stay in the clipboard forever.
- fixed #12386: Story Manager - Carousel rendering broken in Story
7.10.26 7.10.26
- fixed: Template diagnostics when called without a session asset. - fixed: Template diagnostics when called without a session asset.

View file

@ -32,6 +32,7 @@ my $session = start(); # this line required
# upgrade functions go here # upgrade functions go here
fixMetaDataRevisionDates($session); fixMetaDataRevisionDates($session);
addPhotoHeightToStoryArchive($session);
finish($session); # this line required finish($session); # this line required
@ -91,6 +92,22 @@ sub fixMetaDataRevisionDates {
} }
#----------------------------------------------------------------------------
# Describe what our function does
sub addPhotoHeightToStoryArchive {
my $session = shift;
print "\tAdd Photo Height to the Story Manager... " unless $quiet;
# and here's our code
$session->db->write(<<EOSQL);
ALTER TABLE StoryArchive add column photoHeight INT(11);
EOSQL
$session->db->write(<<EOSQL);
UPDATE StoryArchive set photoHeight=300
EOSQL
print "DONE!\n" unless $quiet;
}
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Describe what our function does # Describe what our function does
#sub exampleFunction { #sub exampleFunction {

View file

@ -966,10 +966,11 @@ sub viewTemplateVariables {
}; };
++$photoCounter; ++$photoCounter;
} }
$var->{hasPhotos} = $photoCounter; $var->{hasPhotos} = $photoCounter;
$var->{singlePhoto} = $photoCounter == 1; $var->{singlePhoto} = $photoCounter == 1;
$var->{canEdit} = $self->canEdit; $var->{canEdit} = $self->canEdit;
$var->{photoWidth} = $archive->get('photoWidth'); $var->{photoWidth} = $archive->get('photoWidth');
$var->{photoHeight} = $archive->get('photoHeight');
return $var; return $var;
} }

View file

@ -126,6 +126,13 @@ sub definition {
hoverHelp => $i18n->get('photo width help'), hoverHelp => $i18n->get('photo width help'),
defaultValue => '300', defaultValue => '300',
}, },
photoHeight => {
tab => 'display',
fieldType => 'integer',
label => $i18n->get('photo height'),
hoverHelp => $i18n->get('photo height help'),
defaultValue => '300',
},
editStoryTemplateId => { editStoryTemplateId => {
tab => 'display', tab => 'display',
fieldType => 'template', fieldType => 'template',

View file

@ -87,6 +87,7 @@ our $HELP = {
], ],
}, },
{ name => 'photoWidth', }, { name => 'photoWidth', },
{ name => 'photoHeight', },
{ name => 'hasPhotos', }, { name => 'hasPhotos', },
{ name => 'singlePhoto', }, { name => 'singlePhoto', },
{ name => 'photo_loop', { name => 'photo_loop',

View file

@ -437,6 +437,12 @@ our $I18N = {
lastUpdated => 0, lastUpdated => 0,
}, },
'photoWidth' => {
message => q|The height of slides, set in the Story Archive for this Story.|,
context => q|Template variable|,
lastUpdated => 0,
},
'hasPhoto' => { 'hasPhoto' => {
message => q|This template variable will be true if the a photo in the photo_loop has an image in it.|, message => q|This template variable will be true if the a photo in the photo_loop has an image in it.|,
context => q|Template variable|, context => q|Template variable|,

View file

@ -321,6 +321,12 @@ our $I18N = {
lastUpdated => 0, lastUpdated => 0,
}, },
'photoHeight' => {
message => q|The height used to display photos.|,
context => q|Template variable.|,
lastUpdated => 0,
},
'photo width' => { 'photo width' => {
message => q|Photo width|, message => q|Photo width|,
context => q|Label in the edit screen|, context => q|Label in the edit screen|,
@ -333,6 +339,18 @@ our $I18N = {
lastUpdated => 0, lastUpdated => 0,
}, },
'photo height' => {
message => q|Photo Height|,
context => q|Label in the edit screen|,
lastUpdated => 0,
},
'photo height help' => {
message => q|Slides in the photo carousel have to have a fixed height to render in some browsers. To disable this feature, set it to 0.|,
context => q|hoverhelp for photoHeight in the edit screen|,
lastUpdated => 0,
},
'sortAlphabeticallyChronologically' => { 'sortAlphabeticallyChronologically' => {
message => q|Sort Order|, message => q|Sort Order|,
context => q|Label in the edit screen|, context => q|Label in the edit screen|,