Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using Gielda.Core.Domain.DTO
- @using Microsoft.AspNet.Identity
- @model IEnumerable<ProjectDTO>
- @{
- ViewBag.Title = "Giełda Pomysłów";
- }
- <head>
- <title>Giełda Pomysłów</title>
- <link href="~/Content/bootstrap/bootstrap.less" rel="stylesheet">
- <link href="~/Content/Site.css" rel="stylesheet" />
- </head>
- <div class="jumbotron">
- <h1>Bla bla bla </h1>
- <p class="lead">Witaj na stronie Giełdy pomysłów. szmery bajery lorem ipsum ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
- <p>
- <a href="@Url.Action("Create", "Projects")" class="btn btn-primary btn-lg">Dodaj pomysł</a>
- </p>
- </div>
- <div class="row">
- @foreach (ProjectDTO project in Model)
- {
- <div class="col-md-12">
- <h1>@project.Name</h1>
- @project.Description
- </div>
- <br/>
- <div class="col-md-8">
- <h3>Komentarze:</h3>
- @foreach (CommentDTO comment in project.Comments)
- {
- @comment.Content
- <br />
- }
- </div>
- <div class="col-md-4">
- <h3>Liczba głosów:</h3>
- @project.Votes
- </div>
- <div class="col-md-8">
- <form method="POST" action="@Url.Action("Index")">
- <hr />
- <div class="form-group">
- <label>Dodaj komentarz</label>
- <textarea class="form-control" name="Content" placeholder="Napisz komentarz.."></textarea>
- <input type="hidden" name="ProjectId" value="@project.Id" />
- </div>
- <div class="form-group">
- <input type="submit" value="Dodaj" class="btn btn-default" />
- </div>
- </form>
- </div>
- var userID = User.Identity.GetUserId();
- if (userID != null && !project.Voters.Contains(Guid.Parse(userID)))
- {
- <form method="POST" action="@Url.Action("AddVote")">
- <div class="col-md-4">
- <br />
- <input type="submit" value="Głosuj" class="btn btn-default"/>
- <input type="hidden" name="ProjectId" value="@project.Id"/>
- </div>
- </form>
- }
- else if (userID != null)
- {
- <form method="POST" action="@Url.Action("RemoveVote")">
- <div class="col-md-4">
- <br />
- <input type="submit" value="Usuń głos" class="btn btn-default"/>
- <input type="hidden" name="ProjectId" value="@project.Id"/>
- </div>
- </form>
- }
- }
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement