Skip to content

Commit

Permalink
Merge pull request #132 from enpitut2017/update_books_view
Browse files Browse the repository at this point in the history
Update books view
  • Loading branch information
muratananaho committed Aug 8, 2017
2 parents 55b3043 + ece61df commit e216303
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function parse_input() {
+'<td><input class="form-control" type="text" name="costs[]" value="'+ costs[i] +'"></td>'
+'<td><input class="form-control" type="text" name="times[]" id="datepicker'+ id + i +'" value="' + yyyymmdd +'"></td>'
+'<td> <span onClick="remove(this)" class="glyphicon glyphicon-remove" aria-hidden="true"></span></td>'
+'<tr><br>');
+'<tr>');
$('#datepicker'+ id + i).datepicker({
format: "yyyy-mm-dd"
});
Expand Down
11 changes: 5 additions & 6 deletions app/views/books/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<%= form_with(model: book, local: true) do |form| %>
<br>
<table id="add_items">
</table>
<br>

<%= form.submit class: 'btn btn-default', id: 'submit', style: 'display:none;' %>
<div class="text-center">
<table id="add_items">
</table><br>
<%= form.submit class: 'btn btn-primary', id: 'submit', style: 'display:none;' %>
</div>

<% if book.errors.any? %>
<div id="error_explanation">
Expand Down
22 changes: 11 additions & 11 deletions app/views/books/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="col-sm-12">

<h1>アイテムを追加</h1>

<textarea name="rec_text" class="form-control" id="result_text" cols="100" rows="10"></textarea><br>
<button class="btn btn-primary" type="button" onClick="parse_input()">決定</button>
<button class="btn btn-default" type="button" onClick="reset()">クリア</button>
<button id="rec_button" class="btn btn-default" type="button" onClick="record()">
<span class="glyphicon glyphicon-record" aria-hidden="true" style="color: #92140C;"></span> 録音開始
</button>

<div class="row">
<div class="well col-md-10 col-md-offset-1">
<textarea name="rec_text" class="form-control" id="result_text" cols="100" rows="10"></textarea>
<button class="btn btn-primary" type="button" onClick="parse_input()">決定</button>
<button class="btn btn-default" type="button" onClick="reset()">クリア</button>
<button id="rec_button" class="btn btn-default" type="button" onClick="record()">
<span class="glyphicon glyphicon-record" aria-hidden="true" style="color: #92140C;"></span> 録音開始
</button>
</div>
<div class="col-md-10 col-md-offset-1">
<%= render 'form', book: @book %>
</div>
</div>
32 changes: 17 additions & 15 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<header class="navbar navbar-fixed-top">
<div id="header_container" class="container">
<%= link_to image_tag('/assets/logo-m.png', {:id => "logo", :border => '0', :alt => '家計学園'}), root_path %>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navi">
<span class="sr-only">メニュー</span>
<span class="icon-bar glyphicon glyphicon-menu-hamburger"></span>
</button>
</div>
<div id="navi" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<% if logged_in? %>
<% if logged_in? %>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navi">
<span class="sr-only">メニュー</span>
<span class="icon-bar glyphicon glyphicon-menu-hamburger"></span>
</button>
</div>
<div id="navi" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<%= link_to user_path(current_user.id), { :class => "btn button_settings" } do %>
<i class="glyphicon glyphicon-home"></i> ホーム
Expand All @@ -20,13 +20,15 @@
<i class="glyphicon glyphicon-cog"></i> 設定
<% end %>
</li>
<% else %>
<li>
<%= link_to 'ログイン', login_path, { :class => "btn button_settings" } %>
</li>
<% end %>
</ul>
</div>
<% else %>
<ul class="nav navbar-nav navbar-right">
<li>
<%= link_to 'ログイン', login_path, { :class => "btn button_settings" } %>
</li>
</ul>
</div>
<% end %>
</div>
<div class="border_test">
</div>
Expand Down

0 comments on commit e216303

Please sign in to comment.