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

doc

parent 7b9a6fc3
No related branches found
No related tags found
No related merge requests found
Showing with 157 additions and 107 deletions
a
&[target="_blank"]
&::after
content: ""
width: 0.8rem
height: 0.8rem
margin: 0 0.05rem 0 0.1rem
background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij48cGF0aCBkPSJNOSAyTDkgMyAxMi4zIDMgNiA5LjMgNi43IDEwIDEzIDMuNyAxMyA3IDE0IDcgMTQgMlpNNCA0QzIuOSA0IDIgNC45IDIgNkwyIDEyQzIgMTMuMSAyLjkgMTQgNCAxNEwxMCAxNEMxMS4xIDE0IDEyIDEzLjEgMTIgMTJMMTIgNyAxMSA4IDExIDEyQzExIDEyLjYgMTAuNiAxMyAxMCAxM0w0IDEzQzMuNCAxMyAzIDEyLjYgMyAxMkwzIDZDMyA1LjQgMy40IDUgNCA1TDggNSA5IDRaIi8+PC9zdmc+) no-repeat
background-size: contain
display: inline-block
vertical-align: -1px
filter: invert(.5)
class ApplicationController < ActionController::Base
include WithUniversity
include WithContext
end
module ApplicationController::WithUniversity
module ApplicationController::WithContext
extend ActiveSupport::Concern
included do
......@@ -8,5 +8,10 @@ module ApplicationController::WithUniversity
end
helper_method :current_university
def current_website
@current_website ||= Features::Websites::Site.with_host(request.host)
end
helper_method :current_website
end
end
......@@ -20,12 +20,27 @@
class Features::Websites::Site < ApplicationRecord
belongs_to :university
def self.with_host(host)
find_by domain: extract_domain_from(host)
end
# Website domain
# Production with domain www.iut.u-bordeaux-montaigne.fr
# Production without www.iut.u-bordeaux-montaigne.fr.websites.osuny.org
# Staging www.iut.u-bordeaux-montaigne.fr.websites.osuny.dev
# Dev www.iut.u-bordeaux-montaigne.fr.websites.osuny
def self.extract_domain_from(host)
host.remove('.websites.osuny.org')
.remove('.websites.osuny.dev')
.remove('.websites.osuny')
end
def domain_url
case Rails.env
when 'development'
"http://#{domain}.#{university.identifier}.osuny:3000"
"http://#{domain}.websites.osuny:3000"
when 'staging'
"https://#{domain}.#{university.identifier}.osuny.dev"
"https://#{domain}.websites.osuny.dev"
when 'production'
"https://#{domain}"
end
......
......@@ -2,8 +2,10 @@ module University::WithFeatures
extend ActiveSupport::Concern
included do
has_many :features_websites_sites, class_name: 'Features::Websites::Site', dependent: :destroy
# Education
has_many :features_education_programs, class_name: 'Features::Education::Program', dependent: :destroy
# Websites
has_many :features_websites_sites, class_name: 'Features::Websites::Site', dependent: :destroy
end
end
......@@ -12,7 +12,7 @@
<% @sites.each do |site| %>
<tr>
<td><%= link_to site, [:admin, site] %></td>
<td><%= site.domain %></td>
<td><%= link_to site.domain_url, site.domain_url, target: :_blank %></td>
<td class="text-end">
<%= edit_link site %>
<%= destroy_link site %>
......
......@@ -11,8 +11,11 @@
</head>
<body>
<nav>
<div class="container-fluid">
<%= current_university %>
<div class="container-fluid text-center">
<% if current_website %>
Site: <%= current_website %><br>
<% end %>
University: <%= current_university %>
</div>
</nav>
<main class="container-fluid">
......
# Benchmark
## Excellent websites
- https://www.harvard.edu/
- https://www.mit.edu/
## Other websites
- https://www.stanford.edu/
- https://www.brown.edu/
- https://www.columbia.edu/
......@@ -8,7 +14,6 @@
- https://www.upenn.edu/
- https://www.princeton.edu/
- https://www.yale.edu/
- https://www.mit.edu/
- https://www.ox.ac.uk/
- https://www.cam.ac.uk/
- https://www.caltech.edu/
......
# Education
## education/Program
Bachelor Universitaire de Technologie Métiers du Multimédia et de l'Internet
- university:references
- name:string
- level:integer (enum)
- capacity:integer
- ects:integer
- continuing:boolean
- prerequisites:text
- objectives:text
- duration:text
- registration:text
- pedagogy:text
- evaluation:text
- accessibility:text
+ schools:habtm
+ campuses:habtm
## education/Course
30 heures d'histoire de l'art en année 1
- program:references
- year:references
- name:string
- syllabus:text
- hours:integer
## education/Year
- university:references
- program:references
- year:integer
## education/Session
- name:string
- university:references
- program:references
- from:date
- to:date
## qualiopi/Criterion
- number:integer
- name:text
- description:text
## qualiopi/Indicator
- criterion:references
- number:integer
- name:text
- level_expected:text
- proof:text
- requirement:text
- non_conformity:text
# Websites
## websites/Site
Attributes:
- university:references
- name:string
- domain:string
## websites/Article
Attributes:
- university:references
- title:string
- description:text
- data:json
- published_at:datetime
## websites/Page
Attributes:
- university:references
- title:string
- description:text
- data:json
- parent:references
## websites/Document
Est-ce vraiment dans ce namespace ? Peut-être un DAM ?
1 document peut concerner :
- toute l'université (charte numérique)
- 1 école (règlement intérieur de l'école)
- 1 campus (règlement intérieur du campus)
- 1 formation (contrat d'alternance type)
- 1 session (calendrier pédagogique de l'année en cours)
Attributes:
- university:references
- name:string
- school:references (optional)
- campus:references (optional)
- program:references (optional)
- session:references (optional)
......@@ -58,100 +58,3 @@
- user:references
- program:references
## Program
Bachelor Universitaire de Technologie Métiers du Multimédia et de l'Internet
- university:references
- name:string
- level:integer (enum)
- capacity:integer
- ects:integer
- continuing:boolean
- prerequisites:text
- objectives:text
- duration:text
- registration:text
- pedagogy:text
- evaluation:text
- accessibility:text
+ schools:habtm
+ campuses:habtm
## program/Course
30 heures d'histoire de l'art en année 1
- program:references
- year:references
- name:string
- syllabus:text
- hours:integer
## program/Year
- university:references
- program:references
- year:integer
## program/Session
- name:string
- university:references
- program:references
- from:date
- to:date
## qualiopi/Criterion
- number:integer
- name:text
- description:text
## qualiopi/Indicator
- criterion:references
- number:integer
- name:text
- level_expected:text
- proof:text
- requirement:text
- non_conformity:text
## Website
- university:references
- name:string
- domain:string
## website/Article
- university:references
- title:string
- description:text
- data:json
- published_at:datetime
## website/Page
- university:references
- title:string
- description:text
- data:json
- parent:references
## website/Document
1 document peut concerner :
- toute l'université (charte numérique)
- 1 école (règlement intérieur de l'école)
- 1 campus (règlement intérieur du campus)
- 1 formation (contrat d'alternance type)
- 1 session (calendrier pédagogique de l'année en cours)
- university:references
- name:string
- school:references (optional)
- campus:references (optional)
- program:references (optional)
- session:references (optional)
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