package App::IdiotBox;
+use App::IdiotBox::Common qw(@SupportedFormats);
use Web::Simple __PACKAGE__;
use FindBin;
use HTML::Zoom;
}
}
+has $_ => (is => 'ro') for qw(recent_announcements buckets);
+
sub default_config {
template_dir => 'share/html',
store => 'SQLite',
}
}
-sub recent_announcements { shift->{recent_announcements} }
-
-sub buckets { shift->{buckets} }
-
sub show_front_page {
my $self = shift;
my $ann = $self->recent_announcements;
sub {
$_->select('.bucket-name')->replace_content($obj->bucket->name)
->select('.made-at')->replace_content($obj->made_at)
- ->select('.bucket-link')->set_attribute({
- name => 'href', value => $obj->bucket->slug.'/'
- })
+ ->select('.bucket-link')->set_attribute(
+ 'href' => $obj->bucket->slug.'/'
+ )
->select('.new-videos')->replace_content($obj->video_count)
->select('.total-videos')->replace_content(
$obj->bucket->video_count
$_->select('.video-name')->replace_content($video->name)
->select('.video-author')->replace_content($video->author)
->select('.video-link')->set_attribute(
- { name => 'href', value => $video->slug.'/' }
+ href => $video->slug.'/'
)
}
}))
-e join('/', $self->config->{base_dir}, $_)
} map {
join('/', $video->bucket->slug, $video->slug, $video->file_name.".$_")
- } qw(flv m4v);
+ } @SupportedFormats;
$self->html_response(video => sub {
my $video_url =
$self->base_url
$_->select('.video-name')->replace_content($video->name)
->select('.author-name')->replace_content($video->author)
->select('.bucket-link')->set_attribute(
- { name => 'href', value => '../' }
+ href => '../'
)
->select('.bucket-name')->replace_content($video->bucket->name)
->select('.video-details')->replace_content($video->details)