Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 352e0fcf6afc68f830d3a6514ab351e598f58f7f 1 parent 67be51e
Christopher Darroch authored January 12, 2012
7  app/views/notices/_notice.html.haml
@@ -2,7 +2,6 @@
2 2
   %h3= link_to notice.title, notice
3 3
   = textilize(notice.content).try(:html_safe)
4 4
   - if organiser?
5  
-    %p.actions
6  
-      = link_to 'Edit this notice', edit_notice_path(notice)
7  
-      |
8  
-      = link_to 'Delete this notice', notice_path(notice), :confirm => 'Are you sure you want to delete this notice?', :method => :delete
  5
+    %ul.actions
  6
+      %li= link_to 'Edit this notice', edit_notice_path(notice)
  7
+      %li.destroy= link_to 'Delete this notice', notice_path(notice), :confirm => 'Are you sure you want to delete this notice?', :method => :delete
7  app/views/projects/_project.html.haml
@@ -9,7 +9,6 @@
9 9
   - if project.needs_help?
10 10
     %p.help Could use help with this one
11 11
   - if project.owner == current_user
12  
-    %p.actions
13  
-      = link_to 'Edit this project', edit_user_project_path(project.owner, project)
14  
-      |
15  
-      = link_to 'Delete this project', user_project_path(project.owner, project), :confirm => 'Are you sure you want to delete this project?', :method => :delete
  12
+    %ul.actions
  13
+      %li= link_to 'Edit this project', edit_user_project_path(project.owner, project)
  14
+      %li= link_to 'Delete this project', user_project_path(project.owner, project), :confirm => 'Are you sure you want to delete this project?', :method => :delete
8  app/views/projects/index.html.haml
... ...
@@ -1,9 +1,11 @@
1 1
 - content_for :title do
2 2
   All projects
3 3
 
4  
-- if current_user
5  
-  %p.add
6  
-    = link_to 'Add a project', new_user_project_path(current_user)
  4
+- content_for :content_header do
  5
+  - if current_user
  6
+    #actions
  7
+      %ul.actions
  8
+        %li= link_to 'Add a project', new_user_project_path(current_user)
7 9
 
8 10
 %table.projects
9 11
   %thead
18  app/views/projects/show.html.haml
... ...
@@ -1,12 +1,15 @@
1 1
 - content_for :title do
2 2
   = @project.name
3 3
 
  4
+- content_for :content_header do
  5
+  #actions
  6
+    %ul.actions
  7
+      - if is_owner?
  8
+        %li= link_to 'Edit project', edit_user_project_path(@project.owner)
  9
+
4 10
 = render :partial => 'users/user_card', :locals => {:user => @project.owner}
5 11
 
6 12
 .main
7  
-  %p.add
8  
-    = link_to 'Edit project', edit_user_project_path(@project.owner) if is_owner?
9  
-
10 13
   - if @project.description
11 14
     .description
12 15
       = textilize(@project.description).try(:html_safe)
@@ -16,10 +19,9 @@
16 19
     = @project.status
17 20
 
18 21
   - if is_owner?
19  
-    %p.commands
  22
+    %ul.actions
20 23
       - if @project.active?
21  
-        = link_to 'Completed!', complete_user_project_path(@project.owner, @project)
22  
-        |
23  
-        = link_to 'Can it!', cancel_user_project_path(@project.owner, @project), :class => "destroy"
  24
+        %li= link_to 'Completed!', complete_user_project_path(@project.owner, @project)
  25
+        %li.destroy= link_to 'Can it!', cancel_user_project_path(@project.owner, @project)
24 26
       - else
25  
-        = link_to 'Start it up again?', restart_user_project_path(@project.owner, @project)
  27
+        %li= link_to 'Start it up again?', restart_user_project_path(@project.owner, @project)
8  app/views/talks/index.html.haml
... ...
@@ -1,9 +1,11 @@
1 1
 -content_for :title do
2 2
   Talks
3 3
 
4  
-- if current_user
5  
-  %p.add
6  
-    = link_to 'Add a talk', calendar_talks_path
  4
+- content_for :content_header do
  5
+  - if current_user
  6
+    #actions
  7
+      %ul.actions
  8
+        %li= link_to 'Add a talk', calendar_talks_path
7 9
 
8 10
 %section.expandable-list
9 11
   %div.list-panel
7  app/views/talks/show.html.haml
@@ -10,7 +10,6 @@
10 10
     = textilize(@talk.description).try(:html_safe)
11 11
 
12 12
   - if @talk.user == current_user
13  
-    %p.actions
14  
-      = link_to "Edit this talk", edit_talk_path(@talk)
15  
-      |
16  
-      = link_to "Delete this talk", talk_path(@talk), :method => :delete, :confirm => 'Really delete this talk?'
  13
+    %ul.actions
  14
+      %li= link_to "Edit this talk", edit_talk_path(@talk)
  15
+      %li.destroy= link_to "Delete this talk", talk_path(@talk), :method => :delete, :confirm => 'Really delete this talk?'
3  app/views/users/_user_card.html.haml
@@ -7,4 +7,5 @@
7 7
     %li.bonjour Bonjour: #{user.bonjour}
8 8
     %li.irc IRC: #{user.irc}
9 9
   - if current_user == user
10  
-    %p.edit= link_to("Edit my profile", edit_user_path(user))
  10
+    %ul.actions
  11
+      %li= link_to "Edit my profile", edit_user_path(user)
20  app/views/welcome/index.html.haml
... ...
@@ -1,6 +1,8 @@
1 1
 %section.notices
2  
-  %h1= link_to 'Message board', message_board_camp_path(Camp.current), :title => 'view all notices'
3  
-  %p.view_all= link_to 'view all messages', message_board_camp_path(Camp.current)
  2
+  %header
  3
+    %h1= link_to 'Message board', message_board_camp_path(Camp.current), :title => 'view all notices'
  4
+    %ul.actions
  5
+      %li.more= link_to 'view all messages', message_board_camp_path(Camp.current)
4 6
   
5 7
   - if @latest_notice
6 8
     %h2= @latest_notice.title
@@ -8,16 +10,22 @@
8 10
 
9 11
 .main
10 12
   %section.projects
11  
-    %p.view_all= link_to 'view all projects', projects_path
12  
-    %h1= link_to 'Random project', projects_path, :title => 'view all projects'
  13
+    %header
  14
+      %h1= link_to 'Random project', projects_path, :title => 'view all projects'
  15
+      %ul.actions
  16
+        %li.more= link_to 'view all projects', projects_path
  17
+
13 18
     - if @project
14 19
       = render @project
15 20
     - else
16 21
       %p there are no projects!
17 22
 
18 23
   %section.talks
19  
-    %p.view_all= link_to 'view all talks', talks_path
20  
-    %h1= link_to "Today's talks", talks_path, :title => 'view all talks'
  24
+    %header
  25
+      %h1= link_to "Today's talks", talks_path, :title => 'view all talks'
  26
+      %ul.actions
  27
+        %li.more= link_to 'view all talks', talks_path
  28
+
21 29
     - @venues.each do |venue|
22 30
       = render :partial => 'talks_for_location_list', :locals => { :location => venue, :talks => @todays_talks_by_venue_id[venue.id]}
23 31
             

0 notes on commit 352e0fc

Please sign in to comment.
Something went wrong with that request. Please try again.