Selaa lähdekoodia

Add terms and privacy and navigation and footer

Chris Oliver 7 vuotta sitten
vanhempi
commit
bded193021

+ 4 - 1
app/assets/stylesheets/application.scss

@@ -3,4 +3,7 @@
 // $navbar-default-color: $light-orange;
 
 @import "bootstrap";
-// @import "home";
+
+body > .container {
+  margin-top: 40px;
+}

+ 6 - 0
app/controllers/home_controller.rb

@@ -1,4 +1,10 @@
 class HomeController < ApplicationController
   def index
   end
+
+  def terms
+  end
+
+  def privacy
+  end
 end

+ 2 - 0
app/views/home/privacy.html.erb

@@ -0,0 +1,2 @@
+<h1>Privacy Policy</h1>
+<p class="lead">Use this for your Privacy Policy</p>

+ 2 - 0
app/views/home/terms.html.erb

@@ -0,0 +1,2 @@
+<h1>Terms of Service</h1>
+<p class="lead">Use this for your Terms of Service</p>

+ 9 - 3
app/views/shared/_footer.html.erb

@@ -1,3 +1,9 @@
-<div class="container">
-  <p>Footer</p>
-</div>
+<footer class="footer text-muted">
+  <div class="container">
+    <span>© <%= Date.today.year %> Your Company</span>
+    <ul class="list-inline mb-0 float-right">
+      <li class="list-inline-item mr-3"><%= link_to "Terms", terms_path %></li>
+      <li class="list-inline-item mr-3"><%= link_to "Privacy", privacy_path %></li>
+    </ul>
+  </div>
+</footer>

+ 23 - 20
app/views/shared/_navbar.html.erb

@@ -1,24 +1,27 @@
 <nav class="navbar navbar-toggleable-md navbar-light bg-faded">
-  <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
-    <span class="navbar-toggler-icon"></span>
-  </button>
-  <a class="navbar-brand" href="#">Navbar</a>
+  <div class="container">
+    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+      <span class="navbar-toggler-icon"></span>
+    </button>
+    <%= link_to "Spark", root_path, class: "navbar-brand" %>
 
-  <div class="collapse navbar-collapse" id="navbarSupportedContent">
-    <ul class="navbar-nav mr-auto">
-      <li class="nav-item active">
-        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
-      </li>
-      <li class="nav-item">
-        <a class="nav-link" href="#">Link</a>
-      </li>
-      <li class="nav-item">
-        <a class="nav-link disabled" href="#">Disabled</a>
-      </li>
-    </ul>
-    <form class="form-inline my-2 my-lg-0">
-      <input class="form-control mr-sm-2" type="text" placeholder="Search">
-      <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
-    </form>
+    <div class="collapse navbar-collapse" id="navbarSupportedContent">
+      <ul class="navbar-nav mr-auto mt-2 mt-md-0">
+      </ul>
+
+      <ul class="navbar-nav">
+        <li class="nav-item"><%#= link_to "What's New", announcements_path, class: "nav-link #{unread_announcements(current_user)}" %></li>
+        <% if user_signed_in? %>
+          <li class="nav-item">
+            <a class="nav-link" href="javascript:void(0)" data-uv-lightbox="classic_widget" data-uv-mode="full" data-uv-primary-color="#3aa2e3" data-uv-link-color="#56b68b" data-uv-default-mode="support" data-uv-forum-id="259979">Support</a>
+          </li>
+          <li class="nav-item"><%= link_to "Account", edit_user_registration_path, class: "nav-link" %></li>
+          <li class="nav-item"><%= link_to "Logout", destroy_user_session_path, method: :delete, class: "nav-link" %></li>
+        <% else %>
+          <li class="nav-item"><%= link_to "Sign Up", new_user_registration_path, class: "nav-link" %></li>
+          <li class="nav-item"><%= link_to "Login", new_user_session_path, class: "nav-link" %></li>
+        <% end %>
+      </ul>
+    </div>
   </div>
 </nav>

+ 3 - 0
template.rb

@@ -55,6 +55,9 @@ end
 
 def copy_templates
   directory "app", force: true
+
+  route "get '/terms', to: 'home#terms'"
+  route "get '/privacy', to: 'home#privacy'"
 end
 
 def add_webpack