Skip to content

Commit

Permalink
changed look of about and headers
Browse files Browse the repository at this point in the history
  • Loading branch information
enterteg committed Mar 26, 2016
1 parent 1558c51 commit b4da7aa
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
Binary file added app/assets/images/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/map.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion app/assets/stylesheets/posts.sass
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ section
margin: 80px 0px 200px
z-index: -20
article.about
max-width: 90%
max-width: 80%
margin: 0 auto
.desc
padding: 30px
font-size: 1.3rem
.post
max-width: 700px
margin: 50px auto 80px
Expand Down Expand Up @@ -111,6 +112,8 @@ section
&.sample
font-size: 1.8rem
line-height: 1.2


footer
font-size: 0.9rem
line-height: 2
Expand Down
10 changes: 9 additions & 1 deletion app/assets/stylesheets/public.sass
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,19 @@ hr

#map
max-width: 1100px
margin: 50 auto
margin: 50px auto 0px
.header
font-size: 3rem
text-align: center
padding: 30px 10px
&.travels
margin-top: 80px
&.heart
margin-top: -25px
img
position: relative
top: 22px
left: 10px
.button
text-decoration: none
margin-right: 5px
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ def update
@post.photos.create(photo: photo)
end
end
redirect_to @post, notice: 'Post updated successfully'
if @post.category_id == 4
redirect_to '/about'
else
redirect_to @post, notice: 'Post updated successfully'
end
else
flash.now.notice = 'Some errors occured, cannot update post.'
render :edit
Expand Down
2 changes: 1 addition & 1 deletion app/views/posts/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.input
= f.label :category_id
= f.select :category_id, [['travels', 1], ['food', 2], ['my life', 3]], prompt: '- select category -'
= f.select :category_id, [['travels', 1], ['food', 2], ['my life', 3], ['about', 4]], prompt: '- select category -'
.input
= f.label :title
= f.text_field :title
Expand Down
2 changes: 1 addition & 1 deletion app/views/public/about.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%article.about
.header= @post.title
.desc
= @post.desc
= @post.desc.html_safe

= link_to :back do
.button.edit back
Expand Down
11 changes: 9 additions & 2 deletions app/views/public/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- if @controller == 'travels'
#map
.header= 'All of my travels'
.header.travels= 'All of my travels'
#map_photo
= image_tag 'map.jpg'
- @pins.each do |pin|
Expand All @@ -11,6 +11,13 @@
.date= pin[4].strftime('%d/%m/%Y')
.container
%section
.header= 'Latests posts'
-if @controller == 'life'
.header= "My little world"
-elsif @controller == 'food'
.header.heart
= "Food"
=image_tag 'heart.png'
-else
.header= 'Latest posts'
-if @posts
= render @posts

0 comments on commit b4da7aa

Please sign in to comment.