Commit 8cc6b08804a3221b062b422b3cd682d73fa655d7
Exists in
master
and in
28 other branches
Merge branch 'datepicker_icon' into mezuro-dev
Showing
1 changed file
with
19 additions
and
17 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: </p> | |
5 | - <div id="datepicker" data-date="<%= @project_result.date %>"> | |
6 | - <input id="datepicker_field" style="display:none"/> | |
7 | - </div> | |
8 | - | |
4 | + <div id="current_project_date" data-date="<%= @project_result.date %>"/> | |
5 | + | |
9 | 6 | <h4><%= _('Last Result') %></h4> |
10 | 7 | |
11 | 8 | <table> |
... | ... | @@ -21,19 +18,24 @@ |
21 | 18 | <td><%= _('Analysis time') %></td> |
22 | 19 | <td><%= @project_result.formatted_analysis_time %></td> |
23 | 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> | |
24 | 25 | </table> |
25 | - | |
26 | - | |
26 | + | |
27 | + <div id="datepicker"></div> | |
28 | + | |
27 | 29 | <script> |
28 | - jQuery(document).ready(function($) { | |
29 | - $("#datepicker").datepicker({ altField: '#datepicker_field', showOn: 'button', dateFormat: "yy-mm-dd", | |
30 | - buttonImageOnly: true, buttonImage: '/images/calendar_date_select/calendar.png', | |
31 | - onSelect: function(dateText, inst) { | |
32 | - reloadProjectWithDate(dateText) } }); | |
33 | - var date = jQuery("#datepicker").attr('data-date').substr(0,10); | |
34 | - $("#datepicker").datepicker( "setDate" , date ); | |
35 | - | |
36 | - }); | |
30 | + jQuery(document).ready(function($) { | |
31 | + $("#datepicker").datepicker({ | |
32 | + onSelect: function(dateText, inst) { | |
33 | + reloadProjectWithDate(dateText) } }); | |
34 | + $("#datepicker").toggle(); | |
35 | + var date = jQuery("#current_project_date").attr('data-date').substr(0,10); | |
36 | + $("#datepicker").datepicker( "setDate" , date ); | |
37 | + | |
38 | + }); | |
37 | 39 | </script> |
38 | - | |
40 | + | |
39 | 41 | <% end %> | ... | ... |