Browse files

Completed most of the styling and squashed a few, but not all, bugs

  • Loading branch information...
1 parent 30dec43 commit 5bcd18c686e5bfe368e267a028ddff52b35d7031 @cpursley committed Dec 4, 2012
View
1 Gemfile
@@ -5,6 +5,7 @@ gem 'bootstrap-sass'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem "validate_url"
+gem 'simple_form'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
View
4 Gemfile.lock
@@ -94,6 +94,9 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
+ simple_form (2.0.3)
+ actionpack (~> 3.0)
+ activemodel (~> 3.0)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -125,6 +128,7 @@ DEPENDENCIES
jquery-rails
rails (= 3.2.8)
sass-rails (~> 3.2.3)
+ simple_form
sqlite3
uglifier (>= 1.0.3)
validate_url
View
6 app/assets/javascripts/custom.js.coffee
@@ -0,0 +1,6 @@
+$ ->
+ flashCallback = ->
+ $(".alert").fadeOut(1500)
+ $(".alert").bind 'click', (ev) =>
+ $(".alert").fadeOut()
+ setTimeout flashCallback, 1000
View
508 app/assets/stylesheets/custom.css.scss
@@ -1,104 +1,488 @@
@import "bootstrap";
+/*
+Theme Name: Nannie
+Theme URI: http://responsivewebinc.com
+Description: Responsive Minimal Bootstrap WordPress Theme.
+Version: 1.0
+Author: Ashok
+Author URI: http://responsivewebinc.com
+License: WrapBootstrap License
+License URI: https://wrapbootstrap.com/terms
+Tags: blue, white, multi-column
+Text Domain: Nannie
+*/
+
/* universal */
-html {
- overflow-y: scroll;
+body{
+background:#fff;
+font-family: 'Droid Sans', Arial, Helvetica, sans-serif;
+font-size:13px;
+line-height:24px;
+font-weight:400;
+color:#555;
+padding-top: 60px;
+}
+
+h1,h2,h3,h4,h5,h6{
+margin:0px;
+padding:0px;
+font-weight:400;
+}
+
+h1{
+font-size:27px;
+line-height:40px;
+font-weight:300;
+}
+
+h2{
+font-size:21px;
+line-height:30px;
+}
+
+h3{
+font-size:22px;
+line-height:30px;
+}
+
+h4{
+font-size:18px;
+line-height:27px;
+}
+
+h5,h6{
+font-size:16px;
+line-height:24px;
+}
+
+ul{
+list-style-type:none;
+margin-left:0px;
+}
+
+.color{
+color:#f65314;
+}
+
+a, a:visited{
+color:#1570a6;
+}
+
+a:hover{
+color:#177bb6;
+text-decoration:none;
+}
+
+a:hover,a:active,a:focus {
+outline: 0;
+}
+
+.form-horizontal{
+margin:20px 0px 10px 0px;
+}
+
+.form-horizontal input[type="text"],.form-horizontal input[type="password"], .form-horizontal textarea{
+font-size:12px;
+}
+
+.form-horizontal input[type="submit"], .form-horizontal button{
+font-size:12px;
+}
+
+.form-horizontal .control-label {
+width: 80px;
+font-size:12px;
+}
+
+.form-horizontal .controls {
+margin-left: 100px;
+}
+
+.form-horizontal .controls:first-child {
+*padding-left: 100px;
+}
+
+.form-horizontal .form-actions {
+padding-left: 100px;
+}
+
+.form-actions {
+padding: 10px 20px 11px;
+background:transparent;
+border-top:0px;
+}
+
+:focus {outline:none;}
+
+::-moz-focus-inner {border:0;}
+
+
+/* Image alignment*/
+
+.alignleft, img.alignleft {
+margin-right: 8px;
+margin-top:5px;
+display: inline;
+float: left;
+}
+
+.alignright, img.alignright {
+margin-left: 8px;
+margin-top:5px;
+display: inline;
+float: right;
+}
+
+.aligncenter, img.aligncenter {
+margin-right: auto;
+margin-left: auto;
+display: block;
+clear: both;
+}
+
+/* Header */
+
+header{
+padding:5px 0px 5px 0px;
+}
+
+header .logo{
+margin:10px 0px;
+}
+
+header .logo a, header .logo a:visited, header .logo a:hover{
+color:#555;
+text-decoration:none;
+}
+
+header .lmeta{
+color:#777;
+}
+
+header .social{
+margin-top:20px;
+}
+
+/* Navigation */
+
+.navbar{
+text-transform:lowercase;
+}
+
+.navbar-inner > .container{
+width:940px;
+}
+
+.navbar-inner{
+border-radius:0px;
+background: #fff !important;
+background-image: none;
+background-repeat: no-repeat;
+filter: none !important;
+border-top:1px solid #fafafa !important;
+border-bottom:3px solid #f3f3f3 !important;
+border-left:0px !important;
+border-right:0px !important;
+box-shadow:none;
+}
+
+.navbar .btn{
+background:#eee !important;
+margin:0px;
+padding:10px;
+color:#777 !important;
+text-shadow:none !important;
+border:none;
+border-radius:0px;
+}
+
+.navbar .btn:hover{
+background:#fafafa !important;
+color:#555;
+}
+
+.navbar .caret{
+border-top-color:#ccc !important;
+border-bottom-color:#ccc !important;
+}
+
+.navbar .nav > li > a{
+background: #fff;
+padding:12px 15px 12px;
+color:#777 !important;
+text-shadow:none !important;
+font-size:13px !important;
+}
+
+.navbar .nav > li > a:hover{
+background:#eee !important;
+color:#555 !important;
+}
+
+.navbar .nav .active > a,
+.navbar .nav .active > a:hover,
+.navbar .nav .active > a:focus {
+color: #777;
+box-shadow:none;
+background: #fff !important;
+}
+
+.dropdown-toggle{
+background: #fff !important;
+}
+
+.nav-collapse a{
+font-weight:normal !important;
+text-shadow:none !important;
+border-radius:0px !important;
+}
+
+.dropdown-menu{
+background:#fff !important;
+border-radius:0px !important;
+box-shadow:none !important;
+padding:0px 0px;
+margin:0px;
+border:1px solid #eee;
+border-top:0px;
+}
+
+.dropdown-menu a{
+background:#fafafa !important;
+padding:8px !important;
+color:#555 !important;
+text-shadow:none !important;
+font-size:13px !important;
+}
+
+.dropdown-menu a:hover,.dropdown-menu a:focus{
+filter:none !important;
+background:#fff !important;
+color:#777 !important;
+border-radius:0px !important;
+}
+
+.dropdown-menu::after, .dropdown-menu::before{
+border:none !important;
+}
+
+/* Posts */
+
+.content h3{
+color:#888;
+border-bottom:1px solid #eee;
+margin-bottom:8px;
+font-size:18px;
+text-transform:lowercase;
}
-body {
- padding-top: 60px;
+.content h3 span{
+border-left:3px solid #f65314;
+padding-left:7px;
+padding-bottom:5px;
}
-section {
- overflow: auto;
+.entry{
+margin-top:20px;
+padding-bottom:20px;
+margin-bottom:30px;
+border-bottom:1px solid #eee;
}
-textarea {
- resize: vertical;
+.entry p{
+margin:5px 0px;
}
-.center {
- text-align: center;
+.entry h2 a, .entry h2 a:visited{
+color:#115e8b;
}
-.center h1 {
- margin-bottom: 10px;
+.entry h2 a:hover{
+color:#1570a6;
}
-/* typography */
+.entry .thumb{
+float:left;
+width:130px;
+margin-top:8px;
+margin-right:8px;
+}
-h1, h2, h3, h4, h5, h6 {
- line-height: 1;
+.entry .meta{
+color:#888;
+font-size:12px;
+line-height:23px;
+margin:2px;
}
-h1 {
- font-size: 3em;
- letter-spacing: -2px;
- margin-bottom: 30px;
- text-align: center;
+.entry .meta a, .entry .meta a:visited{
+color:#666;
}
-h2 {
- font-size: 1.7em;
- letter-spacing: -1px;
- margin-bottom: 30px;
- text-align: center;
- font-weight: normal;
- color: #999;
+.entry .meta a:hover{
+color:#555;
}
-p {
- font-size: 1.1em;
- line-height: 1.7em;
+.content .comment-box{
+margin:5px 0px;
+padding:10px;
+background:#fafafa;
+border:1px solid #eee;
}
-#logo {
- float: left;
- margin-right: 10px;
- font-size: 1.7em;
- color: #fff;
- text-transform: uppercase;
- letter-spacing: -1px;
- padding-top: 9px;
- font-weight: bold;
- line-height: 1;
+.content .cmeta{
+font-size:12px;
}
-#logo:hover {
- color: #fff;
- text-decoration: none;
+.comments li ul{
+margin-left:15px;
}
-/* footer */
+/* Sidebar */
-footer {
- margin-top: 45px;
- padding-top: 5px;
- border-top: 1px solid #eaeaea;
- color: #999;
+.widget li{
+padding:2px 0px;
+border-bottom:1px dotted #ddd;
+margin:2px 0px;
+}
+
+.widget{
+border-bottom:1px solid #fafafa;
+margin-bottom:10px;
+}
+
+/* Pagination */
+
+.pagination {
+clear:both;
+padding:6px 0;
+line-height:17px;
+font-size:13px;
+}
+
+.pagination span, .pagination a {
+display:block;
+float:left;
+margin: 2px 2px 2px 0;
+padding:5px 8px;
+text-decoration:none;
+width:auto;
+color:#666;
+background: #fff;
+border:1px solid #eee;
+font-weight:normal;
+}
+
+.pagination a:hover{
+color:#fff;
+background: #115e8b;
+}
+
+.pagination .current{
+padding:5px 8px;
+color:#fff;
+background: #115e8b;
}
-footer a {
- color: #555;
-}
+/* Footer */
-footer a:hover {
- color: #222;
+footer{
+margin-top:25px;
+background:#f8f8f8;
+color:#555;
+padding:20px 0px 0px 0px;
+border-top:2px solid #eee;
}
-footer small {
- float: left;
+footer a, footer a:visited{
+color:#777;
}
-footer ul {
- float: right;
- list-style: none;
+footer a:hover{
+color:#555;
}
-footer ul li {
- float: left;
- margin-left: 10px;
+footer .fwidget h4{
+margin-bottom:5px;
+}
+
+footer .fwidget li{
+padding:2px 0px;
+border-bottom:1px dotted #ddd;
+margin:2px 0px;
+}
+
+footer .copy{
+padding-top:10px;
+margin-top:10px;
+border-top:1px solid #ddd;
+}
+
+/* Responsive */
+
+@media (max-width: 480px){
+ .dropdown-menu a{
+ background:#fff !important;
+ border-bottom:none !important;
+ }
+}
+
+@media (max-width: 767px){
+ header .logo{
+ text-align:center;
+ }
+ header .social{
+ text-align:center;
+ margin-top:5px;
+ margin-bottom:10px;
+ }
+ .navbar,footer{
+ margin-left:-20px;
+ margin-right:-20px;
+ }
+ .navbar .nav{
+ border:0px !important;
+ }
+ .navbar .nav > li > a{
+ border:0px !important;
+ }
+ .dropdown-menu a{
+ background:#fff !important;
+ border-bottom:none !important;
+ }
+ footer{
+ margin-top:20px;
+ padding-left:20px;
+ padding-right:20px;
+ }
+ footer .fwidget{
+ margin-bottom:20px;
+ }
+ .sidebar{
+ margin-top:20px;
+ }
+ header .logo img{
+ max-width:200px;
+ margin:0 auto;
+ }
+}
+
+@media (min-width: 768px) and (max-width: 979px){
+ .navbar .nav{
+ border:0px !important;
+ }
+ .navbar .nav > li > a{
+ border:0px !important;
+ }
+ .dropdown-menu a{
+ border-bottom:none !important;
+ }
+}
+
+@media (max-width: 979px){
+
}
/* star-rating */
View
6 app/assets/stylesheets/custom.js.coffee
@@ -0,0 +1,6 @@
+$ ->
+ flashCallback = ->
+ $(".alert").fadeOut(1500)
+ $(".alert").bind 'click', (ev) =>
+ $(".alert").fadeOut()
+ setTimeout flashCallback, 1500
View
4 app/controllers/admin_controller.rb
@@ -11,8 +11,6 @@ def index
@num_published = @num_state3 + @num_state4
@num_users = User.all.count
- @num_users_active30days = User.where('last_sign_in_at > ?', 30.days.ago).count
- @num_users_created30days = User.where('created_at > ?', 30.days.ago).count
end
def dreams
@@ -43,7 +41,7 @@ def dreams
def accept
@dream = Dream.find(params[:id])
- # only submitted dreams can be accepted
+ # submit dream to be accepted
if @dream.state == 1
@dream.state = 3
flash[:notice] = 'The dream has been accepted.'
View
9 app/controllers/dreams_controller.rb
@@ -5,7 +5,9 @@ class DreamsController < ApplicationController
# GET /dreams
# GET /dreams.json
def index
- @dreams = Dream.where(:state => '1').search(params[:search]).order('accepted desc').paginate(:page => params[:page], :per_page => 10)
+ @dreams = Dream.where(:state => '4').search(params[:search]).order('accepted desc').paginate(:page => params[:page], :per_page => 10)
+ @recent_dreams = Dream.recent
+
respond_to do |format|
format.html # index.html.erb
@@ -14,7 +16,8 @@ def index
end
def all
- @dreams = Dream.where(:state => ['3', '4']).paginate(:page => params[:page], :per_page => 10)
+ @dreams = Dream.where(:state => ['3', '4']).paginate(:page => params[:page], :per_page => 10)
+ @recent_dreams = Dream.recent
respond_to do |format|
format.html { render 'index' }
@@ -145,6 +148,8 @@ def destroy
end
end
+
+
def about
end
end
View
3 app/helpers/application_helper.rb
@@ -1,2 +1,3 @@
module ApplicationHelper
-end
+
+end
View
5 app/models/dream.rb
@@ -14,6 +14,7 @@ class Dream < ActiveRecord::Base
validates :message, :length => { :maximum => 5000 }
validates :state, :presence => true, :numericality => true, :inclusion => { :in => 0..4 }
+
def count_ratings
self.ratings.all.count
end
@@ -31,6 +32,10 @@ def self.search(search)
end
end
+def self.recent
+ where('created_at > ?', Time.now-30.days.ago).order("created_at desc").first(5)
+end
+
protected
def record_not_found
flash[:error] = 'The dream you requested could not be found.'
View
3 app/views/admin/dreams.html.erb
@@ -1,5 +1,4 @@
-<section id = "admin">
-<h2>Admin: <%= @state_name.capitalize %> Dreams</h2>
+<h3><span>Admin: <%= @state_name.capitalize %> Dreams</span></h3>
<% @dreams.each do |dream| %>
<p>
View
47 app/views/admin/index.html.erb
@@ -1,24 +1,27 @@
-<section id = "admin">
- <h2>Admin: Dashboard</h2>
+<h3><span>Admin Dashboard</span></h3>
<h3>Dreams</h3>
- <p>
- Statistics:
- <%=pluralize(@num_published, "total published dreams")%>,
- <%= link_to pluralize(@num_state4, "featured dream"), dreams_admin_index_path + '?state=4' %>,
- <%= link_to pluralize(@num_state3, "standard dream"), dreams_admin_index_path + '?state=3' %>,
- <%= link_to pluralize(@num_state2, "rejected dream"), dreams_admin_index_path + '?state=2' %>,
- <%= link_to pluralize(@num_state1, "submitted dream"), dreams_admin_index_path + '?state=1' %>,
- <%= link_to pluralize(@num_state0, "private dream"), dreams_admin_index_path + '?state=0' %>
- <br />
- <% if @num_state1 > 0 %>
- <b>There are <%= link_to pluralize(@num_state1, "submitted dream") , dreams_admin_index_path + '?state=1' %> waiting for approval!</b>
- <% end %>
- </p>
-
- <h3>Users</h3>
- <p>
- Statistics: <%=pluralize(@num_users, "user") %> total, <%= pluralize(@num_users_active30days, "user") %> have been signed-in within the last 30 days.<br />
- New users: <%= pluralize(@num_users_created30days, "user") %> have been created within the last 30 days.
- </p>
-</section>
+ <div class="meta"><i class="icon-signal"></i>
+ Statistics:
+ <%=pluralize(@num_published, "total published dreams")%>,
+ <%= link_to pluralize(@num_state4, "featured dream"), dreams_admin_index_path + '?state=4' %>,
+ <%= link_to pluralize(@num_state3, "standard dream"), dreams_admin_index_path + '?state=3' %>,
+ <%= link_to pluralize(@num_state2, "rejected dream"), dreams_admin_index_path + '?state=2' %>,
+ <%= link_to pluralize(@num_state1, "submitted dream"), dreams_admin_index_path + '?state=1' %>,
+ <%= link_to pluralize(@num_state0, "private dream"), dreams_admin_index_path + '?state=0' %>
+ <br />
+ <% if @num_state1 > 0 %>
+ <b>There are <%= link_to pluralize(@num_state1, "submitted dream") , dreams_admin_index_path + '?state=1' %> waiting for approval!</b>
+ <% end %>
+ </div><br>
+
+ <h3>Users</h3>
+ <div class="meta"><i class="icon-signal"></i>
+ Statistics:
+ <%=pluralize(@num_users, "user") %> total,
+ <%= pluralize(@num_users_active30days, "user") %> have been signed-in within the last 30 days.<br />
+ <div class="meta"><i class="icon-user"></i>
+ New users:
+ <%= pluralize(@num_users_created30days, "user") %> have been created within the last 30 days.
+ </div>
+ </div>
View
34 app/views/devise/registrations/edit.html.erb
@@ -1,31 +1,19 @@
-<h2>Edit Your Profile</h2>
+<div class="comments well">
+ <h3><span class="comment-heading">Edit Your Profile</span></h3>
-<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
+<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>
- <p><%= f.label 'name', 'Full Name' %><span>(displayed in your dreams / comments)</span><br />
- <%= f.text_field :fullname %></p>
+ <%= f.input :email %>
+ <%= f.input :fullname, :label => 'Name displayed to readers' %>
+ <%= f.input :weburl, :label => 'Your website', :placeholder => 'www.yourwebsite.com' %>
+ <%= f.input :shortbio, :label => 'Tell us a bit about yourself' %>
+ <%= f.input :password %>
+ <%= f.input :password_confirmation %>
- <p><%= f.label 'about', 'About me' %><span>(displayed in your dreams)</span><br />
- <%= f.text_area :shortbio, :size => "100%x5", :class => "fullwidth" %></p>
-
- <p><%= f.label 'url', 'Your Homepage or Blog' %><span>(displayed in your dreams / comments)</span><br />
- <%= f.url_field :weburl %></p>
-
- <p><%= f.label :password %> <span>(leave blank if you don't want to change it)</span><br />
- <%= f.password_field :password %></p>
-
- <p><%= f.label :password_confirmation %><br />
- <%= f.password_field :password_confirmation %></p>
-
- <p><%= f.label :current_password %> <span>(we need your current password to confirm your changes)</span><br />
- <%= f.password_field :current_password %></p>
-
- <div><%= f.submit "Update" %></div>
+ <div><%= f.submit "Update My Profile", class: "btn" %></div>
<% end %>
-<h3>Cancel my account</h3>
-
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>
-<%= link_to "Back", :back %>
+</div>
View
23 app/views/devise/registrations/new.html.erb
@@ -1,21 +1,18 @@
-<h2>Sign up</h2>
+<div class="comments well">
+ <h3><span class="comment-heading">Sign Up</span></h3>
-<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
+<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
- <div><%= f.label :email %><br />
- <%= f.email_field :email %></div>
- <div><%= f.label :fullname %><br />
- <%= f.text_field :fullname %></div>
+ <%= f.input :email %>
+ <%= f.input :fullname %>
+ <%= f.input :password %>
+ <%= f.input :password_confirmation %>
- <div><%= f.label :password %><br />
- <%= f.password_field :password %></div>
-
- <div><%= f.label :password_confirmation %><br />
- <%= f.password_field :password_confirmation %></div>
-
- <div><%= f.submit "Sign up" %></div>
+ <div><%= f.submit "Sign up", class: "btn" %></div>
<% end %>
<%= render "devise/shared/links" %>
+
+</div>
View
17 app/views/devise/sessions/new.html.erb
@@ -1,17 +1,18 @@
-<h2>Sign in</h2>
+<div class="comments well">
+ <h3><span class="comment-heading">Sign in</span></h3>
-<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
- <div><%= f.label :email %><br />
- <%= f.email_field :email %></div>
+<%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
- <div><%= f.label :password %><br />
- <%= f.password_field :password %></div>
+ <%= f.input :email %>
+ <%= f.input :password %>
<% if devise_mapping.rememberable? -%>
- <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
+ <div><%= f.check_box :remember_me %><%= f.label :remember_me %></div>
<% end -%>
- <div><%= f.submit "Sign in" %></div>
+ <div><%= f.submit "Sign in", class: "btn" %></div>
<% end %>
<%= render "devise/shared/links" %>
+
+</div>
View
41 app/views/dreams/_form.html.erb
@@ -1,7 +1,6 @@
-<%= form_for(@dream) do |f| %>
+<%= simple_form_for(@dream) do |f| %>
<% if @dream.errors.any? %>
<div id="error_explanation">
- <h2><%= pluralize(@dream.errors.count, "error") %> prohibited this dream from being saved:</h2>
<ul>
<% @dream.errors.full_messages.each do |msg| %>
@@ -12,38 +11,22 @@
<% end %>
<% if @dream.state < 3 %>
- <div class="field">
- <label for="dream_title">Title</label><br />
- <%= f.text_field :title, :size => "100%", :class => "fullwidth" %>
- </div>
- <div class="field">
- <label for="dream_teaser">Teaser</label><br />
- <%= f.text_area :teaser, :size => "100%x5", :class => "fullwidth" %>
- </div>
+
+ <%= f.input :title %>
+ <%= f.input :teaser %>
+
<% else %>
-
- <div class="field">
- <label for="dream_title">Title</label><br />
- <%= f.text_field :title, :size => "100%", :class => "fullwidth" %>
- </div>
- <div class="field">
- <label for="dream_teaser">Teaser </label><br />
- <%= f.text_area :teaser, :size => "100%x5", :class => "fullwidth" %>
- </div>
+
+ <%= f.input :title %>
+ <%= f.input :teaser %>
+
<% end %>
- <div class="field">
- <label for="dream_body">Your dream</label><br />
- <%= f.text_area :body, :size => "100%x40", :class => "fullwidth" %>
- </div>
- <div class="field">
- <label for="dream_body">Changelog of this dream</label><br />
- <%= f.text_area :changelog, :size => "100%x10", :class => "fullwidth" %>
- </div>
+ <%= f.input :body %>
- <div class="actions">
- <%= f.submit %>
+ <div>
+ <%= f.submit "Submit", class: "btn" %>
<%= link_to 'View this dream', @dream %>
<%= link_to 'Return to my dreams', mydreams_dreams_path %>
</div>
View
17 app/views/dreams/about.html.erb
@@ -1,14 +1,11 @@
-<div class="center hero-unit">
- <h1>About Lucidly</h1>
+<h3><span>about</span></h3>
+ <div class="entry">
+ <div class="matter">
+ <h5>A dream journal.</h5>
+ <p>Lucidly is a place to record your dreams, lucid or otherwise. You can share your dreams for publication on the front page or choose to keep them private for your records. Lucidly is completely free to use and all content is published under a non-commercial license.</p>
+ </div>
+ </div>
- <h4>
- Lucidly is a dream journal.
- </h4>
- <% if user_signed_in? %>
- <% else %>
- <%= link_to "Sign up", new_user_registration_path, class: "btn btn-large btn-primary" %>
- <% end %>
-</div>
View
30 app/views/dreams/index.html.erb
@@ -1,16 +1,24 @@
-<section id = "dreams">
- <% @dreams.each do |dream| %>
- <ul class="stars floatstars">
- <li class="yellowstars" style="width: <%= dream.avg_rating * 25 %> px !important;"></li>
- </ul>
- <div class = "title"><%= link_to dream.title, dream %></div>
- <div class = "byline"><%= dream.created_at.strftime("%B %d, %Y") %></div>
- <div class = "teaser"><%= dream.teaser %></div>
- </dream>
+<h3><span><%= controller.action_name.capitalize %> dreams</span></h3>
+ <div class="entry"><% @dreams.each do |dream| %>
+ <div class="matter">
+ <h2><%= link_to dream.title, dream %></h2>
+ <div class="meta"><i class="icon-calendar"></i> <%= dream.created_at.strftime("%B %d, %Y") %> - <i class="icon-folder-open"></i> tag, tag - <i class="icon-comment"></i><%= dream.comments.count %></div>
+ <p><%= dream.teaser %></p>
+ </br>
+ </div>
<% end %>
+
+ </div>
+
+
<%= will_paginate @dreams %>
-</section>
+ </div>
+
+ <div class="span4">
+ <%= render 'layouts/sidebar' %>
+ </div>
+
+
-<br />
View
57 app/views/dreams/mydreams.html.erb
@@ -1,60 +1,47 @@
-<h2>Manage your dreams</h2>
-
-<p><%= link_to 'Start writing a new dream', new_dream_path %></p>
+<h3><span>Manage your dreams</span></h3>
-<section id="mydreams">
-
- <% if !@mydreams.empty? %>
-
- <% @mydreams.each do |dream| %>
-
- <dream class="mydream">
-
- <div class="title"><%= dream.title %></div>
- <div class="created">
- Created / Last updated: <%= dream.created_at.strftime("%B %d, %Y") %> / <%= dream.updated_at.strftime("%B %d, %Y") %>
+<p><%= link_to 'Record new dream', new_dream_path, class: "btn" %></p>
+
+<div class="entry"><% @mydreams.each do |dream| %>
+ <div class="matter">
+ <h2><%= link_to dream.title, dream %></h2>
+ <div class="meta"><i class="icon-calendar"></i> Created: <%= dream.created_at.strftime("%B %d, %Y") %> / Updated: <%= dream.updated_at.strftime("%B %d, %Y") %>
</div>
- <!-- the states: 0...private, 1...submitted, 2...rejected, 3...full dream, 4...featured dream -->
+ <!-- the states: 0...private, 1...submitted, 2...rejected, 3...standard dream, 4...featured dream -->
<% if dream.state == 0 %>
- <div class="state">Current status: Private</div>
+ <div class="meta"><i class="icon-eye-close"></i> Current status: Private</div>
<% end%>
<% if dream.state == 1 %>
- <div class="state">Current status: Submitted (<%= dream.submitted.strftime("%B %d, %Y") %>)</div>
+ <div class="meta"><i class="icon-refresh"></i> Current status: Submitted on <%= dream.submitted.strftime("%B %d, %Y") %></div>
<% end%>
<% if dream.state == 2 %>
- <div class="state">Current status: Rejected (<%= dream.submitted.strftime("%B %d, %Y") %>)</div>
- <div class="reject">Please read the comment, review your dream and submit it again!</div>
- <div class="rejectmsg"><%= dream.message %></div>
+ <div class="meta"><i class="icon-flag"></i> Current status: Rejected on <%= dream.submitted.strftime("%B %d, %Y") %></div>
+ <div class="meta"><i class="icon-wrench"></i> Please read the comment, review your dream and submit it again!</div>
+ <div class="meta"><i class="icon-envelope"></i> <%= dream.message %></div>
<% end%>
<% if dream.state == 3 %>
- <div class="state">Current status: Accepted and published as a standard dream (<%= dream.accepted.strftime("%B %d, %Y") %>)</div>
+ <div class="meta"><i class="icon-thumbs-up"></i> Current status: Accepted and published as a standard dream on<%= dream.accepted.strftime("%B %d, %Y") %></div>
<% end %>
<% if dream.state == 4 %>
- <div class="state">Current status: Accepted and published as a <b>featured dream</b> (<%= dream.accepted.strftime("%B %d, %Y") %>)</div>
+ <div class="meta"><i class="icon-thumbs-up"></i> Current status: Accepted and published as a <b>featured dream</b> on <%= dream.accepted.strftime("%B %d, %Y") %></div>
<% end %>
- <div class="actions">
- <span class="show"><%= link_to 'View', dream %></span>
- <span class="edit"><%= link_to 'Edit', edit_dream_path(dream) %></span>
+ <div>
+ <span><%= link_to 'Edit dream', edit_dream_path(dream), class: "btn btn-info" %></span>
<% if (dream.state == 0) or (dream.state == 2) %>
- <span><%= link_to "Submit now", submit_dream_path(dream), :method => :put %></span>
+ <span><%= link_to "Submit now", submit_dream_path(dream), :method => :put, class: "btn btn-success" %></span>
<% end %>
<% if dream.state < 3 %>
- <span class="delete"><%= link_to 'Delete', dream, :confirm => 'Are you sure?', :method => :delete %></span>
+ <span><%= link_to 'Delete', dream, :confirm => 'Are you sure?', :method => :delete, class: "btn btn-danger" %></span>
<% end %>
- </div>
+ </div><br>
- </dream>
+ </div>
<% end %>
-
- <% else %>
- <p>You have not written any dreams yet. Start to contribute: <%= link_to 'New dream', new_dream_path %></p>
- <% end %>
-
-</section>
+</div>
View
5 app/views/dreams/new.html.erb
@@ -1,5 +1,6 @@
-<h1>New dream</h1>
+<div class="comments well">
+ <h3><span class="comment-heading">New Dream</span></h3>
<%= render 'form' %>
-<%= link_to 'Back', dreams_path %>
+</div>
View
104 app/views/dreams/show.html.erb
@@ -1,83 +1,63 @@
-<section id="dreamheader">
- <h2>
- <%= @dream.title %>
- <ul class="stars floatstars">
- <li class="yellowstars" style="width: <%= @dream.avg_rating * 25 %>px !important;"></li>
- <li class="text"><%= @dream.avg_rating %> average from <%= pluralize(@dream.count_ratings, "vote") %></li>
- </ul>
- </h2>
- <div class="byline">written by <%= @dream.user.fullname %></div>
-
- <h3><%= @dream.teaser %></h3>
-</section>
+<h3><span><%= @dream.title %></span></h3>
-<section id="dreambody" class="textile">
- <%= @dream.body %>
-</section>
+ <div class="entry">
+ <div class="matter">
+ <div class="meta"><i class="icon-calendar"></i><%= @dream.created_at.strftime("%B %d, %Y") %> - <i class="icon-folder-open"></i> tag, tag - <i class="icon-comment"></i><%= @dream.comments.count %></div>
+ <div class="comment-author"><strong>By <%=@dream.user.fullname %></strong></div><br>
-<% # comments for published dreams only %>
-<% if @dream.state == 1 %>
+ <p><%= @dream.body %></p>
+ </div>
+ </div>
- <section id="rating">
- <% if user_signed_in? %>
- <%= form_for [@dream, @rating_currentuser] do |f| %>
- <div id="ratingbox">
- <ul id="ratingbuttons">
- <li><%= f.radio_button :stars, "5" %><span>Excellent</span></li>
- <li><%= f.radio_button :stars, "4" %><span>Very Good</span></li>
- <li><%= f.radio_button :stars, "3" %><span>Good</span></li>
- <li><%= f.radio_button :stars, "2" %><span>Average</span></li>
- <li><%= f.radio_button :stars, "1" %><span>Poor</span></li>
- </ul>
- <div class="center"><%= f.submit "Rate this dream" %></div>
- </div>
- <% end %>
- <% else %>
- <div id="ratingbox"><%= link_to "Sign in", new_user_session_path %> to rate this dream</div>
- <% end %>
- </section>
+<% #if @dream.state == 1 %>
- <section id="comments">
+ <div class="comments well">
+ <h3><span class="comment-heading">Comments - <%= @dream.comments.count %></span></h3>
<% @comments.each do |comment| %>
- <dream class="comment">
- <div class="commentbody">
- <div class="commenthead">
- <%= comment.user.fullname %> - <%=time_ago_in_words(comment.created_at)%> ago
- <% # delete link only for comments written by this particular user %>
- <% if user_signed_in? and comment.user_id == current_user.id %>
- <span><%= link_to 'delete', dream_comment_path(@dream, comment), :confirm => 'Are you sure?', :method => :delete, :class => "" %></span>
- <% end %>
+ <div class="media-list">
+ <div class="comment byuser comment-author-admin bypostauthor even thread-even depth-1" id="li-comment-6">
+ <div id="comment-6" class="comment-box">
+ <div class="comment-author"><strong><%= comment.user.fullname %></strong></div>
+ <div class="cmeta"><%=time_ago_in_words(comment.created_at)%> ago</div>
+ <div class="clearfix"></div>
+ <p><%= comment.body %></p>
+ </div>
</div>
- <div><%= comment.body %></div>
- </div>
- </dream>
+ </div>
+ <% # delete link only for comments written by this particular user %>
+ <% if user_signed_in? and comment.user_id == current_user.id %>
+ <span><%= link_to 'delete', dream_comment_path(@dream, comment), :confirm => 'Are you sure?', :method => :delete, :class => "" %></span>
+ <% end %>
<% end %>
+ </div>
+
+ <br>
- <% # add a new comment %>
- <dream class="comment newcomment">
+ <div class="comments well">
+ <h3><span class="comment-heading">leave a comment</span></h3>
<% if user_signed_in? %>
- <div class="commentbody">
+
<% if current_user.fullname == nil or current_user.fullname == '' %>
- <div class="commenthead">
+ <div class="comment-author"><strong>
Please complete your <%= link_to "profile", edit_user_registration_path %> before posting comments.
- </div>
+ </strong></div>
<% else %>
- <div class="commenthead">
- <%= current_user.fullname %>
- </div>
- <div>
- <%= form_for [@dream, current_user.comments.new] do |f| %>
- <%= f.text_area :body, :size => "100%x20", :class => "fullwidth" %>
- <%= f.submit "Add Comment" %>
+ <div class="comment-author"><strong><%= current_user.fullname %></div><br>
+ <%= simple_form_for [@dream, current_user.comments.new] do |f| %>
+ <%= f.text_area :body %>
+
+ <div><%= f.submit "Add Comment", class: "btn" %></div>
<% end %>
</div>
<% end %>
- </div>
- <% else %>
+
+ <% #else %>
<div class="signin">
Please <%= link_to "sign in", new_user_session_path %> before posting a comment.
</div>
<% end %>
</dream>
</section>
-<% end %>
+<% #end %>
+
+
View
22 app/views/layouts/_footer.html.erb
@@ -1,10 +1,12 @@
- <footer id="page_footer">
- <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
- <img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" />
- </a>
- <br />
- All content is licensed under
- <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
- Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
- </a>.
- </footer>
+<footer>
+ <div class="container">
+ <div class="row">
+ <div class="span12">
+ <p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
+ lucidly <%= Time.now.year %> - Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.</a></p>
+ </div>
+ </div>
+ <div class="clearfix"></div>
+ </div>
+</footer>
+
View
21 app/views/layouts/_header.html.erb
@@ -1,26 +1,21 @@
<header class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
- <%= link_to "Lucidly", '/', id: "logo" %>
<nav>
- <ul class="nav pull-right">
- <form class="navbar-search">
- <%= form_tag all_dreams_path, :method => 'get' do %>
- <%= text_field_tag :search, params[:search] %>
- <% end %>
- </form>
+ <ul class="nav pull-left">
+ <li><h1><%= link_to "Lucidly", '/', id: "logo" %></h1><li>
+ <br>
+ </ul>
+ <ul class="nav pull-right">
<li><%= link_to "Featured Dreams", root_path %></li>
<li><%= link_to "All Dreams", all_dreams_path %></li>
-
-
<% if user_signed_in? %>
<li><%= link_to "My Dreams", mydreams_dreams_path %></li>
- <li id="fat-menu" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= current_user.email %> <b class="caret"></b></a>
+ <li id="fat-menu" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user"></i> <%= current_user.email %> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><%= link_to "Profile", edit_user_registration_path %></li>
- <li class="divider"></li>
<li><%= link_to "Sign out", destroy_user_session_path, method: "delete" %></li>
<% else %>
<li><%= link_to "About", about_dreams_path %></li>
@@ -33,7 +28,3 @@
</div>
</header>
-
-
- <% #submit_tag "Search Dreams", :name => nil, :class => "search-query" %>
-
View
32 app/views/layouts/_sidebar.html.erb
@@ -0,0 +1,32 @@
+ <div class="span4">
+ <!-- Sidebar -->
+ <div class="sidebar">
+ <!-- Widget -->
+ <div class="widget">
+ <h3><span>Search</span></h3>
+ <div class="form">
+ <%= form_tag all_dreams_path, :method => 'get' do %>
+ <%= text_field_tag :search, params[:search] %>
+ <%= submit_tag "Search", :name => 'nil', :class => "btn" %>
+ <% end %>
+ </div>
+ </div>
+
+ <div class="widget">
+ <h3><span>Recent</span></h3>
+ <ul>
+ <% @recent_dreams.each do |dream| %>
+ <li><%= link_to dream.title, dream_path(dream) %></li>
+ <% end %>
+ </ul>
+ </div>
+
+ <div class="widget">
+ <h3><span>Tags</span></h3>
+ <ul>
+ <li>still need to set tags up - railscast?</li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
View
25 app/views/layouts/application.html.erb
@@ -10,16 +10,21 @@
<body>
<%= render 'layouts/header' %>
- <div class="container">
- <section id="maincontainer">
- <section id="flash">
- <% flash.each do |key, value| %>
- <div class="flash <%= key %>"><%= value %></div>
+ <div class="content">
+ <div class="container">
+ <div class="row">
+ <div class="span8">
+ <% flash.each do |name, msg| %>
+ <div class="alert alert-<%= name == :notice ? "success" : "error" %>">
+ <%= msg %>
+ </div>
<% end %>
- </section>
- <%= yield %>
+ <%= yield %>
+ </div>
+ </div>
</div>
-
- <%= render 'layouts/footer' %>
</body>
-</html>
+ <%= render 'layouts/footer' %>
+
+</html>
+

0 comments on commit 5bcd18c

Please sign in to comment.