public
Description: Canberra Ruby Crew Site #crc
Homepage: http://canberraruby.com
Clone URL: git://github.com/artpop/crc_site.git
added two extra date formats, moved ajax toggle to head, added in toggling of 
link label text, fixed display of topics without a link
schlick (author)
Sat Oct 25 07:02:15 -0700 2008
commit  df6c13e0467972927abf7219b16399ab7ffba02e
tree    fc366147e7bddf360489b63712d02256aee5fda7
parent  73b80e3578ae1f2a203dfec41478e1f3a96b49f0
...
1
2
 
 
 
3
...
1
2
3
4
5
6
0
@@ -1,3 +1,6 @@
0
 class Topic < ActiveRecord::Base
0
   belongs_to :meeting
0
+  
0
+  validates_presence_of :title
0
+  validates_presence_of :description
0
 end
...
10
11
12
 
13
14
15
...
10
11
12
13
14
15
16
0
@@ -10,6 +10,7 @@
0
     =# Using jRails plugin
0
     = javascript_include_tag :defaults
0
     = yield :head
0
+    = yield :unobtrusive_javascript
0
   %body
0
     #main
0
       %div.wrapper
...
1
2
 
 
 
 
3
4
5
...
1
 
2
3
4
5
6
7
8
0
@@ -1,4 +1,7 @@
0
 %li
0
-  = link_to topic.title, topic.link
0
+  - if topic.link.blank?
0
+    = topic.title
0
+  - else
0
+    = link_to topic.title, topic.link
0
   \-
0
   = topic.description
0
\ No newline at end of file
...
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
 
 
3
4
5
 
6
7
 
 
 
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
42
43
44
45
 
 
46
47
48
49
50
51
52
53
54
55
56
57
 
58
59
60
61
62
63
64
65
66
67
68
 
 
 
 
 
 
 
 
 
 
 
 
 
69
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
20
21
22
23
24
25
26
27
28
29
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
32
33
 
 
 
 
 
 
 
 
 
 
34
35
36
 
 
37
38
39
40
41
42
43
 
44
45
46
47
 
 
48
49
50
51
 
52
53
54
55
56
 
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
0
@@ -1,67 +1,69 @@
0
+- content_for :unobtrusive_javascript do
0
+  :javascript
0
+    $(document).ready(function(){
0
+      $("#add_topic").hide();    
0
+      $("a#new_topic").toggle(function(){
0
+        $("#add_topic").show('slow');
0
+        $("a#new_topic").text('Cancel');
0
+      },function(){
0
+        $("#add_topic").hide('slow');
0
+        $("a#new_topic").text('Add new topic');
0
+      });
0
+    });
0
+
0
 = flash[:notice]
0
 
0
+%h2 Meeting Details
0
+
0
 %p
0
   %strong Date:
0
-  =h @meeting.date
0
+  =h @meeting.date.to_s(:day_date)
0
 
0
 %p
0
+  %strong Time:
0
+  =h @meeting.date.to_s(:am_pm).downcase
0
+%p
0
   %strong Venue:
0
   =h @meeting.venue
0
   
0
 %p
0
   %strong Topics:
0
-%ul
0
-
0
-= link_to 'Create new topic', new_topic_path
0
-
0
-%p
0
-  %strong Attendees:
0
-%ul{ :style => 'list-style:none; padding-left: 0' }
0
-  - for person in @meeting.attendees
0
-    %li.peep
0
-      = image_tag(person.gravatar_url(:size => 32), :alt => person.name, :valign => 'middle')
0
-      = person.name
0
-      
0
-= link_to 'Edit', edit_meeting_path(@meeting)
0
-|
0
-= link_to 'Back', meetings_path
0
-
0
 %ul#topic_list
0
   = render :partial => 'topic', :collection => Topic.all
0
 
0
-%a#new_topic Add new topic
0
-:javascript
0
-  $(document).ready(function(){
0
-    $("#add_topic").hide();    
0
-    $("a#new_topic").toggle(function(){
0
-      $("#add_topic").show('slow');
0
-    },function(){
0
-      $("#add_topic").hide('slow');
0
-    });
0
-  });
0
+= link_to 'Add new topic', new_topic_path, :id => "new_topic"
0
 
0
 #add_topic
0
-  %h1 Editing topic
0
-
0
+  %h3 Add a topic
0
+  -# TODO: should do this as unobtrusive
0
   - form_remote_for :topic, :url => topics_path, :html => { :id => 'topic_form' } do |f|
0
     = f.error_messages
0
 
0
     %p
0
       = f.label :title
0
-      %br
0
       = f.text_field :title
0
 
0
     %p
0
       = f.label :description
0
-      %br
0
-      = f.text_area :description
0
+      = f.text_field :description
0
 
0
     %p
0
       = f.label :link
0
-      %br
0
       = f.text_field :link
0
 
0
     = f.hidden_field :meeting_id, :value => @meeting.id
0
 
0
     %p
0
-      = f.submit "Update"
0
\ No newline at end of file
0
+      = f.submit "Update"
0
+
0
+%p
0
+  %strong Attendees:
0
+%ul{ :style => 'list-style:none; padding-left: 0' }
0
+  - for person in @meeting.attendees
0
+    %li.peep
0
+      = image_tag(person.gravatar_url(:size => 32), :alt => person.name, :valign => 'middle')
0
+      = person.name
0
+      
0
+= link_to 'Edit', edit_meeting_path(@meeting)
0
+|
0
+= link_to 'Back', meetings_path
0
\ No newline at end of file

Comments