diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 55e0170..e45a1a2 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -29,3 +29,6 @@ body { text-align: center; } +.date-view { + cursor: pointer; +} \ No newline at end of file diff --git a/app/models/network_event_task.rb b/app/models/network_event_task.rb index 754c8df..f7e9a92 100644 --- a/app/models/network_event_task.rb +++ b/app/models/network_event_task.rb @@ -1,6 +1,6 @@ class NetworkEventTask < ApplicationRecord include PgSearch - + pg_search_scope :search_by_task_name, :against => [:name], :using => { :tsearch => {:prefix => true} } @@ -8,35 +8,35 @@ class NetworkEventTask < ApplicationRecord belongs_to :owner, :class_name => "User" belongs_to :network_event belongs_to :common_task - + validates_presence_of :name - + def self.in_date_range(start_date, end_date) start_date = Date.strptime(start_date, '%A %B %d %Y') end_date = Date.strptime(end_date, '%A %B %d %Y') where(due_date: [start_date.beginning_of_day..end_date.end_of_day, nil]) end - + def formatted_due_date if due_date.present? - due_date.in_time_zone("Central Time (US & Canada)").strftime(' %a, %B %e %Y') + due_date.in_time_zone("Central Time (US & Canada)").strftime(' %a, %B %e %Y') else - nil + date_modifier end end - + def formatted_completed_at if completed_at.present? - completed_at.in_time_zone("Central Time (US & Canada)").strftime(' %a, %B %e %Y') + completed_at.in_time_zone("Central Time (US & Canada)").strftime(' %a, %B %e %Y') else nil end end - + def completed? return completed_at.present? end - + def as_json(options) result = super if completed_at? @@ -44,4 +44,4 @@ def as_json(options) end result end -end \ No newline at end of file +end diff --git a/app/views/network_events/show.html.erb b/app/views/network_events/show.html.erb index b7601ad..c6c10c5 100644 --- a/app/views/network_events/show.html.erb +++ b/app/views/network_events/show.html.erb @@ -186,11 +186,11 @@
<%= f.label :owner %> - <%= f.collection_select :owner_id, User.all, :id, :email, {:include_blank => "No owner selected"}, class: "select2 form-control"%> + <%= f.collection_select :owner_id, User.all, :id, :email, {:include_blank => "No owner selected"}, class: "select2"%>
<%= f.label :common_task %> - <%= f.collection_select :common_task_id, CommonTask.all, :id, :name, {:include_blank => "No common task selected" }, class: "select2 form-control"%> + <%= f.collection_select :common_task_id, CommonTask.all, :id, :name, {:include_blank => "No common task selected" }, class: "select2"%>
<%= f.label :date_modifier, "Due date" %> @@ -199,7 +199,7 @@ :to_s, :titleize, {}, - class: "select2 form-control task-field", + class: "select2 task-field", multiple: false, data: {placeholder: 'Select Date Modifier'} %>