fix an intriguing issue raised by lint.
[sgn.git] / mason / cview / map / overview.mas
bloba7a609effed21b9e4dd99d5c8a4cf20f751b5f5a
2 <%doc>
4 =head1 NAME
6 /cview/map/overview.mas - a mason component that draws a map overview, including resize and highlight functionality
8 =head1 DESCRIPTION
10 Arguments:
12 =over 10
14 =item $map
16 a CXGN::Cview::Map object (or subclass thereof)
18 =item @hilite_markers
20 a list of marker names, which will be highlighted on the map.
22 =item $map_items
24 a scalar with a list of chromosomes, positions (numeric), and names, separated by newline. These will be mapped and shown highlighted on the map. Good for drawing positions of gene families etc.
26 =item size
28 the size of the chromosomes, as a value of 1..10. defaults to 1.
30 =item force
32 if set to 1, always regenerate the image and map cache. Defaults to 0.
34 =item image_width
36 the width of the image in pixels, default is 820.
38 =back
40 =head1 AUTHOR
42 Lukas Mueller <lam87@cornell.edu>
44 =cut
46 </%doc>
48 <%args>
49   $map_version_id
50   @hilite_markers => ()
51   $map_items => ''
52   $force => 0
53   $size => 1
54   $basepath
55   $tempdir
56   $message => ''
57   $overview_image
58   $map_url
59 </%args>
61 <%perl>
63 use CXGN::Page::FormattingHelpers qw | tooltipped_text |;
65 # add the input box and form for the hilite marker feature
67 my $hilite_tooltip = tooltipped_text("Highlight marker(s)", "You can highlight markers on the overview graphic by entering them here, separated by spaces");
68 my $size_tooltip = tooltipped_text("Image size", "You can increase the size of the overview graph by clicking on the (+) button and decrease it by clicking on (-).");
70 my $hilite = join " ", @hilite_markers;
72 my $message_html = "";
74 if ($message) {  $message_html = qq | <div class="boxbgcolor2">$message<br /></div> |; }
77 my $shrink_button_disabled = '';
78 my $enlarge_button_disabled = '';
79 my $smaller_size;
80 my $larger_size;
82 if ($size <= 0) {
83   $size = 0;
84   $shrink_button_disabled = qq { disabled="1" };
85   $smaller_size = $size;
87 else {
88   $smaller_size = $size - 1;
91 if ($size>=10) {
92   $size=10; 
93   $enlarge_button_disabled = qq { disabled="1" };
94   $larger_size = $size;
96 else {
97   $larger_size = $size+ 1;
100 $larger_size = 10 if $larger_size > 10;
104 </%perl>
106 <div class="well" style="overflow:scroll">
107   <center>
108     <% $message_html %>
109     <% $overview_image %>
111     <br/>
112   </center>
114   <div class="row">
115     <div class="col-sm-1 col-md-1 col-lg-2">
116     </div>
117     <div class="col-sm-10 col-md-10 col-lg-8">
118       <div class="row">
119         <div class="col-sm-7 col-md-8 col-lg-8">
121         <form action="<% $map_url %>" class="form-horizontal" role="form">
122           <div class="form-group">
123             <label class="col-sm-3 control-label"><% $hilite_tooltip %>: </label>
124             <div class="col-sm-9">
125               <input type="hidden" name="map_items" value="<% $map_items %>" />
126               <input type="hidden" name="map_version_id" value="<% $map_version_id %>" />
127               <input type="hidden" name="size" value="<% $size %>" />
128               <div class="input-group">
129                 <input class="form-control" type="text" name="hilite" value="<% $hilite %>" aria-describedby="basic-addon1"/>
130                 <span class="input-group-btn" id="basic-addon1"><button class="btn btn-info" type="submit" value="Highlight">Highlight</button></span>
131               </div>
132             </div>
133           </div>
134         </form>
136         </div>
137         <div class="col-sm-5 col-md-4 col-lg-4">
139           <label style="float:left" ><% $size_tooltip %>:&nbsp;&nbsp;</label>
141           <form style="float:left" action="<% $map_url %>"
142             <input type="hidden" name="map_items" value="<% $map_items %>" />
143             <input type="hidden" name="map_version_id" value="<% $map_version_id %>" />
144             <input type="hidden" name="size" value="<% $smaller_size %>" />
145             <input type="hidden" name="hilite" value="<% $hilite %>" />
146             <button class="btn btn-default" type="submit" value="-" <% $shrink_button_disabled %> > - </button>
147           </form>
148           <form style="float:left" action="<% $map_url %>" >
149             <input type="hidden" name="map_items" value="<% $map_items %>" />
150             <input type="hidden" name="map_version_id" value="<% $map_version_id %>" />
151             <input type="hidden" name="hilite" value="<% $hilite %>" />
152             <input type="hidden" name="size" value="<% $larger_size %>" />
153             <button class="btn btn-default" type="submit" value="+" <% $enlarge_button_disabled %> > + </button>
154           </form>
156         </div>
157       </div>
158     </div>
159     <div class="col-sm-1 col-md-1 col-lg-2">
160     </div>
161   </div>
162 </div>