Created
December 18, 2012 22:30
-
-
Save anonymous/4332686 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= form_for booking do |f| %> | |
| <br /> | |
| <%= f.label :name %> | |
| <br /> | |
| <%= f.text_field :name %> | |
| <br /> | |
| <div class="actions"> | |
| <%= f.submit %> | |
| </div> | |
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('table').on('click', 'td', function(e) { | |
| $('.create_booking').dialog | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table class="rota"> | |
| <thead> | |
| <tr> | |
| <!-- Element will carry the month number for initializing this table correctly. --> | |
| <th class="month"-<%= @date_range %>">Days</th> | |
| <% @hospitals.each do |hsp| %> | |
| <th class="hospital-<%= hsp.shortname %>"><%= hsp.name %></th> | |
| <% end %> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <% @date_range.each do |d| %> | |
| <tr> | |
| <th><%= d.to_s(:short) %></th> | |
| <% @hospitals.each do |hsp| %> | |
| <td class="day-<%= d.to_s(:short) %> hospital-<%= hsp.shortname %>"> </td> <!--Class on each td to make it identifiable --> | |
| <% end %> | |
| </tr> | |
| <% end %> | |
| </tbody> | |
| <!--%@hospitals.each { |hospital| hospital.hospital_bookings.each { |booking| booking.id } } %--> | |
| <%@hospitals.each do |hospital| | |
| hospital.hospital_bookings.each do |booking| booking.id %> | |
| <div class="create_booking" data-hospital-id="<%= hospital.id %>" title="Create Booking"> | |
| <% if booking.nil? %> | |
| <div style="display: none;"> | |
| <%= render :partial => "booking_dialog", :locals => { :booking => booking } %> | |
| </div> | |
| <% end %> | |
| <% end %> | |
| </div> | |
| <% end %> | |
| </table> | |
| <%= form_tag rota_days_path, :method => 'get' do %> | |
| <p> | |
| <%= link_to '<< Previous Month', rota_days_path(:beginning_of_month => @beginning_previous) %> | | |
| <%= link_to 'Current Month ', rota_days_path(:beginning_of_month => @beginning_current) %> | | |
| <%= link_to 'Next Month >>', rota_days_path(:beginning_of_month => @beginning_next) %> | |
| </p> | |
| <% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment