line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bootylicious::Plugin::Model; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
2130
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
100
|
|
4
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
99
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
20
|
use base 'Mojolicious::Plugin'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
281
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
23
|
use Mojolicious::Controller; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
31
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
1369
|
use Bootylicious::Article; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
27
|
|
11
|
4
|
|
|
4
|
|
1284
|
use Bootylicious::ArticleArchive; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
21
|
|
12
|
4
|
|
|
4
|
|
1357
|
use Bootylicious::ArticleArchiveSimple; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
24
|
|
13
|
4
|
|
|
4
|
|
1278
|
use Bootylicious::ArticleByTagIterator; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
20
|
|
14
|
4
|
|
|
4
|
|
1346
|
use Bootylicious::ArticleByQueryIterator; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
21
|
|
15
|
4
|
|
|
4
|
|
1282
|
use Bootylicious::ArticleIteratorFinder; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
21
|
|
16
|
4
|
|
|
4
|
|
1263
|
use Bootylicious::ArticlePager; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
20
|
|
17
|
4
|
|
|
4
|
|
1256
|
use Bootylicious::Draft; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
33
|
|
18
|
4
|
|
|
4
|
|
1249
|
use Bootylicious::DraftIteratorLoader; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
22
|
|
19
|
4
|
|
|
4
|
|
1273
|
use Bootylicious::DraftIteratorFinder; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
29
|
|
20
|
4
|
|
|
4
|
|
94
|
use Bootylicious::IteratorSearchable; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
12
|
|
21
|
4
|
|
|
4
|
|
1253
|
use Bootylicious::Page; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
30
|
|
22
|
4
|
|
|
4
|
|
1289
|
use Bootylicious::PageIteratorLoader; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
25
|
|
23
|
4
|
|
|
4
|
|
98
|
use Bootylicious::PageIteratorFinder; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
46
|
|
24
|
4
|
|
|
4
|
|
1266
|
use Bootylicious::TagCloud; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
18
|
|
25
|
4
|
|
|
4
|
|
149
|
use Bootylicious::ArticleIteratorLoader; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
33
|
|
26
|
4
|
|
|
4
|
|
77
|
use Bootylicious::CommentIteratorLoader; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
19
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub register { |
29
|
5
|
|
|
5
|
1
|
274
|
my ($self, $app) = @_; |
30
|
|
|
|
|
|
|
|
31
|
5
|
|
|
|
|
30
|
my $c = Mojolicious::Controller->new(app => $app); |
32
|
|
|
|
|
|
|
|
33
|
5
|
|
|
|
|
81
|
my $config = $c->config; |
34
|
|
|
|
|
|
|
|
35
|
5
|
|
|
|
|
110
|
my $articles_root = $c->articles_root; |
36
|
5
|
|
|
|
|
215
|
my $pages_root = $c->pages_root; |
37
|
5
|
|
|
|
|
102
|
my $drafts_root = $c->drafts_root; |
38
|
|
|
|
|
|
|
|
39
|
5
|
|
|
|
|
85
|
my $page_limit = $config->{pagelimit}; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
$app->helper( |
42
|
|
|
|
|
|
|
get_pager => sub { |
43
|
0
|
|
|
0
|
|
0
|
shift; |
44
|
0
|
|
|
|
|
0
|
my $iterator = shift; |
45
|
0
|
|
|
|
|
0
|
Bootylicious::ArticlePager->new( |
46
|
|
|
|
|
|
|
limit => $page_limit, |
47
|
|
|
|
|
|
|
iterator => $iterator, |
48
|
|
|
|
|
|
|
@_ |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
} |
51
|
5
|
|
|
|
|
38
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$app->helper( |
54
|
|
|
|
|
|
|
get_articles => sub { |
55
|
5
|
|
|
5
|
|
15385
|
shift; |
56
|
|
|
|
|
|
|
|
57
|
5
|
|
|
|
|
64
|
Bootylicious::ArticlePager->new( |
58
|
|
|
|
|
|
|
iterator => Bootylicious::ArticleIteratorLoader->new( |
59
|
|
|
|
|
|
|
root => $articles_root |
60
|
|
|
|
|
|
|
)->load, |
61
|
|
|
|
|
|
|
limit => $page_limit, |
62
|
|
|
|
|
|
|
@_ |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
} |
65
|
5
|
|
|
|
|
107
|
); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
$app->helper( |
68
|
|
|
|
|
|
|
get_recent_articles => sub { |
69
|
1
|
|
|
1
|
|
12
|
my ($self, $limit) = @_; |
70
|
|
|
|
|
|
|
|
71
|
1
|
|
50
|
|
|
4
|
return Bootylicious::ArticleIteratorLoader->new( |
72
|
|
|
|
|
|
|
root => $articles_root)->load->next($limit || 5); |
73
|
|
|
|
|
|
|
} |
74
|
5
|
|
|
|
|
83
|
); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
$app->helper( |
77
|
|
|
|
|
|
|
get_recent_comments => sub { |
78
|
1
|
|
|
1
|
|
12
|
my ($self, $limit) = @_; |
79
|
1
|
|
50
|
|
|
11
|
Bootylicious::CommentIteratorLoader->new(root => $articles_root) |
80
|
|
|
|
|
|
|
->load->reverse->next($limit || 5); |
81
|
|
|
|
|
|
|
} |
82
|
5
|
|
|
|
|
79
|
); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
$app->helper( |
85
|
|
|
|
|
|
|
get_archive => sub { |
86
|
3
|
|
|
3
|
|
104
|
shift; |
87
|
3
|
|
|
|
|
24
|
Bootylicious::ArticleArchive->new( |
88
|
|
|
|
|
|
|
articles => Bootylicious::ArticleIteratorLoader->new( |
89
|
|
|
|
|
|
|
root => $articles_root |
90
|
|
|
|
|
|
|
)->load, |
91
|
|
|
|
|
|
|
@_ |
92
|
|
|
|
|
|
|
); |
93
|
|
|
|
|
|
|
} |
94
|
5
|
|
|
|
|
78
|
); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
$app->helper( |
97
|
|
|
|
|
|
|
get_archive_simple => sub { |
98
|
1
|
|
|
1
|
|
16
|
Bootylicious::ArticleArchiveSimple->new( |
99
|
|
|
|
|
|
|
articles => Bootylicious::ArticleIteratorLoader->new( |
100
|
|
|
|
|
|
|
root => $articles_root |
101
|
|
|
|
|
|
|
)->load, |
102
|
|
|
|
|
|
|
); |
103
|
|
|
|
|
|
|
} |
104
|
5
|
|
|
|
|
79
|
); |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
$app->helper( |
107
|
|
|
|
|
|
|
get_articles_by_tag => sub { |
108
|
1
|
|
|
1
|
|
37
|
my $self = shift; |
109
|
1
|
|
|
|
|
3
|
my $tag = shift; |
110
|
|
|
|
|
|
|
|
111
|
1
|
|
|
|
|
9
|
Bootylicious::ArticlePager->new( |
112
|
|
|
|
|
|
|
iterator => Bootylicious::ArticleByTagIterator->new( |
113
|
|
|
|
|
|
|
Bootylicious::ArticleIteratorLoader->new( |
114
|
|
|
|
|
|
|
root => $articles_root |
115
|
|
|
|
|
|
|
)->load, |
116
|
|
|
|
|
|
|
tag => $tag |
117
|
|
|
|
|
|
|
), |
118
|
|
|
|
|
|
|
limit => $page_limit, |
119
|
|
|
|
|
|
|
@_ |
120
|
|
|
|
|
|
|
); |
121
|
|
|
|
|
|
|
} |
122
|
5
|
|
|
|
|
80
|
); |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
$app->helper( |
125
|
|
|
|
|
|
|
get_articles_by_query => sub { |
126
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
127
|
0
|
|
|
|
|
0
|
my $query = shift; |
128
|
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
0
|
return Bootylicious::ArticleByQueryIterator->new( |
130
|
|
|
|
|
|
|
Bootylicious::ArticleIteratorLoader->new( |
131
|
|
|
|
|
|
|
root => $articles_root |
132
|
|
|
|
|
|
|
)->load, |
133
|
|
|
|
|
|
|
query => $query |
134
|
|
|
|
|
|
|
); |
135
|
|
|
|
|
|
|
} |
136
|
5
|
|
|
|
|
85
|
); |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
$app->helper( |
139
|
|
|
|
|
|
|
get_tag_cloud => sub { |
140
|
2
|
|
|
2
|
|
1315
|
Bootylicious::TagCloud->new( |
141
|
|
|
|
|
|
|
articles => Bootylicious::ArticleIteratorLoader->new( |
142
|
|
|
|
|
|
|
root => $articles_root |
143
|
|
|
|
|
|
|
)->load |
144
|
|
|
|
|
|
|
); |
145
|
|
|
|
|
|
|
} |
146
|
5
|
|
|
|
|
77
|
); |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
$app->helper( |
149
|
|
|
|
|
|
|
get_tags => sub { |
150
|
0
|
|
|
0
|
|
0
|
Bootylicious::TagCloud->new( |
151
|
|
|
|
|
|
|
articles => Bootylicious::ArticleIteratorLoader->new( |
152
|
|
|
|
|
|
|
root => $articles_root |
153
|
|
|
|
|
|
|
)->load |
154
|
|
|
|
|
|
|
); |
155
|
|
|
|
|
|
|
} |
156
|
5
|
|
|
|
|
77
|
); |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
$app->helper( |
159
|
|
|
|
|
|
|
get_article => sub { |
160
|
7
|
|
|
7
|
|
288
|
my $self = shift; |
161
|
7
|
|
|
|
|
55
|
Bootylicious::ArticleIteratorFinder->new( |
162
|
|
|
|
|
|
|
iterator => Bootylicious::ArticleIteratorLoader->new( |
163
|
|
|
|
|
|
|
root => $articles_root |
164
|
|
|
|
|
|
|
)->load |
165
|
|
|
|
|
|
|
)->find(@_); |
166
|
|
|
|
|
|
|
} |
167
|
5
|
|
|
|
|
78
|
); |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
$app->helper( |
170
|
|
|
|
|
|
|
get_page => sub { |
171
|
2
|
|
|
2
|
|
70
|
my $self = shift; |
172
|
2
|
|
|
|
|
6
|
my $name = shift; |
173
|
2
|
|
|
|
|
21
|
Bootylicious::PageIteratorFinder->new(iterator => |
174
|
|
|
|
|
|
|
Bootylicious::PageIteratorLoader->new(root => $pages_root) |
175
|
|
|
|
|
|
|
->load)->find($name); |
176
|
|
|
|
|
|
|
} |
177
|
5
|
|
|
|
|
80
|
); |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
$app->helper( |
180
|
|
|
|
|
|
|
get_draft => sub { |
181
|
1
|
|
|
1
|
|
35
|
my $self = shift; |
182
|
1
|
|
|
|
|
3
|
my $name = shift; |
183
|
|
|
|
|
|
|
|
184
|
1
|
|
|
|
|
8
|
Bootylicious::DraftIteratorFinder->new( |
185
|
|
|
|
|
|
|
iterator => Bootylicious::DraftIteratorLoader->new( |
186
|
|
|
|
|
|
|
root => $self->drafts_root |
187
|
|
|
|
|
|
|
)->load, |
188
|
|
|
|
|
|
|
)->find($name); |
189
|
|
|
|
|
|
|
} |
190
|
5
|
|
|
|
|
80
|
); |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
1; |