date_book 0.0.6 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -1
- data/.rubocop_todo.yml +2 -1
- data/.travis.yml +3 -0
- data/Gemfile +16 -4
- data/Gemfile.lock +14 -2
- data/VERSION +1 -1
- data/app/assets/javascripts/date_book/calendar_events.js +3 -3
- data/app/assets/stylesheets/date_book.css.scss +31 -2
- data/app/controllers/date_book/calendars_controller.rb +30 -19
- data/app/controllers/date_book/date_book_controller.rb +1 -1
- data/app/controllers/date_book/events_controller.rb +60 -62
- data/app/controllers/date_book/graphql_controller.rb +10 -11
- data/app/graphql/date_book_schema.rb +4 -4
- data/app/graphql/types/calendar_type.rb +4 -2
- data/app/graphql/types/date_time_type.rb +9 -5
- data/app/graphql/types/event_occurrence_type.rb +4 -2
- data/app/graphql/types/event_type.rb +4 -2
- data/app/graphql/types/mutation_type.rb +3 -1
- data/app/graphql/types/query_type.rb +12 -26
- data/app/helpers/date_book/application_helper.rb +4 -7
- data/app/helpers/date_book/events_helper.rb +43 -23
- data/app/views/date_book/application/_date_range.html.haml +3 -3
- data/app/views/date_book/calendars/index.html.haml +19 -3
- data/app/views/date_book/calendars/show.html.haml +29 -4
- data/app/views/date_book/events/_event.json.jbuilder +3 -1
- data/app/views/date_book/events/_form.html.haml +4 -4
- data/app/views/date_book/events/_occurrence_dates.html.haml +3 -3
- data/app/views/date_book/events/fields/_date.html.haml +1 -1
- data/app/views/date_book/events/fields/_day.html.haml +1 -1
- data/app/views/date_book/events/fields/_day_of_week.html.haml +3 -3
- data/app/views/date_book/events/fields/_duration.html.haml +3 -3
- data/app/views/date_book/events/fields/_interval.html.haml +1 -1
- data/app/views/date_book/events/fields/_time.html.haml +1 -1
- data/app/views/date_book/events/index.html.haml +1 -1
- data/app/views/date_book/events/rules/_daily.html.haml +3 -3
- data/app/views/date_book/events/rules/_monthly.html.haml +4 -4
- data/app/views/date_book/events/rules/_singular.html.haml +3 -3
- data/app/views/date_book/events/rules/_weekly.html.haml +4 -4
- data/app/views/date_book/events/show.html.haml +1 -1
- data/app/views/layouts/_date_book_scripts.html.haml +2 -4
- data/config/locales/en.yml +2 -0
- data/config/routes.rb +1 -1
- data/date_book.gemspec +25 -22
- data/db/migrate/20170807133845_create_calendars.rb +3 -0
- data/db/migrate/20170807133846_create_events.rb +3 -0
- data/db/migrate/20170807133847_create_schedules.rb +9 -6
- data/db/migrate/20170807133848_add_fields_to_schedule.rb +3 -0
- data/db/migrate/20170807133849_create_event_occurrences.rb +4 -3
- data/db/migrate/20170807133850_add_fields_to_event_occurrences.rb +3 -0
- data/lib/date_book.rb +11 -2
- data/lib/date_book/concerns/ability.rb +9 -12
- data/lib/date_book/concerns/acts_as_calendar.rb +5 -6
- data/lib/date_book/concerns/acts_as_event.rb +30 -9
- data/lib/date_book/concerns/acts_as_event_occurrence.rb +21 -9
- data/lib/date_book/concerns/acts_as_ownable.rb +9 -3
- data/lib/date_book/concerns/acts_as_owner.rb +5 -6
- data/lib/date_book/concerns/acts_as_schedule.rb +14 -7
- data/lib/date_book/configuration.rb +14 -11
- data/lib/date_book/engine.rb +7 -5
- data/lib/date_book/version.rb +2 -0
- data/lib/generators/date_book/install/install_generator.rb +27 -29
- data/lib/generators/date_book/install/templates/app/models/calendar.rb +4 -1
- data/lib/generators/date_book/install/templates/app/models/event.rb +4 -1
- data/lib/generators/date_book/install/templates/app/models/event_occurrence.rb +4 -1
- data/lib/generators/date_book/install/templates/app/models/schedule.rb +4 -1
- data/spec/abilities/event_spec.rb +1 -1
- data/spec/controllers/date_book/calendars_controller_spec.rb +48 -20
- data/spec/controllers/date_book/events_controller_spec.rb +145 -39
- data/spec/dummy/app/models/calendar.rb +3 -1
- data/spec/dummy/app/models/event.rb +3 -1
- data/spec/dummy/app/models/event_occurrence.rb +3 -1
- data/spec/dummy/app/models/role.rb +7 -5
- data/spec/dummy/app/models/schedule.rb +3 -1
- data/spec/dummy/app/models/user.rb +3 -3
- data/spec/dummy/config/initializers/devise.rb +61 -40
- data/spec/dummy/config/initializers/high_voltage.rb +2 -0
- data/spec/dummy/config/initializers/rolify.rb +5 -2
- data/spec/dummy/config/routes.rb +6 -9
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20170728171103_create_users_table.rb +2 -0
- data/spec/dummy/db/migrate/20170807134122_add_devise_to_users.rb +4 -3
- data/spec/dummy/db/migrate/20170807134128_rolify_create_roles.rb +6 -4
- data/spec/dummy/db/migrate/{20170808150915_create_calendars.date_book.rb → 20170808200808_create_calendars.date_book.rb} +3 -0
- data/spec/dummy/db/migrate/{20170808150916_create_events.date_book.rb → 20170808200809_create_events.date_book.rb} +3 -0
- data/spec/dummy/db/migrate/{20170808150917_create_schedules.date_book.rb → 20170808200810_create_schedules.date_book.rb} +9 -6
- data/spec/dummy/db/migrate/{20170808150918_add_fields_to_schedule.date_book.rb → 20170808200811_add_fields_to_schedule.date_book.rb} +3 -0
- data/spec/dummy/db/migrate/{20170808150919_create_event_occurrences.date_book.rb → 20170808200812_create_event_occurrences.date_book.rb} +4 -3
- 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
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/dummy/db/seeds/calendars.seeds.rb +2 -1
- data/spec/dummy/db/seeds/events.seeds.rb +5 -5
- data/spec/dummy/db/seeds/users.seeds.rb +3 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/basic_benchmark.rb +2 -0
- data/spec/factories/calendars.rb +2 -0
- data/spec/factories/events.rb +2 -0
- data/spec/factories/roles.rb +2 -1
- data/spec/factories/users.rb +2 -0
- data/spec/features/calendars_spec.rb +47 -5
- data/spec/features/events_spec.rb +35 -9
- data/spec/helpers/date_book/application_helper_spec.rb +32 -0
- data/spec/helpers/date_book/events_helper_spec.rb +181 -13
- data/spec/models/calendar_spec.rb +3 -1
- data/spec/models/event_spec.rb +3 -1
- data/spec/models/role_spec.rb +1 -0
- data/spec/rails_helper.rb +6 -1
- data/spec/requests/date_book/api_spec.rb +76 -0
- data/spec/routing/date_book/calendars_routing_spec.rb +4 -2
- data/spec/routing/date_book/events_routing_spec.rb +48 -11
- data/spec/support/controller_behaviors.rb +2 -0
- data/spec/support/controller_macros.rb +3 -1
- data/spec/support/factory_girl.rb +2 -0
- data/spec/support/feature_behaviors.rb +9 -9
- data/spec/support/loaded_site.rb +2 -0
- data/spec/support/loaded_site/calendars.rb +2 -0
- data/spec/support/loaded_site/events.rb +3 -1
- data/spec/support/loaded_site/users.rb +2 -0
- data/spec/support/request_behaviors.rb +12 -63
- data/spec/support/shared_connection.rb +2 -0
- data/spec/support/utilities.rb +6 -5
- metadata +79 -42
- data/app/graphql/types/profile_type.rb +0 -7
- data/app/helpers/date_book/calendar_helper.rb +0 -4
- data/app/views/date_book/application/_all_day_checkbox.html.haml +0 -1
- data/bin/rails +0 -15
- data/spec/helpers/date_book/calendar_helper_spec.rb +0 -17
- 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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
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
|
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,7 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Types::DateTimeType = GraphQL::ScalarType.define do
|
2
|
-
name
|
3
|
-
description
|
4
|
+
name 'DateTime'
|
5
|
+
description 'Date with Time'
|
4
6
|
|
5
|
-
coerce_input ->(value,
|
6
|
-
coerce_result
|
7
|
-
|
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
|
3
|
-
description
|
4
|
+
name 'Event Occurrences'
|
5
|
+
description 'DateBook Event Occurrences'
|
4
6
|
|
5
7
|
field :id, !types.ID
|
6
8
|
field :event, Types::EventType
|
@@ -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
|
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
|
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
|
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
|
33
|
+
description 'Find a calendar by slug'
|
40
34
|
argument :slug, types.String
|
41
|
-
resolve
|
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
|
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
|
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
|
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
|
4
|
-
render
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
14
|
-
render
|
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
|
18
|
-
render
|
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
|
22
|
-
render
|
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
|
26
|
-
render
|
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
|
30
|
-
render
|
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
|
34
|
-
render
|
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
|
38
|
-
render
|
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
|
-
=
|
1
|
+
= date_book_date start_date, all_day
|
2
2
|
- unless (all_day && duration == 1.day)
|
3
3
|
—
|
4
4
|
- if start_date.to_date === end_date.to_date
|
5
|
-
=
|
5
|
+
= date_book_time end_date
|
6
6
|
- else
|
7
|
-
=
|
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
|
-
$('
|
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
|
-
|
6
|
-
|
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
|
-
|
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
|
-
$('
|
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
|
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)
|