diff --git a/app/views/admin/application/i18n/_inline.html.erb b/app/views/admin/application/i18n/_inline.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..48e55bd866bd9ae2d8d6cd960e5cfad2745e6e3e --- /dev/null +++ b/app/views/admin/application/i18n/_inline.html.erb @@ -0,0 +1,16 @@ +<% if about.available_languages.many? %> + <br>en <%= t(about.language.iso_code, scope: :languages) %> + + <% + route_args = about.is_direct_object? ? [:admin, about.becomes(about.class.base_class)] + : [:show_in_language, :admin, about.becomes(about.class.base_class)] + %> + <% + links = about.available_languages.map { |language| + next if language.id == about.language_id + link_to t(language.iso_code, scope: :languages).downcase, + [*route_args, lang: language.iso_code] + }.compact + %> + <br>(basculer en <%= links.to_sentence.html_safe %>) +<% end %> \ No newline at end of file diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index 42b782e8b7e09f14c0d824f25c27b41a9f679ef9..ecd640809431bb0ef9abbc1445e9d5291f055f58 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -17,7 +17,6 @@ <div class="row"> <div class="col-lg-4"> <%= render 'admin/communication/websites/pages/show/metadata' %> - <%= render 'admin/application/i18n/widget', about: @page, small: true %> </div> <div class="col-lg-8"> <%= render 'admin/application/summary/show', about: @page, small: true %> diff --git a/app/views/admin/communication/websites/pages/show/_metadata.html.erb b/app/views/admin/communication/websites/pages/show/_metadata.html.erb index d5f2b1bd23dfa50eff925d9a82f0c714eafb6f35..0f58738714517bb4cf1859b792527c17b1740a9e 100644 --- a/app/views/admin/communication/websites/pages/show/_metadata.html.erb +++ b/app/views/admin/communication/websites/pages/show/_metadata.html.erb @@ -12,6 +12,8 @@ <%= @page.published ? 'Publiée' : 'Brouillon' %> + <%= render 'admin/application/i18n/inline', about: @page %> + <% if @page.parent %> <br> Dans @@ -40,3 +42,4 @@ Pleine largeur <% end %> <% end %> + diff --git a/app/views/admin/communication/websites/posts/show.html.erb b/app/views/admin/communication/websites/posts/show.html.erb index 1b25802e65ec1132075f21ffb1ce9a9722d7289c..9ba6dc7ade7e5c248a1d285838bc3ed6dbc4dbbe 100644 --- a/app/views/admin/communication/websites/posts/show.html.erb +++ b/app/views/admin/communication/websites/posts/show.html.erb @@ -17,7 +17,6 @@ <div class="row"> <div class="col-lg-4"> <%= render 'admin/communication/websites/posts/show/metadata' %> - <%= render 'admin/application/i18n/widget', about: @post, small: true %> </div> <div class="col-lg-8"> <%= render 'admin/application/summary/show', about: @post, small: true %> diff --git a/app/views/admin/communication/websites/posts/show/_metadata.html.erb b/app/views/admin/communication/websites/posts/show/_metadata.html.erb index 66d79126d2c7d3907b8d7f2e57b7ddedb243585f..f1ea4e5c5fc0ebb5009a173ed284bed3c68b76a7 100644 --- a/app/views/admin/communication/websites/posts/show/_metadata.html.erb +++ b/app/views/admin/communication/websites/posts/show/_metadata.html.erb @@ -4,6 +4,7 @@ %> <div class="mb-4"> <%= osuny_label t('metadata') %><br> + <% if @post.published %> Publié le <%= l @post.published_at.to_date %> <% if @post.pinned %> @@ -12,10 +13,14 @@ <% else %> Brouillon <% end %> + <% if @post.author %> <br>par <%= @post.author %> <% end %> + <% if @post.categories.any? %> <br>dans <%= @post.categories.collect(&:to_s).join(', ') %> <% end %> + + <%= render 'admin/application/i18n/inline', about: @post %> </div> \ No newline at end of file