public
Description: El Dorado is a full-stack community web application written in Ruby/Rails.
Homepage: http://almosteffortless.com/eldorado/
Clone URL: git://github.com/trevorturk/el-dorado.git
updating plugins with piston

git-svn-id: http://eldorado.googlecode.com/svn/trunk@630 
9c008b19-a030-0410-9975-d76d301b4276
trevorturk (author)
Sun Jan 20 21:13:47 -0800 2008
commit  cea57e058ac3453c43dd4d781edd331903fc1c67
tree    76aafd8ac0f72584a8191720b85ff98443a13e77
parent  9232284a1d436233afa40d009c586a44b0f30650
...
24
25
26
27
28
 
 
29
30
31
...
24
25
26
 
 
27
28
29
30
31
0
@@ -24,8 +24,8 @@ class BasicTest < Test::Unit::TestCase
0
   def test_should_normalize_content_types_to_array
0
     assert_equal %w(pdf), PdfAttachment.attachment_options[:content_type]
0
     assert_equal %w(pdf doc txt), DocAttachment.attachment_options[:content_type]
0
- assert_equal ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png'], ImageAttachment.attachment_options[:content_type]
0
- assert_equal ['pdf', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png'], ImageOrPdfAttachment.attachment_options[:content_type]
0
+ assert_equal ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg'], ImageAttachment.attachment_options[:content_type]
0
+ assert_equal ['pdf', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg'], ImageOrPdfAttachment.attachment_options[:content_type]
0
   end
0
   
0
   def test_should_sanitize_content_type
...
11
12
13
14
15
16
17
18
19
20
21
 
 
 
 
 
 
22
23
24
...
11
12
13
 
 
 
14
15
16
 
 
17
18
19
20
21
22
23
24
25
0
@@ -11,14 +11,15 @@ Authors
0
 Jeremy Voorhis -- http://jvoorhis.com
0
 Original implementation
0
 
0
-Jarkko Laine -- http://jlaine.net/
0
-Dynamic enhancements for starting week on Monday and highlighting weekends
0
-
0
 Geoffrey Grosenbach -- http://nubyonrails.com
0
 Test suite and conversion to a Rails plugin
0
 
0
-Tom Armitage -- http://infovore.org
0
-Improvements to markup (abbreviations on day-headings, <caption>); introduction of :accessible option.
0
+Contributors
0
+============
0
+
0
+* Jarkko Laine http://jlaine.net/
0
+* Tom Armitage http://infovore.org
0
+* Bryan Larsen http://larsen.st
0
 
0
 Usage
0
 =====
...
18
19
20
 
 
 
 
21
22
23
...
18
19
20
21
22
23
24
25
26
27
0
@@ -18,6 +18,10 @@
0
   text-align: center;
0
 }
0
 
0
+thead tr {
0
+ color: black;
0
+}
0
+
0
 .monthName th {
0
   font-weight: normal;
0
   text-align: right;
...
34
35
36
 
 
37
38
39
...
77
78
79
80
 
 
 
81
82
83
...
92
93
94
95
96
 
 
 
 
 
 
 
 
 
 
 
 
97
98
99
...
34
35
36
37
38
39
40
41
...
79
80
81
 
82
83
84
85
86
87
...
96
97
98
 
 
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
0
@@ -34,6 +34,8 @@ module CalendarHelper
0
   #
0
   # :show_today => false # Highlights today on the calendar using the CSS class 'today'.
0
   # # Defaults to true.
0
+ # :previous_month_text => nil # Displayed left of the month name if set
0
+ # :next_month_text => nil # Displayed right of the month name if set
0
   #
0
   # For more customization, you can pass a code block to this method, that will get one argument, a Date object,
0
   # and return a values for the individual table cells. The block can return an array, [cell_text, cell_attrs],
0
@@ -77,7 +79,9 @@ module CalendarHelper
0
       :abbrev => (0..2),
0
       :first_day_of_week => 0,
0
       :accessible => false,
0
- :show_today => true
0
+ :show_today => true,
0
+ :previous_month_text => nil,
0
+ :next_month_text => nil
0
     }
0
     options = defaults.merge options
0
 
0
@@ -92,8 +96,18 @@ module CalendarHelper
0
       day_names.push(day_names.shift)
0
     end
0
 
0
- cal = %(<table class="#{options[:table_class]}" border="0" cellspacing="0" cellpadding="0">)
0
- cal << %(<thead><tr class="#{options[:month_name_class]}"><th colspan="7">#{render :partial => 'events/nav.html.erb'}</th></tr><tr class="#{options[:day_name_class]}">)
0
+ # TODO Use some kind of builder instead of straight HTML
0
+ cal = %(<table class="#{options[:table_class]}" border="0" cellspacing="0" cellpadding="0">)
0
+ cal << %(<thead><tr>)
0
+ if options[:previous_month_text] or options[:next_month_text]
0
+ cal << %(<th colspan="2">#{options[:previous_month_text]}</th>)
0
+ colspan=3
0
+ else
0
+ colspan=7
0
+ end
0
+ cal << %(<th colspan="7">#{render :partial => 'events/nav.html.erb'}</th>)
0
+ cal << %(<th colspan="2">#{options[:next_month_text]}</th>) if options[:next_month_text]
0
+ cal << %(</tr><tr class="#{options[:day_name_class]}">)
0
     day_names.each do |d|
0
       unless d[options[:abbrev]].eql? d
0
         cal << "<th scope='col'><abbr title='#{d}'>#{d[options[:abbrev]]}</abbr></th>"
...
14
15
16
17
 
18
19
20
21
 
 
 
 
22
23
24
...
118
119
120
 
 
 
 
 
 
 
121
122
123
...
14
15
16
 
17
18
19
 
 
20
21
22
23
24
25
26
...
120
121
122
123
124
125
126
127
128
129
130
131
132
0
@@ -14,11 +14,13 @@ class CalendarHelperTest < Test::Unit::TestCase
0
   # include Inflector
0
   # include ActionController::Assertions::SelectorAssertions
0
   include CalendarHelper
0
-
0
+
0
 
0
   def test_with_output
0
- output = "<h2>Past Month</h2>" + calendar_with_defaults
0
- output << "<h2>Current Month</h2>" + calendar_for_this_month
0
+ output = []
0
+ %w(calendar_with_defaults calendar_for_this_month calendar_with_next_and_previous).each do |methodname|
0
+ output << "<h2>#{methodname}</h2>\n" + send(methodname.to_sym) + "\n\n"
0
+ end
0
     write_sample "sample.html", output
0
   end
0
 
0
@@ -118,6 +120,13 @@ class CalendarHelperTest < Test::Unit::TestCase
0
     calendar options
0
   end
0
 
0
+ def calendar_with_next_and_previous
0
+ calendar_for_this_month({
0
+ :previous_month_text => "PREVIOUS",
0
+ :next_month_text => "NEXT"
0
+ })
0
+ end
0
+
0
   def write_sample(filename, content)
0
     FileUtils.mkdir_p "test/output"
0
     File.open("test/output/#{filename}", 'w') do |f|

Comments

    No one has commented yet.