Use haml!

This commit is contained in:
Ilion Beyst 2015-09-08 16:19:48 +02:00
parent f1a95088d8
commit b708319c3b
10 changed files with 58 additions and 57 deletions

View file

@ -21,6 +21,9 @@ gem 'omniauth-oauth2'
# Authorisation
gem 'cancancan'
# Haml for templating!
gem "haml-rails", "~> 0.9"
# Pure for css
gem 'purecss-rails'
# Use datatables

View file

@ -91,8 +91,21 @@ GEM
multipart-post (>= 1.2, < 3)
globalid (0.3.6)
activesupport (>= 4.1.0)
haml (4.0.7)
tilt
haml-rails (0.9.0)
actionpack (>= 4.0.1)
activesupport (>= 4.0.1)
haml (>= 4.0.6, < 5.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
hashie (3.4.2)
high_voltage (2.4.0)
html2haml (2.0.0)
erubis (~> 2.7.0)
haml (~> 4.0.0)
nokogiri (~> 1.6.0)
ruby_parser (~> 3.5)
i18n (0.7.0)
jbuilder (2.3.1)
activesupport (>= 3.0.0, < 5)
@ -187,6 +200,8 @@ GEM
rspec-mocks (~> 3.3.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
ruby_parser (3.7.1)
sexp_processor (~> 4.1)
sass (3.4.18)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
@ -199,6 +214,7 @@ GEM
rdoc (~> 4.0)
select2-rails (3.5.9.3)
thor (~> 0.14)
sexp_processor (4.6.0)
spring (1.3.6)
sprockets (3.3.4)
rack (~> 1.0)
@ -244,6 +260,7 @@ DEPENDENCIES
devise
factory_girl_rails
faker
haml-rails (~> 0.9)
high_voltage (~> 2.4.0)
jbuilder (~> 2.0)
jquery-datatables-rails (~> 3.3.0)

View file

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Tab</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>

View file

@ -0,0 +1,10 @@
!!!
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
%title Tab
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags
%body
= yield

View file

@ -1,9 +0,0 @@
<h1>Hallo</h1>
<% if user_signed_in? %>
<p>Yeah! Je bent ingelogd.</p>
<% else %>
Log een keer in!
<p><%= link_to "Log in met Zeus WPI", user_omniauth_authorize_path(:zeuswpi) %></p>
<% end %>

View file

@ -0,0 +1,6 @@
%h1 Hallo
- if user_signed_in?
%p Yeah! Je bent ingelogd.
- else
Log een keer in!
%p= link_to "Log in met Zeus WPI", user_omniauth_authorize_path(:zeuswpi)

View file

@ -1,27 +0,0 @@
<table id="transactions" class="display">
<thead>
<tr>
<th>id</th>
<th>debtor</th>
<th>creditor</th>
<th>amount</th>
</tr>
</thead>
<tbody>
<% @transactions.each do |transaction| %>
<tr>
<td><%= transaction.id %></td>
<td><%= transaction.debtor.name %></td>
<td><%= transaction.creditor.name %></td>
<td><%= transaction.amount%></td>
</tr>
<% end %>
</tbody>
</table>
<script>
$(document).ready(function() {
$('#transactions').DataTable();
});
</script>

View file

@ -0,0 +1,18 @@
%table#transactions.display
%thead
%tr
%th id
%th debtor
%th creditor
%th amount
%tbody
- @transactions.each do |transaction|
%tr
%td= transaction.id
%td= transaction.debtor.name
%td= transaction.creditor.name
%td= transaction.amount
:javascript
$(document).ready(function() {
$('#transactions').DataTable();
});

View file

@ -1,7 +0,0 @@
<%= form_for @transaction do |f| %>
<%= f.select :creditor, User.all, {}, { class: 'select2-selector' } %>
<%= f.number_field :amount %>
<%= f.submit "Send it!" %>
<% end %>

View file

@ -0,0 +1,4 @@
= form_for @transaction do |f|
= f.select :creditor, User.all, {}, { class: 'select2-selector' }
= f.number_field :amount
= f.submit "Send it!"