aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/views/projectPost.ejs
blob: 80ed6d81cd13621b90eb39f2261be78f23812dc4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                          
                                                                       


                                              
                          
                                   
                                                                  
                                  







                                                                                                                                                                       

                  
                                   
                                                                                                     
                                  
                                                                                               

                  
          



                                                                                                                     











                                                                                                           
                                                                                                          

                  
                                   
                                                                             
                                  




                                                                                                


















                                                                                                           

















                                                                                                   






                                                                                      

       
<% include header %>

</head>
<body>
    <% include navbar %>

    <!-- Wrapper
    ================================================== -->
    <div class="container" id="wrapper">
    <div class="row-fluid">


        <form class="form-horizontal" method="post">
        <input type="hidden" name="project" value="<%= project._id %>">
        <fieldset>

        <h1><legend><%= title %></legend></h1>
        <p>Ta på meg!</p>
        <div class="control-group">
            <label for="username" class="control-label">Av</label>
            <div class="controls">
                <span class="input-medium uneditable-input"><%= req.user.username %></span>
                <span class="help-block"><small><a href="#forSomeone" data-toggle="collapse">Klikk her</a> for å føre utgiften <em>for</em> noen andre</small></span>
            </div>
        </div>
        <div class="control-group collapse" id="forSomeone">
            <label for="for" class="control-label">For</label>
            <div class="controls">
                <input type="text" name="for" id="for">
            </div>
        </div>
        <div class="control-group">
            <label for="what" class="control-label">Hva <strong class="text-error">*</strong></label>
            <div class="controls">
                <input type="text" name="what" id="what" placeholder="Hva ble kjøpt" required>
            </div>
        </div>
        <%
            // we need to populate the date- and timefield with the current time and date
            var d = new Date();
            var n = d.getFullYear() + '-' + ('0' + (d.getMonth()+1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2);
            var t = d.toLocaleTimeString().slice(0, 5);
        %>
    <!-- <%= d %> -->
        <div class="control-group">
            <label for="date" class="control-label">Når</label>
            <div class="controls">
                <input type="date" name="date" value="<%= n %>" class="input-medium">
                <input type="time" name="time" value="<%= t %>" class="input-medium">
            </div>
        </div>
        <div class="control-group">
            <label for="cost" class="control-label">Hvor mye  <strong class="text-error">*</strong></label>
            <div class="controls">
                <input type="number" name="value" id="value" class="input-small" placeholder="0" required>
            </div>
        </div>
        <div class="control-group">
            <label for="split_between" class="control-label">Delt på</label>
            <div class="controls">

                <span class="selectAll">Select all</span>
                <select name="participants[]" id="participants" multiple="multiple">
                    <option value="5180e11b0074a8b029000001" selected="selected">Dennis</option>
                    <option value="51814b792c94cc5346000001" selected="selected">Kurt</option>
                </select>
            </div>
        </div>
        <div class="control-group">
            <label for="file" class="control-label">Kvittering</label>
            <div class="controls">
                <input type="file" name="file" id="file">
            </div>
        </div>
        <div class="control-group">
            <label for="comment" class="control-label">Kommentar</label>
            <div class="controls">
                <textarea id="comment" name="comment" class="span6"></textarea>
            </div>
        </div>

        <div class="control-group">
            <div class="form-actions">
                <button type="submit" id="button1id" name="button1id" class="btn btn-primary">Post</button>
                <button type="reset" id="button2id" name="button2id" class="btn">Nullstill</button>
            </div>
        </div>

        </fieldset>
        </form>







    </div><!-- /div.row -->
    </div><!-- /div.#wrapper -->


<% include footer %>
                <script>
                    $(".selectAll").click(function() {
                        $('#participants').children().attr('selected','selected');
                        //$(this).parent().find('option').attr('selected','selected');
                    });
                </script>

</body>
</html>