From 0dc0f10da7cf3f0e6e44e8a38bf3e88664a749f4 Mon Sep 17 00:00:00 2001 From: ARLakhin Date: Tue, 10 Mar 2026 23:44:59 +0300 Subject: [PATCH] Test layout --- app/assets/stylesheets/application.scss | 4 +- .../stylesheets/application_settings.scss | 39 +++++++++++++++++++ app/assets/stylesheets/main.scss | 29 ++++++++++++++ app/controllers/auditors_controller.rb | 18 +++++++++ app/controllers/welcome_controller.rb | 20 +++++++++- app/helpers/auditors_helper.rb | 2 + app/views/auditors/index.html.slim | 10 +++++ app/views/layouts/_navbar.html.slim | 1 + app/views/layouts/application.html.slim | 2 +- app/views/welcome/index.html.slim | 10 +++++ config/routes.rb | 3 +- spec/helpers/auditors_helper_spec.rb | 15 +++++++ spec/requests/auditors_spec.rb | 11 ++++++ .../auditors/index.html.tailwindcss_spec.rb | 5 +++ 14 files changed, 165 insertions(+), 4 deletions(-) create mode 100644 app/assets/stylesheets/application_settings.scss create mode 100644 app/assets/stylesheets/main.scss create mode 100644 app/controllers/auditors_controller.rb create mode 100644 app/helpers/auditors_helper.rb create mode 100644 app/views/auditors/index.html.slim create mode 100644 app/views/layouts/_navbar.html.slim create mode 100644 app/views/welcome/index.html.slim create mode 100644 spec/helpers/auditors_helper_spec.rb create mode 100644 spec/requests/auditors_spec.rb create mode 100644 spec/views/auditors/index.html.tailwindcss_spec.rb diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 263c9ba..31ab3a2 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -18,4 +18,6 @@ @use "jquery-ui/core"; @use "toastr"; - @use "base"; \ No newline at end of file + @use "base"; + @use "application_settings"; + @use "main"; \ No newline at end of file diff --git a/app/assets/stylesheets/application_settings.scss b/app/assets/stylesheets/application_settings.scss new file mode 100644 index 0000000..fd65cd1 --- /dev/null +++ b/app/assets/stylesheets/application_settings.scss @@ -0,0 +1,39 @@ +:root{ + --bg-color: #F3F3F5; + --navbar-border: #d3d3d3; + --blue-color: #0078F6; + --blue-light-color: #e5f1fe; + --text-callout-color: #B6B6B6; + --yellow-color: #F9D256; + --white-color: #fff; + --red-color: #EF3E3B; + --footer-text-color: #757575; + --purple-color: #4C13A2; + --green-color: #4CBFC0; + --orange-color: #FE9F40; + --grey-color: #C9CBCE; + --grey-light-color:#F6F6F6; + --grey-dark-color:#a9a9a9; + --border-dropdown-color: #e8e8e8; + --text-dropdown-color: #0F0F11; + --main-header-text: #7C7C7C; + +//TEXT weight + --bold: 700; + --semi-bold: 600; + --medium: 500; + --regular: 400; +} + +body { + font-family: 'Inter', sans-serif; + background-color: var(--bg-color); +} + +@media screen and (min-width: 1024px) { +.main-container.top-main{ + margin-left: 144px; + width: calc(100% - 144px); + // margin: 0 auto;] + // max-width: 1260px; +}} diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss new file mode 100644 index 0000000..262e5e4 --- /dev/null +++ b/app/assets/stylesheets/main.scss @@ -0,0 +1,29 @@ +.header{ + width: 100vw; + text-align: center; +} + +.header-title { + font-size: 2.5rem; + font-weight: var(--bold); +} +.organisations-data { + display: flex; + flex-direction: column; + justify-content: space-between; + border: 8px solid black; + height: 100vh; + +} + + +.organisation-data { + border: 2px solid grey; + white-space: pre-line; + display: flex; + flex-direction: column; +} +.organisation-elem { + font-weight: var(--semi-bold); + font-size: 1.5rem; +} \ No newline at end of file diff --git a/app/controllers/auditors_controller.rb b/app/controllers/auditors_controller.rb new file mode 100644 index 0000000..bebf711 --- /dev/null +++ b/app/controllers/auditors_controller.rb @@ -0,0 +1,18 @@ +class AuditorsController < ApplicationController + def index + @auditors = ["A", "B", "C"] + @info_about_auditors = {"A" => {"ИНН" => 1000, + "Наименование" =>"ООО-БАШИР", + "ОГРН" => "123145" + }, + "B" => {"ИНН" => 1000, + "Наименование" =>"ООО-БАШИР", + "ОГРН" => "123145" + }, + "C" => {"ИНН" => 1000, + "Наименование" =>"ООО-БАШИР", + "ОГРН" => "123145" + } + } + end +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 9b58bae..676ea47 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -1,4 +1,22 @@ class WelcomeController < ApplicationController - def home; end + def index + @organisations = ["A", "B", "C"] + @info_about_organisation = {"A" => {"ИНН" => 1000, + "Наименование" =>"ООО-БАШИР", + "КПП" => "123145", + "Код по ОКПО" => "123123", + }, + "B" => {"ИНН" => 1000, + "Наименование" =>"ООО-БАШИР", + "КПП" => "123145", + "Код по ОКПО" => "123123", + }, + "C" => {"ИНН" => 1000, + "Наименование" =>"ООО-БАШИР", + "КПП" => "123145", + "Код по ОКПО" => "123123", + } + } + end end diff --git a/app/helpers/auditors_helper.rb b/app/helpers/auditors_helper.rb new file mode 100644 index 0000000..6cab4b3 --- /dev/null +++ b/app/helpers/auditors_helper.rb @@ -0,0 +1,2 @@ +module AuditorsHelper +end diff --git a/app/views/auditors/index.html.slim b/app/views/auditors/index.html.slim new file mode 100644 index 0000000..44f92b8 --- /dev/null +++ b/app/views/auditors/index.html.slim @@ -0,0 +1,10 @@ +.header + .header-title + = "Аудиторы" +.main-container + .organisations-data + - @auditors.each do |auditor| + .organisation-data + - @info_about_auditors[auditor].keys.each do |key| + .organisation-elem + = "#{key}: #{@info_about_auditors[auditor][key]}" \ No newline at end of file diff --git a/app/views/layouts/_navbar.html.slim b/app/views/layouts/_navbar.html.slim new file mode 100644 index 0000000..eb924fd --- /dev/null +++ b/app/views/layouts/_navbar.html.slim @@ -0,0 +1 @@ +=render 'error', error: @error diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index df3e7b2..788579e 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -2,7 +2,7 @@ doctype html html head title - =t('app_name') + = "Отчетность 2026" meta[name="viewport" content="width=device-width,initial-scale=1"] meta name="turbo-refresh-method" content="morph" = csrf_meta_tags diff --git a/app/views/welcome/index.html.slim b/app/views/welcome/index.html.slim new file mode 100644 index 0000000..363b508 --- /dev/null +++ b/app/views/welcome/index.html.slim @@ -0,0 +1,10 @@ +.header + .header-title + = "Организации" +.main-container + .organisations-data + - @organisations.each do |organisation| + .organisation-data + - @info_about_organisation[organisation].keys.each do |key| + .organisation-elem + = "#{key}: #{@info_about_organisation[organisation][key]}" \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 5d9a41b..ff926e5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,7 @@ # require 'sidekiq/web' Rails.application.routes.draw do + get 'auditors/index' get 'reports/create' get '/reports', to: 'reports#index' post '/reports', to: 'reports#create' @@ -9,5 +10,5 @@ Rails.application.routes.draw do # Defines the root path route ("/") - root "welcome#home" + root "welcome#index" end diff --git a/spec/helpers/auditors_helper_spec.rb b/spec/helpers/auditors_helper_spec.rb new file mode 100644 index 0000000..56e693d --- /dev/null +++ b/spec/helpers/auditors_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the AuditorsHelper. For example: +# +# describe AuditorsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe AuditorsHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/requests/auditors_spec.rb b/spec/requests/auditors_spec.rb new file mode 100644 index 0000000..6ed3516 --- /dev/null +++ b/spec/requests/auditors_spec.rb @@ -0,0 +1,11 @@ +require 'rails_helper' + +RSpec.describe "Auditors", type: :request do + describe "GET /index" do + it "returns http success" do + get "/auditors/index" + expect(response).to have_http_status(:success) + end + end + +end diff --git a/spec/views/auditors/index.html.tailwindcss_spec.rb b/spec/views/auditors/index.html.tailwindcss_spec.rb new file mode 100644 index 0000000..6183b41 --- /dev/null +++ b/spec/views/auditors/index.html.tailwindcss_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe "auditors/index.html.tailwindcss", type: :view do + pending "add some examples to (or delete) #{__FILE__}" +end