Advertisement
Guest User

Untitled

a guest
Jul 11th, 2012
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. @model Tuple<IEnumerable<F4.Lib.Models.TrophyAwarded>, Dictionary<string,F4.Lib.Utilities.Trophies.Trophy>>
  2.  
  3. @{
  4. ViewBag.IsTrophyRoom = true;
  5. string signed_request = ViewBag.FacebookInfo.SignedRequest;
  6.  
  7. int currentElement = 0;
  8. int lastPage = -1;
  9. bool extraElements = (Model.Item1.Count() % 9 > 0);
  10. }
  11.  
  12. <div class="trophy-container">
  13. <div class="clock"></div>
  14. <div id="trophy-case" class="carousel slide">
  15. <!-- Carousel items -->
  16. <div class="carousel-inner">
  17. @foreach (var trophy in Model.Item1)
  18. {
  19. int currentPage = (int)Math.Floor(currentElement / 9.0);
  20. int pageElement = currentElement % 9;
  21. int pageRow = (int)Math.Floor(pageElement / 3.0);
  22. int column = pageElement % 3;
  23.  
  24. if (currentPage > lastPage)
  25. {
  26. @:<div class="@if(currentPage == 0){<text>active</text>} item">
  27. @:<ul class="shelf">
  28. }
  29.  
  30. <li class="row-@(pageRow + 1) column-@(column + 1)"><a class="trophy-button" href="#trophy-modal" data-trophy="@trophy.TrophyID" data-deed="@trophy.Deed" data-displayname="@Model.Item2[trophy.TrophyID].DisplayName"><img src="@Url.Content(String.Format("~/assets/img/trophies/small/{0}.png", trophy.TrophyID))" /></a></li>
  31.  
  32. if (pageElement == 8)
  33. {
  34. @:</ul>
  35. @:</div>
  36. }
  37.  
  38. lastPage = currentPage;
  39. currentElement++;
  40. }
  41.  
  42. @if (extraElements)
  43. {
  44. @:</ul>
  45. @:</div>
  46. }
  47. </div>
  48. <!-- Carousel nav -->
  49. <div class="controls">
  50. <a class="carousel-control left" href="#trophy-case" data-slide="prev"></a>
  51. <a class="carousel-control right" href="#trophy-case" data-slide="next"></a>
  52. </div>
  53. </div>
  54. <div id="video-link-buttons">
  55. <a id="video-share" href="#" class="share-button prize">share</a>
  56. <a id="video-trophy-link" href="@Url.Action(MVC.Machine.TrophyRoom(signed_request))">Trophy Room</a>
  57. <a id="video-tryagain" href="@Url.Action(MVC.Machine.Index(signed_request, true))">Try Again</a>
  58. </div>
  59. <div class="modal fade" id="trophy-modal" data-backdrop="static">
  60. <img id="trophy-image" src="" alt="" width="331" class="trophy-image">
  61. <div class="trophy-information">
  62. <a id="trophy-close" href="#" data-dismiss="modal"><img src="@Url.Content("~/assets/img/trophy-close.png")" alt="Back to trophy room" /></a>
  63. <span>here's your</span>
  64. <h1 id="trophy-title"> TROPHY</h1>
  65. <p>Remember when you did this awesome thing? Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
  66. <div class="social">
  67. <ul>
  68. <li><a href="#" class="share">share</a></li>
  69. <li><a href="#" class="facebook">facebook</a></li>
  70. <li><a href="#" class="twitter">twitter</a></li>
  71. <li><a href="#" class="pinterest">pinterest</a></li>
  72. </ul>
  73. </div>
  74. <a href="#" data-dismiss="modal" class="back"><img src="@Url.Content("~/assets/img/back-to-trophy.png")" alt="Back to trophy room" /></a>
  75. </div>
  76. </div>
  77. </div>
  78.  
  79. @section Scripts
  80. {
  81. <script src="@Url.Script_Exact("libs/bootstrap.js")"></script>
  82. <script type="text/javascript">
  83. $('.trophy-button').click(function ()
  84. {
  85. $('#trophy-image').attr('src', '@Url.Content("~/assets/img/trophies/large/")' + $(this).data('trophy') + '.png');
  86. $('#trophy-title').text($(this).data('displayname') + ' TROPHY');
  87.  
  88. $('#trophy-modal').modal('show');
  89. });
  90.  
  91. $('#trophy-case').on('slid', '', function()
  92. {
  93. var $this = $(this);
  94. if($('.carousel-inner .item:first').hasClass('active')) {
  95. $this.children('.carousel-control.left').hide();
  96. } else if($('.carousel-inner .item:last').hasClass('active')) {
  97. $this.children('.carousel-control.right').hide();
  98. } else {
  99. $this.children('.carousel-control').show();
  100. }
  101. });
  102.  
  103. </script>
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement