Skip to content

Commit

Permalink
Merge pull request #235 from enpitut2017/develop
Browse files Browse the repository at this point in the history
11/27 リリース
  • Loading branch information
tomoya-mikami committed Nov 27, 2017
2 parents 9b948e7 + 32529c1 commit 2d0c3e0
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 14 deletions.
26 changes: 24 additions & 2 deletions app/assets/javascripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,30 @@ function remove(obj) {
}
}

function confirm_delete() {
$("#modal").modal('show');
function confirm_delete(modal) {
$(modal).modal('show');
}

function confirm_item_delete(bookid) {
var modal_box = document.getElementById("Delete-Modal-Box");
modal_box.innerHTML =
'<div id="Delete-Modal" class="modal fade">' +
' <div class="modal-dialog">' +
' <div class="modal-content">' +
' <div class="modal-header">' +
' <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>' +
' <h3 class="modal-title">アイテム削除</h3>' +
' </div>' +
' <div class="modal-body">' +
' <p>アイテムを削除しますか?</p>' +
' </div>' +
' <div class="modal-footer">' +
' <button type="button" class="btn btn-default" data-dismiss="modal">キャンセル</button>' +
' <a class="btn btn-primary" rel="nofollow" data-method="delete" href="/books/' + bookid + '">削除</a>' +
' </div>' +
' </div>' +
'</div>';
$('#Delete-Modal').modal('show');
}

function escape_html(string) {
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/_general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ hr{
padding-top: 24px;
}
}
.modal{
padding-top: 120px;
}
.triangle-top{
position: relative;
width: 0;
Expand Down
3 changes: 0 additions & 3 deletions app/assets/stylesheets/_users.scss
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,3 @@
#LogoutWithdrawButtons{
margin-bottom: 15px;
}
#modal{
padding-top: 120px;
}
6 changes: 3 additions & 3 deletions app/uploaders/image_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def store_dir
# end

# Create different versions of your uploaded files:
# version :thumb do
# process resize_to_fit: [50, 50]
# end
version :thumb do
process resize_to_limit: [106.5, 150]
end

# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
Expand Down
6 changes: 4 additions & 2 deletions app/views/books/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ else
end
hash_for_piechart.each{|key, value|
if counter == piechart_size
p "a"
temp_array_for_data.push(temp_sum_of_data - temp_sum_of_0to4)
temp_array_for_labels.push("その他")
break
Expand Down Expand Up @@ -182,7 +181,7 @@ options_for_piechart = {
<a href="<%= edit_book_path(book.id) %>">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<a href="<%= book_path(book.id) %>" data-method="delete">
<a onclick='confirm_item_delete(<%= book.id %>);return false;'>
<span class="glyphicon glyphicon-remove"></span>
</a>
</td>
Expand All @@ -209,5 +208,8 @@ options_for_piechart = {
<% end %>
<%= link_to 'もどる', user_path(@user.id) %>

<div id="Delete-Modal-Box" class="col-xs-12">
</div>
</div>
</div>
25 changes: 21 additions & 4 deletions app/views/users/profile_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
</div>

<div class="col-md-12 text-center" id="LogoutWithdrawButtons">
<%= link_to 'ログアウト', logout_path, class: 'btn btn-default' , success: 'ばいばーい!'%>
<%= link_to '退会', {}, onclick: "confirm_delete();return false;", class: 'btn btn-danger' , success: 'ご利用いただきありがとうございました!'%>
<%= link_to 'ログアウト', {}, onclick: "confirm_delete(\"#Logout-Modal\");return false;", class: 'btn btn-default' %>
<%= link_to '退会', {}, onclick: "confirm_delete(\"#Leave-Modal\");return false;", class: 'btn btn-danger' %>
</div>
<div class="col-md-12 text-center">
<div id="modal" class="modal fade">
<div id="Leave-Modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
Expand All @@ -63,7 +63,24 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">キャンセル</button>
<%= link_to '退会する', retire_path, class: 'btn btn-danger' %>
<%= link_to '退会する', retire_path, class: 'btn btn-danger', success: 'ご利用いただきありがとうございました!' %>
</div>
</div>
</div>
</div>
<div id="Logout-Modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 class="modal-title">ログアウト</h3>
</div>
<div class="modal-body">
<p>ログアウトしますか?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">キャンセル</button>
<%= link_to 'ログアウト', logout_path, class: 'btn btn-primary', success: 'ばいばーい!' %>
</div>
</div>
</div>
Expand Down

0 comments on commit 2d0c3e0

Please sign in to comment.