write.html (4498B)
1 {% include 'header.html' %} 2 3 <title>Write | Diaspora Diaries</title> 4 5 <link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote-bs4.css" rel="stylesheet"> 6 <script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote-bs4.js"></script> 7 <script src="/static/js/summernote-cleaner.js"></script> 8 9 <script> 10 function countryCheck(that, idname) { 11 if (that.value == "nn") { 12 document.getElementById(idname).style.display = "inline"; 13 } else { 14 document.getElementById(idname).style.display = "none"; 15 } 16 } 17 </script> 18 19 {% include 'nav.html' %} 20 21 <main role="main" class="container"> 22 23 <form action="/write" method="POST" id="storyform"> 24 <div class="form-group"> 25 <p class="lead">Name:<br> 26 {% if current_user.name %} 27 <input type="text" class="form-control" name="Name" required value="{{ current_user.name }}"> 28 {% else %} 29 <input type="text" class="form-control" name="Name" required placeholder="Name"> 30 {% endif %} 31 </p> 32 33 <p class="lead">Country of embarkment:<br> 34 <select class="form-control" name="Embark" form="storyform" onchange="countryCheck(this, 'embarkother');"> 35 {% include 'cc.html' %} 36 </select> 37 <input type="text" class="form-control" name="EmbarkOther" id="embarkother" style="display: none;" placeholder="Type country here"> 38 </p> 39 40 <p class="lead">Country of disembarkment:<br> 41 <select name="Disembark" class="form-control" form="storyform" onchange="countryCheck(this, 'disembarkother');"> 42 {% include 'cc.html' %} 43 </select> 44 <input type="text" class="form-control" name="DisembarkOther" id="disembarkother" style="display: none;" placeholder="Type country here"> 45 </p> 46 47 <p class="lead">City of the story:<br> 48 <input type="text" class="form-control" name="City" placeholder="City (optional)"> 49 </p> 50 51 <p class="lead">Email:<br> 52 {% if current_user.username %} 53 <input type="email" class="form-control" name="Email" value="{{ current_user.username }}"> 54 {% else %} 55 <input type="email" class="form-control" name="Email" placeholder="Email (optional)" title="If you type an email, an account will be created for you 56 so you can edit your story later and talk to other storytellers."> 57 {% endif %} 58 </p> 59 60 <input type="text" name="42" placeholder="Yeah sure" style="display: none;"> 61 62 <p class="lead">About you:<br> 63 <textarea class="form-control" name="About" form="storyform" placeholder="Reasons for moving, etc..."></textarea> 64 </p> 65 66 <p class="lead">Write your story:<br> 67 <textarea class="form-control" id="storytext" name="Story" form="storyform" required></textarea> 68 </p> 69 70 <input type="submit" class="btn btn-outline-primary" value="Submit"> 71 </div> 72 </form> 73 74 </main> 75 76 <script> 77 $('.summernote').summernote({ 78 toolbar:[ 79 ['cleaner',['cleaner']], // The Button 80 ['style',['style']], 81 ['font',['bold','underline','clear']], 82 ['fontname',['fontname']], 83 ['color',['color']], 84 ['para',['ul','ol','paragraph']], 85 ['height',['height']], 86 ['table',['table']], 87 ['insert',['media','link','hr']], 88 ['view',['fullscreen','codeview']], 89 ['help',['help']] 90 ], 91 cleaner:{ 92 action: 'both', // both|button|paste 93 newline: '<br>', // Summernote's default is to use '<p><br></p>' 94 notStyle: 'position:absolute;top:0;left:0;right:0', // Position of Notification 95 icon: '<i class="note-icon">[Your Button]</i>', 96 keepHtml: false, // Remove all Html formats 97 keepOnlyTags: ['<p>', '<br>', '<ul>', '<li>', '<b>', '<strong>','<i>', '<a>'], // If keepHtml is true, remove all tags except these 98 keepClasses: false, // Remove Classes 99 badTags: ['style', 'script', 'applet', 'embed', 'noframes', 'noscript', 'html'], // Remove full tags with contents 100 badAttributes: ['style', 'start'], // Remove attributes from remaining tags 101 limitChars: false, // 0/false|# 0/false disables option 102 limitDisplay: 'both', // text|html|both 103 limitStop: false // true/false 104 } 105 }); 106 107 $(document).ready(function() { 108 $('#storytext').summernote(); 109 }); 110 </script> 111 {% include 'footer.html' %}