@username = user.full_name
@book_info = params
@is_admin = UserAccount.checkAdmin(id)
+ @update_f = session[:book_update_f]
cover_image = getUploadData(params[:cover_file])
if (cover_image != nil)
base64 = Base64.encode64(cover_image[:data])
- before_step = start
- else
- before_step = step
-%h3
- #{user_name} さんの蔵書一覧は以下となります。
-.message
- 登録されている蔵書は #{full_size}冊になります。
-
-.find_form
- %form{:action => "/book_list/find", :method => "post"}
- %table
- %tr
- %th
- 検索対象
- %th
- 検索内容
- %th
-
- %tr
- %td
- %select{ :name => 'kind', :class => 'pulldown', :id => 'kind'}
- %option{ :value => 'title' }
- 書名
- %option{ :value => 'author' }
- 著者
- %option{ :value => 'publisher' }
- 出版社
- %option{ :value => 'original_author'}
- 原作
- %option{ :value => 'illustrator' }
- 作画
- %option{ :value => 'translator' }
- 翻訳
- %option{ :value => 'supervisor' }
- 監修
- %option{ :value => 'series' }
- 単行本シリーズ
- %td
- %input{ :type => 'text', :class => 'input_text', :name => 'find_value', :id => 'find_value', :size => 40}
- %td
- %input{ :type => 'submit', :class => 'side_button', :value => '検索'}
+.book_list_page
+ .list_header
+ %h3
+ #{user_name} さんの蔵書一覧は以下となります。
-.seek_form
- %form{:method => "post"}
- %input{ :type => 'submit', :class => 'side_button', :formaction => '/book_list/before', :value => "《#{before_step}件戻る", :disabled => (before_step == 0) }
- %label{ :for => 'step' }
- 表示件数
- %input{ :name => 'step', :type => 'text', :class => 'input_text', :id => 'step', :size => 5, :value => step, :pattern => '[0-9]{1,4}'}
- %input{ :type => 'submit', :class => 'side_button', :formaction => '/book_list/change_step', :value => '表示件数変更'}
- %input{ :type => 'submit', :class => 'side_button', :formaction => '/book_list/next', :value => "#{next_step}件進む》", :disabled => (next_step == 0) }
- %input{ :type => 'hidden', :name => 'start', :value => start}
-
-.book_list
- %table
- %tr
- %th.number
- 項番
- %th.title
- 書名
- %th.author
- 著者
- %th.publisher
- 出版社
- %th.pubdate
- 出版日
- %th.controll
- 操作
- - book_list.each do |book|
- - index += 1
- - isbn = book[:isbn]; publisher = book[:publisher]; pubdate = book[:pubdate]
- - if book[:volume] != nil
- - title = "#{book[:title]} : #{book[:volume]} 巻"
- - else
- - title = book[:title]
- - if book [:author] != nil and book[:author] !=""
- - author = book[:author]
- - else
- - author = ""
- - if book [:original_author] != nil and book[:orignal_author] != ""
- - author += "原作:#{book[:oritnal_author]} "
- - if book[:illustrator] != nil and book[:illustrator] != ""
- - author += "作画:#{book[:illustrator]} "
- %tr
- %td.number
- #{index}
- %td.title
- %a{ :href => "/book_info/#{isbn}" }
- #{title}
- %td.author
- #{author}
- %td.publisher
- #{publisher}
- %td.pubdate
- #{pubdate}
- %td.controll
- %input{ :type => 'button', :class => 'side_button', :onclick =>"location.href='/book_edit/#{isbn}'", :value => '編集' }
- %input{ :type => 'button', :class => 'side_button', :onclick =>"location.href='/book_delete/#{isbn}'", :value => '削除' }
+ .message
+ 登録されている蔵書は #{full_size}冊になります。
+
+ .find_form
+ %form{:action => "/book_list/find", :method => "post"}
+ %table
+ %tr
+ %th
+ 検索対象
+ %th
+ 検索内容
+ %th
+
+ %tr
+ %td
+ %select{ :name => 'kind', :class => 'pulldown', :id => 'kind'}
+ %option{ :value => 'title' }
+ 書名
+ %option{ :value => 'author' }
+ 著者
+ %option{ :value => 'publisher' }
+ 出版社
+ %option{ :value => 'original_author'}
+ 原作
+ %option{ :value => 'illustrator' }
+ 作画
+ %option{ :value => 'translator' }
+ 翻訳
+ %option{ :value => 'supervisor' }
+ 監修
+ %option{ :value => 'series' }
+ 単行本シリーズ
+ %td
+ %input{ :type => 'text', :class => 'input_text', :name => 'find_value', :id => 'find_value', :size => 40}
+ %td
+ %input{ :type => 'submit', :class => 'side_button', :value => '検索'}
+
+ .seek_form
+ %form{:method => "post"}
+ %input{ :type => 'submit', :class => 'side_button', :formaction => '/book_list/before', :value => "《#{before_step}件戻る", :disabled => (before_step == 0) }
+ %label{ :for => 'step' }
+ 表示件数
+ %input{ :name => 'step', :type => 'text', :class => 'input_text', :id => 'step', :size => 5, :value => step, :pattern => '[0-9]{1,4}'}
+ %input{ :type => 'submit', :class => 'side_button', :formaction => '/book_list/change_step', :value => '表示件数変更'}
+ %input{ :type => 'submit', :class => 'side_button', :formaction => '/book_list/next', :value => "#{next_step}件進む》", :disabled => (next_step == 0) }
+ %input{ :type => 'hidden', :name => 'start', :value => start}
+ %hr
+ .list_body
+ .book_list
+ %table
+ %tr
+ %th.number
+ 項番
+ %th.title
+ 書名
+ %th.author
+ 著者
+ %th.publisher
+ 出版社
+ %th.pubdate
+ 出版日
+ %th.controll
+ 操作
+ - book_list.each do |book|
+ - index += 1
+ - isbn = book[:isbn]; publisher = book[:publisher]; pubdate = book[:pubdate]
+ - if book[:volume] != nil
+ - title = "#{book[:title]} : #{book[:volume]} 巻"
+ - else
+ - title = book[:title]
+ - if book [:author] != nil and book[:author] !=""
+ - author = book[:author]
+ - else
+ - author = ""
+ - if book [:original_author] != nil and book[:orignal_author] != ""
+ - author += "原作:#{book[:oritnal_author]} "
+ - if book[:illustrator] != nil and book[:illustrator] != ""
+ - author += "作画:#{book[:illustrator]} "
+ %tr
+ %td.number
+ #{index}
+ %td.title
+ %a{ :href => "/book_info/#{isbn}" }
+ #{title}
+ %td.author
+ #{author}
+ %td.publisher
+ #{publisher}
+ %td.pubdate
+ #{pubdate}
+ %td.controll
+ %input{ :type => 'button', :class => 'side_button', :onclick =>"location.href='/book_edit/#{isbn}'", :value => '編集' }
+ %input{ :type => 'button', :class => 'side_button', :onclick =>"location.href='/book_delete/#{isbn}'", :value => '削除' }
- isbn_regist_f = false
-%h3
- - if update_f
- 本書の情報を修正することができます。
- - else
- 新規に蔵書の情報を登録することができます。
-
-- if update_f
- .message
- 「ISBN探索」を押下すると、該当する本の情報が取得できます。
- (取得できない場合は、更新されません)
-
-.message
- 「書影Upload」を押下すると、本の書影を登録できます。
-
-- if warning
- .warning
- #{warning}
-
-%hr
-
-%form{ :action => "/book_regist", :method => "post", :enctype => "multipart/form-data"}
- .formstyle
- .params
- .item
- %label{ :for => 'isbn' }
- %span
- ISBN:
- %input{ :name => 'isbn', :type => 'text', :class => 'input_text', :id => 'isbn', :value => book_info[:isbn], :readonly => update_f, :required => isbn_regist_f}
- %input{ :type => 'submit', :class => 'side_button', :value => 'ISBN探索', :formaction => '/book_search_isbn', :disabled => update_f}
-
- .item
- %label{ :for => 'title' }
- %span
- 書名:
- %input{ :name => 'title', :type => 'text', :class => 'input_text', :id => 'title', :value => book_info[:title]}
-
- %label{ :for => 'volume' }
- 巻数:
- %input{ :name => 'volume', :type => 'text', :class => 'input_text', :id => 'volume', :size => 3, :value => book_info[:volume]}
-
- .item
- %label{ :for => 'subtitle' }
- %span
- 副題:
- %input{ :name => 'subtitle', :type => 'text', :class => 'input_text', :id => 'subtitle', :value => book_info[:subtitle]}
-
- .item
- %label{ :for => 'series' }
- %span
- 単行本シリーズ:
- %input{ :name => 'series', :type => 'text', :class => 'input_text', :id => 'series', :value => book_info[:series]}
-
- .item
- %label{ :for => 'author' }
- %span
- 著者:
- %input{ :name => 'author', :type => 'text', :class => 'input_text', :id => 'author', :value => book_info[:author]}
-
- .item
- %label{ :for => 'original_author'}
- %span
- 原作:
- %input{ :name => 'original_author', :type => 'text', :class => 'input_text', :id => 'original_author', :value => book_info[:orignal_author]}
-
- .item
- %label{ :for => 'illustrator' }
- %span
- 作画:
- %input{ :name => 'illustrator', :type => 'text', :class => 'input_text', :id => 'illustrator', :value => book_info[:illustrator]}
-
- .item
- %label{ :for => 'translator' }
- %span
- 翻訳:
- %input{ :name => 'translator', :type => 'text', :class => 'input_text', :id => 'translator', :value => book_info[:translator]}
-
- .item
- %label{ :for => 'supervisor' }
- %span
- 監修:
- %input{ :name => 'supervisor', :type => 'text', :class => 'input_text', :id => 'supervisor', :value => book_info[:supervisor]}
-
- .item
- %label{ :for => 'publisher' }
- %span
- 出版社:
- %input{ :name => 'publisher', :type => 'text', :class => 'input_text', :id => 'publisher', :value => book_info[:publisher]}
-
- .item
- %label{ :for => 'pubdate' }
- %span
- 出版日:
- %input{ :name => 'pubdate', :type => 'text', :class => 'input_text', :id => 'pubdate', :value => book_info[:pubdate], :oninput => 'validDateForm(this)'}
-
- .item
- %label{ :for => 'cover_file'}
- %span
- 書影:
- %input{ :name => 'cover_file', :type => 'file', :id => 'cover_file', :accept => 'image/png, image/jpeg', :style => "display:none"}
- %input{ :type => 'text', :class => 'input_text', :id => 'file_name', :value => ''}
- %input{ :type => 'submit', :class => 'side_button', :value => '書影Upload', :formaction => '/book_upload_cover' }
- :javascript
- var file = document.getElementById( 'cover_file' );
- var text = document.getElementById( 'file_name' );
-
- file.onchange = function()
- {
- text.value = this.value;
- }
-
- text.onclick = function()
- {
- file.click();
- }
-
- .item_center
- - if book_info[:cover_uri] != nil
- %image{ :id => 'cover_image', :border => '1', :src => book_info[:cover_uri], :class => 'cover_image', :width => '128', :height => '182'}
- %input{ :name => 'cover_uri', :type => 'hidden', :value => book_info[:cover_uri]}
- - if book_info[:cover_base64] != nil
- %input{ :name => 'cover_base64', :type => 'hidden', :value => book_info[:cover_base64]}
- %input{ :name => 'mime_type', :type => 'hidden', :value => book_info[:mime_type]}
-
- - if !is_admin_books
- .item
- %label{ :for => 'summary' }
- %span
- 概説:
- %textarea{ :name => 'summary', :class => 'input_text', :rows => '5', :cols => '35', :id => 'summary'}
- #{book_info[:summary]}
+.regist_page
+ .regist_header
+ %h3
+ - if update_f
+ 本書の情報を修正することができます。
+ - else
+ 新規に蔵書の情報を登録することができます。
+
+ - if !update_f
+ .message
+ 「ISBN探索」を押下すると、該当する本の情報が取得できます。
+
+ .message
+ 「書影Upload」を押下すると、本の書影を登録できます。
+
+ - if warning
+ .warning
+ #{warning}
+
+ %hr
+ .regist_body
+ %form{ :action => "/book_regist", :method => "post", :enctype => "multipart/form-data", :id => 'params'}
+ .formstyle
+ .params
+ .item
+ %label{ :for => 'isbn' }
+ %span
+ ISBN:
+ %input{ :name => 'isbn', :type => 'text', :class => 'input_text', :id => 'isbn', :value => book_info[:isbn], :readonly => update_f, :required => isbn_regist_f}
+ %input{ :type => 'submit', :class => 'side_button', :value => 'ISBN探索', :formaction => '/book_search_isbn', :disabled => update_f}
+
+ .item
+ %label{ :for => 'title' }
+ %span
+ 書名:
+ %input{ :name => 'title', :type => 'text', :class => 'input_text', :id => 'title', :value => book_info[:title]}
+
+ %label{ :for => 'volume' }
+ 巻数:
+ %input{ :name => 'volume', :type => 'text', :class => 'input_text', :id => 'volume', :size => 3, :value => book_info[:volume]}
+
+ .item
+ %label{ :for => 'subtitle' }
+ %span
+ 副題:
+ %input{ :name => 'subtitle', :type => 'text', :class => 'input_text', :id => 'subtitle', :value => book_info[:subtitle]}
+
+ .item
+ %label{ :for => 'series' }
+ %span
+ 単行本シリーズ:
+ %input{ :name => 'series', :type => 'text', :class => 'input_text', :id => 'series', :value => book_info[:series]}
+
+ .item
+ %label{ :for => 'author' }
+ %span
+ 著者:
+ %input{ :name => 'author', :type => 'text', :class => 'input_text', :id => 'author', :value => book_info[:author]}
+
+ .item
+ %label{ :for => 'original_author'}
+ %span
+ 原作:
+ %input{ :name => 'original_author', :type => 'text', :class => 'input_text', :id => 'original_author', :value => book_info[:original_author]}
.item
- %label{ :for => 'book_rank' }
+ %label{ :for => 'illustrator' }
%span
- 評価:
- %input{:name => 'book_rank', :type => 'text', :class => 'input_text', :id => 'book_rank', :value => book_info[:book_rank], :pattern => '[0-5]'}
-
- .buttons
- %hr
- %input{ :type => 'submit', :class=>'push_button', :value => '送信', :onclick => 'validDateId("pubdate")'}
+ 作画:
+ %input{ :name => 'illustrator', :type => 'text', :class => 'input_text', :id => 'illustrator', :value => book_info[:illustrator]}
+
+ .item
+ %label{ :for => 'translator' }
+ %span
+ 翻訳:
+ %input{ :name => 'translator', :type => 'text', :class => 'input_text', :id => 'translator', :value => book_info[:translator]}
+
+ .item
+ %label{ :for => 'supervisor' }
+ %span
+ 監修:
+ %input{ :name => 'supervisor', :type => 'text', :class => 'input_text', :id => 'supervisor', :value => book_info[:supervisor]}
+
+ .item
+ %label{ :for => 'publisher' }
+ %span
+ 出版社:
+ %input{ :name => 'publisher', :type => 'text', :class => 'input_text', :id => 'publisher', :value => book_info[:publisher]}
+
+ .item
+ %label{ :for => 'pubdate' }
+ %span
+ 出版日:
+ %input{ :name => 'pubdate', :type => 'text', :class => 'input_text', :id => 'pubdate', :value => book_info[:pubdate], :oninput => 'validDateForm(this)'}
+
+ .item
+ %label{ :for => 'cover_file'}
+ %span
+ 書影:
+ %input{ :name => 'cover_file', :type => 'file', :id => 'cover_file', :accept => 'image/png, image/jpeg', :style => "display:none"}
+ %input{ :type => 'text', :class => 'input_text', :id => 'file_name', :value => ''}
+ %input{ :type => 'submit', :class => 'side_button', :value => '書影Upload', :formaction => '/book_upload_cover' }
+ :javascript
+ var file = document.getElementById( 'cover_file' );
+ var text = document.getElementById( 'file_name' );
+
+ file.onchange = function()
+ {
+ text.value = this.value;
+ }
+
+ text.onclick = function()
+ {
+ file.click();
+ }
+
+ .item_center
+ - if book_info[:cover_uri] != nil
+ %image{ :id => 'cover_image', :border => '1', :src => book_info[:cover_uri], :class => 'cover_image', :width => '128', :height => '182'}
+ %input{ :name => 'cover_uri', :type => 'hidden', :value => book_info[:cover_uri]}
+ - if book_info[:cover_base64] != nil
+ %input{ :name => 'cover_base64', :type => 'hidden', :value => book_info[:cover_base64]}
+ %input{ :name => 'mime_type', :type => 'hidden', :value => book_info[:mime_type]}
+
+ - if !is_admin_books
+ .item
+ %label{ :for => 'summary' }
+ %span
+ 概説:
+ %textarea{ :name => 'summary', :class => 'input_text', :rows => '5', :cols => '35', :id => 'summary'}
+ #{book_info[:summary]}
+
+ .item
+ %label{ :for => 'book_rank' }
+ %span
+ 評価:
+ %input{:name => 'book_rank', :type => 'text', :class => 'input_text', :id => 'book_rank', :value => book_info[:book_rank], :pattern => '[0-5]'}
+
+ %hr
+ .regist_footer
+ .regist_buttons
+ %input{ :type => 'submit', :class=>'push_button', :value => '送信', :onclick => 'validDateId("pubdate")', :form => 'params'}
%input{ :type => 'button', :class=>'push_button', :onclick =>"location.href='/user_home'", :value => 'もどる' }
@charset "utf-8";
+.book_list_page {
+ height: 93%;
+
+ .list_header {
+ height: 25%;
+ }
+
+ .list_body {
+ height: 75%;
+ overflow: auto;
+ position: relative;
+ }
+}
+
.book_list {
- max-height: 32em;
margin: 5px;
padding: 2px;
width: 98%;
- overflow: auto;
display: inline-block;
align-items: center;
.params {
@include form_item;
- max-height: 30em;
+// max-height: 32em;
overflow: auto;
margin-left: 20px;
text-align: left;
--- /dev/null
+@charset "utf-8";
+
+.regist_page {
+ height: 93%;
+
+ .regist_header {
+ height: 20%;
+ }
+
+ .regist_body {
+ height: 70%;
+ overflow: auto;
+ position: relative;
+ }
+
+ .regist_footer {
+ height: 10%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .regist_buttons {
+ margin: 5px 0px;
+ }
+ }
+}
@import 'widget';
@import 'layout';
@import 'classes';
+@import 'regist';
@import 'book_list';
@import 'book_info';
@import 'user_list';
@charset "utf-8";
+.user_list_page {
+ height: 93%;
+
+ .list_header {
+ height: 10%;
+ }
+
+ .list_body {
+ height: 90%;
+ overflow: auto;
+ position: relative;
+ }
+}
+
.user_list {
max-height: 32em;
margin: 5px;
- post_url="/user_edit/#{id}"; return_url='/user_list'
- else
- post_url='/user_edit'; return_url='/user_home'
-
-%h3
- #{editname} さんのユーザデータを変更できます。
-.message
- -if (not is_admin)
- パスワードを変更する際には、現在のパスワードと
- 新しいパスワードを入力してください。
+.regist_page
+ .regist_header
+ %h3
+ #{editname} さんのユーザデータを変更できます。
-%hr
+ .message
+ -if (not is_admin)
+ パスワードを変更する際には、現在のパスワードと
+ 新しいパスワードを入力してください。
-%form{ :action => post_url, :method => "post"}
- .formstyle
- .params
- - if (is_admin)
- .item
- %label{ :for => 'user_id' }
- %span
- ユーザID:
- %input{ :name => 'usr_id', :type => 'text', :class => 'input_text', :id => 'user_id', :value => id, :readonly => true}
-
- .item
- %label{ :for => 'name' }
- %span
- アカウント:
- %input{ :name => 'name', :type => 'text', :class => 'input_text', :id => 'name', :value => account, :readonly => true}
-
- .item
- %label{ :for => 'full_name' }
- %span
- フルネーム:
- %input{ :name => 'full_name', :type => 'text', :class => 'input_text', :id => 'full_name', :size => 30, :value => editname, :maxlength => 127}
+ %hr
+ .regist_body
- - if (not is_admin)
- .item
- %label{ :for => 'old_passwd' }
- %span
- 現在のパスワード:
- %input{ :name => 'try_pass', :type => 'password', :class => 'input_text', :id => 'old_passwd'}
-
- .item
- %label{ :for => 'passwd' }
- %span
- 新しいパスワード:
- %input{ :name => 'new_pass', :type => 'password', :class => 'input_text', :id => 'passwd', :pattern => '.{6,}', :oninput => 'checkDifferentForm(this, "old_passwd", "現在のパスワードと新しいパスワードが同じです。")' }
+ %form{ :action => post_url, :method => "post", :id => 'params'}
+ .formstyle
+ .params
+ - if (is_admin)
+ .item
+ %label{ :for => 'user_id' }
+ %span
+ ユーザID:
+ %input{ :name => 'usr_id', :type => 'text', :class => 'input_text', :id => 'user_id', :value => id, :readonly => true}
- .item
- %label{ :for => 'passwdConfirm'}
- %span
- 新しいパスワード(確認用):
- %input{ :type => 'password', :class => 'input_text', :id => 'passwdConfirm', :pattern => '.{6,}', :oninput => 'checkSameForm(this, "passwd", "新しいパスワードが一致しません。")' }
+ .item
+ %label{ :for => 'name' }
+ %span
+ アカウント:
+ %input{ :name => 'name', :type => 'text', :class => 'input_text', :id => 'name', :value => account, :readonly => true}
- .item
- %label{ :for => 'email' }
- %span
- Eメールアドレス:
- %input{ :name => 'email', :type => 'email', :class => 'input_text', :id => 'email', :size => 30, :maxlength => 127, :value => email }
-
- .buttons
- %hr
- %input{ :type => 'submit', :class => 'push_button', :value => '送信'}
+ .item
+ %label{ :for => 'full_name' }
+ %span
+ フルネーム:
+ %input{ :name => 'full_name', :type => 'text', :class => 'input_text', :id => 'full_name', :size => 30, :value => editname, :maxlength => 127}
+
+ - if (not is_admin)
+ .item
+ %label{ :for => 'old_passwd' }
+ %span
+ 現在のパスワード:
+ %input{ :name => 'try_pass', :type => 'password', :class => 'input_text', :id => 'old_passwd'}
+
+ .item
+ %label{ :for => 'passwd' }
+ %span
+ 新しいパスワード:
+ %input{ :name => 'new_pass', :type => 'password', :class => 'input_text', :id => 'passwd', :pattern => '.{6,}', :oninput => 'checkDifferentForm(this, "old_passwd", "現在のパスワードと新しいパスワードが同じです。")' }
+
+ .item
+ %label{ :for => 'passwdConfirm'}
+ %span
+ 新しいパスワード(確認用):
+ %input{ :type => 'password', :class => 'input_text', :id => 'passwdConfirm', :pattern => '.{6,}', :oninput => 'checkSameForm(this, "passwd", "新しいパスワードが一致しません。")' }
+
+ .item
+ %label{ :for => 'email' }
+ %span
+ Eメールアドレス:
+ %input{ :name => 'email', :type => 'email', :class => 'input_text', :id => 'email', :size => 30, :maxlength => 127, :value => email }
+ %hr
+ .regist_footer
+ .register_buttons
+
+ %input{ :type => 'submit', :class => 'push_button', :value => '送信', :form => 'params'}
%input{ :type => 'button', :class => 'push_button', :onclick =>"location.href='#{return_url}'", :value => 'もどる' }
- # encoding: utf-8
- user_list = @user_list
-%h3
- 現在登録されているユーザーの一覧です。
-
-.user_list
- %table
- %tr
- %th.id
- ID
- %th.name
- ユーザネーム
- %th.full_name
- フルネーム
- %th.email
- Eメールアドレス
- %th.role
- 権限
- %th.update_at
- 更新日時
- %th.controll
- 操作
- - user_list.each do |user|
- - user_id = user[:user_id]; user_name = user[:user_name]
- - email = user[:email]; full_name = user[:full_name]
- - update_at = user[:update_at].strftime('%D %T')
- - delete_disabled = false
- - case user[:user_role]
- - when User::ROLE_ADMIN
- - user_role = '管理者'
- - delete_disabled = true
- - when User::ROLE_NORMAL
- - user_role = '一般利用者'
- - when User::ROLE_FORGOT
- - user_role = '要再発行'
- %tr
- %td.id
- #{user_id}
- %td.name
- #{user_name}
- %td.full_name
- #{full_name}
- %td.email
- #{email}
- %td.role
- #{user_role}
- %td.update_at
- #{update_at}
- %td.controll
- %input{ :type => 'button', :class => 'side_button', :onclick =>"location.href='/user_edit/#{user_id}'", :value => '編集' }
- %input{ :type => 'button', :class => 'side_button', :onclick =>"location.href='/user_delete/#{user_id}'", :value => '削除', :disabled => delete_disabled }
+.user_list_page
+ .list_header
+ %h3
+ 現在登録されているユーザーの一覧です。
+ %hr
+ .list_body
+ .user_list
+ %table
+ %tr
+ %th.id
+ ID
+ %th.name
+ ユーザネーム
+ %th.full_name
+ フルネーム
+ %th.email
+ Eメールアドレス
+ %th.role
+ 権限
+ %th.update_at
+ 更新日時
+ %th.controll
+ 操作
+ - user_list.each do |user|
+ - user_id = user[:user_id]; user_name = user[:user_name]
+ - email = user[:email]; full_name = user[:full_name]
+ - update_at = user[:update_at].strftime('%D %T')
+ - delete_disabled = false
+ - case user[:user_role]
+ - when User::ROLE_ADMIN
+ - user_role = '管理者'
+ - delete_disabled = true
+ - when User::ROLE_NORMAL
+ - user_role = '一般利用者'
+ - when User::ROLE_FORGOT
+ - user_role = '要再発行'
+ %tr
+ %td.id
+ #{user_id}
+ %td.name
+ #{user_name}
+ %td.full_name
+ #{full_name}
+ %td.email
+ #{email}
+ %td.role
+ #{user_role}
+ %td.update_at
+ #{update_at}
+ %td.controll
+ %input{ :type => 'button', :class => 'side_button', :onclick =>"location.href='/user_edit/#{user_id}'", :value => '編集' }
+ %input{ :type => 'button', :class => 'side_button', :onclick =>"location.href='/user_delete/#{user_id}'", :value => '削除', :disabled => delete_disabled }