File Coverage

blib/lib/Rest/HtmlVis/Base.pm
Criterion Covered Total %
statement 11 25 44.0
branch n/a
condition 0 6 0.0
subroutine 4 9 44.4
pod 5 5 100.0
total 20 45 44.4


line stmt bran cond sub pod time code
1             package Rest::HtmlVis::Base;
2              
3 1     1   612 use 5.006;
  1         2  
4 1     1   3 use strict;
  1         1  
  1         18  
5 1     1   3 use warnings FATAL => 'all';
  1         1  
  1         25  
6              
7 1     1   387 use parent qw( Rest::HtmlVis::Key );
  1         222  
  1         4  
8              
9             =head1 NAME
10              
11             Rest::HtmlVis::Base - Return base struct of rest html (menu, styles etc.)
12              
13             =head1 VERSION
14              
15             Version 0.01
16              
17             =cut
18              
19             our $VERSION = '0.13';
20              
21             sub setStruct {
22 0     0 1   my ($self, $key, $struct, $env) = @_;
23 0           $self->{struct} = $struct;
24 0           $self->{env} = $env;
25 0           return 1;
26             }
27              
28             sub getOrder {
29 0     0 1   return 0;
30             }
31              
32             sub blocks {
33 0     0 1   return 0;
34             }
35              
36             my $style =
37             ' body {
38             padding: 0px;
39             margin: 0px;
40             }
41              
42             /* bootstrap-3.3.2-dist */
43             .row {
44             margin: 10px 0px 0px 0px;
45             }
46              
47             .form-control {
48             margin-bottom: 4px;
49             }
50              
51             /* Header styles */
52             .header {
53             background-color: #eee;
54             display: inline-block;
55             width: 100%;
56             min-height: 38px;
57             padding: 6px 0px 5px 0px;
58             border: 1px solid #ddd
59             }
60              
61             /* Header title style */
62             .header .title {
63             margin: 9px;
64             display:inline;
65             text-decoration: none;
66             color: #aaa;
67             font-size: 24px;
68             }
69              
70             .title .project {
71             color: #ccc;
72             }
73              
74             /* Format styles */
75             .format {
76             float:right;
77             list-style-type: none;
78             margin: 5px 10px 0px 0px;
79             padding: 0px;
80             }
81              
82             .format li {
83             float:left;
84             border-right: 1px solid #fff;
85             padding: 0px 7px 0px 7px;
86             }
87              
88             .format li:last-child {
89             border-right: none;
90             }
91              
92             .format li a {
93             margin-top: 1px;
94             text-decoration: none;
95             color: #ccc;
96             text-transform: uppercase;
97            
98             -webkit-transition: all 0.5s ease;
99             -moz-transition: all 0.5s ease;
100             -o-transition: all 0.5s ease;
101             -ms-transition: all 0.5s ease;
102             transition: all 0.5s ease;
103             }
104            
105             .format li a:hover {
106             color: #666;
107             }
108            
109             .format li.active a {
110             font-weight: bold;
111             color: #333;
112             }
113              
114             /* Links ul */
115             .links {
116             list-style-type: none;
117             margin: 5px 0px 0px 10px;
118             padding: 0px;
119             font: 14px/1 Helvetica, Verdana, sans-serif;
120             }
121              
122             .links li {
123             padding-bottom: 1px;
124             }
125              
126             .links li a {
127             margin-top: 1px;
128             text-decoration: none;
129             color: #23527c;
130            
131             -webkit-transition: all 0.5s ease;
132             -moz-transition: all 0.5s ease;
133             -o-transition: all 0.5s ease;
134             -ms-transition: all 0.5s ease;
135             transition: all 0.5s ease;
136             }
137            
138             .links li a:hover {
139             color: #666;
140             }
141            
142             .links li.active a {
143             font-weight: bold;
144             color: #333;
145             }
146              
147             .method-form {
148             margin: 7px 0px 5px 0px;
149             }
150              
151             .links span {
152             color: #aaa;
153             }
154              
155             /* pretty print */
156             pre.prettyprint {
157             padding: 10px;
158             border: 1px solid #ccc;
159             }
160              
161             .kwd {
162             color: #23527c;
163             }
164              
165             a {
166             color: #23527c;
167             }
168             ';
169              
170             sub head {
171 0     0 1   my ($self, $local) = @_;
172              
173 0           my $static = $self->baseurl;
174              
175 0           return '
176            
177            
178            
179            
182              
183            
184              
185            
186            
187            
188            
189             ';
190              
191             }
192              
193             sub html {
194 0     0 1   my ($self) = @_;
195              
196 0   0       my $project = $self->getEnv->{'REST.class'}||$self->getEnv->{'PATH_INFO'}||'';
197 0   0       my $method = $self->getEnv->{REQUEST_METHOD}||'';
198 0   0       my $path = $self->getEnv->{SCRIPT_NAME}||'';
199              
200 0           "
201            
202            
203             $project:
204             $method
205             $path
206            
207            
208            
  • json
  • 209            
  • yaml
  • 210            
  • text
  • 211            
    212            
    213             "
    214             }
    215              
    216             =encoding utf-8
    217              
    218             =head1 AUTHOR
    219              
    220             Václav Dovrtěl Evaclav.dovrtel@gmail.comE
    221              
    222             =head1 BUGS
    223              
    224             Please report any bugs or feature requests to github repository.
    225              
    226             =head1 ACKNOWLEDGEMENTS
    227              
    228             Inspired by L
    229              
    230             =head1 REPOSITORY
    231              
    232             L
    233              
    234             =head1 LICENSE AND COPYRIGHT
    235              
    236             Copyright 2015 Vaclav Dovrtel.
    237              
    238             This program is free software; you can redistribute it and/or modify it
    239             under the terms of either: the GNU General Public License as published
    240             by the Free Software Foundation; or the Artistic License.
    241              
    242             See L for more information.
    243              
    244             =cut
    245              
    246             1; # End of Rest::HtmlVis::Base