[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Debconf-video] [Debconf-team] [PATCH pentabarf] Fix confusion between event and video_event in video/associate view



2011/7/23 Ben Hutchings <ben@decadent.org.uk>
At this point we are listing events that may not yet have an
associated video_event.  We need to instantiate Event and Video_event
separately instead of using Video_event_view.
---
This change should be applied a.s.a.p, preferably before 21:00 tonight.
Sorry for finding this so late.

Thanks Ben :), it's never too late x)

Cheers
 
Ben.

 rails/app/views/video/associate.rxml |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/rails/app/views/video/associate.rxml b/rails/app/views/video/associate.rxml
index ba95789..cc21235 100644
--- a/rails/app/views/video/associate.rxml
+++ b/rails/app/views/video/associate.rxml
@@ -17,14 +17,15 @@ xml.div({:id=>:data}) do

    xml.tbody do
      @distances.each do |d|
-        ev = Video_event_view.select({:event_id=>d.event_id}).first
+        ev = Event.select_single({:event_id=>d.event_id})  # must exist
+        ve = Video_event.select({:event_id=>d.event_id}).first  # may not exist
        ver = Video_event_recording.select({:recording_id=>@video.id, :event_id=>d.event_id}).first
        xml.tr do
          xml.td do xml << format_event(ev).to_s end
          xml.td(display_time(d.start_datetime))
          xml.td(d.distance)
          xml.td do
-            if ev.locked_by != nil && ev.locked_by != POPE.user.person_id
+            if ve != nil && ve.locked_by != nil && ve.locked_by != POPE.user.person_id
              xml.text(local("video::claimed"))
            elsif(ver.nil?)
              xml.a( local("video::link_event_to_recording"), {:href ="" url_for({:action ="" :link_to_event, :id => @video.id, :event_id => d.event_id})})
--
1.7.5.4



_______________________________________________
Debconf-team mailing list
Debconf-team@lists.debconf.org
http://lists.debconf.org/mailman/listinfo/debconf-team




--
Marcelo Gutierrez
Team POSOL http://podcast.softwarelibre.org.ni
Linux User: 448194
Ubuntu User: 26821
http://mmgc84.taygon.com

El formato estándar ISO/IEC OpenDocument (ODF) no se usa en MS Office, por eso uso Open/Libre Office


Reply to: