date_book 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/VERSION +1 -1
- data/app/assets/images/date_book/all-day-bg.png +0 -0
- data/app/assets/images/date_book/part-day-bg.png +0 -0
- data/app/assets/javascripts/date_book/calendar_events.js +5 -2
- data/app/assets/stylesheets/date_book.css.scss +3 -5
- data/app/controllers/date_book/events_controller.rb +3 -0
- data/app/graphql/types/event_type.rb +3 -0
- data/app/views/date_book/calendars/index.html.haml +1 -1
- data/app/views/date_book/calendars/show.html.haml +1 -1
- data/app/views/date_book/events/_form.html.haml +3 -0
- data/app/views/date_book/events/index.html.haml +1 -1
- data/app/views/date_book/events/show.html.haml +1 -1
- data/date_book.gemspec +10 -9
- data/db/migrate/20170807133846_create_events.rb +4 -0
- data/lib/date_book/engine.rb +2 -1
- data/spec/dummy/app/models/user.rb +2 -0
- data/spec/dummy/config/initializers/devise.rb +2 -2
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/dummy/db/migrate/{20170807134137_create_calendars.date_book.rb → 20170808150915_create_calendars.date_book.rb} +0 -0
- data/spec/dummy/db/migrate/{20170807134138_create_events.date_book.rb → 20170808150916_create_events.date_book.rb} +4 -0
- data/spec/dummy/db/migrate/{20170807134139_create_schedules.date_book.rb → 20170808150917_create_schedules.date_book.rb} +0 -0
- data/spec/dummy/db/migrate/{20170807134140_add_fields_to_schedule.date_book.rb → 20170808150918_add_fields_to_schedule.date_book.rb} +0 -0
- data/spec/dummy/db/migrate/{20170807134141_create_event_occurrences.date_book.rb → 20170808150919_create_event_occurrences.date_book.rb} +0 -0
- data/spec/dummy/db/migrate/{20170807134142_add_fields_to_event_occurrences.date_book.rb → 20170808150920_add_fields_to_event_occurrences.date_book.rb} +0 -0
- data/spec/dummy/db/schema.rb +4 -1
- data/spec/models/event_spec.rb +0 -5
- data/spec/models/role_spec.rb +5 -5
- metadata +9 -8
- data/app/assets/images/date_book/.keep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16b86a9b5b8d1c35ae319faf85fbf1c23eebc460
|
4
|
+
data.tar.gz: 54e72d9f916f5749b0c45750d6e301d9e4b52239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac397df0c52ef1a1bd82e064429e8ad93576ee38966c31edc740036b5c24d8d8cb765a13e61b487e34e36219015f97848705ceae1b821270edeec5c1f6f489b7
|
7
|
+
data.tar.gz: 5aee94d1b0912d342a59f29060900d7be17a107e951f19bd041e1b2d384a2e2c64de8b1939362513ac3ba42d3be1ad72247da07adbf8a1924c52f6306798c5e9
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# DateBook
|
2
|
-
|
2
|
+
[![GitHub version](https://badge.fury.io/gh/gemvein%2Fdate_book.svg)](http://badge.fury.io/gh/gemvein%2Fdate_book)
|
3
|
+
[![Build Status](https://travis-ci.org/gemvein/date_book.svg)](https://travis-ci.org/gemvein/date_book)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/gemvein/date_book/badge.png)](https://coveralls.io/r/gemvein/date_book)
|
5
|
+
|
6
|
+
Date Book, still in alpha develpment, is a Rails 5 Engine to give Users the ability to publish and manage calendars of events.
|
3
7
|
|
4
8
|
## Installation
|
5
9
|
Add this line to your application's Gemfile:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
Binary file
|
Binary file
|
@@ -1,11 +1,11 @@
|
|
1
1
|
function calendarBySlugQuery(slug) {
|
2
2
|
// GraphQL requires double-quoted strings in the query:
|
3
|
-
return(' { calendar(slug: "' + slug + '") { event_occurrences { url, popover_url, start, end, event {id, name, description, css_class, all_day} } } } ');
|
3
|
+
return(' { calendar(slug: "' + slug + '") { event_occurrences { url, popover_url, start, end, event {id, name, description, css_class, text_color, background_color, border_color, all_day} } } } ');
|
4
4
|
}
|
5
5
|
|
6
6
|
function calendarEventsQuery(slug) {
|
7
7
|
// GraphQL requires double-quoted strings in the query:
|
8
|
-
return(' { event_occurrences { url, popover_url, start, end, event {id, name, description, css_class, all_day} } } ');
|
8
|
+
return(' { event_occurrences { url, popover_url, start, end, event {id, name, description, css_class, text_color, background_color, border_color, all_day} } } ');
|
9
9
|
}
|
10
10
|
|
11
11
|
function formatEventOccurrence(occurrence) {
|
@@ -25,6 +25,9 @@ function formatEventOccurrence(occurrence) {
|
|
25
25
|
title: event.name,
|
26
26
|
description: event.description,
|
27
27
|
className: className,
|
28
|
+
textColor: event.text_color,
|
29
|
+
backgroundColor: event.background_color,
|
30
|
+
borderColor: event.border_color,
|
28
31
|
allDay: event.all_day,
|
29
32
|
url: occurrence.url,
|
30
33
|
popover_url: occurrence.popover_url,
|
@@ -3,13 +3,11 @@
|
|
3
3
|
@import 'bootstrap-datetimepicker.css';
|
4
4
|
|
5
5
|
.all-day {
|
6
|
-
|
6
|
+
background-image: url('date_book/all-day-bg.png');
|
7
7
|
}
|
8
8
|
|
9
|
-
.part-day
|
10
|
-
|
11
|
-
border: solid 1px #3A87AD;
|
12
|
-
background-color: lighten(#3A87AD, 50%);
|
9
|
+
.part-day {
|
10
|
+
background-image: url('date_book/part-day-bg.png');
|
13
11
|
}
|
14
12
|
|
15
13
|
.float-right {
|
@@ -9,6 +9,9 @@ Types::EventType = GraphQL::ObjectType.define do
|
|
9
9
|
field :url, types.String
|
10
10
|
field :description, types.String
|
11
11
|
field :css_class, types.String
|
12
|
+
field :text_color, types.String
|
13
|
+
field :background_color, types.String
|
14
|
+
field :border_color, types.String
|
12
15
|
field :start, types.String
|
13
16
|
field :end, types.String
|
14
17
|
field :duration, types.String
|
@@ -1,6 +1,6 @@
|
|
1
1
|
- add_title @calendar.name
|
2
2
|
= date_book_scripts
|
3
|
-
.calendar
|
3
|
+
.calendar{ class: @calendar.css_class }
|
4
4
|
= link_to :calendar_events.l(calendar: @calendar.name), date_book.calendar_events_path(@calendar)
|
5
5
|
- if can? :create, @calendar.events.new
|
6
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,6 +5,9 @@
|
|
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
11
|
= f.fields_for :schedule do |schedule|
|
9
12
|
= schedule.form_group :rule, label: { text: :recurrence.l } do
|
10
13
|
- DateBook.configuration.rules.each do |rule|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
= icon_link_to 'plus', :create.l, new_calendar_event_path(@calendar), class: 'btn btn-success'
|
5
5
|
.events
|
6
6
|
- @events.each do |event|
|
7
|
-
.event.article.clearfix{ id: "event-#{event.id}"}
|
7
|
+
.event.article.clearfix{ id: "event-#{event.id}", class: event.css_class }
|
8
8
|
%h2
|
9
9
|
= link_to event.name, [event.calendar, event]
|
10
10
|
%p
|
data/date_book.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: date_book 0.0.
|
5
|
+
# stub: date_book 0.0.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "date_book".freeze
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
@@ -32,7 +32,8 @@ Gem::Specification.new do |s|
|
|
32
32
|
"README.md",
|
33
33
|
"Rakefile",
|
34
34
|
"VERSION",
|
35
|
-
"app/assets/images/date_book
|
35
|
+
"app/assets/images/date_book/all-day-bg.png",
|
36
|
+
"app/assets/images/date_book/part-day-bg.png",
|
36
37
|
"app/assets/javascripts/date_book.js",
|
37
38
|
"app/assets/javascripts/date_book/calendar_events.js",
|
38
39
|
"app/assets/javascripts/date_book/event_form.js",
|
@@ -179,12 +180,12 @@ Gem::Specification.new do |s|
|
|
179
180
|
"spec/dummy/db/migrate/20170728171103_create_users_table.rb",
|
180
181
|
"spec/dummy/db/migrate/20170807134122_add_devise_to_users.rb",
|
181
182
|
"spec/dummy/db/migrate/20170807134128_rolify_create_roles.rb",
|
182
|
-
"spec/dummy/db/migrate/
|
183
|
-
"spec/dummy/db/migrate/
|
184
|
-
"spec/dummy/db/migrate/
|
185
|
-
"spec/dummy/db/migrate/
|
186
|
-
"spec/dummy/db/migrate/
|
187
|
-
"spec/dummy/db/migrate/
|
183
|
+
"spec/dummy/db/migrate/20170808150915_create_calendars.date_book.rb",
|
184
|
+
"spec/dummy/db/migrate/20170808150916_create_events.date_book.rb",
|
185
|
+
"spec/dummy/db/migrate/20170808150917_create_schedules.date_book.rb",
|
186
|
+
"spec/dummy/db/migrate/20170808150918_add_fields_to_schedule.date_book.rb",
|
187
|
+
"spec/dummy/db/migrate/20170808150919_create_event_occurrences.date_book.rb",
|
188
|
+
"spec/dummy/db/migrate/20170808150920_add_fields_to_event_occurrences.date_book.rb",
|
188
189
|
"spec/dummy/db/schema.rb",
|
189
190
|
"spec/dummy/db/seeds.rb",
|
190
191
|
"spec/dummy/db/seeds/calendars.seeds.rb",
|
@@ -6,7 +6,11 @@ class CreateEvents < ActiveRecord::Migration[5.1]
|
|
6
6
|
t.string :name
|
7
7
|
t.string :slug, unique: true
|
8
8
|
t.text :description
|
9
|
+
|
9
10
|
t.string :css_class
|
11
|
+
t.string :text_color, default: '#ffffff'
|
12
|
+
t.string :background_color, default: '#3a87ad'
|
13
|
+
t.string :border_color, default: '#235371'
|
10
14
|
|
11
15
|
t.date :start_date
|
12
16
|
t.time :start_time
|
data/lib/date_book/engine.rb
CHANGED
@@ -22,7 +22,8 @@ module DateBook
|
|
22
22
|
app.config.assets.precompile += %w(
|
23
23
|
date_book.js date_book.css bootstrap-wysiwyg/bootstrap-wysiwyg.css
|
24
24
|
bootstrap-wysiwyg.js jquery_nested_form.js jquery_nested_form.js
|
25
|
-
bootstrap-datetimepicker.js bootstrap-datetimepicker.css
|
25
|
+
bootstrap-datetimepicker.js bootstrap-datetimepicker.css all-day-bg.png
|
26
|
+
part-day-bg.png
|
26
27
|
)
|
27
28
|
end
|
28
29
|
|
@@ -6,7 +6,7 @@ Devise.setup do |config|
|
|
6
6
|
# confirmation, reset password and unlock tokens in the database.
|
7
7
|
# Devise will use the `secret_key_base` as its `secret_key`
|
8
8
|
# by default. You can change it below and use your own secret key.
|
9
|
-
# config.secret_key = '
|
9
|
+
# config.secret_key = '608d36971dd95efcf4efd1431d143d3f54882227287e1378e75d4c08691e8e1cccdc483cb189782eddabb548d3c1accf1d0a5444b59ab5a7be91c18026c14ae3'
|
10
10
|
|
11
11
|
# ==> Mailer Configuration
|
12
12
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
@@ -108,7 +108,7 @@ Devise.setup do |config|
|
|
108
108
|
config.stretches = Rails.env.test? ? 1 : 11
|
109
109
|
|
110
110
|
# Set up a pepper to generate the hashed password.
|
111
|
-
# config.pepper = '
|
111
|
+
# config.pepper = '750d1cf5035bcb29512b9d4eb6e27b092e8d092188934dcb2397633bd41979b8face9b7c67a9d30f99ed876bc74340887dc1de0a9a44054074c8a128e7fe5888'
|
112
112
|
|
113
113
|
# Send a notification to the original email when the user's email is changed.
|
114
114
|
# config.send_email_changed_notification = false
|
data/spec/dummy/config/routes.rb
CHANGED
File without changes
|
@@ -7,7 +7,11 @@ class CreateEvents < ActiveRecord::Migration[5.1]
|
|
7
7
|
t.string :name
|
8
8
|
t.string :slug, unique: true
|
9
9
|
t.text :description
|
10
|
+
|
10
11
|
t.string :css_class
|
12
|
+
t.string :text_color, default: '#ffffff'
|
13
|
+
t.string :background_color, default: '#3a87ad'
|
14
|
+
t.string :border_color, default: '#235371'
|
11
15
|
|
12
16
|
t.date :start_date
|
13
17
|
t.time :start_time
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 20170808150920) do
|
14
14
|
|
15
15
|
create_table "calendars", force: :cascade do |t|
|
16
16
|
t.string "name"
|
@@ -36,6 +36,9 @@ ActiveRecord::Schema.define(version: 20170807134142) do
|
|
36
36
|
t.string "slug"
|
37
37
|
t.text "description"
|
38
38
|
t.string "css_class"
|
39
|
+
t.string "text_color", default: "#ffffff"
|
40
|
+
t.string "background_color", default: "#3a87ad"
|
41
|
+
t.string "border_color", default: "#235371"
|
39
42
|
t.date "start_date"
|
40
43
|
t.time "start_time"
|
41
44
|
t.integer "duration"
|
data/spec/models/event_spec.rb
CHANGED
@@ -39,11 +39,6 @@ RSpec.describe Event, folder: :models do
|
|
39
39
|
it { should include yesterdays_event }
|
40
40
|
it { should_not include tomorrows_event }
|
41
41
|
end
|
42
|
-
describe '#to_list' do
|
43
|
-
subject { Event.all.to_list }
|
44
|
-
its(:first) { should be_a ::Hash }
|
45
|
-
it { should have_at_least(3).items }
|
46
|
-
end
|
47
42
|
describe '.schedule' do
|
48
43
|
describe 'with a new record' do
|
49
44
|
subject { Event.new }
|
data/spec/models/role_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe Role, type: :model do
|
4
|
-
|
5
|
-
end
|
1
|
+
# require 'rails_helper'
|
2
|
+
#
|
3
|
+
# RSpec.describe Role, type: :model do
|
4
|
+
# pending "add some examples to (or delete) #{__FILE__}"
|
5
|
+
# end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: date_book
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karen Lundgren
|
@@ -602,7 +602,8 @@ files:
|
|
602
602
|
- README.md
|
603
603
|
- Rakefile
|
604
604
|
- VERSION
|
605
|
-
- app/assets/images/date_book
|
605
|
+
- app/assets/images/date_book/all-day-bg.png
|
606
|
+
- app/assets/images/date_book/part-day-bg.png
|
606
607
|
- app/assets/javascripts/date_book.js
|
607
608
|
- app/assets/javascripts/date_book/calendar_events.js
|
608
609
|
- app/assets/javascripts/date_book/event_form.js
|
@@ -749,12 +750,12 @@ files:
|
|
749
750
|
- spec/dummy/db/migrate/20170728171103_create_users_table.rb
|
750
751
|
- spec/dummy/db/migrate/20170807134122_add_devise_to_users.rb
|
751
752
|
- spec/dummy/db/migrate/20170807134128_rolify_create_roles.rb
|
752
|
-
- spec/dummy/db/migrate/
|
753
|
-
- spec/dummy/db/migrate/
|
754
|
-
- spec/dummy/db/migrate/
|
755
|
-
- spec/dummy/db/migrate/
|
756
|
-
- spec/dummy/db/migrate/
|
757
|
-
- spec/dummy/db/migrate/
|
753
|
+
- spec/dummy/db/migrate/20170808150915_create_calendars.date_book.rb
|
754
|
+
- spec/dummy/db/migrate/20170808150916_create_events.date_book.rb
|
755
|
+
- spec/dummy/db/migrate/20170808150917_create_schedules.date_book.rb
|
756
|
+
- spec/dummy/db/migrate/20170808150918_add_fields_to_schedule.date_book.rb
|
757
|
+
- spec/dummy/db/migrate/20170808150919_create_event_occurrences.date_book.rb
|
758
|
+
- spec/dummy/db/migrate/20170808150920_add_fields_to_event_occurrences.date_book.rb
|
758
759
|
- spec/dummy/db/schema.rb
|
759
760
|
- spec/dummy/db/seeds.rb
|
760
761
|
- spec/dummy/db/seeds/calendars.seeds.rb
|
File without changes
|