summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Forum/CreateTopic.cshtml
blob: bb592021c7248172c42345e99df06ea8174b3662 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@model Project_Unite.Models.CreateTopicViewModel
@{
    ViewBag.Title = "Create topic";
}

<h2>Create topic</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(Model => Model.Category)

    <table class="table">
        <tr>
            <td style="width:25%">@Html.DisplayNameFor(Model => Model.Subject)</td>
            <td>@Html.TextBoxFor(Model => Model.Subject, new { @class = "form-control", style = "width:100%" })</td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(Model => Model.Body)
            <p>This is the content of your topic. You can use Markdown formatting to style your post. <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" title="Markdown Help">Markdown Help</a></p>
            </td>
            <td>@Html.TextAreaFor(Model => Model.Body, new { @class = "form-control", style = "width:100%", rows = "10" })</td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" value="Post" class="btn btn-primary" /></td>
        </tr>
    </table>

    <h3>Topic options</h3>

     
        bool showGeneral = false;
        if (User.Identity.IsModerator())
        {
            showGeneral = true;
        }
        string generalStyle = "tab-pane fade in";
        string pollStyle = "tab-pane fade in";
        if (showGeneral == true) {
            generalStyle += " active";

        }
        else
        {
            pollStyle += " active";
        }
    

    <ul id="tabs" data-tabs="tabs" class="nav nav-tabs" role="tablist">
        @if (showGeneral)
        {
        <li class="active"><a data-toggle="tab" href="#t_general">Topic status</a></li>
        <li><a data-toggle="tab" href="#t_polls">Polls</a></li>
        }
        else
        {
            <li class="active"><a data-toggle="tab" href="#t_polls">Polls</a></li>
        }
    </ul>

    <div class="tab-content">
        <div class="@generalStyle" id="t_general">
            <h4>Topic status</h4>

            <p>Below you can set the status of your topic.</p>

                <p><strong>Sticky: </strong>@Html.CheckBoxFor(Model => Model.IsSticky, new { @class = "form-control" })</p>
                <p><strong>Announcement: </strong>@Html.CheckBoxFor(Model => Model.IsAnnounce, new { @class = "form-control" })</p>
                <p><strong>Global announcement: </strong>@Html.CheckBoxFor(Model => Model.IsGlobal, new { @class = "form-control" })</p>
        </div>
        <div class="@pollStyle" id="t_polls">
            <h4>Polls</h4>
            <p>Not yet implemented.</p>
        </div>
    </div>
}