Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
a406bff
Branchement des medias
arnaudlevy Aug 17, 2026
6f88bf7
working !
arnaudlevy Aug 17, 2026
2517248
Suppression du composant Medias
arnaudlevy Aug 17, 2026
0f1aa03
Image choisie dans la bibliothèque
arnaudlevy Aug 17, 2026
e7971a2
loca
arnaudlevy Aug 17, 2026
5714eba
wip
pabois Aug 17, 2026
789f2b8
Merge branch 'files-step-2-media' of github.com:noesya/osuny into fil…
pabois Aug 17, 2026
00c242a
reset
arnaudlevy Aug 17, 2026
a5a7358
Merge branch 'files-step-2-media' of github.com:osunyorg/admin into f…
arnaudlevy Aug 17, 2026
b6652c9
fix
arnaudlevy Aug 17, 2026
f21ed2b
Stable, sans sauvegarde
arnaudlevy Aug 17, 2026
637bbf3
Enregistrement qui fonctionne
arnaudlevy Aug 17, 2026
d4bd84d
Filtre par provenance
arnaudlevy Aug 17, 2026
75f2273
clean
arnaudlevy Aug 17, 2026
af65598
wip
arnaudlevy Aug 17, 2026
9f264e8
Mise à jour du alt
arnaudlevy Aug 17, 2026
683d4de
Image uploaded propre
arnaudlevy Aug 17, 2026
bf33c01
Rangement du cloud
arnaudlevy Aug 17, 2026
7bfba7d
Bloc image branché
arnaudlevy Aug 18, 2026
bcee9ba
Refactor
arnaudlevy Aug 18, 2026
1575b62
refactor
arnaudlevy Aug 18, 2026
77f884d
Analyse paresseuse des blobs
arnaudlevy Aug 18, 2026
a5c904d
Rangement
arnaudlevy Aug 18, 2026
548e393
blocks
arnaudlevy Aug 18, 2026
dbcae18
Galerie hack
arnaudlevy Aug 18, 2026
e4ac26c
Animation CSS
arnaudlevy Aug 18, 2026
4e5e116
Drop
arnaudlevy Aug 18, 2026
a51af98
Drop files
arnaudlevy Aug 18, 2026
e5b9aab
fix
arnaudlevy Aug 18, 2026
085d01f
DRY
arnaudlevy Aug 19, 2026
d363d08
Galerie !
arnaudlevy Aug 19, 2026
ef6cda4
Réparation de bugs
arnaudlevy Aug 19, 2026
530dca2
Finalisation du MediaInput multiple
arnaudlevy Aug 19, 2026
a2adb6b
Contextes !
arnaudlevy Aug 19, 2026
c722a16
Image des fichiers
arnaudlevy Aug 19, 2026
5a31e28
featured_media
arnaudlevy Aug 19, 2026
400d305
Simplification du tri du picker
arnaudlevy Aug 19, 2026
d665ea9
Meilleure recherche texte dans le picker
arnaudlevy Aug 19, 2026
2d05c71
Refactor set_featured
arnaudlevy Aug 19, 2026
5673f06
Réparation de la curation
arnaudlevy Aug 19, 2026
5a5c0fa
Amélioration de la pagination
arnaudlevy Aug 19, 2026
6811c79
Nettoyage des localisations
arnaudlevy Aug 19, 2026
050116c
Migration
arnaudlevy Aug 19, 2026
5ea979f
unicorn
arnaudlevy Aug 19, 2026
c689b22
wip
arnaudlevy Aug 20, 2026
1eaeb99
fix
arnaudlevy Aug 20, 2026
eabacd4
Bloc Image fonctionnel
arnaudlevy Aug 20, 2026
e454385
rename resizer as cropper
pabois Aug 20, 2026
2852480
clean locales
pabois Aug 20, 2026
f5e5b12
Tous les crops fonctionnent
arnaudlevy Aug 20, 2026
db36ee6
Merge branch 'files-step-2-media' of github.com:osunyorg/admin into f…
arnaudlevy Aug 20, 2026
521aae7
Améliorations
arnaudlevy Aug 20, 2026
a1e5847
Stabilité
arnaudlevy Aug 20, 2026
56ea15f
Stable
arnaudlevy Aug 20, 2026
39e8b38
Fix #4250
arnaudlevy Aug 20, 2026
4cadbb9
oups
arnaudlevy Aug 20, 2026
bb9aed7
Fix #4252
arnaudlevy Aug 20, 2026
3fc3319
fix
arnaudlevy Aug 20, 2026
5a79538
Fix #4253
arnaudlevy Aug 20, 2026
9c97861
Fix #4254
arnaudlevy Aug 20, 2026
f85a5f6
Fix
arnaudlevy Aug 20, 2026
ca90076
Gestion de la publication
arnaudlevy Aug 21, 2026
5365efd
Publication automatique lors de l'envoi direct
arnaudlevy Aug 21, 2026
838b5c4
Fix
arnaudlevy Aug 21, 2026
821b80c
Merge branch 'files-step-2' into files-step-2-media
arnaudlevy Aug 21, 2026
c7fa015
Downloadable summary
arnaudlevy Aug 21, 2026
6509879
Fix
arnaudlevy Aug 21, 2026
828a195
Nettoyage
arnaudlevy Aug 24, 2026
679dfc9
Fix #4259
arnaudlevy Aug 25, 2026
0d70907
Fix
arnaudlevy Aug 25, 2026
f9df94d
Gestion de la restauration des featured_media
arnaudlevy Aug 27, 2026
c236de1
Restauration des fichiers et médias dans les blocs
arnaudlevy Aug 27, 2026
be19cc0
fix cropper
pabois Aug 27, 2026
5b38f44
factorize
pabois Aug 27, 2026
e8be02c
non-destructive job
SebouChu Aug 27, 2026
def7558
update_all out of app:fix, same for UnicornsJob call
SebouChu Aug 27, 2026
38ae04e
Merge branch 'files-step-2-media' of github.com:osunyorg/admin into f…
SebouChu Aug 27, 2026
01b3af0
crop_settings_for
SebouChu Aug 27, 2026
eb42d06
Restauration du downloable summary
arnaudlevy Aug 27, 2026
b92858c
Merge branch 'files-step-2-media' of github.com:osunyorg/admin into f…
arnaudlevy Aug 27, 2026
4b9cba4
Fix
arnaudlevy Aug 27, 2026
6c5e4c8
line break
SebouChu Aug 27, 2026
db96250
Merge branch 'files-step-2-media' of github.com:osunyorg/admin into f…
SebouChu Aug 27, 2026
da546a9
move Communication::File.find_or_create_file_from_blob to L10n protec…
SebouChu Aug 27, 2026
41e6a14
script to migrate title from blocks to media
pabois Aug 27, 2026
c044959
Publication des fichiers
arnaudlevy Aug 27, 2026
5c8c62d
Merge branch 'files-step-2-media' of github.com:osunyorg/admin into f…
arnaudlevy Aug 27, 2026
73572c1
z-order of cropper modal
pabois Aug 27, 2026
3859f97
Merge branch 'files-step-2-media' of github.com:noesya/osuny into fil…
pabois Aug 27, 2026
bc62750
move back to app:fix
SebouChu Aug 27, 2026
b3cf7a7
Merge branch 'files-step-2-media' of github.com:osunyorg/admin into f…
SebouChu Aug 27, 2026
fbefb2e
Suppression des contextes lors de la suppression d'un bloc
arnaudlevy Aug 27, 2026
d2999d1
Merge branch 'files-step-2' into files-step-2-media
SebouChu Aug 28, 2026
7f51e02
Gestionnaire de fichiers, étape 2 : API (#4268)
arnaudlevy Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ gem "rbnacl", "~> 7.1"
gem "redis", "~> 5.4"
gem "romaji", "~> 0.3.0"
gem "roo", "~> 2"
gem "rorvswild"
# gem "rorvswild"
gem "rswag", "~> 2"
gem "ruby-vips", "~> 2.3"
gem "sanitize"
Expand Down Expand Up @@ -108,7 +108,7 @@ group :development do
gem "better_errors"
gem "binding_of_caller"
gem "listen", "~> 3.10"
gem "rack-mini-profiler", "~> 4.0"
# gem "rack-mini-profiler", "~> 4.0"
gem "spring"
gem "web-console", ">= 4.1.0"
end
Expand Down
5 changes: 0 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,6 @@ GEM
raabro (1.5.0)
racc (1.8.1)
rack (3.2.6)
rack-mini-profiler (4.0.1)
rack (>= 1.2.0)
rack-protection (4.2.1)
base64 (>= 0.1.0)
logger (>= 1.6.0)
Expand Down Expand Up @@ -622,7 +620,6 @@ GEM
roo (2.10.1)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
rorvswild (1.12.0)
rotp (6.3.0)
rouge (5.1.0)
strscan (~> 3.1)
Expand Down Expand Up @@ -848,7 +845,6 @@ DEPENDENCIES
pg_query
pghero
puma
rack-mini-profiler (~> 4.0)
rack-timeout
rails (~> 8.1.3)
rails-autocomplete (~> 2)
Expand All @@ -857,7 +853,6 @@ DEPENDENCIES
redis (~> 5.4)
romaji (~> 0.3.0)
roo (~> 2)
rorvswild
rspec-rails
rswag (~> 2)
ruby-vips (~> 2.3)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# osuny
# osuny, CMS d'intérêt général

[osuny.org](https://www.osuny.org)

Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/admin/osuny/file.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
text-align: center
background: $color-bg-soft
color: $color-flexoki-200
font-size: pxToRem(100)
padding: pxToRem(40)
font-size: pxToRem(60)
padding: pxToRem(30)
border-radius: $border-radius
margin-bottom: 1rem
19 changes: 17 additions & 2 deletions app/assets/stylesheets/vue/cropper.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
.vue__cropper
// Passe au-dessus de la barre de sauvegarde (.vue__changes -> z-index 9999)
z-index: 10000
&__button
background: white
border-radius: $border-radius
cursor: pointer
padding: 5px
position: absolute
right: 10px
top: 10px
z-index: 10
&__preview
overflow: hidden
position: relative
width: 100%
.modal-body
background: #000000
.vue-advanced-cropper
height: 100%
.modal-body
height: 60vh
45 changes: 45 additions & 0 deletions app/assets/stylesheets/vue/media-input.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.vue__media-input
&__cloud
&__results
column-count: 2
column-gap: 16px
@include media-breakpoint-up(lg)
column-count: 3
&--medias
column-count: 2
@include media-breakpoint-up(md)
column-count: 3
@include media-breakpoint-up(lg)
column-count: 4
@include media-breakpoint-up(xl)
column-count: 5
@include media-breakpoint-up(xxl)
column-count: 6
&__result
display: block
margin-bottom: 16px
max-width: 100%
&__button_container
min-width: 70px
&__uploader
position: relative
align-items: center
aspect-ratio: 16/9
background: $color-bg-soft
display: flex
flex-direction: column
justify-content: center
margin-bottom: 10px
padding: 20px
text-align: center
width: 100%
&--dragging
border: 5px solid $color-black
&__progress
background: $color-black
bottom: 0
left: 0
opacity: 0.3
position: absolute
right: 0
transition: height 0.1s
34 changes: 0 additions & 34 deletions app/assets/stylesheets/vue/media-picker.sass

This file was deleted.

15 changes: 15 additions & 0 deletions app/assets/stylesheets/vue/selected-media.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.vue__selected-media
container-type: inline-size
position: relative
&__publication
position: absolute
left: 10px
@container (width > 200px)
background: white
border-radius: $border-radius
bottom: 10px
padding: 2px 8px
@container (width < 200px)
bottom: 3px
.vue__selected-media__label
display: none
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def location_params
localizations_attributes: [
:id, :language_id,
:name, :address_additional, :address_name, :url, :summary, :slug,
:featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit
]
)
.merge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ def post_params
:id, :language_id,
:title, :summary, :text,
:published, :published_at, :pinned, :slug,
:featured_image, :featured_image_delete, :featured_image_infos,
:featured_image_alt, :featured_image_credit
]
)
.merge(
Expand Down
31 changes: 23 additions & 8 deletions app/controllers/admin/communication/library/files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ def picker
end

def show
@contexts = @l10n.contexts
breadcrumb
respond_to do |format|
format.html do
@contexts = @l10n.contexts
breadcrumb
end
format.json do
@l10n = @file.create_localization_if_missing!(current_language)
end
end
end

def new
Expand All @@ -36,7 +43,12 @@ def new
def direct_upload
@blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args)
@blob.update_column(:university_id, current_university&.id)
@l10n = Communication::File::Localization.find_or_create_from_blob(@blob, current_language, current_user)
# Le blob est sur la localisation, contrairement aux médias
@l10n = Communication::File::Localization.find_or_create_file_localization_from_blob(
@blob,
language: current_language,
user: current_user
)
@file = @l10n.file
end

Expand All @@ -49,7 +61,8 @@ def edit
def create
@file.created_by = current_user
if @file.save
redirect_to [:admin, @file], notice: t('admin.successfully_created_html', model: @file.to_s_in(current_language))
redirect_to [:admin, @file],
notice: t('admin.successfully_created_html', model: @file.to_s_in(current_language))
else
load_invalid_localization
@categories = categories
Expand All @@ -60,8 +73,10 @@ def create

def update
if @file.update(file_params)
@file.localization_for(current_language).update_column(:last_updated_by_id, current_user.id)
redirect_to [:admin, @file], notice: t('admin.successfully_updated_html', model: @file.to_s_in(current_language))
@file.localization_for(current_language)
.update_column(:updated_by_id, current_user.id)
redirect_to [:admin, @file],
notice: t('admin.successfully_updated_html', model: @file.to_s_in(current_language))
else
load_invalid_localization
@categories = categories
Expand All @@ -73,7 +88,8 @@ def update

def destroy
@file.destroy
redirect_to admin_communication_files_url, notice: t('admin.successfully_destroyed_html', model: @file.to_s_in(current_language))
redirect_to admin_communication_files_url,
notice: t('admin.successfully_destroyed_html', model: @file.to_s_in(current_language))
end

protected
Expand All @@ -88,7 +104,6 @@ def file_params
category_ids: [],
localizations_attributes: [
:id, :name, :alt, :credit, :internal_description, :meta_description, :published,
:featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit,
:original_uploaded_file, :language_id
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@ def pexels
end
end

def select
origin = params[:origin]

@media = Communication::Media.find_or_create_from_url(
params[:source],
university_id: current_university.id,
user: current_user,
origin: origin
)
@media.find_or_create_localization(current_language, credit: params[:credit])

if origin == 'unsplash'
# Tracking légal Unsplash
unsplash_photo = Unsplash::Photo.find(params[:id])
unsplash_photo.track_download
end

render json: @media.id
end

protected

def prepare
Expand Down
Loading
Loading