Commit 4848a472a53fcbb3e42cdfcd562d5c45da7eed64
Committed by
Paulo Meireles
1 parent
6cb5005b
Exists in
master
and in
28 other branches
[Mezuro] Toggle datepicker
Showing
1 changed file
with
11 additions
and
7 deletions
Show diff stats
plugins/mezuro/views/mezuro_plugin_project/_project_result.rhtml
1 | 1 | <% unless @content.errors[:base].nil? %> |
2 | 2 | <%= @content.errors[:base] %> |
3 | 3 | <% else %> |
4 | - <p> Choose a date to see specific project results: <input type="image" id="datepicker" /> </p> | |
5 | 4 | <div id="current_project_date" data-date="<%= @project_result.date %>"/> |
6 | 5 | |
7 | 6 | <h4><%= _('Last Result') %></h4> |
... | ... | @@ -19,19 +18,24 @@ |
19 | 18 | <td><%= _('Analysis time') %></td> |
20 | 19 | <td><%= @project_result.formatted_analysis_time %></td> |
21 | 20 | </tr> |
21 | + <tr> | |
22 | + <td>Click to choose specific date:</td> | |
23 | + <td><%= link_to(image_tag('/images/calendar_date_select/calendar.png', :width => 20, :height => 20, :onClick => "$( 'datepicker' ).toggle();"), "javascript:void(0)") %></p></td> | |
24 | + </tr> | |
22 | 25 | </table> |
23 | - | |
24 | - | |
26 | + | |
27 | + <div id="datepicker"></div> | |
28 | + | |
25 | 29 | <script> |
26 | 30 | jQuery(document).ready(function($) { |
27 | - $("#datepicker").datepicker({ showOn: 'button', dateFormat: "yy-mm-dd", | |
28 | - buttonImageOnly: true, buttonImage: '/images/calendar_date_select/calendar.png', | |
31 | + $("#datepicker").datepicker({ | |
29 | 32 | onSelect: function(dateText, inst) { |
30 | 33 | reloadProjectWithDate(dateText) } }); |
34 | + $("#datepicker").toggle(); | |
31 | 35 | var date = jQuery("#current_project_date").attr('data-date').substr(0,10); |
32 | 36 | $("#datepicker").datepicker( "setDate" , date ); |
33 | - | |
37 | + | |
34 | 38 | }); |
35 | 39 | </script> |
36 | - | |
40 | + | |
37 | 41 | <% end %> | ... | ... |