This repository has been archived by the owner on Nov 29, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #393 from YaleSTC/335_shift_schedule_tooltips
- Loading branch information
Showing
17 changed files
with
79 additions
and
91 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
$('#tooltip').remove(); | ||
$('#<%= @shift.start.strftime("%Y-%m-%d") %>').html('<%= escape_javascript render partial: (params[:calendar] ? "calendars/schedule/day" : "shifts/schedule/day"), object: @shift.start.to_date %>') | ||
$('#<%= @shift.start.strftime("%Y-%m-%d") %>').html( | ||
'<%= escape_javascript render partial: | ||
(params[:calendar] ? "calendars/schedule/day" : "shifts/schedule/day"), | ||
object: @shift.start.to_date %>'); | ||
|
||
// TODO: Figure out how to make this work in jQuery | ||
// page["#shift#{@shift.id}"].visual_effect :highlight | ||
$('#shift<%= @shift.id %>').effect('highlight', 1100); | ||
initialize('body'); | ||
|
||
// display alert | ||
// alert("shift created"); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
$('#tooltip').html('<%= escape_javascript render partial: "shifts/tooltips/show", object: @shift %>'); | ||
|
||
// page.replace_html "tooltip", partial: "shifts/tooltips/show", object: @shift | ||
// page.replace_html "tooltip", partial: "shifts/tooltips/show", object: @shift |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<p>This shift is part of a repeating event.<br>What do you wish to destroy?</p> | ||
<%= button_to "Just this shift", {controller: 'shifts', action: 'destroy', id: @shift.id, calendar: params[:calendar]}, data:{confirm: 'Are you sure?'}, method: :delete %><br /> | ||
<%= button_to "This and all future shifts", {controller: 'repeating_events', action: 'destroy', id: @shift.repeating_event.id, calendar: params[:calendar], delete_after_date: @shift.start}, data:{confirm: 'Are you sure?'}, method: :delete %><br /> | ||
<%= button_to "All events in this series", {controller: 'repeating_events', action: 'destroy', id: @shift.repeating_event.id, calendar: params[:calendar], rerender_date: @shift.start}, data:{confirm: 'Are you sure?'}, method: :delete %> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,7 @@ | |
<% if (current_user.is_admin_of?(current_department) or ( current_user == @shift.user and @shift.calendar.public? and [email protected]? )) and @shift.scheduled? %> | ||
<% if params[:delete_options] and @shift.repeating_event %> | ||
<div id="repeating_event_delete_options"> | ||
<p>This shift is part of a repeating event.<br>What do you wish to destroy?</p> | ||
<%= button_to_remote "Just this shift", {url: {controller: 'shifts', action: 'destroy', id: @shift.id, calendar: params[:calendar]}, confirm: 'Are you sure?', method: :delete} %><br /> | ||
<%= button_to_remote "This and all future shifts", {url: {controller: 'repeating_events', action: 'destroy', id: @shift.repeating_event.id, calendar: params[:calendar], delete_after_date: @shift.start}, confirm: 'Are you sure?', method: :delete} %><br /> | ||
<%= button_to_remote "All events in this series", {url: {controller: 'repeating_events', action: 'destroy', id: @shift.repeating_event.id, calendar: params[:calendar], rerender_date: @shift.start}, confirm: 'Are you sure?', method: :delete} %> | ||
<%= render partial: 'shifts/tooltips/repeating_destroy' %> | ||
</div> | ||
<% else%> | ||
<% if @shift.report %> | ||
|
@@ -41,9 +38,7 @@ | |
<%= link_to_function "Destroy this shift", "$('#repeating_event_delete_options').toggle()" %> | ||
<div id="repeating_event_delete_options" style="display:none"> | ||
<p>This shift is part of a repeating event.<br>What do you wish to destroy?</p> | ||
<%= button_to_remote "Just this shift", {url: {controller: 'shifts', action: 'destroy', id: @shift.id, calendar: params[:calendar]}, confirm: 'Are you sure?', method: :delete} %><br /> | ||
<%= button_to_remote "This and all future shifts", {url: {controller: 'repeating_events', action: 'destroy', id: @shift.repeating_event.id, calendar: params[:calendar], delete_after_date: @shift.start}, confirm: 'Are you sure?', method: :delete} %><br /> | ||
<%= button_to_remote "All events in this series", {url: {controller: 'repeating_events', action: 'destroy', id: @shift.repeating_event.id, calendar: params[:calendar], rerender_date: @shift.start}, confirm: 'Are you sure?', method: :delete} %> | ||
<%= render partial: 'shifts/tooltips/repeating_destroy' %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
|
@@ -60,7 +55,7 @@ | |
<div class="toggle_me"> | ||
<%= form_for @shift, remote: true do |f| %> | ||
<%= render partial: 'shifts/form', locals: {f: f} %> | ||
<p><%= submit_to_remote "edit_button", "Save Changes", url: { controller: 'shifts', action: 'update', calendar: params[:calendar] } %></p> | ||
<p><%= submit_tag "Save Changes", url: { controller: 'shifts', action: 'update', calendar: params[:calendar] } %></p> | ||
<% end %> | ||
|
||
<% if current_user == @shift.user and !@shift.has_passed? %> | ||
|
@@ -87,19 +82,16 @@ | |
<% else %> | ||
<%= link_to_function "Destroy this shift", "$('#repeating_event_delete_options').toggle()" %> | ||
<div id="repeating_event_delete_options" style="display:none"> | ||
<p>This shift is part of a repeating event.<br>What do you wish to destroy?</p> | ||
<%= button_to_remote "Just this shift", {url: {controller: 'shifts', action: 'destroy', id: @shift.id, calendar: params[:calendar]}, confirm: 'Are you sure?', method: :delete} %><br /> | ||
<%= button_to_remote "This and all future shifts", {url: {controller: 'repeating_events', action: 'destroy', id: @shift.repeating_event.id, calendar: params[:calendar], delete_after_date: @shift.start}, confirm: 'Are you sure?', method: :delete} %><br /> | ||
<%= button_to_remote "All events in this series", {url: {controller: 'repeating_events', action: 'destroy', id: @shift.repeating_event.id, calendar: params[:calendar], rerender_date: @shift.start}, confirm: 'Are you sure?', method: :delete} %> | ||
<%= render partial: 'shifts/tooltips/repeating_destroy' %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% if current_user.is_admin_of?(@department) and @shift.repeating_event %> | ||
<div class="toggle_me" style="display:none"> | ||
<%= form_for (@repeating_event = @shift.repeating_event), remote: true do |f| %> | ||
<%= form_for (@repeating_event = @shift.repeating_event) do |f| %> | ||
<%= render partial: 'shifts/form_repeating', locals: {f: f, shift_start: @shift.start, shift_end: @shift.end} %> | ||
<%= hidden_field_tag 'rerender_date', @shift.start.to_date.to_s %> | ||
<p style="clear:both"><%= submit_to_remote "add_button", "Update Repeating Event", url: { controller: 'repeating_events', action: 'update', id: @repeating_event.id, calendar: params[:calendar] } %></p> | ||
<p style="clear:both"><%= submit_tag "Update Repeating Event", url: { controller: 'repeating_events', action: 'update', id: @repeating_event.id, calendar: params[:calendar] } %></p> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
|
@@ -147,8 +139,8 @@ | |
<% elsif current_user == @shift.user %> | ||
<% unless @shift.has_passed? or @shift.submitted? %> | ||
<% if @shift.has_sub?%> | ||
<%= link_to "Edit sub request", edit_sub_request_path(@shift.sub_request) %> | | ||
<%= link_to 'Cancel Request and Sign In', sub_request_path(@sub_request, sign_in: true), method: :delete%> | ||
<%= link_to "Edit sub request", edit_sub_request_path(@shift.sub_request) %> | ||
<%= link_to 'Cancel Request and Sign In', sub_request_path(@shift.sub_request, sign_in: true), method: :delete%> | ||
<% else%> | ||
<%= link_to "Request a sub for this shift", new_shift_sub_request_path(@shift) %> | ||
<% end %> | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
$('#shift.start.strftime("%Y-%m-%d")').html('<%= escape_javascript render partial: (params[:calendar] ? "calendars/schedule/day" : "shifts/schedule/day"), object: @shift.start.to_date %>'); | ||
$('#tooltip').remove(); | ||
$('#<%= @shift.start.strftime("%Y-%m-%d") %>').html( | ||
'<%= escape_javascript render partial: | ||
(params[:calendar] ? "calendars/schedule/day" : "shifts/schedule/day"), | ||
object: @shift.start.to_date %>'); | ||
|
||
// TODO: Figure out how to make this work in jQuery | ||
// page["#shift#{@shift.id}"].visual_effect :highlight | ||
$("#tooltip").remove(); | ||
|
||
initialize('##{@shift.start.strftime("%Y-%m-%d")}'); | ||
$('#shift<%= @shift.id %>').effect('highlight', 1100); | ||
|
||
initialize('#<%= @shift.start.strftime("%Y-%m-%d") %>'); | ||
|
||
// display alert | ||
alert("shift updated"); | ||
//alert("shift updated"); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<ul id="location<%=location.id%>_<%= time_slot_day %>_timeslots" class="events" style="height: 11%;"> | ||
<li id="location<%=location.id%>_<%= time_slot_day %>_free_time" style="width:100%" class="click_to_add_new"> | ||
<%= render partial: "time_slots/time_slot", locals: {time_slot_day: time_slot_day}, collection: fetch_timeslots(time_slot_day,location) %> | ||
<li id="location<%=location.id%>_<%= time_slot_day %>_free_time" style="width:100%" class="click_to_add_new_timeslot"> | ||
<%= render partial: "time_slots/time_slot", locals: {time_slot_day: time_slot_day}, collection: fetch_timeslots(time_slot_day,location) -%> | ||
</ul> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
$("#tooltip").remove() | ||
|
||
$("#location<%= @time_slot.location.id %>_<%= @time_slot_day.strftime("%Y-%m-%d") %>_timeslots").append('<%= escape_javascript render partial: "time_slots/time_slot", object: @time_slot, locals: {time_slot_day: @time_slot_day} %>'); | ||
//TODO How to do this in jQuery | ||
//page["#timeslot#{@time_slot.id}"].visual_effect :highlight | ||
$("#timeslot<%= @time_slot.id %>").effect("highlight", 1100); | ||
$('#timeslot<%= @time_slot.id %>').click(function (e) {popup_edit_timeslot($(this), e); return false;}); | ||
|
||
// display alert | ||
alert("timeslot created"); |
This file contains 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
Oops, something went wrong.