diff --git a/app/assets/stylesheets/commons/_block.sass b/app/assets/stylesheets/commons/_block.sass new file mode 100644 index 0000000000000000000000000000000000000000..573a390e9e1a82760d4a4ab3f93e03cfec8a4c83 --- /dev/null +++ b/app/assets/stylesheets/commons/_block.sass @@ -0,0 +1,6 @@ +[v-cloak] + form + display: none +[data-v-app] + .spinner-border + display: none \ No newline at end of file diff --git a/app/views/admin/communication/blocks/edit.html.erb b/app/views/admin/communication/blocks/edit.html.erb index dbb7ad566b425797f1391097f7e636a65b7a118a..3a0255ef34b6b8b18cdef2800922db32eedbd22c 100644 --- a/app/views/admin/communication/blocks/edit.html.erb +++ b/app/views/admin/communication/blocks/edit.html.erb @@ -4,7 +4,10 @@ # Default elements array to move outside : it is only required when block type has an elements list @block.data['elements'] ||= [] %> -<div id="app" v-cloak style="opacity:0;"> +<div id="app" v-cloak> + <div class="spinner-border text-primary" role="status"> + <span class="sr-only">Loading...</span> + </div> <%= simple_form_for [:admin, @block] do |f| %> <div class="row"> <div class="col-xxl-4 col-md-6"> @@ -93,7 +96,6 @@ window.addEventListener('load', function(){ setTimeout(function() { app.mount('#app'); - document.getElementById('app').style.opacity = 1; }, 1000); }); </script> diff --git a/app/views/admin/communication/blocks/templates/partners/_show.html.erb b/app/views/admin/communication/blocks/templates/partners/_show.html.erb index 14f0efec4faf9130f2856b116ee8bd82be61121a..5b2485cf525b26d520504a52bd37ff8650c12028 100644 --- a/app/views/admin/communication/blocks/templates/partners/_show.html.erb +++ b/app/views/admin/communication/blocks/templates/partners/_show.html.erb @@ -1,5 +1,27 @@ <div class="row"> <% @block.data['elements'].each do |partner| %> + <% organization = nil + id = partner['id'] + if id != '' + unless id.nil? + unless id.empty? + organization = @block.university.organizations.find id + end + end + end + if organization %> + <div class="col-md-2"> + <article class="card"> + <% if organization.logo.attached? %> + <%= kamifusen_tag organization.logo, width: 300, class: 'img-fluid mb-2' %> + <% end %> + <div class="card-body"> + <h3 class="card-title h5"><%= organization.name %></h3> + <p class="mb-0"><%= organization.url %></p> + </div> + </article> + </div> + <% else %> <div class="col-md-2"> <article class="card"> <% unless partner.dig('logo', 'id').blank? %> @@ -12,5 +34,6 @@ </div> </article> </div> + <% end %> <% end if @block.data %> </div> diff --git a/app/views/admin/layouts/application.html.erb b/app/views/admin/layouts/application.html.erb index cb201e1b9cc7f1c13c7099cf8f324cc574efc7a4..e05be43486a8a92e8c6d87ffd06569458689866e 100644 --- a/app/views/admin/layouts/application.html.erb +++ b/app/views/admin/layouts/application.html.erb @@ -8,6 +8,9 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&display=swap" rel="stylesheet"> + <script> + // Avoid opening menu on load + </script> <%= stylesheet_link_tag 'admin', media: 'all' %> <%= favicon_link_tag 'favicon.png' %> </head>