Skip to content

Commit

Permalink
css fix
Browse files Browse the repository at this point in the history
  • Loading branch information
halimkhaldi committed Mar 6, 2018
1 parent ebf8f9b commit 4ca6a49
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 5 deletions.
6 changes: 5 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
Expand Down Expand Up @@ -247,12 +247,16 @@ $(document).on('turbolinks:load', function () {
}
if (map_id) {
map();
$('#user_nav').addClass('active')

}
if (user_map) {
reservation_map();
$('#user_nav').addClass('active')
}
if (show_history) {
history();
$('#history_nav').addClass('active')
}

var slideIndex = 0;
Expand Down
11 changes: 9 additions & 2 deletions app/controllers/rentals_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ def create
end
end
def current
@user=User.find(session[:user_id])
@rental=Rental.new
@locals=Local.all
@current_rental=User.find(session[:user_id]).rental.where("drop_date = 'nill'")
@current_rental=@user.rental.where("drop_date = 'nill'")
@vehicle=@current_rental[0].vehicle
@local=@current_rental[0].local
end
Expand All @@ -45,10 +46,13 @@ def drop
@rental.update(local_drop:params_drop[:local_id])
redirect_to user_path
else
flash[:error_current]='error try again'
redirect_to current_path
end
else
flash[:error]='pick another location this one is full'
flash[:error_current]='pick another location this one is full'
redirect_to current_path

end
end

Expand All @@ -67,6 +71,9 @@ def reserved?
@rental
end
end
def history
@user=User.find(session[:user_id])
end


end
49 changes: 48 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

<body>
<!--begin header -->
<% s=controller.controller_name+'#'+controller.action_name %>
<% if ["users#show","rentals#history","rentals#current"].include? s %>

<header class="header">

<!--begin nav -->
Expand All @@ -53,7 +56,49 @@
</button>

<!--logo -->
<a href="index.html" class="navbar-brand" id="logo">ScootWee</a>
<a href="/" class="navbar-brand" id="logo">ScootWee</a>

</div>

<div id="navbar-collapse-02" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li id='user_nav'><a href="/user"><%= @user.first_name%></a></li>
<li id='history_nav'><a href="/user/history">History</a></li>
<li><a href="/logout">log_out</a></li>


</ul>
</div>
<!--end navbar -->

</div>
<!--end container -->

</nav>
<!--end nav -->

</header>
<% else %>
<header class="header">

<!--begin nav -->
<nav class="navbar navbar-default navbar-fixed-top">

<!--begin container -->
<div class="container">

<!--begin navbar -->
<div class="navbar-header">

<button data-target="#navbar-collapse-02" data-toggle="collapse" class="navbar-toggle" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>

<!--logo -->
<a href="/" class="navbar-brand" id="logo">ScootWee</a>

</div>

Expand All @@ -78,7 +123,9 @@
<!--end nav -->

</header>
<% end %>
<div class='container'>

<%= yield %>
</div>

Expand Down
5 changes: 5 additions & 0 deletions app/views/rentals/current.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@

<div class='contaner'>
<% if flash[:error_current] %>
<div class='alert alert-danger'>
<p><%=flash[:error_current] %></p>
</div>
<% end %>
<div class=' col-lg-3 col-md-offset-2' id='reservation'>
<p><img src='https://thescooterfarm.com/wp-content/uploads/2017/07/Chilli-Pro-Scooter-Reaper-Wave1.jpg' style='width:60%' ><br> <%= @vehicle.description %> @ <%= @local.street %> , <%= @local.city %> , <%= @local.state %> | <%= @local.zip_code %> Show this acces code</p>
<p><strong><img src=" https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=<%=@vehicle.sn%>"></strong><button class="btn btn-primary btn-lg" id='drop' style="margin-left:2em">Drop </button> </p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/session/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
<% end %>
</div>

</div
</div>
</div>

0 comments on commit 4ca6a49

Please sign in to comment.