changed wizard style, fixed some bugs
This commit is contained in:
parent
69bfa9b6ea
commit
c4145f98b5
2 changed files with 27 additions and 6 deletions
|
|
@ -104,12 +104,19 @@ sub www_pickStyle {
|
|||
push @styles, $style;
|
||||
}
|
||||
|
||||
my $row = 0;
|
||||
for my $style ( sort { $a->getTitle cmp $b->getTitle } @styles ) {
|
||||
my $class = ++$row % 2 ? " odd" : "";
|
||||
|
||||
# Prepare the synopsis
|
||||
my $synopsis = WebGUI::HTML::format( $style->get('synopsis') );
|
||||
$synopsis =~ s{(https?://\S+)}{<a href="$1">$1</a>}g;
|
||||
|
||||
$f->raw(
|
||||
'<div class="stylePicker"><label><input type="radio" name="styleTemplateId" value="' . $style->getId . '"/>'
|
||||
'<div class="stylePicker' . $class . '"><label><input type="radio" name="styleTemplateId" value="' . $style->getId . '"/>'
|
||||
. '<img src="' . $style->getExampleImageUrl . '" height="150" />'
|
||||
. '<div class="title">' . $style->getTitle . '</div>'
|
||||
. '<div class="synopsis">' . $style->get('synopsis') . '</div></label>'
|
||||
. '<div class="synopsis">' . $synopsis . '</div></label>'
|
||||
. '</div>'
|
||||
);
|
||||
}
|
||||
|
|
@ -187,6 +194,7 @@ sub www_chooseContentSave {
|
|||
}
|
||||
|
||||
# update default site style
|
||||
$session->setting->set( "userFunctionStyleId", $self->get('styleTemplateId') );
|
||||
foreach my $asset ( @{ $home->getLineage( [ "self", "descendants" ], { returnObjects => 1 } ) } ) {
|
||||
if ( defined $asset ) {
|
||||
$asset->update( { styleTemplateId => $self->get("styleTemplateId") } );
|
||||
|
|
|
|||
|
|
@ -67,11 +67,21 @@ h1 {
|
|||
}
|
||||
|
||||
.stylePicker img {
|
||||
margin-top: 1em;
|
||||
float: left;
|
||||
margin: 1em 0;
|
||||
float: right;
|
||||
}
|
||||
.stylePicker {
|
||||
clear: left;
|
||||
overflow: hidden;
|
||||
clear: both;
|
||||
}
|
||||
.stylePicker.odd {
|
||||
background-color: #eee;
|
||||
}
|
||||
.stylePicker input {
|
||||
float: left;
|
||||
}
|
||||
.stylePicker .title {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -252,13 +262,16 @@ sub www_defaultStyle {
|
|||
sub www_defaultStyleSave {
|
||||
my ( $self, @args ) = @_;
|
||||
my $output = WebGUI::Wizard::HomePage::www_pickStyleSave( $self, @args );
|
||||
my $session = $self->session;
|
||||
# update default site style
|
||||
my $home = WebGUI::Asset->getDefault( $self->session );
|
||||
$session->setting->set( "userFunctionStyleId", $self->get('styleTemplateId') );
|
||||
my $home = WebGUI::Asset->getDefault( $session );
|
||||
foreach my $asset ( @{ $home->getLineage( [ "self", "descendants" ], { returnObjects => 1 } ) } ) {
|
||||
if ( defined $asset ) {
|
||||
$asset->update( { styleTemplateId => $self->get("styleTemplateId") } );
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue