Browse Source

Partial views.

old-ruby
Ben Kurtovic 9 years ago
parent
commit
6c3d9c620c
5 changed files with 32 additions and 6 deletions
  1. +11
    -1
      app/helpers/application_helper.rb
  2. +9
    -3
      app/views/layouts/application.html.erb
  3. +1
    -0
      app/views/shared/_footer.html.erb
  4. +1
    -0
      app/views/shared/_header.html.erb
  5. +10
    -2
      app/views/tools/index.html.erb

+ 11
- 1
app/helpers/application_helper.rb View File

@@ -1,7 +1,17 @@
module ApplicationHelper

def get_title(title = '')
base = 'Calefaction' # TODO: replace with settings name thing
base = '[Site Name]'
title.empty? ? base : "#{title} : #{base}"
end

def get_copyright_year
start = 2015
year = Time.now.year
year > start ? "#{start}–#{year}" : start
end

def get_project_version
'0.1' # todo
end
end

+ 9
- 3
app/views/layouts/application.html.erb View File

@@ -7,8 +7,14 @@
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

<div id="header">
<%= render "shared/header" %>
</div>
<div id="content">
<%= yield %>
</div>
<div id="footer">
<%= render "shared/footer" %>
</div>
</body>
</html>

+ 1
- 0
app/views/shared/_footer.html.erb View File

@@ -0,0 +1 @@
<p>Copyright &copy; <%= get_copyright_year %> [copyright holders] &bull; Running Calefaction <%= get_project_version %> &bull; [CCP Copyright Info]</p>

+ 1
- 0
app/views/shared/_header.html.erb View File

@@ -0,0 +1 @@
<!-- -->

+ 10
- 2
app/views/tools/index.html.erb View File

@@ -1,7 +1,15 @@
<h1>Tools#index</h1>

<p>Users: <a href="/signup">Signup</a> &bull; <a href="/login">Login</a></p>
<p>Admin: <a href="/admin">Admin</a></p>
<p>
Users:
<%= link_to "Signup", controller: "users", action: "create" %>
&bull;
<%= link_to "Login", controller: "users", action: "login" %>
</p>
<p>
Admin:
<%= link_to "Admin", controller: "admin", action: "index" %>
</p>
<p>Tools: ...</p>

<p>[Site description]</p>

Loading…
Cancel
Save