Permalink
Browse files

Every list of actions should be marked up as such.

- Consolidate the markup in to a single unordered list of actions pattern.
- Class the significant actions only.
- Lift page-wide actions in to the page's header.
  • Loading branch information...
1 parent 67be51e commit 352e0fcf6afc68f830d3a6514ab351e598f58f7f @chrisdarroch committed Jan 12, 2012
@@ -2,7 +2,6 @@
%h3= link_to notice.title, notice
= textilize(notice.content).try(:html_safe)
- if organiser?
- %p.actions
- = link_to 'Edit this notice', edit_notice_path(notice)
- |
- = link_to 'Delete this notice', notice_path(notice), :confirm => 'Are you sure you want to delete this notice?', :method => :delete
+ %ul.actions
+ %li= link_to 'Edit this notice', edit_notice_path(notice)
+ %li.destroy= link_to 'Delete this notice', notice_path(notice), :confirm => 'Are you sure you want to delete this notice?', :method => :delete
@@ -9,7 +9,6 @@
- if project.needs_help?
%p.help Could use help with this one
- if project.owner == current_user
- %p.actions
- = link_to 'Edit this project', edit_user_project_path(project.owner, project)
- |
- = link_to 'Delete this project', user_project_path(project.owner, project), :confirm => 'Are you sure you want to delete this project?', :method => :delete
+ %ul.actions
+ %li= link_to 'Edit this project', edit_user_project_path(project.owner, project)
+ %li= link_to 'Delete this project', user_project_path(project.owner, project), :confirm => 'Are you sure you want to delete this project?', :method => :delete
@@ -1,9 +1,11 @@
- content_for :title do
All projects
-- if current_user
- %p.add
- = link_to 'Add a project', new_user_project_path(current_user)
+- content_for :content_header do
+ - if current_user
+ #actions
+ %ul.actions
+ %li= link_to 'Add a project', new_user_project_path(current_user)
%table.projects
%thead
@@ -1,12 +1,15 @@
- content_for :title do
= @project.name
+- content_for :content_header do
+ #actions
+ %ul.actions
+ - if is_owner?
+ %li= link_to 'Edit project', edit_user_project_path(@project.owner)
+
= render :partial => 'users/user_card', :locals => {:user => @project.owner}
.main
- %p.add
- = link_to 'Edit project', edit_user_project_path(@project.owner) if is_owner?
-
- if @project.description
.description
= textilize(@project.description).try(:html_safe)
@@ -16,10 +19,9 @@
= @project.status
- if is_owner?
- %p.commands
+ %ul.actions
- if @project.active?
- = link_to 'Completed!', complete_user_project_path(@project.owner, @project)
- |
- = link_to 'Can it!', cancel_user_project_path(@project.owner, @project), :class => "destroy"
+ %li= link_to 'Completed!', complete_user_project_path(@project.owner, @project)
+ %li.destroy= link_to 'Can it!', cancel_user_project_path(@project.owner, @project)
- else
- = link_to 'Start it up again?', restart_user_project_path(@project.owner, @project)
+ %li= link_to 'Start it up again?', restart_user_project_path(@project.owner, @project)
@@ -1,9 +1,11 @@
-content_for :title do
Talks
-- if current_user
- %p.add
- = link_to 'Add a talk', calendar_talks_path
+- content_for :content_header do
+ - if current_user
+ #actions
+ %ul.actions
+ %li= link_to 'Add a talk', calendar_talks_path
%section.expandable-list
%div.list-panel
@@ -10,7 +10,6 @@
= textilize(@talk.description).try(:html_safe)
- if @talk.user == current_user
- %p.actions
- = link_to "Edit this talk", edit_talk_path(@talk)
- |
- = link_to "Delete this talk", talk_path(@talk), :method => :delete, :confirm => 'Really delete this talk?'
+ %ul.actions
+ %li= link_to "Edit this talk", edit_talk_path(@talk)
+ %li.destroy= link_to "Delete this talk", talk_path(@talk), :method => :delete, :confirm => 'Really delete this talk?'
@@ -7,4 +7,5 @@
%li.bonjour Bonjour: #{user.bonjour}
%li.irc IRC: #{user.irc}
- if current_user == user
- %p.edit= link_to("Edit my profile", edit_user_path(user))
+ %ul.actions
+ %li= link_to "Edit my profile", edit_user_path(user)
@@ -1,23 +1,31 @@
%section.notices
- %h1= link_to 'Message board', message_board_camp_path(Camp.current), :title => 'view all notices'
- %p.view_all= link_to 'view all messages', message_board_camp_path(Camp.current)
+ %header
+ %h1= link_to 'Message board', message_board_camp_path(Camp.current), :title => 'view all notices'
+ %ul.actions
+ %li.more= link_to 'view all messages', message_board_camp_path(Camp.current)
- if @latest_notice
%h2= @latest_notice.title
= textilize(@latest_notice.content).try(:html_safe)
.main
%section.projects
- %p.view_all= link_to 'view all projects', projects_path
- %h1= link_to 'Random project', projects_path, :title => 'view all projects'
+ %header
+ %h1= link_to 'Random project', projects_path, :title => 'view all projects'
+ %ul.actions
+ %li.more= link_to 'view all projects', projects_path
+
- if @project
= render @project
- else
%p there are no projects!
%section.talks
- %p.view_all= link_to 'view all talks', talks_path
- %h1= link_to "Today's talks", talks_path, :title => 'view all talks'
+ %header
+ %h1= link_to "Today's talks", talks_path, :title => 'view all talks'
+ %ul.actions
+ %li.more= link_to 'view all talks', talks_path
+
- @venues.each do |venue|
= render :partial => 'talks_for_location_list', :locals => { :location => venue, :talks => @todays_talks_by_venue_id[venue.id]}

0 comments on commit 352e0fc

Please sign in to comment.