Skip to content

Commit 60ac3e4

Browse files
committed
updated list/index templates
1 parent dbdbfa7 commit 60ac3e4

5 files changed

Lines changed: 31 additions & 68 deletions

File tree

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +0,0 @@
1-
body {
2-
background-color: #fff;
3-
color: #333;
4-
font-family: verdana, arial, helvetica, sans-serif;
5-
font-size: 13px;
6-
line-height: 18px; }
7-
8-
p, ol, ul, td {
9-
font-family: verdana, arial, helvetica, sans-serif;
10-
font-size: 13px;
11-
line-height: 18px; }
12-
13-
pre {
14-
background-color: #eee;
15-
padding: 10px;
16-
font-size: 11px; }
17-
18-
a {
19-
color: #000;
20-
&:visited {
21-
color: #666; }
22-
&:hover {
23-
color: #fff;
24-
background-color: #000; } }
25-
26-
div {
27-
&.field, &.actions {
28-
margin-bottom: 10px; } }
29-
30-
#notice {
31-
color: green; }
32-
33-
.field_with_errors {
34-
padding: 2px;
35-
background-color: red;
36-
display: table; }
37-
38-
#error_explanation {
39-
width: 450px;
40-
border: 2px solid red;
41-
padding: 7px;
42-
padding-bottom: 0;
43-
margin-bottom: 20px;
44-
background-color: #f0f0f0;
45-
h2 {
46-
text-align: left;
47-
font-weight: bold;
48-
padding: 5px 5px 5px 15px;
49-
font-size: 12px;
50-
margin: -7px;
51-
margin-bottom: 0px;
52-
background-color: #c00;
53-
color: #fff; }
54-
ul li {
55-
font-size: 12px;
56-
list-style: square; } }
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
%li.item
2-
= link_to list, resource_path(list)
3-
1+
%tr.item
2+
%td= list.title
3+
%td= list.description
4+
%td= link_to "Show", resource_path(list)
45
- if can? :update, list
5-
= link_to 'Edit', edit_resource_path(list)
6+
%td= link_to 'Edit', edit_resource_path(list)
67
- if can? :destroy, list
7-
= link_to 'Delete', resource_path(list), :confirm => 'Are you sure?', :method => :delete
8+
%td= link_to 'Delete', resource_path(list), :confirm => 'Are you sure?', :method => :delete

app/views/questions/index.html.haml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,13 @@
55
- if can? :create, Question
66
= link_to "New question", new_resource_path
77

8-
%ol
8+
%table
9+
%thead
10+
%th Title
11+
%th Description
12+
13+
%th
14+
%th
15+
%th
16+
917
= render :partial => "list", :collection => collection
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
%li.item
2-
= link_to list, resource_path(list)
3-
1+
%tr.item
2+
<% for attribute in attributes -%>
3+
%td= list.<%= attribute.name %>
4+
<% end -%>
5+
%td= link_to "Show", resource_path(list)
46
- if can? :update, list
5-
= link_to 'Edit', edit_resource_path(list)
7+
%td= link_to 'Edit', edit_resource_path(list)
68
- if can? :destroy, list
7-
= link_to 'Delete', resource_path(list), :confirm => 'Are you sure?', :method => :delete
9+
%td= link_to 'Delete', resource_path(list), :confirm => 'Are you sure?', :method => :delete

lib/generators/haml/scaffold/templates/index.html.haml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,13 @@
55
- if can? :create, <%= singular_table_name.classify %>
66
= link_to "New <%= singular_table_name %>", new_resource_path
77

8-
%ol
8+
%table
9+
%thead
10+
<% for attribute in attributes -%>
11+
%th <%= attribute.human_name %>
12+
<% end -%>
13+
%th
14+
%th
15+
%th
16+
917
= render :partial => "list", :collection => collection

0 commit comments

Comments
 (0)