f34607f17f
http://wiki.whatwg.org/wiki/Meta_referrer lobsters isn't secret, but because it's all behind https, browsers don't send a referrer header when visiting linked stories that aren't behind ssl. for site owners, it can be useful to see where a sudden burst of traffic is coming from and view comments, so force supporting browsers (currently only chrome) to send the lobsters referral url.
101 lines
3.1 KiB
Plaintext
101 lines
3.1 KiB
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="robots" content="noarchive,noodp,noydir" />
|
|
<meta name="referrer" content="always" />
|
|
<% if @short_url %>
|
|
<link rev="canonical" rel="self alternate shorter shorturl shortlink"
|
|
href="<%= @short_url %>" />
|
|
<% end %>
|
|
<title><%= @title.present? ? "#{@title} | Lobsters" : "Lobsters" %></title>
|
|
<%= stylesheet_link_tag "application", :media => "all" %>
|
|
<%= javascript_include_tag "application" %>
|
|
<%= csrf_meta_tags %>
|
|
<% if @rss_link %>
|
|
<%= raw(@rss_link) %>
|
|
<% end %>
|
|
<% if @user %>
|
|
<script>
|
|
Lobsters.curUser = '<%= @user.id %>';
|
|
</script>
|
|
<% end %>
|
|
</head>
|
|
<body>
|
|
<div id="wrapper">
|
|
<div id="header">
|
|
<div id="headerleft">
|
|
<a id="l_holder" style="background-color: #<%= sprintf("%02x%02x%02x",
|
|
[ 255, (@traffic * 7).floor + 50.0 ].min, 0, 0) %>;" href="/"
|
|
title="Lobsters (<%= @traffic.to_i %>)"></a>
|
|
|
|
<% links = {
|
|
"/" => "Home",
|
|
"/newest" => "Newest",
|
|
"/comments" => "Comments"
|
|
} %>
|
|
|
|
<% if @user %>
|
|
<% links.merge!({ "/threads" => "Your Threads",
|
|
"/stories/new" => "Submit Story" }) %>
|
|
<% end %>
|
|
|
|
<% links.merge!({ "/search" => "Search" }) %>
|
|
|
|
<% if @cur_url.present? && !links.keys.include?(@cur_url) &&
|
|
@heading.present? %>
|
|
<span id="headertitle">
|
|
<a href="<%= @cur_url %>"><%= @heading %></a>
|
|
</span>
|
|
<% end %>
|
|
|
|
<span class="headerlinks">
|
|
<% links.each do |u,v| %>
|
|
<a href="<%= u %>" <%= u == @cur_url ? raw("class=\"cur_url\"") :
|
|
"" %>><%= v %></a>
|
|
<% end %>
|
|
</span>
|
|
</div>
|
|
|
|
<div id="headerright" class="<%= @user ? "loggedin" : "" %>">
|
|
<span class="headerlinks">
|
|
<% if @user %>
|
|
<a href="/filters">Filters</a>
|
|
|
|
<% if (count = @user.unread_message_count) > 0 %>
|
|
<a href="/messages" class="new_messages"><%= count %> New
|
|
Message<%= count == 1 ? "" : "s" %></a>
|
|
<% else %>
|
|
<a href="/messages">Messages</a>
|
|
<% end %>
|
|
|
|
<a href="/settings"><%= @user.username %> (<%= @user.karma %>)</a>
|
|
|
|
<%= link_to "Logout", { :controller => "login", :action => "logout" },
|
|
:data => { :confirm => "Are you sure you want to logout?" },
|
|
:method => "post" %>
|
|
<% else %>
|
|
<a href="/login">Login</a>
|
|
<% end %>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div id="inside">
|
|
<% if flash[:error] %>
|
|
<div class="flash-error"><%= flash[:error] %></div>
|
|
<% elsif flash[:success] %>
|
|
<div class="flash-success"><%= flash[:success] %></div>
|
|
<% end %>
|
|
|
|
<%= yield %>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|