Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'haml'
gem "bulma-rails", "~> 0.2.3"
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ GEM
tzinfo (~> 1.1)
arel (7.1.4)
builder (3.2.2)
bulma-rails (0.2.3)
sass (~> 3.2)
byebug (9.0.6)
coffee-rails (4.2.1)
Expand Down Expand Up @@ -158,7 +157,6 @@ PLATFORMS
ruby

DEPENDENCIES
bulma-rails (~> 0.2.3)
byebug
coffee-rails (~> 4.2)
haml
Expand Down
126 changes: 96 additions & 30 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,40 +1,106 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
@import "bulma";

.hero {
margin-bottom: 30px;
body,
ul,
li,
h1,
p {
margin: 0;
padding: 0;
}

.todo-list {
padding: 30px;
*,
*::before,
*::after {
box-sizing: border-box;
}

body {
background: #fafafa;
color: #555;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
line-height: 1.4;
}

.addTodo {
margin-top: 30px;
.container {
margin: 0 auto;
max-width: 450px;
padding: 15px;
}

.addTodo input {
.h1 {
font-size: 24px;
font-weight: 500;
margin-top: 60px;
padding-left: 48px;
}

.todo-list {
background: white;
border: 1px solid #e6e6e6;
border-radius: 6px;
box-shadow: 0 1px 3px rgba(0,0,0,.06);
margin: 15px 0 150px;
}

.todo-list-item {
display: flex;
font-size: 19px;
padding: 18px;
width: 100%;
height: 50px;
padding: 10px;
resize: vertical;
font-size: 18px;

+ .new_todo,
+ .todo-list-item {
border-top: 1px solid #e6e6e6
}
}

.button-complete {
background: #fff;
border: 3px solid #e6e6e6;
border-radius: 6px;
cursor: pointer;
flex: 0 0 auto;
height: 18px;
margin: 4px 12px 0 0;
width: 18px;
}

.button-edit {
color: #888;
font-size: 15px;
margin-left: auto;
position: relative;
top: 4px;
}

.input {
background: none;
border: none;
color: inherit;
line-height: inherit;
outline: none;
padding-left: 48px;
}

.notification {
background: #fff;
border: 1px solid #e6e6e6;
border-radius: 6px;
border-width: 1px;
box-shadow: 0 1px 3px rgba(0,0,0,.06);
color: #555;
display: flex;
padding: 15px;
}

.emoji {
font-size: 45px;
margin-right: 12px;
}

.weight-strong {
font-weight: 500;
}

.addTodo label {
display: none;
.small {
font-size: 13px;
}
34 changes: 0 additions & 34 deletions app/assets/stylesheets/scaffolds.scss

This file was deleted.

Empty file removed app/assets/stylesheets/todos.scss
Empty file.
10 changes: 4 additions & 6 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
!!!
%html
%head
%title ToDo List
%title Todo List
%meta{:charset => "utf-8"}
%meta{:"http-equiv" => "X-UA-Compatible", :content => "IE=edge,chrome=1"}
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1"}
= favicon_link_tag "favicon.png", rel: 'shortcut icon', type: 'image/png'
= stylesheet_link_tag "application", media: "all"
= javascript_include_tag "application"
= csrf_meta_tags
%body
%section.hero.is-dark
.hero-body
.container
%h1.title Todo List
%h2.subtitle <em>Submit</em> a new Todo to get started!
= yield
17 changes: 2 additions & 15 deletions app/views/todos/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
<%= form_for(todo, :html => {:class => 'addTodo'}) do |f| %>
<% if todo.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(todo.errors.count, "error") %> prohibited this todo from being saved:</h2>

<ul>
<% todo.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>

<%= f.text_field :content, autofocus: true, placeholder: 'Add a Todo!' %>
<%= f.submit 'Submit', :class => 'button is-dark is-fullwidth' %>
<%= form_for(todo) do |f| %>
<%= f.text_field :content, autofocus: true, placeholder: 'Add a task', class: 'todo-list-item input' %>
<% end %>
6 changes: 0 additions & 6 deletions app/views/todos/edit.html.erb

This file was deleted.

9 changes: 9 additions & 0 deletions app/views/todos/edit.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.container
.notification
.emoji 🚀
%div
%p.weight-strong This is your demo app.
%p.small Each branch gets its own database. Check it out and then head back to Runnable.
%h1.h1 Editing Todo
%ul.todo-list
=render 'form', todo: @todo
24 changes: 12 additions & 12 deletions app/views/todos/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.container.todo-list
- if @todos.empty?
%p There are no todos!
- else
.container
.notification
.emoji 🚀
%div
%p.weight-strong This is your demo app.
%p.small Each branch gets its own database. Check it out and then head back to Runnable.
%h1.h1 Todo List
%ul.todo-list
- @todos.each do |todo|
%article.media
.media-content
.content
%p= todo.content
.media-right
%a= link_to 'Delete', todo, method: :delete, class: 'button is-danger'
=render 'form', todo: @todo
%p#notice= notice
%li.todo-list-item
%a= link_to '', todo, method: :delete, class: 'button-complete'
%p= todo.content
=render 'form', todo: @todo
17 changes: 11 additions & 6 deletions app/views/todos/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.container
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should remove this. You will get an app error if you got to <navi_url>:3000/todos/#

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I should just put the file back in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get that issue when I go to that address.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean a number instead of #.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@tosih tosih Dec 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can put the file back in with simple styling. People can't hit the link via UI, but people familiar with rails will try and hit the direct route if they are curious.

%p#notice= notice
%br
.box
%p= @todo.content
= link_to 'Edit', edit_todo_path(@todo), class: 'button'
= link_to 'Back', todos_path, class: 'button'
.notification
.emoji 🚀
%div
%p.weight-strong This is your demo app.
%p.small Each branch gets its own database. Check it out and then head back to Runnable.
%h1.h1 Viewing Todo
%ul.todo-list
%li.todo-list-item
%a= link_to '', @todo, method: :delete, class: 'button-complete'
%p= @todo.content
= link_to 'Edit', edit_todo_path(@todo), class: 'button-edit'