Skip to content

Commit e86b9fe

Browse files
authored
Merge pull request #613 from coopdevs/develop
v3.13.0
2 parents 7f4900d + e04dfcc commit e86b9fe

File tree

19 files changed

+116
-347
lines changed

19 files changed

+116
-347
lines changed

app/admin/user.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
f.inputs "Members" do
4242
f.has_many :members do |m|
4343
m.input :organization, collection: Organization.order(id: :asc).pluck(:name, :id)
44+
m.input :active
4445
m.input :manager
4546
end
4647
end
@@ -59,6 +60,9 @@
5960
panel "Memberships" do
6061
table_for user.members do
6162
column :organization
63+
column :active do |member|
64+
"✔" if member.active
65+
end
6266
column :manager do |member|
6367
"✔" if member.manager
6468
end

app/assets/stylesheets/application.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,7 @@ html {
232232
overflow-x: inherit;
233233
}
234234

235-
table.users {
236-
padding: 10px;
237-
}
238-
239235
@media screen {
240-
241236
html {
242237
min-height: 100%;
243238
position: relative;
@@ -280,18 +275,15 @@ table.users {
280275
}
281276

282277
@media print {
283-
284278
body {
285279
padding-top: 0px;
286280
}
287281

288282
.table {
289283
border-collapse: collapse;
290284
}
291-
292285
}
293286

294-
295287
.error {
296288
color: red;
297289
}

app/assets/stylesheets/application/footer.scss

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@
4141
}
4242
}
4343

44-
.landing-page, .login-page, .pages, .unlocks-page, .confirmations-page, .passwords-page {
45-
.footer {
46-
position: absolute;
47-
bottom: 0;
48-
left: 0;
49-
}
44+
.footer {
45+
position: absolute;
46+
bottom: 0;
47+
left: 0;
5048
}
5149

5250
.language-selector {
@@ -65,23 +63,12 @@
6563
border: 1px solid white;
6664
padding: 4px 8px;
6765
}
68-
69-
&:hover {
70-
background-color: transparent;
71-
}
7266
}
7367

7468
&.open > a.btn-default.dropdown-toggle {
7569
& {
7670
background-color: transparent;
77-
color: white;
78-
border-color: #ddd;
79-
}
80-
81-
&:hover {
82-
background-color: transparent;
83-
color: white;
84-
border-color: #ddd;
71+
border: 1px solid white;
8572
}
8673
}
8774
}

app/controllers/organizations_controller.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
class OrganizationsController < ApplicationController
22
before_action :load_resource, only: [:show, :edit, :update, :set_current]
33

4-
def new
5-
@organization = Organization.new
6-
7-
authorize @organization
8-
end
9-
104
def index
115
@organizations = Organization.all.page(params[:page]).per(25)
126
end
@@ -20,18 +14,6 @@ def show
2014
per(10)
2115
end
2216

23-
def create
24-
@organization = Organization.new(organization_params)
25-
26-
authorize @organization
27-
28-
if @organization.save
29-
redirect_to @organization
30-
else
31-
render action: :new, status: :unprocessable_entity
32-
end
33-
end
34-
3517
def update
3618
if @organization.update(organization_params)
3719
redirect_to @organization
@@ -40,8 +22,6 @@ def update
4022
end
4123
end
4224

43-
# POST /organizations/:organization_id/set_current
44-
#
4525
def set_current
4626
if current_user
4727
session[:current_organization_id] = @organization.id

app/policies/organization_policy.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ def index?
55
true
66
end
77

8-
def create?
9-
user&.superadmin?
10-
end
11-
128
def update?
139
user&.superadmin? || user&.admins?(organization)
1410
end

app/views/organizations/index.html.erb

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,32 @@
22
<%= Organization.model_name.human(count: :many) %>
33
</h1>
44

5-
<ul class="nav navbar-nav pull-right">
6-
<% if superadmin? %>
7-
<li>
8-
<%= link_to new_organization_path do %>
9-
<%= glyph :plus %>
10-
<%= t 'global.add_new' %>
11-
<% end %>
12-
</li>
13-
<% end %>
14-
</ul>
15-
16-
<table class="table table-hover table-condensed">
17-
<thead>
18-
<tr>
19-
<th><%= Organization.model_name.human(count: :one) %></th>
20-
<th><%= t '.member_count' %></th>
21-
<th></th>
22-
</tr>
23-
</thead>
24-
<tbody>
25-
<% @organizations.each do |org| %>
26-
<tr>
27-
<td><%= link_to org.name, org %></td>
28-
<td><%= org.users.count %></td>
29-
<td>
30-
<% if current_user&.admins?(org) %>
31-
<%= link_to edit_organization_path(org), class: 'action' do %>
32-
<%= glyph :pencil %>
33-
<%= t 'global.edit' %>
34-
<% end %>
35-
<% end %>
36-
</td>
37-
</tr>
38-
<% end %>
39-
</tbody>
40-
</table>
41-
42-
<%= paginate @organizations %>
5+
<div class="panel panel-default table-responsive">
6+
<div class="panel-body">
7+
<table class="table table-hover table-condensed panel">
8+
<thead>
9+
<tr>
10+
<th></th>
11+
<th><%= t '.city' %></th>
12+
<th><%= t '.neighborhood' %></th>
13+
<th><%= t '.web' %></th>
14+
<th><%= t '.member_count' %></th>
15+
</tr>
16+
</thead>
17+
<tbody>
18+
<% @organizations.each do |org| %>
19+
<tr>
20+
<td><%= link_to(org.name, org) %></td>
21+
<td><%= org.city %></td>
22+
<td><%= org.neighborhood %></td>
23+
<td><%= link_to(org.web, org.web) if org.web.present? %></td>
24+
<td><%= org.members.count %></td>
25+
</tr>
26+
<% end %>
27+
</tbody>
28+
</table>
29+
<div class="paginate-align">
30+
<%= paginate @organizations %>
31+
</div>
32+
</div>
33+
</div>

app/views/organizations/new.html.erb

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/views/organizations/show.html.erb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@
8484
</div>
8585
<div class="col-sm-5">
8686
<ul class="nav nav-pills pull-right">
87-
<% if superadmin? %>
88-
<li>
89-
<%= link_to organizations_path do %>
90-
<%= glyph :hand_left %>
91-
<%= t 'global.back' %>
92-
<% end %>
93-
</li>
94-
<% end %>
9587
<% if admin? %>
9688
<li>
9789
<%= link_to edit_organization_path(@organization) do %>

app/views/users/index.html.erb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<div class="container-fluid">
22
<div class="row">
33
<div class="col-md-12">
4-
<h1><%= t(".members") %></h1>
4+
<h1>
5+
<%= link_to current_organization.name, current_organization %>
6+
<%= t(".members") %>
7+
</h1>
58
</div>
69
</div>
710
</div>
@@ -22,15 +25,6 @@
2225
</div>
2326

2427
<div class="container-fluid">
25-
<div class="row">
26-
<div class="col-md-12">
27-
<h2>
28-
<%= link_to current_organization.name,
29-
organization_path(current_organization) %>
30-
</h2>
31-
</div>
32-
</div>
33-
3428
<div class="row to-member-cards">
3529
<%= render partial: 'member_card', collection: @member_view_models, as: :member %>
3630
</div>

app/views/users/manage.html.erb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<div class="container-fluid">
22
<div class="row">
33
<div class="col-md-12">
4-
<h1><%= t(".members") %></h1>
4+
<h1>
5+
<%= link_to current_organization.name, current_organization %>
6+
<%= t("users.index.members") %>
7+
</h1>
58
</div>
69
</div>
710
</div>
@@ -30,17 +33,13 @@
3033
</div>
3134
</div>
3235
</div>
36+
<br>
3337

3438
<div class="container-fluid">
3539
<div class="row">
3640
<div class="col-md-12">
37-
<h2>
38-
<%= link_to current_organization.name,
39-
organization_path(current_organization) %>
40-
</h2>
41-
4241
<div class="table-responsive">
43-
<table class="table table-hover table-condensed users panel">
42+
<table class="table table-hover table-condensed panel">
4443
<thead>
4544
<tr>
4645
<th></th>

0 commit comments

Comments
 (0)