public
Description: Canberra Ruby Crew Site #crc
Homepage: http://canberraruby.com
Clone URL: git://github.com/artpop/crc_site.git
moved topic creation out of meeting show into meeting edit and fixed up topics 
list to only show topics for a meeting, not all topics
schlick (author)
Sun Oct 26 07:33:48 -0700 2008
commit  08f26049f92be7c45780b66ceb6634976c1e378e
tree    10cbc5dc8dc9635f4e3fbc9f884f7069e0e8047a
parent  df6c13e0467972927abf7219b16399ab7ffba02e
...
27
28
29
30
 
31
32
33
...
27
28
29
 
30
31
32
33
0
@@ -27,7 +27,7 @@ class TopicsController < ApplicationController
0
       if @topic.save
0
         flash[:notice] = 'Topic was successfully created.'
0
         # redirect_to(@topic)
0
-        format.html { redirect_to meeting_path(@topic.meeting_id) }
0
+        format.html { redirect_to edit_meeting_path(@topic.meeting_id) }
0
         format.js
0
       else
0
         render :action => "new"
...
1
2
3
 
 
4
5
 
 
 
 
 
 
 
 
6
7
8
...
10
11
12
13
 
14
15
16
...
22
23
24
 
25
26
27
...
29
30
31
32
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
20
21
22
 
23
24
25
26
...
32
33
34
35
36
37
38
...
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
72
73
74
75
76
0
@@ -1,8 +1,18 @@
0
 - content_for :head do
0
   = stylesheet_link_tag 'ui.datepicker.css'
0
   = javascript_include_tag 'ui.datepicker.js'
0
+
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
       $("#meeting_date").datepicker({ 
0
           dateFormat: "DD, MM d, yy", 
0
           showOn: "both", 
0
@@ -10,7 +20,7 @@
0
           buttonImageOnly: true 
0
       });
0
     });
0
-
0
+        
0
 - form_for(@meeting) do |f|
0
   = f.error_messages
0
 
0
@@ -22,6 +32,7 @@
0
     = f.label :venue
0
     %br
0
     = f.text_field :venue
0
+
0
   %h4 Attendees
0
   %ul{ :style => 'list-style:none; padding-left: 0'}
0
     - for person in Person.all
0
@@ -29,4 +40,36 @@
0
         = check_box_tag "meeting[attendee_ids][]", person.id, @meeting.attendees.include?(person)
0
         = person.name
0
   %p
0
-    = f.submit "Save"
0
\ No newline at end of file
0
+    = f.submit "Save"
0
+
0
+- unless @meeting.new_record?
0
+
0
+  %p
0
+    %strong Topics:
0
+  %ul#topic_list
0
+    = render :partial => 'topic', :collection => @meeting.topics
0
+
0
+  %p= link_to 'Add new topic', new_topic_path, :id => "new_topic"
0
+    
0
+  #add_topic
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
+        = f.text_field :title
0
+
0
+      %p
0
+        = f.label :description
0
+        = f.text_field :description
0
+
0
+      %p
0
+        = f.label :link
0
+        = f.text_field :link
0
+
0
+      = f.hidden_field :meeting_id, :value => @meeting.id
0
+
0
+      %p
0
+        = f.submit "Update"
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
...
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
...
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
...
15
16
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
19
20
21
22
23
24
25
0
@@ -1,16 +1,3 @@
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
@@ -28,33 +15,11 @@
0
   
0
 %p
0
   %strong Topics:
0
-%ul#topic_list
0
-  = render :partial => 'topic', :collection => Topic.all
0
-
0
-= link_to 'Add new topic', new_topic_path, :id => "new_topic"
0
-
0
-#add_topic
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
-      = f.text_field :title
0
-
0
-    %p
0
-      = f.label :description
0
-      = f.text_field :description
0
-
0
-    %p
0
-      = f.label :link
0
-      = f.text_field :link
0
-
0
-    = f.hidden_field :meeting_id, :value => @meeting.id
0
-
0
-    %p
0
-      = f.submit "Update"
0
+- if @meeting.topics.empty?
0
+  None
0
+- else
0
+  %ul
0
+    = render :partial => 'topic', :collection => @meeting.topics
0
 
0
 %p
0
   %strong Attendees:

Comments