Skip to content

Commit

Permalink
Alert improvement and adding byebug gem (#383)
Browse files Browse the repository at this point in the history
* byebug gem added and alerts in separate file

* adding byebug history to gitignore

* adding timestamp to redirect

* added z-index to render login dropdown above leaflet icon
  • Loading branch information
grvsachdeva authored and jywarren committed Mar 30, 2019
1 parent caa0f18 commit 0e1bb76
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ public/lib
node_modules
todo.txt
.sass-cache
.byebug_history
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ group :test do
end

group :development do
gem "byebug"
gem "jshintrb"
gem "therubyracer"
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def successful_login(back_to, id)
def logout
session[:user_id] = nil
flash[:success] = "You have successfully logged out."
redirect_to '/'
redirect_to '/' + '?_=' + Time.now.to_i.to_s
end

protected
Expand Down
15 changes: 15 additions & 0 deletions app/views/layouts/_alerts.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="container-fluid" id="alerts">
<% flash.each do |key, value| %>
<% if key == :notice %>
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">
<i class="fa fa-close"></i></button><%= value %>
</div>
<% else %>
<div class="alert alert-<%= key %>">
<button type="button" class="close" data-dismiss="alert">
<i class="fa fa-close"></i></button><%= value %>
</div>
<% end %>
<% end %>
</div>
9 changes: 1 addition & 8 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,8 @@
</head>
<body>
<%= render 'layouts/header' %>

<div class="container-fluid" id="alerts">
<% if flash[:notice] %><div class="alert alert-success"><button type="button" class="close" data-dismiss="alert"><i class="fa fa-close"></i></button><%=raw flash[:notice] %></div><% end %>
<% if flash[:error] %><div class="alert alert-error"><button type="button" class="close" data-dismiss="alert"><i class="fa fa-close"></i></button><%=raw flash[:error] %></div><% end %>
<% if flash[:warning] %><div class="alert alert-warning"><button type="button" class="close" data-dismiss="alert"><i class="fa fa-close"></i></button><%=raw flash[:warning] %></div><% end %>
</div>

<%= render 'layouts/alerts' %>
<%= yield; %>
<%= render 'layouts/footer' %>

<script>
Expand Down
2 changes: 1 addition & 1 deletion app/views/maps/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%= javascript_include_tag('/lib/leaflet-spin/example/leaflet.spin.min.js') %>

<div class="container-fluid">
<div id="mapknitter-unique" style="height: 300px ; width: 100% ; margin-bottom: 1%"></div>
<div id="mapknitter-unique" style="height: 300px ; width: 100% ; margin-bottom: 1%; z-index: 5;"></div>
<div class="row">
<div class="col-md-3">
<% if logged_in? %>
Expand Down

0 comments on commit 0e1bb76

Please sign in to comment.