citygate 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,4 +31,11 @@ class Citygate::Admin::UsersController < Citygate::Admin::ApplicationController
31
31
  redirect_to :action => 'edit'
32
32
  end
33
33
  end
34
+
35
+ def destroy
36
+ @user = Citygate::User.find(params[:id])
37
+ @user.destroy
38
+
39
+ redirect_to admin_users_path
40
+ end
34
41
  end
@@ -15,7 +15,7 @@ module Citygate
15
15
  devise :encryptor => :sha1
16
16
  # @!endgroup
17
17
 
18
- attr_accessible :first_name, :last_name, :email, :password, :password_confirmation, :remember_me, :confirmed_at
18
+ attr_accessible :first_name, :last_name, :email, :password, :password_confirmation, :remember_me, :confirmed_at, :role_id
19
19
 
20
20
  has_many :authorizations, :dependent => :destroy
21
21
  belongs_to :role
@@ -1,14 +1,24 @@
1
- <div id="users">
2
- <% @users.each do |user| %>
3
- <div class="user">
4
- <span class="email"><%= user.email %></span>
5
- <%= content_tag(:span, user.full_name) if user.full_name %>
6
- <div class="user-links">
7
- <%= link_to t('admin.users.index.show_link'), admin_user_path(user), :class => "show-link" %>
8
- <%= link_to t('admin.users.index.edit_link'), edit_admin_user_path(user), :class => "edit-link" if can? :update, user %>
9
- </div>
10
- </div>
11
- <% end %>
1
+ <h1><%= t('admin.users.index.title') %></h1>
12
2
 
13
- <%= will_paginate @users %>
14
- </div>
3
+ <table class='list'>
4
+ <thead>
5
+ <tr>
6
+ <th><%= t('admin.users.show.first_name') %></th>
7
+ <th><%= t('admin.users.show.last_name') %></th>
8
+ <th><%= t('admin.users.show.email') %></th>
9
+ <th></th>
10
+ </tr>
11
+ </thead>
12
+ <tbody>
13
+ <% @users.each do |user| %>
14
+ <tr>
15
+ <td><%= user.first_name %></td>
16
+ <td><%= user.last_name %></td>
17
+ <td><%= truncate(user.email, length: 25) %></td>
18
+ <td><i class='icon-pencil'></i><%= link_to t('admin.users.index.edit_link'), edit_admin_user_path(user) %><i class='icon-trash'></i><%= link_to t('admin.users.index.delete_link'), admin_user_path(user), confirm: t('admin.actions.confirm'), :method => :delete, class: 'danger' if can? :update, user %></td>
19
+ </tr>
20
+ <% end %>
21
+ </tbody>
22
+ </table>
23
+
24
+ <%= will_paginate @users %>
@@ -1,7 +1,7 @@
1
1
  <nav>
2
2
  <ul>
3
3
  <% if user_signed_in? %>
4
- <% if can?(:manage, Citygate::User) and !params[:controller]["admin"] %>
4
+ <% if can?(:manage, Citygate::User) %>
5
5
  <li><i class='icon-cog'></i><%= link_to t('navigation.links.admin'), citygate.admin_users_path %></li>
6
6
  <% end %>
7
7
 
@@ -12,7 +12,9 @@
12
12
  <li><%= link_to t('navigation.links.sign_up'), citygate.new_user_registration_path %></li>
13
13
 
14
14
  <% Citygate::User.omniauth_providers.each do |provider| %>
15
- <li><%= link_to t('navigation.links.omniauth', provider: provider.to_s.titleize), "/users/auth/#{provider.to_s}", :id => "#{provider.to_s}" %></li>
15
+ <% if provider != "facebook" %>
16
+ <li><%= link_to t('navigation.links.omniauth', provider: provider.to_s.titleize), "/users/auth/#{provider.to_s}", :id => "#{provider.to_s}" %></li>
17
+ <% end %>
16
18
  <% end -%>
17
19
  <% end %>
18
20
  </ul>
@@ -2,11 +2,15 @@ en:
2
2
  admin:
3
3
  users:
4
4
  index:
5
+ title: "Users"
5
6
  show_link: "Show"
6
7
  edit_link: "Edit"
8
+ delete_link: "Delete"
7
9
  show:
8
10
  labels:
9
11
  name: "Name"
12
+ first_name: "First name"
13
+ last_name: "Last name"
10
14
  email: "Email"
11
15
  edit:
12
16
  title: "Edit Profile"
@@ -25,8 +29,9 @@ en:
25
29
  label:
26
30
  user:
27
31
  name: "Name"
32
+ first_name: "First name"
33
+ last_name: "Last name"
28
34
  email: "Email"
29
35
  password: "Password"
30
36
  password_confirmation: "Password Confirmation"
31
37
  current_password: "Current Password"
32
-
@@ -27,7 +27,7 @@ module Citygate
27
27
  # Accepts the same options as will_paginate and uses
28
28
  # them in the backend
29
29
  mattr_accessor :will_paginate_options
30
- @@will_paginate_options = {per_page: 1}
30
+ @@will_paginate_options = {per_page: 10}
31
31
 
32
32
  # If the mount path of citygate in the app changes,
33
33
  # this must change
@@ -1,3 +1,3 @@
1
1
  module Citygate
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: citygate
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.7
5
+ version: 0.0.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Group Buddies
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-09-17 00:00:00 Z
13
+ date: 2012-09-19 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -468,7 +468,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
468
468
  requirements:
469
469
  - - ">="
470
470
  - !ruby/object:Gem::Version
471
- hash: -4134967999806487145
471
+ hash: 2053322453284048139
472
472
  segments:
473
473
  - 0
474
474
  version: "0"
@@ -477,7 +477,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
477
477
  requirements:
478
478
  - - ">="
479
479
  - !ruby/object:Gem::Version
480
- hash: -4134967999806487145
480
+ hash: 2053322453284048139
481
481
  segments:
482
482
  - 0
483
483
  version: "0"