tb_events 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +15 -0
  2. data/README.md +58 -0
  3. data/Rakefile +28 -0
  4. data/app/assets/images/spud/admin/events_thumb.png +0 -0
  5. data/app/assets/javascripts/calendar_events.js +2 -0
  6. data/app/assets/javascripts/calendars.js +2 -0
  7. data/app/assets/javascripts/spud/admin/calendar_events.js +2 -0
  8. data/app/assets/javascripts/spud/admin/calendars.js +0 -0
  9. data/app/assets/javascripts/spud/admin/events.js +51 -0
  10. data/app/assets/javascripts/spud/events.js +0 -0
  11. data/app/assets/lib/colorpicker/colorpicker.css +164 -0
  12. data/app/assets/lib/colorpicker/colorpicker.js +484 -0
  13. data/app/assets/lib/colorpicker/images/blank.gif +0 -0
  14. data/app/assets/lib/colorpicker/images/colorpicker_background.png +0 -0
  15. data/app/assets/lib/colorpicker/images/colorpicker_hex.png +0 -0
  16. data/app/assets/lib/colorpicker/images/colorpicker_hsb_b.png +0 -0
  17. data/app/assets/lib/colorpicker/images/colorpicker_hsb_h.png +0 -0
  18. data/app/assets/lib/colorpicker/images/colorpicker_hsb_s.png +0 -0
  19. data/app/assets/lib/colorpicker/images/colorpicker_indic.gif +0 -0
  20. data/app/assets/lib/colorpicker/images/colorpicker_overlay.png +0 -0
  21. data/app/assets/lib/colorpicker/images/colorpicker_rgb_b.png +0 -0
  22. data/app/assets/lib/colorpicker/images/colorpicker_rgb_g.png +0 -0
  23. data/app/assets/lib/colorpicker/images/colorpicker_rgb_r.png +0 -0
  24. data/app/assets/lib/colorpicker/images/colorpicker_select.gif +0 -0
  25. data/app/assets/lib/colorpicker/images/colorpicker_submit.png +0 -0
  26. data/app/assets/lib/colorpicker/images/custom_background.png +0 -0
  27. data/app/assets/lib/colorpicker/images/custom_hex.png +0 -0
  28. data/app/assets/lib/colorpicker/images/custom_hsb_b.png +0 -0
  29. data/app/assets/lib/colorpicker/images/custom_hsb_h.png +0 -0
  30. data/app/assets/lib/colorpicker/images/custom_hsb_s.png +0 -0
  31. data/app/assets/lib/colorpicker/images/custom_indic.gif +0 -0
  32. data/app/assets/lib/colorpicker/images/custom_rgb_b.png +0 -0
  33. data/app/assets/lib/colorpicker/images/custom_rgb_g.png +0 -0
  34. data/app/assets/lib/colorpicker/images/custom_rgb_r.png +0 -0
  35. data/app/assets/lib/colorpicker/images/custom_submit.png +0 -0
  36. data/app/assets/lib/colorpicker/images/select.png +0 -0
  37. data/app/assets/lib/colorpicker/images/select2.png +0 -0
  38. data/app/assets/lib/colorpicker/images/slider.png +0 -0
  39. data/app/assets/stylesheets/spud/admin/events.css +16 -0
  40. data/app/assets/stylesheets/spud/calendar_events.css +18 -0
  41. data/app/assets/stylesheets/spud/calendars.css +136 -0
  42. data/app/assets/stylesheets/spud/events.css +4 -0
  43. data/app/controllers/calendar_events_controller.rb +8 -0
  44. data/app/controllers/calendars_controller.rb +30 -0
  45. data/app/controllers/spud/admin/calendar_events_controller.rb +64 -0
  46. data/app/controllers/spud/admin/calendars_controller.rb +52 -0
  47. data/app/helpers/calendars_helper.rb +50 -0
  48. data/app/helpers/spud/admin/calendar_events_helper.rb +2 -0
  49. data/app/helpers/spud/admin/calendars_helper.rb +15 -0
  50. data/app/models/spud_calendar.rb +7 -0
  51. data/app/models/spud_calendar_event.rb +11 -0
  52. data/app/views/calendar_events/show.html.erb +5 -0
  53. data/app/views/calendars/_calendar.html.erb +26 -0
  54. data/app/views/calendars/_calendar_options.html.erb +4 -0
  55. data/app/views/calendars/show.html.erb +4 -0
  56. data/app/views/spud/admin/calendar_events/_calendar.html.erb +14 -0
  57. data/app/views/spud/admin/calendar_events/_form.html.erb +98 -0
  58. data/app/views/spud/admin/calendar_events/edit.html.erb +1 -0
  59. data/app/views/spud/admin/calendar_events/index.html.erb +20 -0
  60. data/app/views/spud/admin/calendar_events/new.html.erb +1 -0
  61. data/app/views/spud/admin/calendars/_calendar_legend.html.erb +7 -0
  62. data/app/views/spud/admin/calendars/_form.html.erb +20 -0
  63. data/app/views/spud/admin/calendars/edit.html.erb +1 -0
  64. data/app/views/spud/admin/calendars/new.html.erb +1 -0
  65. data/config/application.rb +50 -0
  66. data/config/boot.rb +6 -0
  67. data/config/routes.rb +17 -0
  68. data/db/migrate/20120216191833_create_spud_calendars.rb +12 -0
  69. data/db/migrate/20120216192531_create_spud_calendar_events.rb +15 -0
  70. data/db/migrate/20130214131628_add_location_to_spud_calendar_event.rb +10 -0
  71. data/lib/spud_events/calendar_builder.rb +133 -0
  72. data/lib/spud_events/configuration.rb +10 -0
  73. data/lib/spud_events/engine.rb +31 -0
  74. data/lib/spud_events/table_builder.rb +88 -0
  75. data/lib/spud_events/version.rb +5 -0
  76. data/lib/tb_events.rb +8 -0
  77. metadata +258 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDQ0NzdjNmE5NTdlNzVjNzEzM2RjMGZiNmZhNmEyYjgyZWUzYjZjZg==
5
+ data.tar.gz: !binary |-
6
+ MGUyYTBjMGMxNTY1YWIxNzc3YjY4ZWM0NWYyNjEwZTJhMmI4ZjI3Mw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YzI2ODJmYWYyZjEzNzQ1ODA4NGUzMGEzYjY5ZmFiYTA4YjA2MmZkYjQzY2Yw
10
+ YzFlYjQwNTQyNTBlZTZhYzg4NjAwYTE4MTAyNmNkZWFiZmU5OGJjZWE3YmU2
11
+ MDcxOTNjMzdlZjg4YjU3YTNlODJmNmVmZDM1N2ZlNTVmMTBjYjU=
12
+ data.tar.gz: !binary |-
13
+ ZDY0N2JlMDE3YmM1MGVmNGUxZGRiZDNmNzNjNDNiYjViNGM1NmEwNTQ2YWIy
14
+ ZjYzYjM0OWFlZjAzMjg0ZDc1ZGNiZDg4YTc3NTgyMDY4ZWRiYWQ5Njg5ODFk
15
+ YWUzOGZiZjkzZmNiNGFkYTAxYjExNzUzMzI5OTJhOWI2YTEzM2U=
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ Spud Events
2
+ ===========
3
+
4
+ Spud Events is an event and calendaring engine for the Spud Engine
5
+
6
+ Installation/Usage
7
+ ------------------
8
+
9
+ 1. Add the following to your Gemfile
10
+
11
+ gem 'spud_core'
12
+ gem 'spud_events', :git => "git://github.com/davydotcom/spud_events.git"
13
+
14
+ 2. Run ```bundle install```
15
+ 3. Copy the database migrations in to your rails project
16
+
17
+ rake railties:install:migrations
18
+
19
+ 4. Run the database migrations ```rake db:migrate```
20
+ 5. The defualt URL for the calendar page is ```/calendar```
21
+
22
+ Configruations
23
+ --------------
24
+
25
+ * Set the layout for the calendar pages (Defualt is layouts/spud/calendar)
26
+
27
+ Spud::Events.configure do |config|
28
+ config.calendar_layout = 'application'
29
+ end
30
+
31
+ * Override the default calendar views by placing the corresponding views in the ```calendars``` and ```calendar_events``` view folders.
32
+ * Include the default calendar CSS by adding the following to your ```application.css``` file
33
+
34
+ /*
35
+ ...
36
+ *= require spud/events
37
+ */
38
+
39
+ Testing
40
+ -----------------
41
+
42
+ Spud uses RSpec for testing. Get the tests running with a few short commands:
43
+
44
+ 1. Create and migrate the databases:
45
+
46
+ rake db:create
47
+ rake db:migrate
48
+
49
+ 2. Load the schema in to the test database:
50
+
51
+ rake app:db:test:prepare
52
+
53
+ 3. Run the tests with RSpec
54
+
55
+ rspec spec
56
+
57
+ After the tests have completed the current code coverage stats is available by opening ```/coverage/index.html``` in a browser.
58
+
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'TbEvents'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+ Bundler::GemHelper.install_tasks
27
+
28
+ require 'rake'
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
File without changes
@@ -0,0 +1,51 @@
1
+ //= require colorpicker/colorpicker
2
+ //= require_self
3
+
4
+ var Spud = Spud || {};
5
+ Spud.Admin = Spud.Admin || {};
6
+
7
+ Spud.Admin.Events = new function(){
8
+ var self = this;
9
+
10
+ self.init = function(){
11
+ // Wd.Admin.tinyMce();
12
+ self.configureColorPicker();
13
+ self.attachCalendarDeleteFX();
14
+ };
15
+
16
+ self.configureColorPicker = function(){
17
+ var $colorPickers = $('.spud_events_admin_color_picker'),
18
+ $calendarColor = $('#spud_calendar_color');
19
+
20
+ if($colorPickers.size() > 0) {
21
+ $colorPickers.css('backgroundColor', '#' + $calendarColor.val());
22
+ $colorPickers.ColorPicker({
23
+ color: $calendarColor.val(),
24
+ onShow: function (colpkr) {
25
+ $(colpkr).fadeIn(500);
26
+ return false;
27
+ },
28
+ onHide: function (colpkr) {
29
+ $(colpkr).fadeOut(500);
30
+ return false;
31
+ },
32
+ onChange: function (hsb, hex, rgb) {
33
+
34
+ $colorPickers.css('backgroundColor', '#' + hex);
35
+ $calendarColor.attr('value', hex);
36
+ }
37
+ });
38
+ }
39
+ };
40
+
41
+ self.attachCalendarDeleteFX = function() {
42
+ $(document).on('ajax:succes','.js-spud-calendar-delete-action', function() {
43
+ $(this).closest('.spud_events_admin_calendar_legend_item').fadeOut(500, function(){ $(this).remove(); });
44
+ });
45
+ };
46
+ };
47
+
48
+ $(function() {
49
+ Spud.Admin.Events.init();
50
+ });
51
+
File without changes
@@ -0,0 +1,164 @@
1
+ .colorpicker {
2
+ width: 356px;
3
+ height: 176px;
4
+ overflow: hidden;
5
+ position: absolute;
6
+ background: url(/assets/colorpicker/images/colorpicker_background.png);
7
+ font-family: Arial, Helvetica, sans-serif;
8
+ display: none;
9
+ }
10
+ .colorpicker_color {
11
+ width: 150px;
12
+ height: 150px;
13
+ left: 14px;
14
+ top: 13px;
15
+ position: absolute;
16
+ background: #f00;
17
+ overflow: hidden;
18
+ cursor: crosshair;
19
+ }
20
+ .colorpicker_color div {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ width: 150px;
25
+ height: 150px;
26
+ background: url(/assets/colorpicker/images/colorpicker_overlay.png);
27
+ }
28
+ .colorpicker_color div div {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ width: 11px;
33
+ height: 11px;
34
+ overflow: hidden;
35
+ background: url(/assets/colorpicker/images/colorpicker_select.gif);
36
+ margin: -5px 0 0 -5px;
37
+ }
38
+ .colorpicker_hue {
39
+ position: absolute;
40
+ top: 13px;
41
+ left: 171px;
42
+ width: 35px;
43
+ height: 150px;
44
+ cursor: n-resize;
45
+ }
46
+ .colorpicker_hue div {
47
+ position: absolute;
48
+ width: 35px;
49
+ height: 9px;
50
+ overflow: hidden;
51
+ background: url(/assets/colorpicker/images/colorpicker_indic.gif) left top;
52
+ margin: -4px 0 0 0;
53
+ left: 0px;
54
+ }
55
+ .colorpicker_new_color {
56
+ position: absolute;
57
+ width: 60px;
58
+ height: 30px;
59
+ left: 213px;
60
+ top: 13px;
61
+ background: #f00;
62
+ }
63
+ .colorpicker_current_color {
64
+ position: absolute;
65
+ width: 60px;
66
+ height: 30px;
67
+ left: 283px;
68
+ top: 13px;
69
+ background: #f00;
70
+ }
71
+ .colorpicker input {
72
+ background-color: transparent;
73
+ border: 1px solid transparent;
74
+ position: absolute;
75
+ font-size: 10px;
76
+ font-family: Arial, Helvetica, sans-serif;
77
+ color: #898989;
78
+ top: 4px;
79
+ right: 11px;
80
+ text-align: right;
81
+ margin: 0;
82
+ padding: 0;
83
+ height: 11px;
84
+ }
85
+ .colorpicker_hex {
86
+ position: absolute;
87
+ width: 72px;
88
+ height: 22px;
89
+ background: url(/assets/colorpicker/images/colorpicker_hex.png) top;
90
+ left: 212px;
91
+ top: 142px;
92
+ }
93
+ .colorpicker_hex input {
94
+ right: 6px;
95
+ }
96
+ .colorpicker_field {
97
+ height: 22px;
98
+ width: 62px;
99
+ background-position: top;
100
+ position: absolute;
101
+ }
102
+ .colorpicker_field span {
103
+ position: absolute;
104
+ width: 12px;
105
+ height: 22px;
106
+ overflow: hidden;
107
+ top: 0;
108
+ right: 0;
109
+ cursor: n-resize;
110
+ }
111
+ .colorpicker_field input{
112
+ width:auto;
113
+ }
114
+ .colorpicker_rgb_r {
115
+ background-image: url(/assets/colorpicker/images/colorpicker_rgb_r.png);
116
+ top: 52px;
117
+ left: 212px;
118
+ }
119
+ .colorpicker_rgb_g {
120
+ background-image: url(/assets/colorpicker/images/colorpicker_rgb_g.png);
121
+ top: 82px;
122
+ left: 212px;
123
+ }
124
+ .colorpicker_rgb_b {
125
+ background-image: url(/assets/colorpicker/images/colorpicker_rgb_b.png);
126
+ top: 112px;
127
+ left: 212px;
128
+ }
129
+ .colorpicker_hsb_h {
130
+ background-image: url(/assets/colorpicker/images/colorpicker_hsb_h.png);
131
+ top: 52px;
132
+ left: 282px;
133
+ }
134
+ .colorpicker_hsb_s {
135
+ background-image: url(/assets/colorpicker/images/colorpicker_hsb_s.png);
136
+ top: 82px;
137
+ left: 282px;
138
+ }
139
+ .colorpicker_hsb_b {
140
+ background-image: url(/assets/colorpicker/images/colorpicker_hsb_b.png);
141
+ top: 112px;
142
+ left: 282px;
143
+ }
144
+ .colorpicker_submit {
145
+ position: absolute;
146
+ width: 22px;
147
+ height: 22px;
148
+ background: url(/assets/colorpicker/images/colorpicker_submit.png) top;
149
+ left: 322px;
150
+ top: 142px;
151
+ overflow: hidden;
152
+ }
153
+ .colorpicker_focus {
154
+ background-position: center;
155
+ }
156
+ .colorpicker_hex.colorpicker_focus {
157
+ background-position: bottom;
158
+ }
159
+ .colorpicker_submit.colorpicker_focus {
160
+ background-position: bottom;
161
+ }
162
+ .colorpicker_slider {
163
+ background-position: bottom;
164
+ }