mirror of
https://github.com/neocities/neocities.git
synced 2025-07-22 10:36:07 +02:00
baseplate for tutorials
This commit is contained in:
parent
843fd9c40d
commit
7c1a895c89
6 changed files with 129 additions and 5 deletions
38
views/tutorial/layout.erb
Normal file
38
views/tutorial/layout.erb
Normal file
|
@ -0,0 +1,38 @@
|
|||
<section class="section tutorial">
|
||||
<div class="row">
|
||||
<div class="col col-60 lesson">
|
||||
<h1><%= @section.upcase %> Tutorial</h1>
|
||||
<h2 class="subtitle">Page <%= @page %>/10</h2>
|
||||
|
||||
<%== erb "tutorial/#{@section}/#{@page}".to_sym, layout: false %>
|
||||
</div>
|
||||
|
||||
<div class="col col-40 interact">
|
||||
<input id="submit" class="btn btn-action" type="submit" value="Save">
|
||||
<h3>HTML</h3>
|
||||
<textarea id="editor" class="editor">
|
||||
<html>
|
||||
<body>
|
||||
|
||||
Hello World!
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</textarea>
|
||||
|
||||
<h3>Site Preview</h3>
|
||||
<div class="preview">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.tutorial #submit').on('click', function() {
|
||||
var editor = $('#editor')
|
||||
var result = checkHomework(editor)
|
||||
if(result == true) {
|
||||
window.location.href = '/tutorial/<%= @section %>/<%= @page.to_i+1 %>'
|
||||
}
|
||||
})
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue