Skip to content

v3.13.0 #613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/admin/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
f.inputs "Members" do
f.has_many :members do |m|
m.input :organization, collection: Organization.order(id: :asc).pluck(:name, :id)
m.input :active
m.input :manager
end
end
Expand All @@ -59,6 +60,9 @@
panel "Memberships" do
table_for user.members do
column :organization
column :active do |member|
"✔" if member.active
end
column :manager do |member|
"✔" if member.manager
end
Expand Down
8 changes: 0 additions & 8 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,7 @@ html {
overflow-x: inherit;
}

table.users {
padding: 10px;
}

@media screen {

html {
min-height: 100%;
position: relative;
Expand Down Expand Up @@ -280,18 +275,15 @@ table.users {
}

@media print {

body {
padding-top: 0px;
}

.table {
border-collapse: collapse;
}

}


.error {
color: red;
}
Expand Down
23 changes: 5 additions & 18 deletions app/assets/stylesheets/application/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@
}
}

.landing-page, .login-page, .pages, .unlocks-page, .confirmations-page, .passwords-page {
.footer {
position: absolute;
bottom: 0;
left: 0;
}
.footer {
position: absolute;
bottom: 0;
left: 0;
}

.language-selector {
Expand All @@ -65,23 +63,12 @@
border: 1px solid white;
padding: 4px 8px;
}

&:hover {
background-color: transparent;
}
}

&.open > a.btn-default.dropdown-toggle {
& {
background-color: transparent;
color: white;
border-color: #ddd;
}

&:hover {
background-color: transparent;
color: white;
border-color: #ddd;
border: 1px solid white;
}
}
}
20 changes: 0 additions & 20 deletions app/controllers/organizations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
class OrganizationsController < ApplicationController
before_action :load_resource, only: [:show, :edit, :update, :set_current]

def new
@organization = Organization.new

authorize @organization
end

def index
@organizations = Organization.all.page(params[:page]).per(25)
end
Expand All @@ -20,18 +14,6 @@ def show
per(10)
end

def create
@organization = Organization.new(organization_params)

authorize @organization

if @organization.save
redirect_to @organization
else
render action: :new, status: :unprocessable_entity
end
end

def update
if @organization.update(organization_params)
redirect_to @organization
Expand All @@ -40,8 +22,6 @@ def update
end
end

# POST /organizations/:organization_id/set_current
#
def set_current
if current_user
session[:current_organization_id] = @organization.id
Expand Down
4 changes: 0 additions & 4 deletions app/policies/organization_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ def index?
true
end

def create?
user&.superadmin?
end

def update?
user&.superadmin? || user&.admins?(organization)
end
Expand Down
67 changes: 29 additions & 38 deletions app/views/organizations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,32 @@
<%= Organization.model_name.human(count: :many) %>
</h1>

<ul class="nav navbar-nav pull-right">
<% if superadmin? %>
<li>
<%= link_to new_organization_path do %>
<%= glyph :plus %>
<%= t 'global.add_new' %>
<% end %>
</li>
<% end %>
</ul>

<table class="table table-hover table-condensed">
<thead>
<tr>
<th><%= Organization.model_name.human(count: :one) %></th>
<th><%= t '.member_count' %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @organizations.each do |org| %>
<tr>
<td><%= link_to org.name, org %></td>
<td><%= org.users.count %></td>
<td>
<% if current_user&.admins?(org) %>
<%= link_to edit_organization_path(org), class: 'action' do %>
<%= glyph :pencil %>
<%= t 'global.edit' %>
<% end %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>

<%= paginate @organizations %>
<div class="panel panel-default table-responsive">
<div class="panel-body">
<table class="table table-hover table-condensed panel">
<thead>
<tr>
<th></th>
<th><%= t '.city' %></th>
<th><%= t '.neighborhood' %></th>
<th><%= t '.web' %></th>
<th><%= t '.member_count' %></th>
</tr>
</thead>
<tbody>
<% @organizations.each do |org| %>
<tr>
<td><%= link_to(org.name, org) %></td>
<td><%= org.city %></td>
<td><%= org.neighborhood %></td>
<td><%= link_to(org.web, org.web) if org.web.present? %></td>
<td><%= org.members.count %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="paginate-align">
<%= paginate @organizations %>
</div>
</div>
</div>
4 changes: 0 additions & 4 deletions app/views/organizations/new.html.erb

This file was deleted.

8 changes: 0 additions & 8 deletions app/views/organizations/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@
</div>
<div class="col-sm-5">
<ul class="nav nav-pills pull-right">
<% if superadmin? %>
<li>
<%= link_to organizations_path do %>
<%= glyph :hand_left %>
<%= t 'global.back' %>
<% end %>
</li>
<% end %>
<% if admin? %>
<li>
<%= link_to edit_organization_path(@organization) do %>
Expand Down
14 changes: 4 additions & 10 deletions app/views/users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h1><%= t(".members") %></h1>
<h1>
<%= link_to current_organization.name, current_organization %>
<%= t(".members") %>
</h1>
</div>
</div>
</div>
Expand All @@ -22,15 +25,6 @@
</div>

<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h2>
<%= link_to current_organization.name,
organization_path(current_organization) %>
</h2>
</div>
</div>

<div class="row to-member-cards">
<%= render partial: 'member_card', collection: @member_view_models, as: :member %>
</div>
Expand Down
13 changes: 6 additions & 7 deletions app/views/users/manage.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h1><%= t(".members") %></h1>
<h1>
<%= link_to current_organization.name, current_organization %>
<%= t("users.index.members") %>
</h1>
</div>
</div>
</div>
Expand Down Expand Up @@ -30,17 +33,13 @@
</div>
</div>
</div>
<br>

<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h2>
<%= link_to current_organization.name,
organization_path(current_organization) %>
</h2>

<div class="table-responsive">
<table class="table table-hover table-condensed users panel">
<table class="table table-hover table-condensed panel">
<thead>
<tr>
<th></th>
Expand Down
1 change: 1 addition & 0 deletions config/initializers/active_admin.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ActiveAdmin.setup do |config|
config.site_title = "TimeOverflow"
config.site_title_link = "/"
config.footer = "TimeOverflow Admin | www.timeoverflow.org"
config.authentication_method = :authenticate_superuser!
config.current_user_method = :current_user
config.logout_link_path = :destroy_user_session_path
Expand Down
25 changes: 0 additions & 25 deletions config/locales/ca.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
ca:
active_admin:
comments:
author_type: Tipus d'autor
resource_type: Tipus de recurs
users:
organization: Banc de temps
upload_csv: Fitxer
Expand Down Expand Up @@ -36,7 +33,6 @@ ca:
phone: Telèfon
public_opening_times: Horari d'atenció al públic
reg_number_seq: Nombre de seqüència d'usuari
theme: Tema visual
updated_at: Actualitzat
post:
category: Categoria
Expand Down Expand Up @@ -154,28 +150,10 @@ ca:
type_of_swaps: Tipus d'intercanvis
users: Usuaris
without_offers: Sense ofertes publicades
organization_list:
address: Direcció
city: Ciutat
description: Descripció
email: Correu
neighborhood: Barri
not_member: No ets membre de cap Banc de Temps, per fer servir el sistema hauràs de posar-te en contacte amb un dels Bancs de Temps del sistema
phone: Telèfon
public_opening_times: Horari d'atenció al públic
time_bank: Banc de Temps
welcome: Benvingut a Timeoverflow %{user}.
terms_conditions: Termes del servei
tips:
entertag: Introdueix etiquetes separades per comes
user_not_found: Usuari no trobat.
categories:
index:
add: Afegir servei
all: Totes
global: Globals
local: Locals
tree: Principals
devise:
confirmations:
confirmed: El teu compte ha estat confirmat amb èxit.
Expand Down Expand Up @@ -534,13 +512,10 @@ ca:
account_deactivated: El teu compte ha estat desactivat per aquest Banc de Temps
actions: Accions
active_warning: Estàs a punt de canviar l'estat de l'usuari %{username}
active_warning_angular: Vas a canviar l'estat del compte de l'usuari {{username}}
cancel_warning: Estàs a punt d'esborrar el compte de l'usuari %{username}
cancel_warning_angular: Vas a eliminar del banc a l'usuari {{username}}
create: Crear nou usuari
deactivated_warning: 'Si creus que el vostre compte es podria haver desactivat per error, poseu-vos en contacte amb l''administrador amb la informació que es proporciona a continuació. '
manage_warning: Estàs a punt de canviar els permisos de l'usuari %{username}
manage_warning_angular: Vas a canviar els permisos de l'usuari {{username}}
members: Membres
user_created: Usuari %{uid} %{name} guardat
member_card:
Expand Down
Loading