vgquotes/Src/VideoGameQuotes.Web/Views/Shared/SingleQuote.ascx

54 lines
2.5 KiB
Plaintext

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<VideoGameQuotes.Web.Models.QuoteModel>" %>
<%@ Import Namespace="Portoa.Util" %>
<%@ Import Namespace="VideoGameQuotes.Api" %>
<div class="quote-container">
<input type="hidden" class="quote-id" value="<%= Model.Quote.Id %>" />
<div class="quote-data clearfix">
<div class="quote-score-container">
<div class="vote-container">
<% if (!Model.VotedUp) { %>
<span class="vote-for" title="I like this quote">&#x25B2;</span>
<% } %>
</div>
<div class="quote-score" title="+<%= Model.Quote.UpVotes %>, -<%= Model.Quote.DownVotes %>"><%= Model.Quote.Score %></div>
<div class="vote-container">
<% if (!Model.VotedDown) { %>
<span class="vote-against" title="I hate this quote">&#x25BC;</span>
<% } %>
</div>
</div>
<div class="quote-text">
<%: Model.Quote.Text %>
</div>
</div>
<div class="clearfix">
<p class="quote-details-created">
<span title="<%: Model.Quote.Created %>">added <%: Model.Quote.GetHumanReadableTimeSinceCreated() %></span>
<% if (Model.User != null && Model.User.Group >= UserGroup.Admin) { %>
by <%= Html.ActionLink(Model.Quote.Creator.GetUsernameOrIp(), "edit", "user", new { usernameOrIp = Model.Quote.Creator.GetUsernameOrIp()}, null) %>
<% } %>
</p>
<p class="quote-links">
<a class="quote-report-link" href="#" title="report this quote as inaccurate, fake, spam, duplicate, etc.">report</a> |
<%= Html.ActionLink("permalink", "quote", "quote", new { id = Model.Quote.Id, text = Model.Quote.GetUrlFriendlyText() }, new { title = "permanent link to this quote" })%>
<% if (Model.User != null && Model.User.Group >= UserGroup.Admin) { %>
| <%= Html.ActionLink("edit", "edit", "quote", new { id = Model.Quote.Id }, null) %>
(<%= Model.Quote.Flags.Count() %> flags)
<% } %>
</p>
</div>
<div class="quote-categories">
<ul class="menu clearfix">
<li><%= Html.ActionLink(Model.Quote.Game.Name, "browse", "Quote", new { qualifiers = "game/" + Model.Quote.Game.Id }, new { @class = "quote-game-link", title = string.Format("browse quotes from the game \"{0}\"", Model.Quote.Game.Name) }) %></li>
<% foreach (var category in Model.Quote.Categories.OrderBy(category => category.Name)) { %>
<li><%= Html.ActionLink(category.Name, "browse", "Quote", new { qualifiers = "category/" + category.Id }, new { title = string.Format("browse quotes categorized as \"{0}\"", category.Name) })%></li>
<% } %>
</ul>
</div>
</div>