Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Commit

Permalink
Update admin and button styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
hmans committed Feb 12, 2012
1 parent 1bc8608 commit 1678651
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
6 changes: 4 additions & 2 deletions lib/schreihals/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ def set_page_title(title)
@page_title = title
end

def link_to(title, thing)
haml "%a{href: '#{url_for thing}'} #{title}"
def link_to(title, thing, link_options = {})
link_options.merge(href: url_for(thing))
# TODO: use some kind of content_tag helper. HALP!
haml "%a{href: '#{link_options[:href]}'} #{title}"
end

def url_for(thing, options = {})
Expand Down
5 changes: 3 additions & 2 deletions lib/views/admin/admin.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
%p
You're logged in as #{session[:user]}.
%ul.admin
%li= link_to "Create new Post", '/admin/new'
%li= link_to "Logout", '/logout'
%li
%a.green.button{href: '/admin/new'} Create new Post
%a.red.button{href: '/logout'} Logout

= partial "admin_post_list", posts: @drafts, title: "Drafts"
= partial "admin_post_list", posts: @posts, title: "Published Posts"
Expand Down
9 changes: 6 additions & 3 deletions lib/views/partials/_admin_post_list.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
%ul.admin-post-list
- posts.each do |post|
%ul.admin
%li= link_to "edit", "/admin/edit/#{post.id}"
%li= link_to "view", url_for(post)
%li= post.title
%li
%a.button{href: "/admin/edit/#{post.id}"} edit
%li
%a.button{href: url_for(post)} view
%li
= post.title
5 changes: 1 addition & 4 deletions lib/views/schreihals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ article.post {
/* admin post lists */
ul.admin-post-list {
max-height: 300px;
padding-bottom: 5px;
overflow: auto;
}

Expand All @@ -58,10 +59,6 @@ ul.admin {
display: inline;
margin-right: 0.5em;
}

a {
@include button;
}
}

/* disqus */
Expand Down

0 comments on commit 1678651

Please sign in to comment.