baseplate for tutorials

This commit is contained in:
Kyle Drake 2015-09-09 16:58:18 -07:00
parent 843fd9c40d
commit 7c1a895c89
6 changed files with 129 additions and 5 deletions

38
views/tutorial/layout.erb Normal file
View 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>