From 31cdeb2614a1909a7a25f398056f9587ef463f47 Mon Sep 17 00:00:00 2001 From: "OHASHI, Norikazu" Date: Tue, 21 Jul 2020 07:20:22 +0900 Subject: [PATCH] =?utf8?q?scss-lint=20=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- readme.md | 10 +++++-- sinatra/app/controllers/web_gui.rb | 4 +-- sinatra/app/views/scss/.scss-lint.yml | 29 +++++++++++++++++++ sinatra/app/views/scss/book_info.scss | 8 ++++-- sinatra/app/views/scss/book_list.scss | 18 ++++++++++-- sinatra/app/views/scss/classes.scss | 36 ++++++++++++++---------- sinatra/app/views/scss/layout.scss | 2 +- sinatra/app/views/scss/main_tag.scss | 8 +++--- sinatra/app/views/scss/user_list.scss | 26 +++++++++++++---- sinatra/app/views/scss/widget.scss | 40 ++++++++++++++------------- 10 files changed, 129 insertions(+), 52 deletions(-) create mode 100644 sinatra/app/views/scss/.scss-lint.yml diff --git a/readme.md b/readme.md index 15fd82c..68e7da4 100644 --- a/readme.md +++ b/readme.md @@ -23,17 +23,23 @@ books_db.rb # access to book table views/ # views layout.haml # layout of html view + sidebar.haml # side menu view main.haml # start up view signup.haml # sign up user view login.haml # user login view logout.haml # user logout view user_home.haml # user default home view user_edit.haml # change user info view - list.haml # list of books view + user_list.haml # list of users view + user_delete.haml # delete user request search.haml # search books view - detail.haml # detail of book parameter view find_isbn.haml # search books parameter with isbn view setup.haml # setup book parameter view + book_info.haml # detail of book parameter view + book_list.haml # list of books view + book_regist.haml # registed book view + book_delete.haml # delete book + error.haml # error message view ```
diff --git a/sinatra/app/controllers/web_gui.rb b/sinatra/app/controllers/web_gui.rb index ebc1d01..477706e 100644 --- a/sinatra/app/controllers/web_gui.rb +++ b/sinatra/app/controllers/web_gui.rb @@ -1,4 +1,4 @@ - # coding: utf-8 +# coding: utf-8 # Web GUI用コントローラ # @author OHASHI, Norikazu @@ -259,7 +259,7 @@ class WebGui < Sinatra::Base redirect to('/user_list') rescue UserAccount::NotFoundInstanceError, UserAccount::AuthenticationError - raise WebError.new(status: 400, message: "ユーザ情報の編集に失敗しました。", refs: "/user_edit") + raise WebError.new(status: 400, message: "ユーザ情報の編集に失敗しました。", refs: "/user_edit/#{edit_id}") end end diff --git a/sinatra/app/views/scss/.scss-lint.yml b/sinatra/app/views/scss/.scss-lint.yml new file mode 100644 index 0000000..83c63ed --- /dev/null +++ b/sinatra/app/views/scss/.scss-lint.yml @@ -0,0 +1,29 @@ +linters: + ColorVariable: + enabled: false + IdSelector: + enabled: false + Shorthand: + enabled: false + ZeroUnit: + enabled: false + SelectorFormat: + enabled: false + SingleLinePerSelector: + enabled: false + Indentation: + enabled: true + allow_non_nested_indentation: false + character: space + width: 4 + PropertySortOrder: + enabled: false + NameFormat: + enabled: false + LeadingZero: + enabled: true + style: include_zero + QualifyingElement: + enabled: false + + diff --git a/sinatra/app/views/scss/book_info.scss b/sinatra/app/views/scss/book_info.scss index 5338e4b..507ebbd 100644 --- a/sinatra/app/views/scss/book_info.scss +++ b/sinatra/app/views/scss/book_info.scss @@ -1,16 +1,20 @@ @charset "utf-8"; + .book_info { display: inline-block; align-items: center; text-align: center; + th { width: 10em; height: 2.5em; text-align: right; - &:after { - content: ":"; + + &::after { + content: ':'; } } + td { width: 25em; height: 2.5em; diff --git a/sinatra/app/views/scss/book_list.scss b/sinatra/app/views/scss/book_list.scss index 931387a..d5ce039 100644 --- a/sinatra/app/views/scss/book_list.scss +++ b/sinatra/app/views/scss/book_list.scss @@ -1,4 +1,6 @@ -.book_list{ +@charset "utf-8"; + +.book_list { max-height: 32em; margin: 5px; padding: 2px; @@ -6,37 +8,47 @@ overflow: auto; display: inline-block; align-items: center; + table { border-collapse: collapse; } + .number { width: 2.5em; } + .title { width: 20em; } + .author { width: 6em; } + .publisher { width: 8em; } + th { height: 1.5em; background: #f4dda5; border: 1px solid #f8e58c; } + td { height: 2.8em; background: #fff1cf; border: 1px solid #f8e58c; + &.number { - text-align: right + text-align: right; } + &.title, &.author, &.publisher { - text-align: left + text-align: left; } } + tr:nth-child(odd) td { background: #f4dda5; } diff --git a/sinatra/app/views/scss/classes.scss b/sinatra/app/views/scss/classes.scss index 4eadf8b..1f9b7a8 100644 --- a/sinatra/app/views/scss/classes.scss +++ b/sinatra/app/views/scss/classes.scss @@ -1,8 +1,25 @@ @charset "utf-8"; + +@mixin form_item { + .item { + margin: 5px auto; + + label { + margin-right: 10px; + + span { + width: 220px; + display: inline-block; + vertical-align: top; + } + } + } +} + .message { margin-left: 10px; margin-right: 10px; - font-family: "Sawarabi Mincho"; + font-family: 'Sawarabi Mincho'; font-size: 1em; text-align: left; padding: 2px; @@ -10,23 +27,15 @@ .formstyle { margin: 0, auto; + .params { + @include form_item; max-height: 30em; overflow: auto; margin-left: 20px; text-align: left; display: block; - .item { - margin: 5px auto; - label { - margin-right: 10px; - span { - width:220px; - display: inline-block; - vertical-align: top; - } - } - } + .item_center { align-items: center; text-align: center; @@ -46,8 +55,7 @@ bottom: 0; left: 0; right: 0; - hight: 5em; - margin: 0px auto; + height: 5em; padding-bottom: 20px; } diff --git a/sinatra/app/views/scss/layout.scss b/sinatra/app/views/scss/layout.scss index 0a1c041..31c8765 100644 --- a/sinatra/app/views/scss/layout.scss +++ b/sinatra/app/views/scss/layout.scss @@ -1,4 +1,5 @@ @charset "utf-8"; + #main1 { position: relative; background: #f8e58c; @@ -15,7 +16,6 @@ } #center { - block: float; overflow: hidden; } diff --git a/sinatra/app/views/scss/main_tag.scss b/sinatra/app/views/scss/main_tag.scss index 3fd856a..35b0bfe 100644 --- a/sinatra/app/views/scss/main_tag.scss +++ b/sinatra/app/views/scss/main_tag.scss @@ -1,11 +1,11 @@ @charset "utf-8"; + body { - color:#444; + color: #444; align-items: center; text-align: center; margin: 10px auto; - max-width:60em; - -webkit-text-size-adjust: 100%; + max-width: 60em; } h1 { @@ -17,7 +17,7 @@ h2 { font-size: 1.7em; font-family: 'Sawarabi Gothic'; } - + h3 { font-size: 1.5em; font-family: 'Sawarabi Mincho'; diff --git a/sinatra/app/views/scss/user_list.scss b/sinatra/app/views/scss/user_list.scss index 62db612..d8a205d 100644 --- a/sinatra/app/views/scss/user_list.scss +++ b/sinatra/app/views/scss/user_list.scss @@ -1,5 +1,6 @@ @charset "utf-8"; -.user_list{ + +.user_list { max-height: 32em; margin: 5px; padding: 2px; @@ -7,43 +8,55 @@ overflow: auto; display: inline-block; align-items: center; + table { border-collapse: collapse; } + .id { width: 2.5em; } + .name { width: 6em; } + .full_name { width: 10em; } + .email { width: 10em; } + .role { width: 5em; } + .update_at { width: 8em; } + th { height: 1.5em; background: #f4dda5; border: 1px solid #f8e58c; } + td { height: 2.8em; background: #fff1cf; border: 1px solid #f8e58c; + &.number { - text-align: right + text-align: right; } + &.title, &.author, &.publisher { - text-align: left + text-align: left; } } + tr:nth-child(odd) td { background: #f4dda5; } @@ -53,14 +66,17 @@ display: inline-block; align-items: center; text-align: center; + th { width: 10em; height: 2.5em; text-align: right; - &:after { - content: ":"; + + &::after { + content: ':'; } } + td { width: 25em; height: 2.5em; diff --git a/sinatra/app/views/scss/widget.scss b/sinatra/app/views/scss/widget.scss index 3f5bf4b..4bffe1c 100644 --- a/sinatra/app/views/scss/widget.scss +++ b/sinatra/app/views/scss/widget.scss @@ -1,12 +1,15 @@ @charset "utf-8"; + @mixin button_color { background-color: #f08300; color: #3e62ad; border: 1px solid #554738; + &:hover { - background-color:#f6ad49; + background-color: #f6ad49; color: #3e62ad; } + &:disabled { border: 1px solid #554738; color: #bbc8e6; @@ -18,20 +21,21 @@ border: solid 1px #554738; background-color: #f8fbf8; color: #1c305c; + &:hover { border: 1px solid #db8449; } + &:focus { outline: 0; border: 2px solid #db8449; } - } @mixin select_style { padding: 2px 10px; border-radius: 5px; - background-image: url(/down.png); + background-image: url('/down.png'); background-repeat: no-repeat; background-position: right 50%; background-size: 10px, 80%; @@ -40,31 +44,33 @@ border: 1px solid #554738; &:hover { - background-color:#f6ad49; + background-color: #f6ad49; color: #3e62ad; } + &:focus { outline: 0; } } input, button, textarea, select { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } -input.push_button{ +input.push_button { + @include button_color; font-size: 1em; padding: 5px,20px; width: 200px; height: 25px; margin-left: 20px; border-radius: 5px; - @include button_color; } -input.side_button{ +input.side_button { + @include button_color; font-size: 0.7em; padding: 2px,2px; min-width: 20px; @@ -72,32 +78,28 @@ input.side_button{ height: 22px; margin-left: 2px; border-radius: 5px; - @include button_color; } input.input_text { + @include text_style; font-size: 0.9em; padding: 2px,2px; margin-left: 2px; height: 22px; - @include text_style; } textarea.input_text { + @include text_style; font-size: 0.9em; padding: 2px, 2px; - hieght: 60px; - @include text_style; + height: 60px; } -select.pulldown -{ +select.pulldown { + @include select_style; font-size: 0.7em; min-width: 20px; max-width: 180px; height: 22px; - - @include select_style; - } -- 2.19.2