Fix linting issues in app/views/blocks (#1851) [ci skip]
This commit is contained in:
parent
c0c95d7e1a
commit
35845258dd
6 changed files with 64 additions and 62 deletions
|
|
@ -2,7 +2,7 @@
|
|||
Featured: <%= block.featured %> | Position: <%= block.index_position %>
|
||||
<% if block.processed_html != block.published_html || block.processed_css != block.published_css %>
|
||||
<%= form_for(block) do |f| %>
|
||||
<%= f.hidden_field :publish_now %><br/>
|
||||
<%= f.hidden_field :publish_now %><br />
|
||||
<button style="cursor:pointer;background:#30cb98;color:white;border:0px;padding:10px;font-size:25px;">PUBLISH</button>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -4,44 +4,46 @@
|
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.26.0/mode/javascript/javascript.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.26.0/mode/htmlmixed/htmlmixed.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
setTimeout(function(){
|
||||
var myTextArea = document.getElementById("block_input_css");
|
||||
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
|
||||
var myTextArea = document.getElementById("block_input_javascript");
|
||||
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
|
||||
var myTextArea = document.getElementById("block_input_html");
|
||||
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
|
||||
// var myCodeMirror = CodeMirror(function(elt) {
|
||||
// myTextArea.parentNode.replaceChild(elt, myTextArea);
|
||||
// }, {
|
||||
// value: myTextArea.value,
|
||||
// mode: "css"
|
||||
// });
|
||||
},1)
|
||||
setTimeout(function () {
|
||||
var myTextArea = document.getElementById("block_input_css");
|
||||
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
|
||||
var myTextArea = document.getElementById("block_input_javascript");
|
||||
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
|
||||
var myTextArea = document.getElementById("block_input_html");
|
||||
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
|
||||
// var myCodeMirror = CodeMirror(function(elt) {
|
||||
// myTextArea.parentNode.replaceChild(elt, myTextArea);
|
||||
// }, {
|
||||
// value: myTextArea.value,
|
||||
// mode: "css"
|
||||
// });
|
||||
}, 1)
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.form-wrapper form{
|
||||
width:800px;
|
||||
max-width:100%;
|
||||
margin:auto;
|
||||
text-align:left !important;
|
||||
font-size:1.5em;
|
||||
.form-wrapper form {
|
||||
width: 800px;
|
||||
max-width: 100%;
|
||||
margin: auto;
|
||||
text-align: left !important;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
textarea{
|
||||
opacity:0;
|
||||
|
||||
textarea {
|
||||
opacity: 0;
|
||||
}
|
||||
pre{
|
||||
overflow:visible !important;
|
||||
|
||||
pre {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.CodeMirror{
|
||||
border:2px solid red;
|
||||
margin-top:10px;
|
||||
font-size:14px;
|
||||
padding:2px;
|
||||
|
||||
.CodeMirror {
|
||||
border: 2px solid red;
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
<div class="form-wrapper">
|
||||
|
|
@ -51,31 +53,31 @@ setTimeout(function(){
|
|||
<h2><%= pluralize(@block.errors.count, "error") %> prohibited this block from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @block.errors.full_messages.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
<% @block.errors.full_messages.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<style>
|
||||
textarea{
|
||||
height:250px;
|
||||
width:600px;
|
||||
max-width:90%;
|
||||
textarea {
|
||||
height: 250px;
|
||||
width: 600px;
|
||||
max-width: 90%;
|
||||
}
|
||||
</style>
|
||||
<%= f.label :input_css %><br/>
|
||||
<%= f.text_area :input_css %><br/>
|
||||
<%= f.label :input_javascript %><br/>
|
||||
<%= f.text_area :input_javascript %><br/>
|
||||
<%= f.label :input_html %><br/>
|
||||
<%= f.text_area :input_html %><br/>
|
||||
<%= f.label :featured %><br/>
|
||||
<%= f.check_box :featured %><br/>
|
||||
<%= f.label :index_position %><br/>
|
||||
<%= f.text_field :index_position %><br/>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<%= f.label :input_css %><br />
|
||||
<%= f.text_area :input_css %><br />
|
||||
<%= f.label :input_javascript %><br />
|
||||
<%= f.text_area :input_javascript %><br />
|
||||
<%= f.label :input_html %><br />
|
||||
<%= f.text_area :input_html %><br />
|
||||
<%= f.label :featured %><br />
|
||||
<%= f.check_box :featured %><br />
|
||||
<%= f.label :index_position %><br />
|
||||
<%= f.text_field :index_position %><br />
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
<br/><br/><br/><br/>
|
||||
<%= render 'form' %>
|
||||
<br /><br /><br /><br />
|
||||
<%= render "form" %>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<div class="home" id="index-container">
|
||||
|
||||
<div class="articles-list">
|
||||
<% @blocks.each_with_index do |block,i| %>
|
||||
<%= render "articles/block", block: block, show_published: false, i:i %>
|
||||
<% @blocks.each_with_index do |block, i| %>
|
||||
<%= render "articles/block", block: block, show_published: false, i: i %>
|
||||
<center>
|
||||
<%= render "blocks/actions", block: block %>
|
||||
<%= link_to 'Edit', edit_block_path(block), style: "color:white;display:block;font-size:35px;background:rgb(0, 93, 190);padding:10px 0px;" %>
|
||||
<%= link_to "Edit", edit_block_path(block), style: "color:white;display:block;font-size:35px;background:rgb(0, 93, 190);padding:10px 0px;" %>
|
||||
</center>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= link_to 'New Block', new_block_path %>
|
||||
<%= link_to "New Block", new_block_path %>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<h1>New Block</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
<%= render "form" %>
|
||||
|
||||
<%= link_to 'Back', blocks_path %>
|
||||
<%= link_to "Back", blocks_path %>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<div class="home" id="index-container">
|
||||
<div class="articles-list">
|
||||
<%= render "articles/block", block: @block, show_published: false, i:0 %>
|
||||
<%= render "articles/block", block: @block, show_published: false, i: 0 %>
|
||||
<center>
|
||||
<%= render "blocks/actions", block: @block %>
|
||||
<%= link_to 'Edit', edit_block_path(@block), style: "color:white;display:block;font-size:35px;background:rgb(0, 93, 190);padding:10px 0px;" %>
|
||||
<%= render "blocks/actions", block: @block %>
|
||||
<%= link_to "Edit", edit_block_path(@block), style: "color:white;display:block;font-size:35px;background:rgb(0, 93, 190);padding:10px 0px;" %>
|
||||
</center>
|
||||
<h1><a href="/blocks" style="color:blue">Go to Index</a></h1>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue