From 09c82fe69ec4a8e84df60935130c7777c10239af Mon Sep 17 00:00:00 2001 From: Ali Spittel Date: Wed, 13 Feb 2019 12:10:54 -0500 Subject: [PATCH] Prevent double article submission on v1 editor (#1791) --- app/views/articles/_markdown_form.html.erb | 138 ++++++++++----------- 1 file changed, 68 insertions(+), 70 deletions(-) diff --git a/app/views/articles/_markdown_form.html.erb b/app/views/articles/_markdown_form.html.erb index 21f077525..1631ee024 100644 --- a/app/views/articles/_markdown_form.html.erb +++ b/app/views/articles/_markdown_form.html.erb @@ -2,11 +2,10 @@ <% if @article.errors.any? %>

<%= pluralize(@article.errors.count, "error") %> prohibited this article from being saved:

-
<% end %> @@ -14,25 +13,25 @@ <% if hiring_form?(@tag, @article) %>
< beta ❤️ >
-

The #Hiring Tag

-

Fill out this form to share your company's job opportunity.

-
- <% end %> -
- <% unless hiring_form?(@tag, @article) %> -
- - - - +

The #Hiring Tag

+

Fill out this form to share your company's job opportunity.

<% end %> -
- <% if hiring_form?(@tag, @article) %> - <%= render 'articles/hiring_form', f:f %> - <% else %> - <% if current_user.organization %> -
+
+ <% unless hiring_form?(@tag, @article) %> +
+ + + + +
+ <% end %> +
+ <% if hiring_form?(@tag, @article) %> + <%= render 'articles/hiring_form', f:f %> + <% else %> + <% if current_user.organization %> +
Publish under the <%= current_user.organization.name %> organization? <%= f.check_box :publish_under_org, {checked: @article.organization_id.present?} %>
@@ -109,54 +108,50 @@

<%= @user.username %> profile - By <%= @user.name %> - - <% if @user.twitter_username.present? %> - <%= icon("twitter","20") %> - <% end %> - <% if @user.github_username.present? %> - <%= icon("github","20") %> - <% end %> - <%= "on "+@article.published_at.strftime("%B %d, %Y") if @article.published_at %> -

-
-
+ By <%= @user.name %> + + <% if @user.twitter_username.present? %> + <%= icon("twitter","20") %> + <% end %> + <% if @user.github_username.present? %> + <%= icon("github","20") %> + <% end %> + <%= "on "+@article.published_at.strftime("%B %d, %Y") if @article.published_at %> + +
-
-
- <%= render "articles/about_author" %> - <% if current_user.organization %> - <%= render "articles/org_branding", organization: current_user.organization %> - <% end %>
+
+
+ <%= render "articles/about_author" %> + <% if current_user.organization %> + <%= render "articles/org_branding", organization: current_user.organization %> + <% end %> +
- - - <%= javascript_include_tag 'lib/js-yaml', async: true %> <%= javascript_include_tag 'https://cdnjs.cloudflare.com/ajax/libs/postscribe/2.0.8/postscribe.min.js', async: true %> <%= javascript_include_tag 'https://embed.runkit.com', async: true %> -