<%= content_for :javascript do%> <%if @event.authorize?(:update, :to => current_user)%> $('#streaming_url_value').editable('<%=space_event_path(@space, @event, :format => 'js')%>',{ method : 'PUT', tooltip : '<%= t('dblclick')%>', cancel : '<%= t('cancel')%>', onblur : 'ignore', submit : '<%= t('ok')%>', indicator : '', placeholder: '<%=t("event.streaming.none")%> <%=link_to_function t('event.streaming.add'), "edit_streaming()", :id => "add_streaming_link"%>', type : 'textarea', name : 'event[other_streaming_url]', width : 635, height: 150, event : "dblclick", submitdata : {authenticity_token: "<%=form_authenticity_token()%>"}, }); $('#streaming_url_value form input').livequery("blur",function(){ $('#edit_streaming_icon').show(); }); edit_streaming = function(){ $('#streaming_url_value').dblclick(); }; <%end%> request_participation = function(){ var route = "<%= space_event_path(@space, @event) %>" + "?participation_by_ajax=true"; $.get(route,{ authenticity_token: "<%=form_authenticity_token()%>" }, function(data){ $("#title_content").html("<%=t('event.video_part')%>"); $("#streaming_url_value").html(data); $("#req_participation_link").html('<%=link_to_function ('' + t('event.streaming.back') + ''),"request_streaming()", {:id=>"view_streaming", :class=>"grey_button basic_button",:title => t('event.view_participation')} %>'); }); }; request_streaming = function(){ var route = "<%= space_event_path(@space, @event) %>" + "?streaming_by_ajax=true"; $.get(route,{ authenticity_token: "<%=form_authenticity_token()%>" }, function(data){ $("#title_content").html("<%=t('event.streaming.title')%>"); $("#streaming_url_value").html(data); $("#req_participation_link").html('<%=link_to_function ('' + t('join_cam') + ''), "request_participation()", {:id=>"view_streaming", :class=>"grey_button basic_button",:title => t('event.view_participation')} %>'); }); }; <%end%>
<%= link_to_function(image_tag("icons/pencil.png", :alt => t('edit'),:title=>t('event.streaming.edit'), :class=>"icon" ), "edit_streaming()", :id => "edit_streaming_icon") if @event.authorize?(:update, :to => current_user) %>

<%if @event.is_happening_now?%>
<%=image_tag("down.png",:class=>"jqueryToggle")%><%=image_tag("right.png",:style=>"display:none",:class=>"jqueryToggle")%>
<%=t('event.streaming.title')%> <%else%>
<%=image_tag("down.png",:class=>"jqueryToggle")%><%=image_tag("right.png",:style=>"display:none",:class=>"jqueryToggle")%>
<%=t('event.streaming.will_be_available')%> <%end%>

<%if (@event.other_streaming_url== nil || @event.other_streaming_url=="") && !@event.authorize?(:update, :to => current_user)%> <%=t("event.streaming.none")%> <%elsif (@event.other_streaming_url== nil || @event.other_streaming_url=="") && @event.authorize?(:update, :to => current_user)%>
<%=@event.other_streaming_url%>
<%else%>
Live!
<%=@event.other_streaming_url%>
<%end%>
<%if @event.description != ""%> <%= render :partial => "events/event_description" %> <%end%>