forked from codidact/qpixel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes codidact#180
- Loading branch information
Showing
6 changed files
with
86 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<%= render 'posts/markdown_script' %> | ||
|
||
<% if @tag.errors.any? %> | ||
<div class="notice is-danger"> | ||
There were some errors while saving this tag: | ||
|
||
<ul> | ||
<% @tag.errors.full_messages.each do |msg| %> | ||
<li><%= msg %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<%= form_for @tag, url: submit_path do |f| %> | ||
<% if submit_path == create_tag_path %> | ||
<div class="form-group"> | ||
<%= f.label :name, 'Name', class: 'form-element' %> | ||
<span class="form-caption"> | ||
Name of the tag | ||
</span> | ||
<%= f.text_field :name, class: 'form-element' %> | ||
</div> | ||
<% end %> | ||
|
||
<div class="form-group"> | ||
<%= f.label :parent_id, 'Parent tag', class: 'form-element' %> | ||
<span class="form-caption"> | ||
Optional. Select a parent tag to make this part of a tag hierarchy. | ||
</span> | ||
<%= f.select :parent_id, options_for_select(@tag.parent.present? ? [[@tag.parent.name, @tag.parent_id]] : [], | ||
selected: @tag.parent.present? ? @tag.parent_id : nil), | ||
{ include_blank: true }, class: "form-element js-tag-select", | ||
data: { tag_set: @category.tag_set_id, use_ids: true, placeholder: "None" } %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%= f.label :excerpt, 'Usage guidance', class: 'form-element' %> | ||
<span class="form-caption"> | ||
Short usage guidance for this tag. Will be cut off at 120 characters in the tags list, but displayed in full on | ||
the tag page. | ||
</span> | ||
<%= f.text_area :excerpt, class: 'form-element js-tag-excerpt', rows: 3 %> | ||
<span class="has-float-right has-font-size-caption js-character-count" | ||
data-target=".js-tag-excerpt" data-max="600">0 / 600</span> | ||
</div> | ||
|
||
<%= render 'shared/body_field', f: f, field_name: :wiki_markdown, field_label: 'Wiki', post: @tag do %> | ||
Full usage guidance and any other information you want people to know about this tag. | ||
<% end %> | ||
<div class="post-preview"></div> | ||
|
||
<%= f.submit 'Save', class: 'button is-filled' %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,7 @@ | ||
<% content_for :title, 'Edit tag' %> | ||
|
||
<%= render 'posts/markdown_script' %> | ||
|
||
<h1> | ||
Edit <span class="<%= @classes %> is-large"><%= @tag.name %></span> | ||
</h1> | ||
|
||
<% if @tag.errors.any? %> | ||
<div class="notice is-danger"> | ||
There were some errors while saving this tag: | ||
|
||
<ul> | ||
<% @tag.errors.full_messages.each do |msg| %> | ||
<li><%= msg %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<%= form_for @tag, url: update_tag_path(id: @category.id, tag_id: @tag.id) do |f| %> | ||
<div class="form-group"> | ||
<%= f.label :parent_id, 'Parent tag', class: 'form-element' %> | ||
<span class="form-caption"> | ||
Optional. Select a parent tag to make this part of a tag hierarchy. | ||
</span> | ||
<%= f.select :parent_id, options_for_select(@tag.parent.present? ? [[@tag.parent.name, @tag.parent_id]] : [], | ||
selected: @tag.parent.present? ? @tag.parent_id : nil), | ||
{ include_blank: true }, class: "form-element js-tag-select", | ||
data: { tag_set: @category.tag_set_id, use_ids: true, placeholder: "None" } %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%= f.label :excerpt, 'Usage guidance', class: 'form-element' %> | ||
<span class="form-caption"> | ||
Short usage guidance for this tag. Will be cut off at 120 characters in the tags list, but displayed in full on | ||
the tag page. | ||
</span> | ||
<%= f.text_area :excerpt, class: 'form-element js-tag-excerpt', rows: 3 %> | ||
<span class="has-float-right has-font-size-caption js-character-count" | ||
data-target=".js-tag-excerpt" data-max="600">0 / 600</span> | ||
</div> | ||
|
||
<%= render 'shared/body_field', f: f, field_name: :wiki_markdown, field_label: 'Wiki', post: @tag do %> | ||
Full usage guidance and any other information you want people to know about this tag. | ||
<% end %> | ||
<div class="post-preview"></div> | ||
|
||
<%= f.submit 'Save', class: 'button is-filled' %> | ||
<% end %> | ||
<%= render 'form', submit_path: update_tag_path(id: @category.id, tag_id: @tag.id) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<% content_for :title, 'Create tag' %> | ||
|
||
<h1> | ||
Create <span class="<%= @classes %> is-large">Tag</span> | ||
</h1> | ||
|
||
<%= render 'form', submit_path: create_tag_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters