headstart 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/generators/headstart/templates/report.css +19 -8
- data/generators/headstart/templates/style.css +4 -4
- data/generators/headstart_admin/templates/app/controllers/admin/users_controller.rb +5 -4
- data/generators/headstart_admin/templates/app/views/admin/_admin_header.html.erb +4 -0
- data/generators/headstart_admin/templates/app/views/admin/admin/index.html.erb +1 -2
- data/generators/headstart_admin/templates/app/views/admin/users/_form.html.erb +8 -25
- data/generators/headstart_admin/templates/app/views/admin/users/index.html.erb +35 -6
- data/generators/headstart_admin/templates/app/views/admin/users/new.html.erb +4 -2
- data/generators/headstart_admin/templates/app/views/admin/users/show.html.erb +1 -0
- metadata +5 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
@@ -1,8 +1,19 @@
|
|
1
|
+
.report h2 {
|
2
|
+
font-family: Helvetica, Verdana, sans-serif;
|
3
|
+
font-size:20px;
|
4
|
+
display:block;
|
5
|
+
color:#000;
|
6
|
+
text-indent:0;
|
7
|
+
font-weight:bold;
|
8
|
+
}
|
9
|
+
.report img {
|
10
|
+
border:none;
|
11
|
+
}
|
1
12
|
.report table {
|
2
|
-
font-family:
|
13
|
+
font-family: Helvetica, Verdana, sans-serif;
|
3
14
|
width: 700px;
|
4
|
-
height: 160px;
|
5
15
|
border: 2px solid black;
|
16
|
+
margin-top:10px;
|
6
17
|
}
|
7
18
|
.report table th {
|
8
19
|
text-align: center;
|
@@ -40,22 +51,22 @@
|
|
40
51
|
border-right: 2px solid black;
|
41
52
|
}
|
42
53
|
.report table th {
|
43
|
-
background-color: #
|
54
|
+
background-color: #C8C6C6;
|
44
55
|
}
|
45
56
|
.report table th.even, .report table th:nth-child(2n) {
|
46
|
-
background-color: #
|
57
|
+
background-color: #C8C6C6;
|
47
58
|
}
|
48
59
|
.report table tr.odd td {
|
49
|
-
background-color: #
|
60
|
+
background-color: #E7E5E5;
|
50
61
|
}
|
51
62
|
.report table tr.odd td.even, .report table tr.odd td:nth-child(2n) {
|
52
|
-
background-color: #
|
63
|
+
background-color: #E7E5E5;
|
53
64
|
}
|
54
65
|
.report table tr.even td {
|
55
|
-
background-color: #
|
66
|
+
background-color: #DAE9F1;
|
56
67
|
}
|
57
68
|
.report table tr.even td.even, .report table tr.even td:nth-child(2n) {
|
58
|
-
background-color: #
|
69
|
+
background-color: #DAE9F1;
|
59
70
|
}
|
60
71
|
.report table tfoot th, .report table tfoot td {
|
61
72
|
background-color: white;
|
@@ -16,8 +16,8 @@
|
|
16
16
|
}
|
17
17
|
|
18
18
|
.notice_flash {
|
19
|
-
|
20
|
-
|
19
|
+
color: #000;
|
20
|
+
background-color: #E7E5E5;aa;
|
21
21
|
}
|
22
22
|
|
23
23
|
.failure_flash {
|
@@ -26,6 +26,6 @@
|
|
26
26
|
}
|
27
27
|
|
28
28
|
.success_flash {
|
29
|
-
|
30
|
-
|
29
|
+
color: #000;
|
30
|
+
background-color: #E7E5E5;
|
31
31
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
class Admin::UsersController < Admin::AdminController
|
2
|
+
MODEL = self.controller_name.singularize.downcase.to_sym
|
2
3
|
|
3
4
|
def index
|
4
5
|
@users = User.all
|
@@ -13,8 +14,8 @@ class Admin::UsersController < Admin::AdminController
|
|
13
14
|
end
|
14
15
|
|
15
16
|
def create
|
16
|
-
@user = User.new(params[
|
17
|
-
@user.role = params[
|
17
|
+
@user = User.new(params[MODEL])
|
18
|
+
@user.role = params[MODEL][:role]
|
18
19
|
if @user.save
|
19
20
|
flash[:notice] = "Created #{@user.name}"
|
20
21
|
redirect_to admin_user_url(@user)
|
@@ -29,8 +30,8 @@ class Admin::UsersController < Admin::AdminController
|
|
29
30
|
|
30
31
|
def update
|
31
32
|
@user = User.find(params[:id])
|
32
|
-
@user.role = params[
|
33
|
-
if @user.update_attributes(params[
|
33
|
+
@user.role = params[MODEL][:role]
|
34
|
+
if @user.update_attributes(params[MODEL])
|
34
35
|
flash[:notice] = "Updated #{@user.name}"
|
35
36
|
redirect_to admin_user_url(@user)
|
36
37
|
else
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
<%= link_to 'Users', '/admin/users' %>
|
1
|
+
<%= render :partial => 'admin/admin_header' %>
|
@@ -1,25 +1,8 @@
|
|
1
|
-
<%=
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
</p>
|
10
|
-
<p class="text_field">
|
11
|
-
<%= form.label :email %>
|
12
|
-
<%= form.text_field :email %>
|
13
|
-
</p>
|
14
|
-
<p class="password_field">
|
15
|
-
<%= form.label :password %>
|
16
|
-
<%= form.password_field :password %>
|
17
|
-
</p>
|
18
|
-
<p class="password_field">
|
19
|
-
<%= form.label :password_confirmation, "Confirm password" %>
|
20
|
-
<%= form.password_field :password_confirmation %>
|
21
|
-
</p>
|
22
|
-
<p>
|
23
|
-
<%= form.label :role %>
|
24
|
-
<%= form.collection_select :role, ['', 'admin'], :to_s, :to_s %>
|
25
|
-
</p>
|
1
|
+
<%= render :partial => 'admin/admin_header' %>
|
2
|
+
<h2>Edit User</h2>
|
3
|
+
<table>
|
4
|
+
<% form_for @user, :url => admin_user_path(@user) do |form| %>
|
5
|
+
<%= render :partial => '/admin/users/form', :object => form %>
|
6
|
+
<tr><td colspan="2"><%= form.submit 'Save', :disable_with => 'Please wait...' %></td></tr>
|
7
|
+
<% end %>
|
8
|
+
</table>
|
@@ -1,7 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<%= render :partial => 'admin/admin_header' %>
|
2
|
+
<div class="report">
|
3
|
+
<h2>Users</h2>
|
4
|
+
<%= link_to image_tag("/images/add.png", :border=>0)+" New user", {:action => :new}, {:style => "font-size:12px;"} %>
|
5
|
+
|
6
|
+
|
7
|
+
<%= will_paginate @users %>
|
8
|
+
|
9
|
+
<table width="900px">
|
10
|
+
<thead>
|
11
|
+
<tr style='font:11px verdana;'>
|
12
|
+
<th style="text-align:left">Name</th>
|
13
|
+
<th style="width:70px"></th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
<% @users.each do |user| -%>
|
18
|
+
<tr class="<%= cycle('odd', 'even') %>">
|
19
|
+
<td style="text-align:left"><%= user.name %></td>
|
20
|
+
<td><%= link_to image_tag("/images/application_edit.png", :border=>0), {:action => :edit, :id => user.id}, :title => 'Edit' %> <%= link_to image_tag("/images/delete.png", :border=>0), admin_user_path(user), :confirm => 'Are you sure?', :method => :delete, :title => 'Delete' %>
|
21
|
+
</td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
</tbody>
|
25
|
+
<tfoot>
|
26
|
+
<tr>
|
27
|
+
<td colspan="3">
|
28
|
+
<%= page_entries_info @users %>
|
29
|
+
<%= will_paginate @users %>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
</tfoot>
|
33
|
+
</table>
|
34
|
+
|
35
|
+
</div>
|
6
36
|
|
7
|
-
<%= link_to 'New User', new_admin_user_path %>
|
@@ -1,6 +1,8 @@
|
|
1
|
+
<%= render :partial => 'admin/admin_header' %>
|
1
2
|
<h2>Create User</h2>
|
2
|
-
|
3
|
+
<table>
|
3
4
|
<% form_for @user, :url => admin_users_path do |form| %>
|
4
5
|
<%= render :partial => '/admin/users/form', :object => form %>
|
5
|
-
|
6
|
+
<tr><td colspan="2"><%= form.submit 'Save', :disable_with => 'Please wait...' %></td></tr>
|
6
7
|
<% end %>
|
8
|
+
</table>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: headstart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 4
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bran Burridge
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-14 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- generators/headstart_admin/templates/README
|
146
146
|
- generators/headstart_admin/templates/app/controllers/admin/admin_controller.rb
|
147
147
|
- generators/headstart_admin/templates/app/controllers/admin/users_controller.rb
|
148
|
+
- generators/headstart_admin/templates/app/views/admin/_admin_header.html.erb
|
148
149
|
- generators/headstart_admin/templates/app/views/admin/admin/index.html.erb
|
149
150
|
- generators/headstart_admin/templates/app/views/admin/users/_form.html.erb
|
150
151
|
- generators/headstart_admin/templates/app/views/admin/users/edit.html.erb
|