You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Link.cshtml 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. @{
  2. Layout = "~/Views/Shared/_Layout.cshtml";
  3. }
  4. @model LinkModel
  5. <div class="text-center">
  6. @if(!Model.IsValid)
  7. {
  8. <p>This link has expired</p>
  9. }
  10. else
  11. {
  12. @if(Model.Share == true)
  13. {
  14. @Url.Action(action: "Link", controller: "Home", values: new { id = @Model.message.Id }, protocol: "https")
  15. }else{
  16. <div>
  17. @if(Model.TimeLeft != null)
  18. {
  19. var time = Model.TimeLeft.Value;
  20. if(time.Days > 0)
  21. {
  22. <p>This message will expire in: @time.ToString("%d") days @time.ToString("%h") hours @time.ToString("%m") minutes</p>
  23. }
  24. else
  25. {
  26. <p>This message will expire in: @time.ToString(@"hh\:mm\:ss")</p>
  27. }
  28. }
  29. else
  30. {
  31. <p>This message will expire when you leave this page</p>
  32. }
  33. </div>
  34. }
  35. <div>
  36. Message: @Model.message.Text
  37. </div>
  38. }
  39. <a class="btn btn-light" asp-controller="Home" asp-action="Index">Back</a>
  40. </div>