docbrown/app/views/articles/edit.html.erb
2018-05-10 11:57:39 -04:00

37 lines
No EOL
1.5 KiB
Text

<% title "Edit Article - DEV" %>
<% if @article.video.present? %>
<div style="text-align:center;padding-top:100px;margin:auto;max-width:880px">
<% if @article.video_state == "PROGRESSING" %>
<h1 style="color:#062144">⏳ Video Transcoding In Progress ⏳</h1>
<img src="https://media.giphy.com/media/xf20D8HzvTQzu/giphy.gif" style="border-radius:12px" />
<div style="max-width:376px;margin:18px auto 0px;font-size:0.8em;">
<p>
You'll get an email when it's finished. Contact <a href="mailto:ben@dev.to">ben@dev.to</a> if the email never comes, or if anything else is broken. 😱
</p>
<p>
This is an unpublished article with a video. Publish it as usual when the video is done processing.
</p>
</div>
<% elsif @article.video_state == "COMPLETED" %>
<h2>Video uploaded - <%= @article.video_code %></h2>
<%= render "articles/video_player", meta_tags: false, article: @article %>
<h2>Change preview image:</h2>
<%= form_for(@article) do |f| %>
<%= f.text_field :video_thumbnail_url, placeholder: "New Thumbnail URL" %>
<%= f.submit %>
<% end %>
<br/>Video is in beta ❤️<br/><br/><br/>
<% end %>
</div>
<% end %>
<% if params[:beta_form] %>
<%= render 'react_form' %>
<% else %>
<% if @article.body_html && @article.body_html.size > 10 %>
<%= render 'inline_form' %>
<% else %>
<%= render 'articles/markdown_form' %>
<% end %>
<% end %>