Skip to content

Commit

Permalink
setup postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
enterteg committed Mar 26, 2016
1 parent c5b9285 commit 53e247b
Show file tree
Hide file tree
Showing 71 changed files with 30 additions and 21 deletions.
12 changes: 7 additions & 5 deletions app/assets/stylesheets/posts.sass
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ section
&.sample
padding: 35px 65px 25px
max-width: 620px
outline: 1px dashed rgba(180,0,200,0.5)
box-shadow: 0px 0px 50px rgba(0,0,0,0.05)
z-index: 10
&:after
Expand All @@ -95,14 +94,17 @@ section
border-style: solid
border-color: rgba(121,203,250,0.65) white
&.travels
outline: 1px dashed rgba(0,253,150,0.65)
&:before
border-color: rgba(250,203,250,0.65) white
border-color: rgba(0,253,150,0.65) white
&.food
outline: 1px dashed rgba(250,53,250,0.65)
&:before
border-color: rgba(250,53,250,0.65) white
&.life
outline: 1px dashed rgba(250,150,100,0.65)
&:before
border-color: rgba(0,53,250,0.65) white
border-color: rgba(250,130,100,0.65) white


header
Expand Down Expand Up @@ -164,11 +166,11 @@ section
#roll_map
position: relative
display: block
opacity: 0.15
opacity: 0.1
width: 160%
+transform(translateX(-18%))
z-index: -4
top: -220px
top: -140px
height: 0px
#map_form
max-width: 1100px
Expand Down
2 changes: 1 addition & 1 deletion app/models/post.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Post < ActiveRecord::Base
validate :validate_travel_pin
belongs_to :category
has_many :photos
has_many :photos, dependent: :destroy

default_scope { order(created_at: :desc)}

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
=link_to 'Logout', logout_path, class: 'button logout'
- else
.social
=link_to 'fb-profile' do
=link_to 'https://www.facebook.com/dominika.jagiela?fref=ts' do
=image_tag 'fb-icon.png'
=link_to 'gmail' do
=image_tag 'gmail-icon.png'
Expand Down
1 change: 1 addition & 0 deletions app/views/posts/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.clear
.submit
= f.submit

= f.number_field :locX, type: 'hidden'
= f.number_field :locY, type: 'hidden'

14 changes: 7 additions & 7 deletions app/views/public/about.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
.desc
= @post.desc.html_safe

= link_to :back do
.button.edit back
- if current_user
= link_to edit_post_path(@post) do
.button.edit edit
= link_to @post, method: 'delete', data: {confirm: 'Are you sure?'} do
.button.edit destroy
= link_to :back do
.button.edit back
- if current_user
= link_to edit_post_path(@post) do
.button.edit edit
= link_to @post, method: 'delete', data: {confirm: 'Are you sure?'} do
.button.edit destroy
18 changes: 11 additions & 7 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20160323162218) do
ActiveRecord::Schema.define(version: 20160322161631) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "categories", force: :cascade do |t|
t.string "name"
Expand All @@ -29,19 +32,19 @@
t.datetime "updated_at", null: false
end

add_index "photos", ["post_id"], name: "index_photos_on_post_id"
add_index "photos", ["post_id"], name: "index_photos_on_post_id", using: :btree

create_table "posts", force: :cascade do |t|
t.string "title"
t.text "desc"
t.integer "category_id"
t.decimal "locX", precision: 6, scale: 3
t.decimal "locY", precision: 6, scale: 3
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "locX"
t.integer "locY"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

add_index "posts", ["category_id"], name: "index_posts_on_category_id"
add_index "posts", ["category_id"], name: "index_posts_on_category_id", using: :btree

create_table "users", force: :cascade do |t|
t.string "login"
Expand All @@ -50,4 +53,5 @@
t.datetime "updated_at", null: false
end

add_foreign_key "photos", "posts"
end
2 changes: 2 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)

Category.create([{id: 1, name: 'travels'}, {id:3, name: 'life'},{id: 2, name: 'food'}, {id: 4, name: 'about'}])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 53e247b

Please sign in to comment.