Advertisement
Guest User

Untitled

a guest
Dec 21st, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. @using Gielda.Core.Domain.DTO
  2. @using Microsoft.AspNet.Identity
  3. @model IEnumerable<ProjectDTO>
  4. @{
  5. ViewBag.Title = "Giełda Pomysłów";
  6. }
  7.  
  8. <head>
  9. <title>Giełda Pomysłów</title>
  10. <link href="~/Content/bootstrap/bootstrap.less" rel="stylesheet">
  11. <link href="~/Content/Site.css" rel="stylesheet" />
  12. </head>
  13.  
  14. <div class="jumbotron">
  15. <h1>Bla bla bla </h1>
  16. <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>
  17. <p>
  18. <a href="@Url.Action("Create", "Projects")" class="btn btn-primary btn-lg">Dodaj pomysł</a>
  19. </p>
  20. </div>
  21.  
  22. <div class="row">
  23.  
  24. @foreach (ProjectDTO project in Model)
  25. {
  26. <div class="col-md-12">
  27. <h1>@project.Name</h1>
  28. @project.Description
  29. </div>
  30.  
  31. <br/>
  32. <div class="col-md-8">
  33. <h3>Komentarze:</h3>
  34. @foreach (CommentDTO comment in project.Comments)
  35. {
  36. @comment.Content
  37. <br />
  38. }
  39. </div>
  40. <div class="col-md-4">
  41. <h3>Liczba głosów:</h3>
  42. @project.Votes
  43. </div>
  44.  
  45.  
  46.  
  47. <div class="col-md-8">
  48. <form method="POST" action="@Url.Action("Index")">
  49. <hr />
  50. <div class="form-group">
  51. <label>Dodaj komentarz</label>
  52. <textarea class="form-control" name="Content" placeholder="Napisz komentarz.."></textarea>
  53. <input type="hidden" name="ProjectId" value="@project.Id" />
  54. </div>
  55.  
  56. <div class="form-group">
  57. <input type="submit" value="Dodaj" class="btn btn-default" />
  58. </div>
  59. </form>
  60. </div>
  61.  
  62.  
  63.  
  64. var userID = User.Identity.GetUserId();
  65. if (userID != null && !project.Voters.Contains(Guid.Parse(userID)))
  66. {
  67. <form method="POST" action="@Url.Action("AddVote")">
  68. <div class="col-md-4">
  69. <br />
  70. <input type="submit" value="Głosuj" class="btn btn-default"/>
  71. <input type="hidden" name="ProjectId" value="@project.Id"/>
  72. </div>
  73. </form>
  74. }
  75. else if (userID != null)
  76. {
  77. <form method="POST" action="@Url.Action("RemoveVote")">
  78. <div class="col-md-4">
  79. <br />
  80. <input type="submit" value="Usuń głos" class="btn btn-default"/>
  81. <input type="hidden" name="ProjectId" value="@project.Id"/>
  82. </div>
  83. </form>
  84. }
  85. }
  86.  
  87. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement