Compare commits

..

1 Commits

Author SHA1 Message Date
wmcheng 17e2c67acd Revert "Fix show issue if no enough info. provided."
This reverts commit e1e90a83cf
2019-06-14 00:22:48 +08:00
3 changed files with 68 additions and 53 deletions

View File

@ -77,7 +77,7 @@ var Calendar = function(dom,property_id){
c.modeBtns.each(function(){ c.modeBtns.each(function(){
if ($(this).data("mode") == view) if ($(this).data("mode") == view)
$(this).addClass("active"); $(this).addClass("active");
}); })
if(view != "agenda"){ if(view != "agenda"){
if(c.currentView == "agenda"){ if(c.currentView == "agenda"){
// $("#sec1").addClass("span3").removeClass("span7"); // $("#sec1").addClass("span3").removeClass("span7");
@ -97,23 +97,23 @@ var Calendar = function(dom,property_id){
c.calendar.fullCalendar("refetchEvents"); c.calendar.fullCalendar("refetchEvents");
loadeventsonviewchange = false; loadeventsonviewchange = false;
} }
}; }
if(c.currentView == "agenda"){toggleViews("agenda");loadeventsonviewchange = true;} if(c.currentView == "agenda"){toggleViews("agenda");loadeventsonviewchange = true;}
}; }
this.renderEvent = function(eventStick){ this.renderEvent = function(eventStick){
if(eventStick.recurring === true) if(eventStick.recurring == true)
c.calendar.fullCalendar("refetchEvents"); c.calendar.fullCalendar("refetchEvents");
else else
c.calendar.fullCalendar("renderEvent",eventStick); c.calendar.fullCalendar("renderEvent",eventStick);
}; }
$(document).ready(function() { $(document).ready(function() {
c.initialize(); c.initialize();
}); });
}; }
var EventDialog = function(calendar,event){ var EventDialog = function(calendar,event){
_t = this; _t = this;
@ -148,12 +148,13 @@ var EventDialog = function(calendar,event){
} }
event_quick_view = $('<div class="calendar-modal" style="display:none;"></div>'); event_quick_view = $('<div class="calendar-modal" style="display:none;"></div>');
template = '<div class="modal-content">' + template = '<div class="modal-content">' +
'<div class="modal-header">' + '<div class="modal-header">' +
'<button type="button" class="close event-close-btn" data-dismiss="modal" aria-hidden="true">&times;</button>' + '<button type="button" class="close event-close-btn" data-dismiss="modal" aria-hidden="true">&times;</button>' +
'<h3>' + _event.title + '</h3>' + '<h3>' + _event.title + '</h3>' +
'</div>' + '</div>' +
'<div class="modal-body">' + '<div class="modal-body">' +
'<div class="event_summary">' + time_string + '</br>' + _event.hiring_person_name + '</div>' + _event.note + '<div class="event_summary">' + time_string + '</div>' +
_event.note +
'</div>' + '</div>' +
'<div class="modal-footer" />' + '<div class="modal-footer" />' +
'</div>'; '</div>';
@ -564,3 +565,33 @@ var AgendaView = function(calendar){
} }
} }

View File

@ -69,57 +69,43 @@ class PropertyHiresController < ApplicationController
"value" => property.note "value" => property.note
} }
end end
if !property.property_number.blank? data << {
data << { "header" => t("property_hire.property_number"),
"header" => t("property_hire.property_number"), "value" => property.property_number
"value" => property.property_number }
}
end
data << { data << {
"header" => t("property_hire.can_be_hired"), "header" => t("property_hire.can_be_hired"),
"value" => (property.can_be_hired ? "<span class='label label-success'>Yes</span>" : "<span class='label label-danger'>No</span>") "value" => (property.can_be_hired ? "<span class='label label-success'>Yes</span>" : "<span class='label label-danger'>No</span>")
} }
if !property.purchase_date.to_s.blank? data << {
data << { "header" => t("property_hire.purchase_date"),
"header" => t("property_hire.purchase_date"), "value" => property.purchase_date.strftime("%Y-%m-%d")
"value" => property.purchase_date.strftime("%Y-%m-%d") }
}
end
if property.owners.empty? if property.owners.empty?
owners = property.other_owner owners = property.other_owner
else else
owners = property.owner_profiles.collect{|mp| mp.name}.join(",") owners = property.owner_profiles.collect{|mp| mp.name}.join(",")
end end
if !owners.blank? data << {
data << { "header" => t("property_hire.owners"),
"header" => t("property_hire.owners"), "value" => owners
"value" => owners }
} data << {
end "header" => t("property_hire.owner_email"),
if !property.owner_email.blank? "value" => property.owner_email
data << { }
"header" => t("property_hire.owner_email"), data << {
"value" => property.owner_email "header" => t("property_hire.owner_phone"),
} "value" => property.owner_phone
end }
if !property.owner_phone.blank? data << {
data << { "header" => t("property_hire.price"),
"header" => t("property_hire.owner_phone"), "value" => property.price
"value" => property.owner_phone }
} data << {
end "header" => t("property_hire.location"),
if !property.price.blank? "value" => property.get_location_name
data << { }
"header" => t("property_hire.price"),
"value" => property.price
}
end
if !property.get_location_name.blank?
data << {
"header" => t("property_hire.location"),
"value" => property.get_location_name
}
end
actions = [] actions = []
if property.can_be_hired if property.can_be_hired
actions << { actions << {

View File

@ -23,8 +23,6 @@ class PHire
{ {
:id => self.id.to_s, :id => self.id.to_s,
:title => self.reason_for_hire, :title => self.reason_for_hire,
:hiring_person_id => self.hiring_person_id,
:hiring_person_name => self.hiring_person_name,
:note => self.note_for_hire || "", :note => self.note_for_hire || "",
:start => self.start_time.rfc822, :start => self.start_time.rfc822,
:end => self.end_time.rfc822, :end => self.end_time.rfc822,