journalduhacker/app/views/layouts/application.html.erb

147 lines
5.4 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" />
<%= favicon_link_tag 'jdh-ico.ico' %>
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-144.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="referrer" content="always" />
<meta name="theme-color" content="#AC130D" />
<% if @meta_tags %>
<% @meta_tags.each do |k,v| %>
<meta name="<%= k %>" content="<%= v %>" />
<% end %>
<% end %>
<link rel="shortcut icon" href="/favicon.ico" />
<% if @short_url %>
<link rev="canonical" rel="self alternate shorter shorturl shortlink"
href="<%= @short_url %>" />
<% end %>
<title><%= @title.present? ? "#{@title} | " : "" %><%=
Rails.application.name %></title>
<%= stylesheet_link_tag "application", :media => "all" %>
<% if @user %>
<%= stylesheet_link_tag "themes/" + @user.theme, :media => "all" %>
<%= javascript_include_tag "application" %>
<script>
Lobsters.curUser = '<%= @user.id %>';
</script>
<% end %>
<%= csrf_meta_tags %>
<% if @rss_link %>
<link rel="alternate" type="application/rss+xml"
title="<%= @rss_link[:title] %>" href="<%= @rss_link[:href] %>" />
<% end %>
<% if @comments_rss_link %>
<link rel="alternate" type="application/rss+xml"
title="<%= @comments_rss_link[:title] %>"
href="<%= @comments_rss_link[:href] %>" />
<% end %>
</head>
<body>
<div id="wrapper">
<a href="/" title="<%= Rails.application.name %> <%= raw t('.currenttraffic', :usernb => "#{@traffic.to_i}") %>"><%= image_tag "logo-journal-du-hacker-middle.png" %></a>
<div id="header">
<div id="headerleft">
<% links = {
"/" => @cur_url == "/" ? Rails.application.name : t('.homelink'),
"/recent" => t('.recentlink'),
"/comments" => t('.commentslink')
} %>
<% if @user && @user.can_submit_stories? %>
<% links.merge!({ "/threads" => t('.yourthreadslink'),
"/stories/new" => t('.submitstorylink') }) %>
<% end %>
<% links.merge!({ "/search" => t('.searchlink') }) %>
<% if !@user %>
<% links.merge!({ "/invitations/request" => t('.invitationlink') }) %>
<% end %>
<% 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">
<span class="headerlinks">
<a href="/filters" <%= @cur_url == "/filters" ?
raw("class=\"cur_url\"") : "" %>><%= t('.filterslink') %></a>
<% if @user %>
<% if (count = @user.unread_message_count) > 0 %>
<a href="/messages" class="new_messages <%= @cur_url == "/messages" ?
"cur_url" : "" %>"><%= t(".newmessagelink", :count => count)
%></a>
<% else %>
<a href="/messages" <%= @cur_url == "/messages" ?
raw("class=\"cur_url\"") : "" %>><%= t('.messageslink') %></a>
<% end %>
<a href="/settings" <%= @cur_url == "/settings" ?
raw("class=\"cur_url\"") : "" %>><%= @user.username %>
(<%= @user.karma %>)</a>
<% else %>
<a href="/login"><%= t('.loginlink') %></a>
<% end %>
</span>
</div>
<div class="clear"></div>
</div>
<div id="inside">
<% [ :error, :success, :notice ].each do |f| %>
<% if flash[f].present? %>
<div class="flash-<%= f %>"><%= flash[f] %></div>
<% end %>
<% end %>
<%= yield %>
<div id="footer">
<% if lookup_context.template_exists?("footer", "layouts", true) %>
<%= render :partial => "layouts/footer" %>
<% else %>
<a href="/moderations"><%= t('.moderationloglink') %></a>
<% if @user && !@user.is_new? &&
(iqc = InvitationRequest.verified_count) > 0 %>
<a href="/invitations"><%= t('.invitationqueuelink') %>(<%= iqc %>)</a>
<% end %>
<% if @user && @user.is_moderator? &&
(hrc = HatRequest.count) > 0 %>
<a href="/hats/requests"><%= t('.hatrequestlink') %>(<%= hrc %>)</a>
<% else %>
<a href="/hats"><%= t('.hatslink') %></a>
<% end %>
<a href="/privacy"><%= t('.privacylink') %></a>
<a href="/about"><%= t('.aboutlink') %></a>
<a href="https://blog.journalduhacker.net"><%= t('.blog') %></a>
<a href="https://twitter.com/journalduhacker"><%= t('.twitter') %></a>
<a href="https://framasphere.org/people/2aaaaba0110c0133c7ea2a0000053625"><%= t('.diaspora') %></a>
<a href="https://framapiaf.org/@journalduhacker"><%= t('.mastodon') %></a>
<% end %>
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html>