docbrown/app/views/articles/_v2_form.html.erb
Mac Siri 0f3342bcec [WIP] Implement non front-matter editor (#415)
* Create alternate editor

* Install linkstate (?)

Not sure how it disappear in the first place

* Run yarn install

* Modulize ArticleForm component

* Refactor

* Isolating css WIP

* Implement simplified frontmatter-less editor

* Modulize individual form element

* Ajust props names

* Transform json params to snakecase

* Remove codes

* Update /new, almost there for release

* Fix editor resize issues

* Change defaultvalue to value in article form tag element

* Modify html buttons in article form
2018-07-27 20:12:33 -07:00

34 lines
No EOL
1.7 KiB
Text

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.38.0/codemirror.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.38.0/theme/material.min.css">
<div class="articleformcontainer">
<div class="articleform"
id="article-form"
data-article="<%= @article.
to_json(only: [:id, :title, :cached_tag_list, :published, :body_markdown, :main_image]) %>"
data-organization="<%= current_user.organization&.to_json(only: [:name, :bg_color_hex, :text_color_hex]) %>"
>
<form class="articleform__form">
<input class="articleform__title" type="text" value="<%= @article.title %>" placeholder="title" />
<div class="articleform__detailfields">
<div class="articleform__tagswrapper">
<textarea type="text" class="articleform__tags" placeholder="tags"><%= @article.cached_tag_list %></textarea>
</div><button class="articleform__imageButton">
<img src="<%= asset_path 'image-upload.svg' %>"> IMAGES</button>
</div>
<textarea class="articleform__body" placeholder="Body" name="body_markdown"><%= @article.body_markdown %></textarea>
<% if @article.published %>
<div class="articleform__buttons"><button class="inactive">HELP</button><button class="inactive">PREVIEW</button><button>UNPUBLISH</button><button>SAVE CHANGES</button></div> </form>
<% else %>
<div class="articleform__buttons"><button class="inactive">HELP</button><button class="inactive">PREVIEW</button><button>SAVE DRAFT</button><button>PUBLISH</button></div> </form>
<% end %>
<div style="display:none">
<%= render "pages/editor_guide_text" %>
</div>
</div>
</div>
<style>
#footer-container{display: none}
</style>