twitter-bootstrap-calendar 0.0.1 → 0.0.2
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.
data/README.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
# Twitter::Bootstrap::Calendar
|
2
2
|
|
3
|
-
|
3
|
+
I recently upgraded TroopTrack from Twitter Bootstrap 1 to 2, redesigning a few key aspects of the site to make it more usable. Overall, I was very pleased with the results except for one area – the calendar. I was using a calendar gem that provided a view helper that generates a table based calendar. It’s worked okay in the past, but now that I had managed to get every other aspect of my site scaling nicely for display on tablets, the horizontal scrolling caused by the rigid table layout was more than I could bear.
|
4
|
+
|
5
|
+
What I really needed was a table-less calendar that uses the bootstrap grid. The problem is, a 12-grid layout isn’t very good for creating a calendar, unless I manage to convince the universe to have either six or twelve days in a week. A quick call to my senator to that option off the table, so I decided to create a 7 column grid.
|
6
|
+
|
7
|
+
This is totally easy with Bootstrap’s form for downloading a customized CSS. I tweaked things a bit to get rid of the gutters, turned off pretty much everything except the grid bits, then wrapped the resulting CSS in a selector so it would only apply to my calendar div.
|
8
|
+
|
9
|
+
That was the easy part.
|
10
|
+
|
11
|
+
Next I needed a helper I could use to create my calendar. Fortunately, Ryan Bates had revised his screencast (#213) on how to create a calendar back in August and I was lucky enough to remember watching it. I swiped his calendar helper code and was off to the races.
|
12
|
+
|
13
|
+
I’m pretty happy with the end result – a 100% table free calendar layout that is uber-responsive and looks great on my iPad Mini (which I love!).
|
4
14
|
|
5
15
|
## Installation
|
6
16
|
|
@@ -12,6 +22,10 @@ Add this line to your application.css:
|
|
12
22
|
|
13
23
|
*= require twitter-bootstrap-calendar
|
14
24
|
|
25
|
+
And this line to your application.js:
|
26
|
+
|
27
|
+
//= require twitter-bootstrap-calendar
|
28
|
+
|
15
29
|
And then execute:
|
16
30
|
|
17
31
|
$ bundle
|
@@ -0,0 +1,11 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
var maxHeight = -1;
|
3
|
+
|
4
|
+
$('.calendar_grid .week .span1').each(function() {
|
5
|
+
maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();
|
6
|
+
});
|
7
|
+
|
8
|
+
$('.calendar_grid .week .span1').each(function() {
|
9
|
+
$(this).height(maxHeight);
|
10
|
+
});
|
11
|
+
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter-bootstrap-calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-12-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|
16
|
-
requirement: &
|
16
|
+
requirement: &70106235809180 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70106235809180
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: railties
|
27
|
-
requirement: &
|
27
|
+
requirement: &70106235806740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '3.1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70106235806740
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: actionpack
|
38
|
-
requirement: &
|
38
|
+
requirement: &70106235803340 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.1'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70106235803340
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &70106235801100 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '3.1'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70106235801100
|
58
58
|
description: Adds a helper and 7-column grid for creating calendar views
|
59
59
|
email:
|
60
60
|
- dave@trooptrack.com
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- lib/twitter/bootstrap/calendar/engine.rb
|
67
67
|
- lib/twitter/bootstrap/calendar/version.rb
|
68
68
|
- lib/twitter-bootstrap-calendar.rb
|
69
|
+
- vendor/assets/javascripts/twitter-bootstrap-calendar/index.js
|
69
70
|
- vendor/assets/stylesheets/twitter-bootstrap-calendar/index.css.scss
|
70
71
|
- app/helpers/bootstrap_calendar_helper.rb
|
71
72
|
- Rakefile
|