date_book 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +9 -1
  3. data/.rubocop_todo.yml +2 -1
  4. data/.travis.yml +3 -0
  5. data/Gemfile +16 -4
  6. data/Gemfile.lock +14 -2
  7. data/VERSION +1 -1
  8. data/app/assets/javascripts/date_book/calendar_events.js +3 -3
  9. data/app/assets/stylesheets/date_book.css.scss +31 -2
  10. data/app/controllers/date_book/calendars_controller.rb +30 -19
  11. data/app/controllers/date_book/date_book_controller.rb +1 -1
  12. data/app/controllers/date_book/events_controller.rb +60 -62
  13. data/app/controllers/date_book/graphql_controller.rb +10 -11
  14. data/app/graphql/date_book_schema.rb +4 -4
  15. data/app/graphql/types/calendar_type.rb +4 -2
  16. data/app/graphql/types/date_time_type.rb +9 -5
  17. data/app/graphql/types/event_occurrence_type.rb +4 -2
  18. data/app/graphql/types/event_type.rb +4 -2
  19. data/app/graphql/types/mutation_type.rb +3 -1
  20. data/app/graphql/types/query_type.rb +12 -26
  21. data/app/helpers/date_book/application_helper.rb +4 -7
  22. data/app/helpers/date_book/events_helper.rb +43 -23
  23. data/app/views/date_book/application/_date_range.html.haml +3 -3
  24. data/app/views/date_book/calendars/index.html.haml +19 -3
  25. data/app/views/date_book/calendars/show.html.haml +29 -4
  26. data/app/views/date_book/events/_event.json.jbuilder +3 -1
  27. data/app/views/date_book/events/_form.html.haml +4 -4
  28. data/app/views/date_book/events/_occurrence_dates.html.haml +3 -3
  29. data/app/views/date_book/events/fields/_date.html.haml +1 -1
  30. data/app/views/date_book/events/fields/_day.html.haml +1 -1
  31. data/app/views/date_book/events/fields/_day_of_week.html.haml +3 -3
  32. data/app/views/date_book/events/fields/_duration.html.haml +3 -3
  33. data/app/views/date_book/events/fields/_interval.html.haml +1 -1
  34. data/app/views/date_book/events/fields/_time.html.haml +1 -1
  35. data/app/views/date_book/events/index.html.haml +1 -1
  36. data/app/views/date_book/events/rules/_daily.html.haml +3 -3
  37. data/app/views/date_book/events/rules/_monthly.html.haml +4 -4
  38. data/app/views/date_book/events/rules/_singular.html.haml +3 -3
  39. data/app/views/date_book/events/rules/_weekly.html.haml +4 -4
  40. data/app/views/date_book/events/show.html.haml +1 -1
  41. data/app/views/layouts/_date_book_scripts.html.haml +2 -4
  42. data/config/locales/en.yml +2 -0
  43. data/config/routes.rb +1 -1
  44. data/date_book.gemspec +25 -22
  45. data/db/migrate/20170807133845_create_calendars.rb +3 -0
  46. data/db/migrate/20170807133846_create_events.rb +3 -0
  47. data/db/migrate/20170807133847_create_schedules.rb +9 -6
  48. data/db/migrate/20170807133848_add_fields_to_schedule.rb +3 -0
  49. data/db/migrate/20170807133849_create_event_occurrences.rb +4 -3
  50. data/db/migrate/20170807133850_add_fields_to_event_occurrences.rb +3 -0
  51. data/lib/date_book.rb +11 -2
  52. data/lib/date_book/concerns/ability.rb +9 -12
  53. data/lib/date_book/concerns/acts_as_calendar.rb +5 -6
  54. data/lib/date_book/concerns/acts_as_event.rb +30 -9
  55. data/lib/date_book/concerns/acts_as_event_occurrence.rb +21 -9
  56. data/lib/date_book/concerns/acts_as_ownable.rb +9 -3
  57. data/lib/date_book/concerns/acts_as_owner.rb +5 -6
  58. data/lib/date_book/concerns/acts_as_schedule.rb +14 -7
  59. data/lib/date_book/configuration.rb +14 -11
  60. data/lib/date_book/engine.rb +7 -5
  61. data/lib/date_book/version.rb +2 -0
  62. data/lib/generators/date_book/install/install_generator.rb +27 -29
  63. data/lib/generators/date_book/install/templates/app/models/calendar.rb +4 -1
  64. data/lib/generators/date_book/install/templates/app/models/event.rb +4 -1
  65. data/lib/generators/date_book/install/templates/app/models/event_occurrence.rb +4 -1
  66. data/lib/generators/date_book/install/templates/app/models/schedule.rb +4 -1
  67. data/spec/abilities/event_spec.rb +1 -1
  68. data/spec/controllers/date_book/calendars_controller_spec.rb +48 -20
  69. data/spec/controllers/date_book/events_controller_spec.rb +145 -39
  70. data/spec/dummy/app/models/calendar.rb +3 -1
  71. data/spec/dummy/app/models/event.rb +3 -1
  72. data/spec/dummy/app/models/event_occurrence.rb +3 -1
  73. data/spec/dummy/app/models/role.rb +7 -5
  74. data/spec/dummy/app/models/schedule.rb +3 -1
  75. data/spec/dummy/app/models/user.rb +3 -3
  76. data/spec/dummy/config/initializers/devise.rb +61 -40
  77. data/spec/dummy/config/initializers/high_voltage.rb +2 -0
  78. data/spec/dummy/config/initializers/rolify.rb +5 -2
  79. data/spec/dummy/config/routes.rb +6 -9
  80. data/spec/dummy/db/development.sqlite3 +0 -0
  81. data/spec/dummy/db/migrate/20170728171103_create_users_table.rb +2 -0
  82. data/spec/dummy/db/migrate/20170807134122_add_devise_to_users.rb +4 -3
  83. data/spec/dummy/db/migrate/20170807134128_rolify_create_roles.rb +6 -4
  84. data/spec/dummy/db/migrate/{20170808150915_create_calendars.date_book.rb → 20170808200808_create_calendars.date_book.rb} +3 -0
  85. data/spec/dummy/db/migrate/{20170808150916_create_events.date_book.rb → 20170808200809_create_events.date_book.rb} +3 -0
  86. data/spec/dummy/db/migrate/{20170808150917_create_schedules.date_book.rb → 20170808200810_create_schedules.date_book.rb} +9 -6
  87. data/spec/dummy/db/migrate/{20170808150918_add_fields_to_schedule.date_book.rb → 20170808200811_add_fields_to_schedule.date_book.rb} +3 -0
  88. data/spec/dummy/db/migrate/{20170808150919_create_event_occurrences.date_book.rb → 20170808200812_create_event_occurrences.date_book.rb} +4 -3
  89. data/spec/dummy/db/migrate/{20170808150920_add_fields_to_event_occurrences.date_book.rb → 20170808200813_add_fields_to_event_occurrences.date_book.rb} +3 -0
  90. data/spec/dummy/db/schema.rb +1 -1
  91. data/spec/dummy/db/seeds/calendars.seeds.rb +2 -1
  92. data/spec/dummy/db/seeds/events.seeds.rb +5 -5
  93. data/spec/dummy/db/seeds/users.seeds.rb +3 -1
  94. data/spec/dummy/db/test.sqlite3 +0 -0
  95. data/spec/dummy/lib/basic_benchmark.rb +2 -0
  96. data/spec/factories/calendars.rb +2 -0
  97. data/spec/factories/events.rb +2 -0
  98. data/spec/factories/roles.rb +2 -1
  99. data/spec/factories/users.rb +2 -0
  100. data/spec/features/calendars_spec.rb +47 -5
  101. data/spec/features/events_spec.rb +35 -9
  102. data/spec/helpers/date_book/application_helper_spec.rb +32 -0
  103. data/spec/helpers/date_book/events_helper_spec.rb +181 -13
  104. data/spec/models/calendar_spec.rb +3 -1
  105. data/spec/models/event_spec.rb +3 -1
  106. data/spec/models/role_spec.rb +1 -0
  107. data/spec/rails_helper.rb +6 -1
  108. data/spec/requests/date_book/api_spec.rb +76 -0
  109. data/spec/routing/date_book/calendars_routing_spec.rb +4 -2
  110. data/spec/routing/date_book/events_routing_spec.rb +48 -11
  111. data/spec/support/controller_behaviors.rb +2 -0
  112. data/spec/support/controller_macros.rb +3 -1
  113. data/spec/support/factory_girl.rb +2 -0
  114. data/spec/support/feature_behaviors.rb +9 -9
  115. data/spec/support/loaded_site.rb +2 -0
  116. data/spec/support/loaded_site/calendars.rb +2 -0
  117. data/spec/support/loaded_site/events.rb +3 -1
  118. data/spec/support/loaded_site/users.rb +2 -0
  119. data/spec/support/request_behaviors.rb +12 -63
  120. data/spec/support/shared_connection.rb +2 -0
  121. data/spec/support/utilities.rb +6 -5
  122. metadata +79 -42
  123. data/app/graphql/types/profile_type.rb +0 -7
  124. data/app/helpers/date_book/calendar_helper.rb +0 -4
  125. data/app/views/date_book/application/_all_day_checkbox.html.haml +0 -1
  126. data/bin/rails +0 -15
  127. data/spec/helpers/date_book/calendar_helper_spec.rb +0 -17
  128. data/spec/requests/date_book/events_spec.rb +0 -56
@@ -1,14 +1,17 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DateBook
4
+ # Gives access to the GraphQL api
2
5
  class GraphqlController < DateBookController
3
6
  def execute
4
7
  variables = ensure_hash(params[:variables])
5
8
  query = params[:query]
6
9
  operation_name = params[:operationName]
7
- context = {
8
- # Query context goes here, for example:
9
- current_user: current_user,
10
- }
11
- result = DateBookSchema.execute(query, variables: variables, context: context, operation_name: operation_name)
10
+ context = { current_user: current_user }
11
+ result = DateBookSchema.execute(
12
+ query, variables: variables, context: context,
13
+ operation_name: operation_name
14
+ )
12
15
  render json: result
13
16
  end
14
17
 
@@ -18,11 +21,7 @@ module DateBook
18
21
  def ensure_hash(ambiguous_param)
19
22
  case ambiguous_param
20
23
  when String
21
- if ambiguous_param.present?
22
- ensure_hash(JSON.parse(ambiguous_param))
23
- else
24
- {}
25
- end
24
+ ambiguous_param.present? ? ensure_hash(JSON.parse(ambiguous_param)) : {}
26
25
  when Hash, ActionController::Parameters
27
26
  ambiguous_param
28
27
  when nil
@@ -32,4 +31,4 @@ module DateBook
32
31
  end
33
32
  end
34
33
  end
35
- end
34
+ end
@@ -1,10 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  DateBookSchema = GraphQL::Schema.define do
2
4
  # mutation(Types::MutationType)
3
5
  query(Types::QueryType)
4
- resolve_type ->(type, obj, ctx) do
6
+ resolve_type(lambda do |_type, obj, _ctx|
5
7
  case obj
6
- when Profile
7
- Types::ProfileType
8
8
  when Calendar
9
9
  Types::CalendarType
10
10
  when Event
@@ -14,5 +14,5 @@ DateBookSchema = GraphQL::Schema.define do
14
14
  else
15
15
  raise("Unexpected object: #{obj}")
16
16
  end
17
- end
17
+ end)
18
18
  end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Types::CalendarType = GraphQL::ObjectType.define do
2
- name "Calendar"
3
- description "DateBook Calendars"
4
+ name 'Calendar'
5
+ description 'DateBook Calendars'
4
6
 
5
7
  field :id, types.ID
6
8
  field :name, types.String
@@ -1,7 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Types::DateTimeType = GraphQL::ScalarType.define do
2
- name "DateTime"
3
- description "Date with Time"
4
+ name 'DateTime'
5
+ description 'Date with Time'
4
6
 
5
- coerce_input ->(value, ctx) { Time.at(Float(value)) }
6
- coerce_result ->(value, ctx) { "#{value.to_date} #{value.strftime('%I:%M %p')}" }
7
- end
7
+ coerce_input ->(value, _ctx) { Time.at(Float(value)) }
8
+ coerce_result(lambda do |value, _ctx|
9
+ "#{value.to_date} #{value.strftime('%I:%M %p')}"
10
+ end)
11
+ end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Types::EventOccurrenceType = GraphQL::ObjectType.define do
2
- name "Event Occurrences"
3
- description "DateBook Event Occurrences"
4
+ name 'Event Occurrences'
5
+ description 'DateBook Event Occurrences'
4
6
 
5
7
  field :id, !types.ID
6
8
  field :event, Types::EventType
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Types::EventType = GraphQL::ObjectType.define do
2
- name "Event"
3
- description "DateBook Events"
4
+ name 'Event'
5
+ description 'DateBook Events'
4
6
 
5
7
  field :id, !types.ID
6
8
  field :calendar, Types::CalendarType
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Types::MutationType = GraphQL::ObjectType.define do
2
- name "Mutation"
4
+ name 'Mutation'
3
5
 
4
6
  # TODO: Add Mutations as fields
5
7
  end
@@ -1,23 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This defines the top-level queries that are available.
4
+ # rubocop:disable Metrics/BlockLength
1
5
  Types::QueryType = GraphQL::ObjectType.define do
2
- name "Date Book API"
6
+ name 'Date Book API'
3
7
  # Add root-level fields here.
4
8
  # They will be entry points for queries on your schema.
5
-
6
- # Current user hack // Check GraphQL controller
7
- field :profile do
8
- type Types::ProfileType
9
- description "Current signed in User"
10
- resolve -> (obj, args, ctx) {
11
- ctx[:current_user] ? ctx[:current_user] : User.new
12
- }
13
- end
14
-
15
9
  field :event_occurrences do
16
10
  type types[Types::EventOccurrenceType]
17
- description "Find all event occurrences in range"
11
+ description 'Find all event occurrences in range'
18
12
  argument :ending_after, types.String # Start date
19
13
  argument :starting_before, types.String # End date
20
- resolve ->(obj, args, ctx) {
14
+ resolve(lambda do |_obj, args, ctx|
21
15
  ending_after = (
22
16
  args[:ending_after]&.to_datetime ||
23
17
  Time.now.beginning_of_month
@@ -31,27 +25,19 @@ Types::QueryType = GraphQL::ObjectType.define do
31
25
  .as_occurrences
32
26
  .starting_before(starting_before)
33
27
  .ending_after(ending_after)
34
- }
28
+ end)
35
29
  end
36
30
 
37
31
  field :calendar do
38
32
  type Types::CalendarType
39
- description "Find a calendar by slug"
33
+ description 'Find a calendar by slug'
40
34
  argument :slug, types.String
41
- resolve ->(obj, args, ctx) {
35
+ resolve(lambda do |_obj, args, ctx|
42
36
  Calendar
43
37
  .readable_by(ctx[:current_user])
44
38
  .friendly
45
39
  .find(args[:slug])
46
- }
47
- end
48
-
49
- field :user do
50
- type Types::ProfileType
51
- description "Find user by name"
52
- argument :name, types.String
53
- resolve -> (obj, args, ctx) {
54
- User.find_by_name(args[:name])
55
- }
40
+ end)
56
41
  end
57
42
  end
43
+ # rubocop:enable Metrics/BlockLength
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DateBook
4
+ # Global helpers, used mostly to format dates smartly
4
5
  module ApplicationHelper
5
6
  def date_book_scripts
6
7
  render partial: 'layouts/date_book_scripts'
7
8
  end
8
9
 
9
- def render_date_range(start_date, end_date, all_day, duration)
10
+ def date_book_date_range(start_date, end_date, all_day, duration)
10
11
  render partial: 'date_book/application/date_range', locals: {
11
12
  start_date: start_date,
12
13
  end_date: end_date,
@@ -15,7 +16,7 @@ module DateBook
15
16
  }
16
17
  end
17
18
 
18
- def render_date(date, all_day = false)
19
+ def date_book_date(date, all_day = false)
19
20
  format = if all_day
20
21
  :human_date
21
22
  else
@@ -24,12 +25,8 @@ module DateBook
24
25
  I18n.localize date, format: format
25
26
  end
26
27
 
27
- def render_time(date)
28
+ def date_book_time(date)
28
29
  I18n.localize date, format: :human_time
29
30
  end
30
-
31
- def render_all_day_checkbox(schedule)
32
- render partial: 'date_book/application/all_day_checkbox', locals: { schedule: schedule }
33
- end
34
31
  end
35
32
  end
@@ -1,42 +1,62 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DateBook
4
+ # Helpers used by the Events views
2
5
  module EventsHelper
3
- def event_occurrence_dates(event)
4
- render partial: 'date_book/events/occurrence_dates', locals: { event: event }
5
- end
6
-
7
- def event_popover(event)
8
- render partial: 'date_book/events/popover', locals: {
9
- event: event
10
- }, formats: :html
6
+ def date_book_event_occurrence_dates(event)
7
+ render(
8
+ partial: 'date_book/events/occurrence_dates',
9
+ locals: { event: event }
10
+ )
11
11
  end
12
12
 
13
- def render_rule_form_section(rule, schedule)
14
- render partial: "date_book/events/rules/#{rule}", locals: { schedule: schedule }
13
+ def date_book_rule_form_section(rule, form_section)
14
+ render(
15
+ partial: "date_book/events/rules/#{rule}",
16
+ locals: { f: form_section }
17
+ )
15
18
  end
16
19
 
17
- def render_date_field(schedule)
18
- render partial: "date_book/events/fields/date", locals: { schedule: schedule }
20
+ def date_book_date_field(form_section)
21
+ render(
22
+ partial: 'date_book/events/fields/date',
23
+ locals: { f: form_section }
24
+ )
19
25
  end
20
26
 
21
- def render_time_field(schedule)
22
- render partial: "date_book/events/fields/time", locals: { schedule: schedule }
27
+ def date_book_time_field(form_section)
28
+ render(
29
+ partial: 'date_book/events/fields/time',
30
+ locals: { f: form_section }
31
+ )
23
32
  end
24
33
 
25
- def render_duration_field(schedule)
26
- render partial: "date_book/events/fields/duration", locals: { schedule: schedule }
34
+ def date_book_duration_field(form_section)
35
+ render(
36
+ partial: 'date_book/events/fields/duration',
37
+ locals: { f: form_section }
38
+ )
27
39
  end
28
40
 
29
- def render_interval_field(unit, schedule)
30
- render partial: "date_book/events/fields/interval", locals: { schedule: schedule, unit: unit }
41
+ def date_book_interval_field(unit, form_section)
42
+ render(
43
+ partial: 'date_book/events/fields/interval',
44
+ locals: { f: form_section, unit: unit }
45
+ )
31
46
  end
32
47
 
33
- def render_day_field(schedule)
34
- render partial: "date_book/events/fields/day", locals: { schedule: schedule }
48
+ def date_book_day_field(form_section)
49
+ render(
50
+ partial: 'date_book/events/fields/day',
51
+ locals: { f: form_section }
52
+ )
35
53
  end
36
54
 
37
- def render_day_of_week_field(schedule)
38
- render partial: "date_book/events/fields/day_of_week", locals: { schedule: schedule }
55
+ def date_book_day_of_week_field(form_section)
56
+ render(
57
+ partial: 'date_book/events/fields/day_of_week',
58
+ locals: { f: form_section }
59
+ )
39
60
  end
40
-
41
61
  end
42
62
  end
@@ -1,8 +1,8 @@
1
- = render_date start_date, all_day
1
+ = date_book_date start_date, all_day
2
2
  - unless (all_day && duration == 1.day)
3
3
  &mdash;
4
4
  - if start_date.to_date === end_date.to_date
5
- = render_time end_date
5
+ = date_book_time end_date
6
6
  - else
7
- = render_date end_date, all_day
7
+ = date_book_date end_date, all_day
8
8
 
@@ -1,17 +1,21 @@
1
1
  - add_title Calendar.model_name.human.pluralize
2
2
  = date_book_scripts
3
3
  .row
4
- .col-md-9
5
- #calendar-display
6
4
  .col-md-3
7
5
  %ul.calendars
8
6
  - @calendars.each do |calendar|
9
7
  %li.calendar{ class: calendar.css_class }
10
8
  = link_to calendar.name, calendar
9
+ .date-book--wrapper.col-md-9
10
+ .date-book--spinner
11
+ = icon 'spinning fa fa-spinner'
12
+ .date-book--calendar
11
13
  - add_footer_javascript do
12
14
  :javascript
13
15
  $(function() {
14
- $('#calendar-display').fullCalendar({
16
+ var calendar = $('.date-book--calendar');
17
+ var spinner = $('.date-book--spinner');
18
+ calendar.fullCalendar({
15
19
  events: {
16
20
  url: '#{date_book.api_path format: :json}',
17
21
  type: 'POST',
@@ -24,5 +28,17 @@
24
28
  },
25
29
  eventRender: calendarEventRender,
26
30
  header: calendarEventHeader,
31
+ firstDay: #{DateBook.week_start_index},
32
+ loading: function( isLoading, view ) {
33
+ if(isLoading) {// isLoading gives boolean value
34
+ spinner.show();
35
+ } else {
36
+ //hide your loader here
37
+ spinner.hide();
38
+ }
39
+ },
40
+ eventAfterAllRender: function (view) {
41
+ spinner.hide();
42
+ }
27
43
  });
28
44
  });
@@ -2,15 +2,28 @@
2
2
  = date_book_scripts
3
3
  .calendar{ class: @calendar.css_class }
4
4
  = link_to :calendar_events.l(calendar: @calendar.name), date_book.calendar_events_path(@calendar)
5
- - if can? :create, @calendar.events.new
6
- %p.float-right.margin-left= icon_link_to 'plus', :add_event.l, date_book.new_calendar_event_path(@calendar), class: 'btn btn-success'
5
+ .clearfix
6
+ .pull-right
7
+ - if can? :edit, @calendar
8
+ = icon_link_to 'pencil', :edit_item.l(item: @calendar.name), date_book.edit_calendar_path(@calendar), class: 'btn btn-info'
9
+ - if can? :delete, @calendar
10
+ = icon_link_to 'remove', :delete_item.l(item: @calendar.name), date_book.calendar_path(@calendar), class: 'btn btn-danger', method: :delete, data: { confirm: :are_you_sure.l }
11
+ .pull-left
12
+ - if can? :create, @calendar.events.new
13
+ = icon_link_to 'plus', :add_event.l, date_book.new_calendar_event_path(@calendar), class: 'btn btn-success'
14
+
7
15
  = @calendar.description.html_safe
8
16
  %hr
9
- #calendar-display
17
+ .date-book--wrapper
18
+ .date-book--spinner
19
+ = icon 'spinning fa fa-spinner'
20
+ .date-book--calendar
10
21
  - add_footer_javascript do
11
22
  :javascript
12
23
  $(function() {
13
- $('#calendar-display').fullCalendar({
24
+ var calendar = $('.date-book--calendar');
25
+ var spinner = $('.date-book--spinner');
26
+ calendar.fullCalendar({
14
27
  events: {
15
28
  url: '#{date_book.api_path format: :json}',
16
29
  type: 'POST',
@@ -24,5 +37,17 @@
24
37
  },
25
38
  eventRender: calendarEventRender,
26
39
  header: calendarEventHeader,
40
+ firstDay: #{DateBook.week_start_index},
41
+ loading: function( isLoading, view ) {
42
+ if(isLoading) {// isLoading gives boolean value
43
+ spinner.show();
44
+ } else {
45
+ //hide your loader here
46
+ spinner.hide();
47
+ }
48
+ },
49
+ eventAfterAllRender: function (view) {
50
+ spinner.hide();
51
+ }
27
52
  });
28
53
  });
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  json.occurrence_id event.occurrence_id
2
4
  json.slug event.slug
3
5
  json.url date_book.event_path(event.slug, occurrence_id: event.occurrence_id)
@@ -9,4 +11,4 @@ json.start event.start_moment
9
11
  json.end event.end_moment
10
12
  json.duration event.duration
11
13
  json.allDay event.all_day
12
- json.popover_url date_book.popover_event_path(event.slug, format: :html)
14
+ json.popover_url date_book.popover_event_path(event.slug, format: :html)
@@ -5,15 +5,15 @@
5
5
  = f.text_field :name
6
6
  = f.text_area :description, class: 'date-book--wysiwyg'
7
7
  = f.text_field :css_class
8
- = f.color_field :text_color
9
- = f.color_field :background_color
10
- = f.color_field :border_color
8
+ = f.color_field :text_color, control_class: 'col-sm-2'
9
+ = f.color_field :background_color, control_class: 'col-sm-2'
10
+ = f.color_field :border_color, control_class: 'col-sm-2'
11
11
  = f.fields_for :schedule do |schedule|
12
12
  = schedule.form_group :rule, label: { text: :recurrence.l } do
13
13
  - DateBook.configuration.rules.each do |rule|
14
14
  = schedule.radio_button :rule, rule, label: rule.titleize, class: 'event-schedule-rule'
15
15
  :javascript
16
- sections['#{rule}'] = '#{escape_javascript render_rule_form_section rule, schedule}';
16
+ sections['#{rule}'] = '#{escape_javascript date_book_rule_form_section rule, schedule}';
17
17
  .event-schedule-rule-section
18
18
 
19
19
  = f.submit :save_model.l(model: Event.model_name.human)