site.erb 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <div class="header-Outro with-site-image">
  2. <% if flash.keys.length > 0 %>
  3. <div class="row content">
  4. <div class="alert txt-Center">
  5. <% flash.keys.each do |key| %>
  6. <%= flash[key] %>
  7. <% end %>
  8. </div>
  9. </div>
  10. <% end %>
  11. <div class="row content site-info-row">
  12. <div class="col col-50 signup-Area site-display-preview-wrapper large">
  13. <div class="signup-Form site-display-preview">
  14. <fieldset class="content">
  15. <a href="<%= site.uri %>" class="screenshot" style="background-image:url(<%= site.screenshot_url('index.html', '540x405') %>);"></a>
  16. </fieldset>
  17. </div>
  18. </div>
  19. <div class="col col-50 profile-info">
  20. <h2 class="eps title-with-badge"><span><%= site.title %></span> <% if site.supporter? %><a href="/supporter" class="supporter-badge" title="Neocities Supporter"></a> <% end %></h2>
  21. <p class="site-url"><a href="<%= site.uri %>"><%= site.host %></a></p>
  22. <% follow_count = site.follows_dataset.count %>
  23. <div class="stats">
  24. <div class="stat"><strong><%= site.views.format_large_number %></strong> <span>view<%= site.views == 1 ? '' : 's' %></span></div>
  25. <div class="stat"><strong><%= follow_count.format_large_number %></strong> <span>follower<%= follow_count == 1 ? '' : 's' %></span></div>
  26. <div class="stat"><strong><%= site.changed_count.format_large_number %></strong> <span>update<%= site.changed_count == 1 ? '' : 's' %></span></div>
  27. <div class="stat tips"><strong><%= site.tips_dataset.count %></strong> <span>tips</span></div>
  28. </div>
  29. <div class="actions">
  30. <% if current_site == site && !current_site.tutorial_required %>
  31. <a href="/dashboard" class="btn-Action edit"><i class="fa fa-edit" title="Edit"></i> Edit Site</a>
  32. <% end %>
  33. <% if current_site && current_site != site %>
  34. <% is_following = current_site.is_following?(site) %>
  35. <a id="followLink" href="#" onclick="Site.toggleFollow(<%= site.id %>, '<%= csrf_token %>'); return false" class="btn-Action <%= is_following ? 'is-following' : '' %>">
  36. <span class="unfollow"><i class="fa fa-times"></i>Unfollow</span>
  37. <span class="following"><i class="fa fa-check"></i>Following</span>
  38. <span class="follow"><i class="fa fa-plus"></i>Follow</span>
  39. </a>
  40. <% end %>
  41. <a href="#" id="shareButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'_share', layout: false, locals: {site: site} %>'><i class="fa fa-share-alt"></i> <span>Share</span></a>
  42. <% if site.tipping_enabled? %>
  43. <a href="#" id="tipButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'site/_tip', layout: false, locals: {site: site} %>'><i class="fa fa-usd"></i> <span>Send a Tip</span></a>
  44. <% end %>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="container site-profile">
  50. <div class="content misc-page columns right-col"><div class="col-left">
  51. <div class="col col-66">
  52. <%== erb :'site/_profile_comments', locals: {site: site} %>
  53. <div class="site-profile-padding"><%== erb :'_news', layout: false, locals: {site: site, events: @latest_events} %></div>
  54. </div>
  55. <div class="col col-33">
  56. <h3>Website Stats</h3>
  57. <div class="stats">
  58. <div class="stat">
  59. <span>Last updated</span>
  60. <strong>
  61. <% if site.updated_at.nil? %>
  62. <%= site.created_at.ago.downcase %>
  63. <% else %>
  64. <%= site.updated_at.ago.downcase %>
  65. <% end %>
  66. </strong>
  67. </div>
  68. <div class="stat"><span>Created</span><strong><%= site.created_at.strftime('%b %-d, %Y') %></strong></div>
  69. <a href="/site/<%= site.username %>/stats">Site Traffic Stats</a>
  70. </div>
  71. <%== erb :'_follows', layout: false, locals: {site: site, is_current_site: site == current_site} %>
  72. <%== erb :'_tags', layout: false, locals: {site: site, is_current_site: site == current_site} %>
  73. <% if site != current_site %>
  74. <div class="report">
  75. <% if signed_in? %>
  76. <% if current_site && current_site.is_blocking?(site) %>
  77. <a href="/site/<%= site.username %>/unblock">Unblock</a>
  78. <% else %>
  79. <a href="#block" data-toggle="modal">Block Site</a>
  80. <% end %>
  81. <% end %>
  82. </div>
  83. <% end %>
  84. </div>
  85. </div></div>
  86. </div>
  87. <div class="modal hide" id="block" tabindex="-1" role="dialog" aria-labelledby="blockLabel" aria-hidden="true">
  88. <form method="POST" action="/site/<%= site.username %>/block">
  89. <input type="hidden" value="<%= csrf_token %>" name="csrf_token">
  90. <div class="modal-header">
  91. <button class="close" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
  92. <h3 id="blockLabel">Block Site</h3>
  93. </div>
  94. <div class="modal-body">
  95. <p>You are going to block this site. This will do the following:</p>
  96. <ul>
  97. <li>You will no longer see this site in searches.</li>
  98. <li>Site will no longer see your site in searches.</li>
  99. <li>Site will not be able to comment on your site profile.</li>
  100. <li>Any comments this site has posted to your profile will not be displayed.</li>
  101. </ul>
  102. <p>Are you sure you want to do this?</p>
  103. </div>
  104. <div class="modal-footer">
  105. <button class="btn cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
  106. <button type="submit" class="btn-Action">Block Site</button>
  107. </div>
  108. </form>
  109. </div>