<!DOCTYPE html>
<html lang="fi">
  <head>
    <% include head %>
  </head>
  <body class="container-fluid">
        <% include header %>
        <% include hallinta %>
    
        <script>
            function cancel(){
                
            }
        </script>
    <main class="flex justify-content-center flex-column">
        <div class="serif row"><a href="/">aiheet</a> > Aloita uusi keskustelu
        </div>
        <% console.log(msgTopic) %>
        <form method='POST' action='/uusi_viesti'>
            <input type="hidden" name="sender" value="<%= login %>">
            <input type="hidden" name="muokkaa" value="<%= msgId %>">
            <input type="hidden" name="topikki" value="<%= topikki %>">
            <label class="serif" for="topic"  >Otsikko</label><br>
            <input type="text" value="<%= msgTopic %>" <%- (msgTopic!='')?'readonly="readonly"':''%> placeholder="<%= msgTopic %>" name="topic" required='true'><br>
            <label class="serif" for="message">Viesti</label><br>
            <textarea name="message" placeholder="Viesti" rows="3" cols="50" ><%= msg %> %></textarea><br>
            
            <button type="submit" class="serif btn btn-dark m-2" id="submit" value="L채het채">L채het채</button>
            <button type="button" class="serif btn btn-dark m-2" onclick="<%- (msgId!='')?"window.location='/keskustelu_aiheesta/?id="+msgId+"'":"window.location='/'" %>;return false;" Value="Peru" formnovalidate>Peru</button>
            
        </form>
    </main>
        <% include footer %>
  </body>
</html>
