blib/lib/Galileo/Plugin/Modal.pm

filter: Statementstmt 100% 11 / 11 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 94.1% 16 / 17 CC 2 SCAR 4.2
CC
2
Cov
92%
__ANON__
2.0
register
1.0
BEGIN
1.0
CRAP 1.5
« blib/lib/Galileo/Plugin/Deploy.pm ↑ Summary blib/lib/Galileo/DB/Schema.pm »
1 package Galileo::Plugin::Modal;
2  
3 3 ▶use Mojo::Base 'Mojolicious::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 sub register {
6 3 ▶ my ($plugin, $app) = @_;
Subroutine register: called CC=1 SCAR=0.0
Pod documented
7  
8 3 push @{$app->renderer->classes}, __PACKAGE__;
9  
10 $app->helper( modal => sub {
11 37 ▶ my ($self, $id, $body) = @_;
Subroutine __ANON__: called CC=2 SCAR=7.1
12 37 ▶ $body = $body->() if ref $body;
Branch: 1 branch
BranchTrueFalseTotal
if ref $body 37 0 37
13 37 return $self->render_to_string(
14 template => 'galileo_modal',
15 'galileo.modal.id' => $id,
16 'galileo.modal.body' => $body,
17 );
18 3 });
19 }
20  
21 3 1;
22  
23 __DATA__
24  
25 @@ galileo_modal.html.ep
26 <div class="modal hide fade" id="<%= stash 'galileo.modal.id' %>">
27 <div class="modal-header">
28 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
29 <h3>Confirm Action</h3>
30 </div>
31 <div class="modal-body">
32 <p><%= stash 'galileo.modal.body' %></p>
33 </div>
34 <div class="modal-footer">
35 <a href="#" class="btn" data-dismiss="modal">Close</a>
36 <a href="#" class="btn btn-primary" data-dismiss="modal">Confirm</a>
37 </div>
38 </div>
« blib/lib/Galileo/Plugin/Deploy.pm ↑ Summary blib/lib/Galileo/DB/Schema.pm »