From a7791635aa98f012d35f97c3c5288494bbb28e38 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 13 Mar 2024 18:03:43 +0100 Subject: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- app/views/layouts/_errors.html.erb | 13 ++++ .../layouts/action_text/contents/_content.html.erb | 3 + app/views/layouts/application.html.erb | 78 ++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 app/views/layouts/_errors.html.erb create mode 100644 app/views/layouts/action_text/contents/_content.html.erb create mode 100644 app/views/layouts/application.html.erb (limited to 'app/views/layouts') diff --git a/app/views/layouts/_errors.html.erb b/app/views/layouts/_errors.html.erb new file mode 100644 index 0000000..9e5ce38 --- /dev/null +++ b/app/views/layouts/_errors.html.erb @@ -0,0 +1,13 @@ +<% if model.errors.size.positive? %> +
+ <% if model.errors.size == 1 %> + <%= model.errors.first.full_message %>. + <% else %> +
    + <% model.errors.each do |error| %> +
  • <%= error.full_message %>.
  • + <% end %> +
+ <% end %> +
+<% end %> diff --git a/app/views/layouts/action_text/contents/_content.html.erb b/app/views/layouts/action_text/contents/_content.html.erb new file mode 100644 index 0000000..9e3c0d0 --- /dev/null +++ b/app/views/layouts/action_text/contents/_content.html.erb @@ -0,0 +1,3 @@ +
+ <%= yield -%> +
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..6042f43 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,78 @@ + + + + <%= ENV.fetch('OPERUM_BASE_TITLE', 'Operum') %> + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + + + + <% if current_user && @searches %> +
+ + + +
+ <% end %> + +
+ <% if flash[:notice] %> +
+ <%= flash[:notice] %>. +
+ <% end %> + + <% if flash[:alert] %> +
+ <%= flash[:alert] %>. +
+ <% end %> + + <%= yield %> +
+ + + + -- cgit v1.2.3