Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- @page_title = "New Event"
- @stylesheet = "calendar"
- -%>
- <div id="sidebar">
- <h2>New Event</h2>
- <p>To create a new event, insert the appropriate information in the fields to the left</p>
- </div>
- <div id="substance">
- <div id="important">
- <div>Click on the day of your event</div>
- </div>
- <div id="calendar">
- <table cellpadding="0" cellspacing="0">
- <tr>
- <%
- if @first.wday > 0
- (@first.wday - @first.wday/7).times do
- @previous_month_count = @previous_month_count - 1
- @previous_month = @first.yesterday
- @previous_month = @previous_month + 1 -%>
- <td class="other_month"><a href="#" onclick="NewEvent_Step2()"><%= @previous_month.day - @previous_month_count -%></a></td>
- <% end
- end
- @count = 0
- @day_count = 0
- (42 - @first.wday).times do
- @week = @week + 1 if @first.wday > 5
- @day = @day + 1
- @day = @day - 7 if @day > 7
- @current_day = @first.day - 1
- @first = @first.tomorrow if @count > 0
- @count = @count + 1
- unless @first.month < @last.tomorrow.month
- @current_day = "other_month"
- else
- @current_day = nil
- end
- @day_count = @day_count + 1
- if @first.wday == 0
- @day_count = 1
- -%>
- <tr>
- <% end -%>
- <td class="<%= @current_day -%>">
- <a href="#" onclick="NewEvent_Step2()">
- <% for event in @events
- if event.date == @first.strftime("%Y-%m-%d") -%>
- <strong class="event">
- <% end
- end -%>
- <%= @first.day -%>
- <% for event in @events
- if event.date == @first.strftime("%Y-%m-%d") -%>
- </strong>
- <% end
- end -%>
- </a>
- </td>
- <% if @first.wday > 5 -%>
- </tr>
- <% end
- end -%>
- </table>
- </div>
- <div id="event_details" style="display: none;">
- <%= form_tag :action => "create_event" -%>
- <div>
- <h3>Name of event</h3>
- <%= text_field "event", "name" -%>
- </div>
- <div>
- <h3>Message</h3>
- <%= text_area "event", "message" -%>
- </div>
- <div>
- <h3>Date of event</h3>
- <%= datetime_select "event", "date", :discard_hour => true -%>
- <p class="note">(Automatically configured to the previously chosen date)</p>
- </div>
- <%= submit_tag "Add" -%>
- <%= end_form_tag -%>
- </div>
- </div>
- <br style="clear: both;" />
Add Comment
Please, Sign In to add comment