Skip to content
Snippets Groups Projects
Commit 945985e7 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

transparency

parent 9888561f
No related branches found
No related tags found
No related merge requests found
class Transparency::ApplicationController < ApplicationController
layout 'transparency/layouts/application'
skip_before_action :ensure_university, :authenticate_user!
end
class Transparency::HomeController < Transparency::ApplicationController
def index
@universities = University.contributing.ordered
@contributions_total = University.sum(:contribution_amount)
@costs = [
['Bugsnag', 'Interception d\'erreur (gratuit pour l\'open source)', 0],
['CodeClimate', 'Qualité de code (gratuit pour l\'open source)', 0],
['Deuxfleurs', 'Hébergement sans data center', 100],
['KeyCDN', 'Redimensionnement des images', 600],
['LibreTranslate', 'Hébergement sans data center', 696],
['MicroLink', 'Captures d\'écran', 144],
['noesya', 'Tierce maintenance applicative (pro bono)', 0],
['Plausible', 'Mesure d\'audience', 100],
['Scalingo', 'Hébergement de l\'admin', 3000],
['Scaleway', 'Stockage des fichiers', 100]
]
@costs_total = @costs.sum { |cost| cost.last }
@balance = @contributions_total - @costs_total
end
end
<% content_for :title, 'Transparence' %>
<h1 class="text-center">Transparence</h1>
<h2 class="mt-5 h4 text-center mb-4">Contributions annuelles</h2>
<div class="table-responsive">
<table class="<%= table_classes %> table-dark table-striped">
<thead>
<tr>
<th>Organisation contributrice</th>
<th>Contribution annuelle</th>
</tr>
</thead>
<tbody>
<% @universities.each do |university| %>
<tr>
<td><%= university %></td>
<td><%= number_to_currency university.contribution_amount, precision: 0, locale: :fr %></td>
</tr>
<% end %>
</tbody>
<tfoot>
<tr>
<th><%= t('server_admin.universities.contributions_total') %></th>
<td><%= number_to_currency @contributions_total, precision: 0, locale: :fr %></td>
</tr>
</tfoot>
</table>
</div>
<h2 class="mt-5 h4 text-center mb-4">Coûts de fonctionnement annuels</h2>
<p class="text-center">Les coût sont remis à jour à la main, ils ne sont pas très précis.</p>
<div class="table-responsive">
<table class="<%= table_classes %> table-dark table-striped">
<thead>
<tr>
<th>Organisation</th>
<th>Nature</th>
<th>Coût annuel</th>
</tr>
</thead>
<tbody>
<% @costs.each do |cost| %>
<tr>
<td><%= cost.first %></td>
<td><%= cost.second %></td>
<td><%= number_to_currency cost.last, precision: 0, locale: :fr %></td>
</tr>
<% end %>
</tbody>
<tfoot>
<tr>
<th colspan="2">Coûts (total)</th>
<td><%= number_to_currency @costs_total, precision: 0, locale: :fr %></td>
</tr>
</tfoot>
</table>
</div>
<h2 class="mt-5 h4 text-center mb-4">Balance annuelle</h2>
<p class="text-center">Tant que la SCIC Osuny n'est pas en place, noesya utilise l'excédent pour payer une part de la maintenance et des développements.</p>
<p class="display-1 text-center">
<%= number_to_currency @balance, precision: 0, locale: :fr %>
</p>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><%= yield :title %> — Osuny</title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= favicon_link_tag 'favicon.png' %>
</head>
<body class="bg-black text-white">
<nav class="navbar navbar-light">
<div class="container justify-content-center">
<a class="navbar-brand" href="/">
<%= image_tag 'osuny-white.svg',
class: 'img-fluid py-4',
alt: 'Osuny',
width: 100 %>
</a>
</div>
</nav>
<main class="container mt-5 pt-5">
<%= yield %>
</main>
</body>
</html>
......@@ -31,6 +31,7 @@ OSUNY_DEVELOPMENT_DBNAME:
OSUNY_STAGING_APP_NAME:
OSUNY_STAGING_PG_ADDON_ID:
OSUNY_SHOWCASE:
OSUNY_TRANSPARENCY:
OTP_SECRET_ENCRYPTION_KEY:
......
......@@ -2,6 +2,9 @@ Rails.application.routes.draw do
constraints host: ENV['OSUNY_SHOWCASE'] do
get '/' => 'showcase/home#index'
end
constraints host: ENV['OSUNY_TRANSPARENCY'] do
get '/' => 'transparency/home#index'
end
authenticated :user, -> user { user.server_admin? } do
match "/delayed_job" => DelayedJobWeb, :anchor => false, :via => [:get, :post]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment