Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sachac/quantified
Browse files Browse the repository at this point in the history
  • Loading branch information
sachac committed Jan 6, 2015
2 parents 9acd5d8 + 117ff35 commit 496e1f3
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 10 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: ruby
rvm:
- "2.0.0"
install:
- bundle install
- npm install bower -g
- echo n | bundle exec rake bower:install
- cp config/database.yml.sample config/database.yml
- cp config/initializers/secret_token.rb.sample config/initializers/secret_token.rb
- mysql -e 'create database quantified_test;'
script: bundle exec rspec spec
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
This is the source code for QuantifiedAwesome.com. It'll probably take a lot of tweaking to get it to work for you, but at least it's up here! =)

You may want to rake db:setup, which will set up the database with an admin user. The admin user will have the password "testpasswordgoeshere".
Instructions for setting up:

Also, if you use Emacs, see lisp/quantified.el
1. If you use Vagrant, the included Vagrantfile will set up a bunch of things for you. If you don't use Vagrant, look at the Vagrantfile for ideas on what to install.
2. Copy `config/database.yml.sample` to `database.yml` and customize it for your setup. Create the accompanying databases. If you would like to run your databases within the virtual machine, you may want to `apt-get install mysql-server mysql-client`.
3. Copy `config/initializers/secret_token.rb.sample` to `config/initializers/secret_token.rb` and update it.

To start with an empty database, run `rake db:schema:load`.
Alternatively, you may want to run `rake db:setup`, which will set up
the database with an admin user. The admin user will have the password
"testpasswordgoeshere".

If you use Emacs, see `lisp/quantified.el`.

----

Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
//= require cal-heatmap.min
//= require quantified
//= require grocery_lists
//= require clothing
10 changes: 10 additions & 0 deletions app/assets/javascripts/clothing.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
logClothingInBackground = (element) ->
element.style.backgroundColor = '#CCCCCC'
$.ajax(url: element.href, method: 'POST').done ->
element.style.backgroundColor = '#CCFFCC'
return false

$ ->
$("a.log-action").click (e) ->
e.preventDefault()
logClothingInBackground(this)
17 changes: 12 additions & 5 deletions app/views/application/_main_nav.html.haml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
%nav.navbar.navbar-default{role: 'navigation'}
.container-fluid
- if current_account
= link_to "#{current_account.username.blank? ? current_account.email : current_account.username}", root_path, :class => 'navbar-brand'
- else
= link_to "quantified awesome",root_path, :class => 'navbar-brand'
.collapse.navbar-collapse
.navbar-header
%button.navbar-toggle.collapsed{'type' => 'button', 'data-toggle' => 'collapse', 'data-target' => '#navbar-collapse-1' }
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
- if current_account
= link_to "#{current_account.username.blank? ? current_account.email : current_account.username}", root_path, :class => 'navbar-brand'
- else
= link_to "quantified awesome",root_path, :class => 'navbar-brand'
.collapse.navbar-collapse#navbar-collapse-1
%ul.nav.navbar-nav
%li{:class => active_menu('/stuff')}= link_to 'stuff', stuff_index_path
%li{:class => active_menu('/clothing')}= link_to 'clothing', clothing_index_path
Expand All @@ -19,3 +25,4 @@
- else
%li.track= link_to t('app.user.login'), new_user_session_path
%li.feedback{:class => active_menu('/feedback')}= feedback_link
%ul.nav.navbar-nav-navbar-right
6 changes: 3 additions & 3 deletions app/views/clothing/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Tags:
%td= link_to clothing.name, clothing
- if managing?
%td
= link_to 'Yesterday', clothing_logs_path + "?clothing_id=" + clothing.id.to_s + "&date=" + Time.zone.today.yesterday.to_s, :method => :post
= link_to 'Today', clothing_logs_path + "?clothing_id=" + clothing.id.to_s + "&date=" + Time.zone.today.to_s, :method => :post
= link_to 'Tomorrow', clothing_logs_path + "?clothing_id=" + clothing.id.to_s + "&date=" + Time.zone.today.tomorrow.to_s, :method => :post
= link_to 'Yesterday', clothing_logs_path + "?clothing_id=" + clothing.id.to_s + "&date=" + Time.zone.today.yesterday.to_s, :method => :post, class: 'log-action'
= link_to 'Today', clothing_logs_path + "?clothing_id=" + clothing.id.to_s + "&date=" + Time.zone.today.to_s, :method => :post, class: 'log-action'
= link_to 'Tomorrow', clothing_logs_path + "?clothing_id=" + clothing.id.to_s + "&date=" + Time.zone.today.tomorrow.to_s, :method => :post, class: 'log-action'
%td= clothing.status
%td= clothing.clothing_logs_count
%td= date_ago_future(clothing.last_worn)
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'rubygems'
require 'simplecov'
ActiveRecord::Migration.maintain_test_schema!
SimpleCov.start 'rails' do
use_merging true
SimpleCov.merge_timeout 3600
Expand Down

0 comments on commit 496e1f3

Please sign in to comment.