Guest User

Untitled

a guest
Feb 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <%
  2. @page_title = "New Event"
  3. @stylesheet = "calendar"
  4. -%>
  5. <div id="sidebar">
  6. <h2>New Event</h2>
  7. <p>To create a new event, insert the appropriate information in the fields to the left</p>
  8. </div>
  9. <div id="substance">
  10. <div id="important">
  11. <div>Click on the day of your event</div>
  12. </div>
  13. <div id="calendar">
  14. <table cellpadding="0" cellspacing="0">
  15. <tr>
  16. <%
  17. if @first.wday > 0
  18. (@first.wday - @first.wday/7).times do
  19. @previous_month_count = @previous_month_count - 1
  20. @previous_month = @first.yesterday
  21. @previous_month = @previous_month + 1 -%>
  22. <td class="other_month"><a href="#" onclick="NewEvent_Step2()"><%= @previous_month.day - @previous_month_count -%></a></td>
  23. <% end
  24. end
  25. @count = 0
  26. @day_count = 0
  27. (42 - @first.wday).times do
  28. @week = @week + 1 if @first.wday > 5
  29. @day = @day + 1
  30. @day = @day - 7 if @day > 7
  31. @current_day = @first.day - 1
  32. @first = @first.tomorrow if @count > 0
  33. @count = @count + 1
  34. unless @first.month < @last.tomorrow.month
  35. @current_day = "other_month"
  36. else
  37. @current_day = nil
  38. end
  39. @day_count = @day_count + 1
  40. if @first.wday == 0
  41. @day_count = 1
  42. -%>
  43. <tr>
  44. <% end -%>
  45. <td class="<%= @current_day -%>">
  46. <a href="#" onclick="NewEvent_Step2()">
  47. <% for event in @events
  48. if event.date == @first.strftime("%Y-%m-%d") -%>
  49. <strong class="event">
  50. <% end
  51. end -%>
  52. <%= @first.day -%>
  53. <% for event in @events
  54. if event.date == @first.strftime("%Y-%m-%d") -%>
  55. </strong>
  56. <% end
  57. end -%>
  58. </a>
  59. </td>
  60. <% if @first.wday > 5 -%>
  61. </tr>
  62. <% end
  63. end -%>
  64. </table>
  65. </div>
  66. <div id="event_details" style="display: none;">
  67. <%= form_tag :action => "create_event" -%>
  68. <div>
  69. <h3>Name of event</h3>
  70. <%= text_field "event", "name" -%>
  71. </div>
  72. <div>
  73. <h3>Message</h3>
  74. <%= text_area "event", "message" -%>
  75. </div>
  76. <div>
  77. <h3>Date of event</h3>
  78. <%= datetime_select "event", "date", :discard_hour => true -%>
  79. <p class="note">(Automatically configured to the previously chosen date)</p>
  80. </div>
  81. <%= submit_tag "Add" -%>
  82. <%= end_form_tag -%>
  83. </div>
  84. </div>
  85. <br style="clear: both;" />
Add Comment
Please, Sign In to add comment