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 | <% unless @content.errors[:base].nil? %> | 1 | <% unless @content.errors[:base].nil? %> |
2 | <%= @content.errors[:base] %> | 2 | <%= @content.errors[:base] %> |
3 | <% else %> | 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 | <h4><%= _('Last Result') %></h4> | 6 | <h4><%= _('Last Result') %></h4> |
10 | 7 | ||
11 | <table> | 8 | <table> |
@@ -21,19 +18,24 @@ | @@ -21,19 +18,24 @@ | ||
21 | <td><%= _('Analysis time') %></td> | 18 | <td><%= _('Analysis time') %></td> |
22 | <td><%= @project_result.formatted_analysis_time %></td> | 19 | <td><%= @project_result.formatted_analysis_time %></td> |
23 | </tr> | 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 | </table> | 25 | </table> |
25 | - | ||
26 | - | 26 | + |
27 | + <div id="datepicker"></div> | ||
28 | + | ||
27 | <script> | 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 | </script> | 39 | </script> |
38 | - | 40 | + |
39 | <% end %> | 41 | <% end %> |