Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Commit dfef91e

Browse files
committed
#12 datepicker in bottom of model show page, totally obtrusive and not okay
1 parent 208b900 commit dfef91e

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed
+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<% environment.context_class.instance_eval { include Rails.application.routes.url_helpers } %>
22
var new_user = "<%= "#{new_user_path}" + " #content" %>";
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script type="text/javascript">
2+
$(document).ready(function(){
3+
var staticDate = "<%= Date.today.strftime('%m/%d/%Y') %>";
4+
$('.equipment_model_calendar').datepicker({
5+
inline: true,
6+
defaultDate: staticDate
7+
});
8+
});
9+
</script>
10+
11+
<%= hidden_field_tag "static_date", Date.today.strftime('%m/%d/%Y') %>
12+
<div class="equipment_model_calendar"></div>

app/views/equipment_models/show.html.erb

+1
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@
273273
</section>
274274
<% end %>
275275

276+
<%= render :partial => 'availability_calendar' %>
276277

277278

278279
<div class="form-actions">

app/views/shared/_date_picker.html.erb

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<%#
22
3-
This is the Javascript necessary for the _date_picker partial, loaded via application.js
3+
::::::::::THIS IS DOCUMENTATION::::::::::
4+
5+
This is the Javascript necessary for the _date_picker partial, place in application.js
46
57
$('.date_start').datepicker({
68
onClose: function(dateText, inst) {
@@ -15,10 +17,10 @@ This is the Javascript necessary for the _date_picker partial, loaded via applic
1517
1618
%>
1719

18-
<div id ="black_out_dates">
19-
<%= label_tag :start_date, 'Start of Blackout' %>
20+
<div id ="general_datepicker">
21+
<%= label_tag :start_date, 'Start Date' %>
2022
<%= datepicker_input object.class.name.underscore, "start_date", :class => 'date_start span2', :value => object[:start_date].strftime('%m/%d/%Y') %>
2123

22-
<%= label_tag :end_date, 'End of Blackout' %>
24+
<%= label_tag :end_date, 'End Date' %>
2325
<%= datepicker_input object.class.name.underscore, "end_date", :class => 'date_end span2', :value => object[:end_date].strftime('%m/%d/%Y') %>
2426
</div>

0 commit comments

Comments
 (0)