Adds internal/articles input to update author (#1628)
* adds input to change article author * remove link * remove unnecessary attribute
This commit is contained in:
parent
0a1454dc97
commit
d0b17f2a77
2 changed files with 6 additions and 2 deletions
|
|
@ -73,6 +73,8 @@ class Internal::ArticlesController < Internal::ApplicationController
|
|||
article.email_digest_eligible = article_params[:email_digest_eligible].to_s == "true"
|
||||
article.boosted_additional_articles = article_params[:boosted_additional_articles].to_s == "true"
|
||||
article.boosted_dev_digest_email = article_params[:boosted_dev_digest_email].to_s == "true"
|
||||
article.user_id = article_params[:user_id].to_i
|
||||
|
||||
article.update!(article_params)
|
||||
if article.live_now
|
||||
Article.where.not(id: article.id).where(live_now: true).update_all(live_now: false)
|
||||
|
|
@ -95,6 +97,7 @@ class Internal::ArticlesController < Internal::ApplicationController
|
|||
:boosted_additional_articles,
|
||||
:boosted_dev_digest_email,
|
||||
:main_image_background_hex_color,
|
||||
:featured_number)
|
||||
:featured_number,
|
||||
:user_id)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<% article.decorate.cached_tag_list_array.each do |tag| %>
|
||||
<a href='/t/<%= tag %>'>#<%= tag %></a>
|
||||
<% end %>
|
||||
<a href="/internal/users/<%= article.user_id %>">@<%= article.user&.username %></a> ❤️ <%= article.positive_reactions_count %> | 💬 <%= article.comments_count %> | ID: <a href="/internal/articles/<%= article.id %>"><%= article.id %></a>
|
||||
<a href="/internal/users/<%= article.user_id %>">@<%= article.user&.username %></a> ❤️ <%= article.positive_reactions_count %> | 💬 <%= article.comments_count %>
|
||||
<br/><br/>
|
||||
<div class="inner-row">
|
||||
<form action="/internal/articles/<%= article.id %>" accept-charset="UTF-8" method="post">
|
||||
|
|
@ -52,6 +52,7 @@
|
|||
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>" />
|
||||
<input type="hidden" name="_method" value="patch" />
|
||||
Featured Number: <input name="article[featured_number]" value="<%= article.featured_number %>" id="featured_number_<%= article.id %>" style="max-width:140px"><button onclick="timeNow(<%= article.id %>);return false;">☝️</button><button onclick="sink(<%= article.id %>);return false;">👇 SPAM!</button>
|
||||
Change author: <input size="6" name="article[user_id]" value="<%= article.user_id %>" >
|
||||
  Featured: <input name="article[featured]" type="checkbox" <%= "checked" if article.featured %>>
|
||||
  Approved: <input name="article[approved]" type="checkbox" <%= "checked" if article.approved %>>
|
||||
  Live Now: <input name="article[live_now]" type="checkbox" <%= "checked" if article.live_now %>>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue