viewable 0.5.17 → 0.5.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +10 -10
  3. data/.gitignore +27 -27
  4. data/.travis.yml +22 -22
  5. data/AUTHORS.md +6 -6
  6. data/CONTRIBUTING.md +22 -22
  7. data/Gemfile +7 -7
  8. data/LICENSE.md +23 -23
  9. data/README.md +38 -38
  10. data/Rakefile +6 -6
  11. data/lib/viewable/generators/viewable/controller_generator.rb +22 -22
  12. data/lib/viewable/generators/viewable/css_generator.rb +11 -11
  13. data/lib/viewable/generators/viewable/install_generator.rb +17 -17
  14. data/lib/viewable/generators/viewable/js_generator.rb +17 -17
  15. data/lib/viewable/generators/viewable/resource_model_generator.rb +21 -21
  16. data/lib/viewable/generators/viewable/templates/assets/javascript/calendar-editable.js +6991 -6991
  17. data/lib/viewable/generators/viewable/templates/assets/javascript/custom.js +126 -126
  18. data/lib/viewable/generators/viewable/templates/assets/javascript/fullcalendar.js +6110 -6110
  19. data/lib/viewable/generators/viewable/templates/assets/stylesheets/fullcalendar.css +587 -587
  20. data/lib/viewable/generators/viewable/templates/controllers/resource_controller.rb +50 -50
  21. data/lib/viewable/generators/viewable/templates/controllers/viewing_controller.rb +77 -77
  22. data/lib/viewable/generators/viewable/templates/models/datetime.rb +6 -6
  23. data/lib/viewable/generators/viewable/templates/models/resource.rb +4 -4
  24. data/lib/viewable/generators/viewable/templates/models/viewable.rb +85 -85
  25. data/lib/viewable/generators/viewable/templates/models/viewing.rb +4 -4
  26. data/lib/viewable/generators/viewable/templates/views/_errors.html.erb +13 -13
  27. data/lib/viewable/generators/viewable/templates/views/_form.html.erb +6 -6
  28. data/lib/viewable/generators/viewable/templates/views/edit.html.erb +1 -1
  29. data/lib/viewable/generators/viewable/templates/views/index.html.erb +12 -12
  30. data/lib/viewable/generators/viewable/templates/views/new.html.erb +1 -1
  31. data/lib/viewable/generators/viewable/templates/views/viewings/_errors.html.erb +12 -12
  32. data/lib/viewable/generators/viewable/templates/views/viewings/_form.html.erb +11 -11
  33. data/lib/viewable/generators/viewable/templates/views/viewings/edit.html.erb +9 -9
  34. data/lib/viewable/generators/viewable/templates/views/viewings/index.html.erb +22 -22
  35. data/lib/viewable/generators/viewable/templates/views/viewings/new.html.erb +9 -9
  36. data/lib/viewable/generators/viewable/templates/views/viewings/show.html.erb +6 -6
  37. data/lib/viewable/generators/viewable/viewing_model_generator.rb +25 -25
  38. data/lib/viewable/generators/viewable/views_generator.rb +21 -21
  39. data/lib/viewable/railtie.rb +8 -8
  40. data/lib/viewable/viewable.rb +1 -1
  41. data/viewable.gemspec +33 -33
  42. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71bdc222154ae9dbf6617547f5bbd0e4ae92d4ea
4
- data.tar.gz: b25eea649ec69a81a1df7d15770e48c4014f5fc4
3
+ metadata.gz: 220c35ee0187b188830ad217448db637c945e23f
4
+ data.tar.gz: e6439cda21e0d906cc61308932f4ed2a88306114
5
5
  SHA512:
6
- metadata.gz: b5e64e6b82dff2fc4c4fc1ab5ddbb490867c178867b5a9250f3b54f2b9d2816a60668e9975ede5243d08005b08244f007a7e75cb5f517227b49b1a8cdd6335b5
7
- data.tar.gz: 620c26f91efd05a828f057421701f3db3e234c38029ca87ce70d4511fae5a267f95bceaefe27b16faf9bba3574fd22f4371d00d423fbe751f245338b59af0ed8
6
+ metadata.gz: 3f940e37644d950a2d83c7032e4de69eb57d7edccdcd20d39715ebc3f30c50651ef97e04bddcb068ad0dc2940058a4bfeff7bac67c417fff229a0dd53300b218
7
+ data.tar.gz: 6877bb3cea8aaa6f4726207597698235ba91ce175be5e61e19e2160fb294793fcd0c90b7f7cdeb517aa41f19c519bf4b7223d374a0ca73695ae3fd1c03a0b92c
@@ -1,10 +1,10 @@
1
- # http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = tab
7
- indent_size = 1
8
- end_of_line = crlf
9
- insert_final_newline = false
10
- trim_trailing_whitespace = true
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ end_of_line = crlf
9
+ insert_final_newline = false
10
+ trim_trailing_whitespace = true
data/.gitignore CHANGED
@@ -1,27 +1,27 @@
1
- *.gem
2
- *.rbc
3
- /.config
4
- /coverage/
5
- /InstalledFiles
6
- /pkg/
7
- /spec/reports/
8
- /test/tmp/
9
- /test/version_tmp/
10
- /tmp/
11
-
12
- ## Documentation cache and generated files:
13
- /.yardoc/
14
- /doc/
15
-
16
- ## Environment normalisation:
17
- /.bundle/
18
- /lib/bundler/man/
19
-
20
- # for a library or gem, you might want to ignore these files since the code is
21
- # intended to run in multiple environments; otherwise, check them in:
22
- Gemfile.lock
23
- # .ruby-version
24
- # .ruby-gemset
25
-
26
- ## Ignore RubyMine idea folder
27
- .idea/
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Documentation cache and generated files:
13
+ /.yardoc/
14
+ /doc/
15
+
16
+ ## Environment normalisation:
17
+ /.bundle/
18
+ /lib/bundler/man/
19
+
20
+ # for a library or gem, you might want to ignore these files since the code is
21
+ # intended to run in multiple environments; otherwise, check them in:
22
+ Gemfile.lock
23
+ # .ruby-version
24
+ # .ruby-gemset
25
+
26
+ ## Ignore RubyMine idea folder
27
+ .idea/
@@ -1,22 +1,22 @@
1
- os:
2
- - linux
3
- language: ruby
4
-
5
- rvm:
6
- - 2.2.0
7
- - 2.0.0
8
- before_install:
9
- - sudo apt-get update
10
- - gem update --system
11
- - gem update
12
- - gem --version
13
-
14
- before_script:
15
- - bundle exec rake
16
-
17
- notifications:
18
- on_success: change
19
- on_failure: change
20
- email:
21
- recipients:
22
- - tom.jcox@icloud.com
1
+ os:
2
+ - linux
3
+ language: ruby
4
+
5
+ rvm:
6
+ - 2.2.0
7
+ - 2.0.0
8
+ before_install:
9
+ - sudo apt-get update
10
+ - gem update --system
11
+ - gem update
12
+ - gem --version
13
+
14
+ before_script:
15
+ - bundle exec rake
16
+
17
+ notifications:
18
+ on_success: change
19
+ on_failure: change
20
+ email:
21
+ recipients:
22
+ - tom.jcox@icloud.com
data/AUTHORS.md CHANGED
@@ -1,6 +1,6 @@
1
- # C|R|M
2
-
3
- >Cox | Rees | Mitchell | [crmis](https://crm-is.herokuapp.com)
4
-
5
- ## Tom Cox
6
- #### [Github](https://github.com/Koxzi95) | [Website](http://koxzi.me) | [Twitter](https://twitter.com/Koxzi95) | [![endorse](https://api.coderwall.com/koxzi95/endorsecount.png)](https://coderwall.com/koxzi95)
1
+ # C|R|M
2
+
3
+ >Cox | Rees | Mitchell | [crmis](https://crm-is.herokuapp.com)
4
+
5
+ ## Tom Cox
6
+ #### [Github](https://github.com/Koxzi95) | [Website](http://koxzi.me) | [Twitter](https://twitter.com/Koxzi95) | [![endorse](https://api.coderwall.com/koxzi95/endorsecount.png)](https://coderwall.com/koxzi95)
@@ -1,22 +1,22 @@
1
- # Contributing to [crmis/viewable](www.github.com/crmis/viewable)
2
-
3
- #### Thanks for thinking of contributing to crmis! Whether you are here to report issues or develop on the project the sections below provide outlines on how to get started.
4
-
5
- ## Bugs/Issues :bug:
6
-
7
- Write specifically which browser (and version if possible) this is reported to be found in.
8
-
9
- Write out the steps to replicate the error. What did you expect to happen? What happened instead?
10
-
11
- If possible provide a snippet of code, and the syntax if possible. Check the guide on how to do so:
12
- [Mastering Markdown.](https://guides.github.com/features/mastering-markdown/)
13
-
14
- ## Steps
15
-
16
- ##### 1. Fork this repository to your own space.
17
- ##### 2. Make any changes on your version.
18
- ##### 3. Push your repository
19
- ##### 4. Make a pull request, this will get reviewed/discussed.
20
- ##### 5. If it's good and passes the tests, it should get pulled in!
21
-
22
- ###### Needs more work :octocat:
1
+ # Contributing to [crmis/viewable](www.github.com/crmis/viewable)
2
+
3
+ #### Thanks for thinking of contributing to crmis! Whether you are here to report issues or develop on the project the sections below provide outlines on how to get started.
4
+
5
+ ## Bugs/Issues :bug:
6
+
7
+ Write specifically which browser (and version if possible) this is reported to be found in.
8
+
9
+ Write out the steps to replicate the error. What did you expect to happen? What happened instead?
10
+
11
+ If possible provide a snippet of code, and the syntax if possible. Check the guide on how to do so:
12
+ [Mastering Markdown.](https://guides.github.com/features/mastering-markdown/)
13
+
14
+ ## Steps
15
+
16
+ ##### 1. Fork this repository to your own space.
17
+ ##### 2. Make any changes on your version.
18
+ ##### 3. Push your repository
19
+ ##### 4. Make a pull request, this will get reviewed/discussed.
20
+ ##### 5. If it's good and passes the tests, it should get pulled in!
21
+
22
+ ###### Needs more work :octocat:
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
- source 'https://rubygems.org'
2
-
3
- # Dependencies are specified in viewable.gemspec
4
- gemspec
5
-
6
-
7
- gem 'rspec-rails', '~> 3.2.1'
1
+ source 'https://rubygems.org'
2
+
3
+ # Dependencies are specified in viewable.gemspec
4
+ gemspec
5
+
6
+
7
+ gem 'rspec-rails', '~> 3.2.1'
data/LICENSE.md CHANGED
@@ -1,23 +1,23 @@
1
- ###### We use the Github License generator. But if you're unsure check out: http://choosealicense.com/
2
-
3
- # The MIT License (MIT)
4
-
5
- ### Copyright (c) 2015 Tom Cox
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in all
15
- copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- SOFTWARE.
1
+ ###### We use the Github License generator. But if you're unsure check out: http://choosealicense.com/
2
+
3
+ # The MIT License (MIT)
4
+
5
+ ### Copyright (c) 2015 Tom Cox
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
data/README.md CHANGED
@@ -1,38 +1,38 @@
1
- # viewable-gem
2
-
3
- :octocat:
4
-
5
- [![Gem Version](https://badge.fury.io/rb/viewable.svg)](http://badge.fury.io/rb/viewable)
6
- [![Build Status](https://travis-ci.org/crmis/viewable.svg?branch=master)](https://travis-ci.org/crmis/viewable)
7
- [![Code Climate](https://codeclimate.com/github/crmis/viewable-gem/badges/gpa.svg)](https://codeclimate.com/github/crmis/viewable-gem)
8
- [![Dependency Status](https://gemnasium.com/crmis/viewable-gem.svg)](https://gemnasium.com/crmis/viewable-gem)
9
-
10
- ## Installation
11
-
12
- Viewable works with Rails 4.0. Add this line to your Gemfile:
13
-
14
- gem 'viewable', '~> 0.5.17'
15
-
16
- Then execute:
17
-
18
- $ bundle
19
-
20
- Or install it yourself as:
21
-
22
- $ gem install viewable
23
-
24
- After you've installed the gem, you need to run the generator:
25
-
26
- $ rails generate viewable:install
27
-
28
- Alternatively you can specify a named resource such as 'room'
29
-
30
- $ rails generate viewable:install room
31
-
32
- The generator will create the file structure you need to implement viewing functionality into your app, it will also run migrations after generating these:
33
- * controllers
34
- * models - resource(room) and viewing
35
- * views
36
- * javascript - which uses the jQuery Full Calendar (old) plugin
37
- * css - some basic CSS is provided which you may want to override
38
- * routes
1
+ # viewable-gem
2
+
3
+ :octocat:
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/viewable.svg)](http://badge.fury.io/rb/viewable)
6
+ [![Build Status](https://travis-ci.org/crmis/viewable.svg?branch=master)](https://travis-ci.org/crmis/viewable)
7
+ [![Code Climate](https://codeclimate.com/github/crmis/viewable-gem/badges/gpa.svg)](https://codeclimate.com/github/crmis/viewable-gem)
8
+ [![Dependency Status](https://gemnasium.com/crmis/viewable-gem.svg)](https://gemnasium.com/crmis/viewable-gem)
9
+
10
+ ## Installation
11
+
12
+ Viewable works with Rails 4.0. Add this line to your Gemfile:
13
+
14
+ gem 'viewable', '~> 0.5.18'
15
+
16
+ Then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install viewable
23
+
24
+ After you've installed the gem, you need to run the generator:
25
+
26
+ $ rails generate viewable:install
27
+
28
+ Alternatively you can specify a named resource such as 'room'
29
+
30
+ $ rails generate viewable:install room
31
+
32
+ The generator will create the file structure you need to implement viewing functionality into your app, it will also run migrations after generating these:
33
+ * controllers
34
+ * models - resource(room) and viewing
35
+ * views
36
+ * javascript - which uses the jQuery Full Calendar (old) plugin
37
+ * css - some basic CSS is provided which you may want to override
38
+ * routes
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require 'bundler/gem_tasks'
2
-
3
- # temp
4
- require 'rspec/core/rake_task'
5
- RSpec::Core::RakeTask.new(:spec)
6
- task :default => :spec
1
+ require 'bundler/gem_tasks'
2
+
3
+ # temp
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ task :default => :spec
@@ -1,22 +1,22 @@
1
- module Viewable
2
- module Generators
3
- class ControllerGenerator < Rails::Generators::Base
4
- source_root File.expand_path('../templates/controllers', __FILE__)
5
- argument :resource_name, type: :string, default: 'resource'
6
- def generate_viewable_controller
7
- template "viewing_controller.rb", "app/controllers/viewings_controller.rb"
8
- template "resource_controller.rb", "app/controllers/#{resource_name_underscore.pluralize}_controller.rb"
9
- route "resources :#{resource_name_underscore.pluralize} do\n" \
10
- "\t resources :viewings\n" \
11
- "\tend"
12
- end
13
- private
14
- def resource_name_underscore
15
- resource_name.underscore
16
- end
17
- def resource_name_camelize
18
- resource_name.camelize
19
- end
20
- end
21
- end
22
- end
1
+ module Viewable
2
+ module Generators
3
+ class ControllerGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../templates/controllers', __FILE__)
5
+ argument :resource_name, type: :string, default: 'resource'
6
+ def generate_viewable_controller
7
+ template "viewing_controller.rb", "app/controllers/viewings_controller.rb"
8
+ template "resource_controller.rb", "app/controllers/#{resource_name_underscore.pluralize}_controller.rb"
9
+ route "resources :#{resource_name_underscore.pluralize} do\n" \
10
+ "\t resources :viewings\n" \
11
+ "\tend"
12
+ end
13
+ private
14
+ def resource_name_underscore
15
+ resource_name.underscore
16
+ end
17
+ def resource_name_camelize
18
+ resource_name.camelize
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,11 +1,11 @@
1
- module Viewable
2
- module Generators
3
- class CssGenerator < Rails::Generators::Base
4
- source_root File.expand_path('../templates/assets/stylesheets', __FILE__)
5
- def generate_css
6
- template "custom.css", "app/assets/stylesheets/viewable_custom.css"
7
- template "fullcalendar.css", "app/assets/stylesheets/viewable_fullcalendar.css"
8
- end
9
- end
10
- end
11
- end
1
+ module Viewable
2
+ module Generators
3
+ class CssGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../templates/assets/stylesheets', __FILE__)
5
+ def generate_css
6
+ template "custom.css", "app/assets/stylesheets/viewable_custom.css"
7
+ template "fullcalendar.css", "app/assets/stylesheets/viewable_fullcalendar.css"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,17 +1,17 @@
1
- module Viewable
2
- module Generators
3
- class InstallGenerator < Rails::Generators::Base
4
- argument :resource_name, :type => :string, :default => "resource"
5
- source_root File.expand_path("../", __FILE__)
6
- def install
7
- generate "viewable:resource_model #{resource_name}"
8
- generate "viewable:viewing_model #{resource_name}"
9
- generate "viewable:controller #{resource_name}"
10
- generate "viewable:views #{resource_name}"
11
- generate "viewable:js #{resource_name}"
12
- generate "viewable:css #{resource_name}"
13
- rake 'db:migrate'
14
- end
15
- end
16
- end
17
- end
1
+ module Viewable
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ argument :resource_name, :type => :string, :default => "resource"
5
+ source_root File.expand_path("../", __FILE__)
6
+ def install
7
+ generate "viewable:resource_model #{resource_name}"
8
+ generate "viewable:viewing_model #{resource_name}"
9
+ generate "viewable:controller #{resource_name}"
10
+ generate "viewable:views #{resource_name}"
11
+ generate "viewable:js #{resource_name}"
12
+ generate "viewable:css #{resource_name}"
13
+ rake 'db:migrate'
14
+ end
15
+ end
16
+ end
17
+ end