Skip to content

Commit

Permalink
Merge pull request #189 from alaashafaee/C1_Assuty_123_view_layout
Browse files Browse the repository at this point in the history
View Layout #123 Strory 1.20
  • Loading branch information
KhaledHelmy committed Apr 13, 2014
2 parents aaf4de1 + 5f50258 commit f8bce8a
Show file tree
Hide file tree
Showing 14 changed files with 7,118 additions and 20 deletions.
Binary file added tutor/app/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions tutor/app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,39 @@
*= require_self
*= require_tree .
*/

.center {
margin: 0 auto;
width: 80%;
}

.home-banner {
margin: 10px 0;
font-family: 'Telex', sans-serif;
font-weight: bold;
line-height: 20px;
color: #317eac;
text-rendering: optimizelegibility;
font-size:38.5px;
}


.side-bar-left-fix-rat {
width:19%;
height:700px;
margin-left:6px;
}


.side-bar-right-fix-rat {
width:19%;
height:700px;
margin-right:6px;
}

.main-content {
margin-top:70px;
margin-bottom:70px;
width:60%;
height:80%;
}
14 changes: 13 additions & 1 deletion tutor/app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
<p>This line is from the footer file. </p>
<!--
# [View Layout - Story 1.2]
# General layout for footer
# Author: Ahmed Elassuty
-->
<div style="margin-top:20px">
<span style="margin:5px">
<%= link_to "About us"%>
</span>
<span style="margin:5px">
<%= link_to "Contact us"%>
</span>
</div>
1 change: 0 additions & 1 deletion tutor/app/views/layouts/_header.html.erb

This file was deleted.

7 changes: 7 additions & 0 deletions tutor/app/views/layouts/_left_side_bar.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
# [View Layout - Story 1.2]
# General layout for left side bar
# Author: Ahmed Elassuty
-->
<div id="left_side_bar" align="left" class="col-lg-4 well pull-left side-bar-left-fix-rat">
</div>
20 changes: 20 additions & 0 deletions tutor/app/views/layouts/_log_out_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
# [View Layout - Story 1.2]
# logout button configurations
# Author: Ahmed Elassuty
-->
<ul class="nav navbar-nav navbar-right" id="navbar-main">
<%- if lecturer_signed_in?%>
<li style="margin-top:10px">
<%= button_to 'Log Out',destroy_lecturer_session_path,class: "btn btn-danger", method: :delete %>
</li>
<%- elsif student_signed_in?%>
<li style="margin-top:10px">
<%= button_to 'Log Out',destroy_student_session_path,class: "btn btn-danger",method: :delete %>
</li>
<%- elsif teaching_assistant_signed_in?%>
<li style="margin-top:10px">
<%= button_to 'Log Out', destroy_teaching_assistant_session_path, class: "btn btn-danger" ,method: :delete %>
</li>
<% end%>
</ul>
7 changes: 7 additions & 0 deletions tutor/app/views/layouts/_right_side_bar.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
# [View Layout - Story 1.2]
# General layout for right side bar
# Author: Ahmed Elassuty
-->
<div id="right_side_bar" align="right" class="col-lg-4 well pull-right side-bar-right-fix-rat">
</div>
13 changes: 13 additions & 0 deletions tutor/app/views/layouts/_signed_in_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
# [View Layout - Story 1.2]
# Sign in header
# Author: Ahmed Elassuty
-->
<div class="navbar-header">
<form class="navbar-form navbar-left">
<input type="text" class="form-control col-lg-8" placeholder="Search">
</form>
</div>
<div class="navbar-collapse collapse" id="navbar-main">
<%= render "layouts/log_out_form" %>
</div>
53 changes: 35 additions & 18 deletions tutor/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
<!--
# [View Layout - Story 1.2]
# General layout
# Author: Ahmed Elassuty
-->
<!DOCTYPE html>
<html>
<head>
<title>CoolSoft - Java Tutor</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>

<p>This line is from the main application layout file. <a href='http://guides.rubyonrails.org/layouts_and_rendering.html'>Read more here.</a></p>

<%= render partial: "layouts/header" %>

<%= yield %>

<%= render partial: "layouts/footer" %>

</body>
</html>
<head>
<title>CoolSoft - Java Tutor</title>
<%= stylesheet_link_tag "application", "bootstrap", "bootstrap.min", :media => "all"%>
<%= javascript_include_tag "application","jquery"%>
<%= csrf_meta_tags%>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="nav navbar-nav navbar-left" style="margin-right:12px">
<%= link_to image_tag("logo.png" , { :title => "Tutor Java !" , size: "50x50"})%>
</div>
<a href="../" class="navbar-brand">CoolSoft - Java Tutor</a>
<%- if signed_in?%>
<%= render "layouts/signed_in_header"%>
<%end%>
</div>
</div>
<%- if signed_in?%>
<%= render "layouts/left_side_bar"%>
<%= render "layouts/right_side_bar"%>
<%end%>
<div class="container well main-content" align="center">
<%= yield %>
</div>
<div id="footer" align="center" class="navbar navbar-default navbar-fixed-bottom">
<%= render "layouts/footer"%>
</div>
</body>
</html>
Empty file.
Loading

0 comments on commit f8bce8a

Please sign in to comment.