Skip to content

Commit 827a6f6

Browse files
committed
add warning for user with no memberships
1 parent d88be54 commit 827a6f6

File tree

12 files changed

+143
-123
lines changed

12 files changed

+143
-123
lines changed

app/admin/user.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
column :posts do |u|
3333
u.posts.count
3434
end
35+
column :created_at
3536
actions
3637
end
3738

app/assets/stylesheets/application.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ ul.statistics li{
302302
padding-left: 1.5rem;
303303
}
304304

305+
.alert a {
306+
text-decoration: underline;
307+
}
308+
305309
// fields that contain an error
306310
.field_with_errors{
307311
color: red;

app/models/user.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ def active?(organization)
9494
organization && !!(as_member_of(organization).try :active)
9595
end
9696

97+
def memberships?
98+
members.any?
99+
end
100+
97101
def member(organization)
98102
members.where(organization_id: organization).first
99103
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="alert alert-info">
2+
<%= t('layouts.application.no_memberhsip_warning', link: organizations_path).html_safe %>
3+
</div>

app/views/layouts/application.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<div class="container content">
1818
<%= render 'layouts/messages' unless devise_controller? %>
1919
<div class="container-fluid">
20+
<%= render 'application/no_membership_warning' if current_user && !current_user.memberships? && !devise_controller? %>
2021
<%= yield %>
2122
</div>
2223
<%= organization_logo %>

config/locales/ca.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ ca:
319319
help: Ajuda
320320
login: Entra
321321
manage_memberships: Gestiona membres
322+
no_memberhsip_warning:
322323
report:
323324
report_title: INFORME
324325
locales:
@@ -393,8 +394,8 @@ ca:
393394
banner-title: Ets un Banc de Temps?
394395
empower-adbdt: ADBdT
395396
empower-adbdt-title: Associació pel Desenvolupament dels Bancs de Temps
396-
empower-coopdevs: CoopDevs
397-
empower-coopdevs-title: CoopDevs
397+
empower-coopdevs: Coopdevs
398+
empower-coopdevs-title: Coopdevs
398399
empower-github: Github
399400
empower-github-title: Github
400401
empower-showmap: veure mapa
@@ -417,7 +418,7 @@ ca:
417418
title2: als Bancs de Temps
418419
petitions:
419420
application_sent: Sol·licitud enviada correctament
420-
application_sent_body: Hola! La teva sol·licitud a %{organization_name} s'ha enviat correctament.
421+
application_sent_body: Hola! La teva sol·licitud a %{organization_name} s'ha enviat correctament. Algú de l'equip del banc de temps es posarà en contacte amb tu per finalitzar el procés dalta.
421422
application_status: Sol·licitud %{status}
422423
applications: Sol·licituds
423424
apply: Sol·licita unir-te

config/locales/en.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ en:
319319
help: Help
320320
login: Login
321321
manage_memberships: Manage memberships
322+
no_memberhsip_warning: Remember users without membership (15 days after register) they should ask for membership in <a href="%{link}">some Organization</a> or the user will be deleted when user have 1 month on the platform without any membership.
322323
report:
323324
report_title: REPORT
324325
locales:
@@ -393,8 +394,8 @@ en:
393394
banner-title: Are you a Time Bank?
394395
empower-adbdt: ADBdT
395396
empower-adbdt-title: Association for the Development of Time Banks
396-
empower-coopdevs: CoopDevs
397-
empower-coopdevs-title: CoopDevs
397+
empower-coopdevs: Coopdevs
398+
empower-coopdevs-title: Coopdevs
398399
empower-github: Github
399400
empower-github-title: Github
400401
empower-showmap: see map

config/locales/es.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ es:
319319
help: Ayuda
320320
login: Entra
321321
manage_memberships: Gestionar membresia
322+
no_memberhsip_warning:
322323
report:
323324
report_title: INFORME
324325
locales:
@@ -393,8 +394,8 @@ es:
393394
banner-title: "¿Eres un Banco de Tiempo?"
394395
empower-adbdt: ADBdT
395396
empower-adbdt-title: Asociación para el Desarrollo de los Bancos de Tiempo
396-
empower-coopdevs: CoopDevs
397-
empower-coopdevs-title: CoopDevs
397+
empower-coopdevs: Coopdevs
398+
empower-coopdevs-title: Coopdevs
398399
empower-github: Github
399400
empower-github-title: Github
400401
empower-showmap: ver mapa
@@ -417,7 +418,7 @@ es:
417418
title2: los Bancos de Tiempo
418419
petitions:
419420
application_sent: Solicitud enviada correctamente
420-
application_sent_body: 'Hola! Tu solicitud a %{organization_name} se ha enviado correctamente. '
421+
application_sent_body: Hola! Tu solicitud a %{organization_name} se ha enviado correctamente. Alguien del equipo del banco de tiempo se pondrá en contacto contigo para finalizar el proceso de alta.
421422
application_status: Solicitud %{status}
422423
applications: Solicitudes
423424
apply: Solicita unirte

config/locales/eu.yml

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ eu:
6565
notifications: Jaso eposta jakinarazpenak
6666
organization: Erakundea
6767
phone: Telefonoa
68-
postcode:
68+
postcode:
6969
push_notifications: Jaso jakinarazpenak sakelakoan
7070
registration_date: Erregistratze-da
7171
registration_number: Erabiltzaile kodea
@@ -274,29 +274,29 @@ eu:
274274
contact_details: Kontaktuaren datuak
275275
create: Sortu
276276
date: Datuak
277-
decline:
277+
decline:
278278
delete: Ezabatu
279279
demote: Ohiko erabiltzaile bihurtu
280280
edit: Aldaketak egin
281281
enter_to_timebank: Denbora Bankuan sartu
282282
filter: Iragazkia
283283
from: tik
284284
give_time: Denbora eman
285-
here:
285+
here:
286286
home: Hasiera
287287
information: Informazioa
288288
locales_header: Hizkuntza aldatu
289289
member_count: Erabiltzaile zenbakia
290290
more: 'Gehiago ikusi '
291291
movements: Mugimenduak
292292
next: Hurrengoa
293-
or:
293+
or:
294294
promote: Administratzaile bihurtu
295295
reason: Arrazoia
296296
required_field: Derrigorrez bete beharrekoa
297297
save: Gorde
298298
search: Bilatu
299-
search_location:
299+
search_location:
300300
show: Erakutsi
301301
source_destination: Jatorria/ helmuga
302302
statistics: Estatistika
@@ -313,12 +313,13 @@ eu:
313313
layouts:
314314
application:
315315
about: TimeOverflowri buruz
316-
bdtnear:
316+
bdtnear:
317317
edit_org: " %{organization} aldaketak egin"
318318
edit_profile: Nire profila aldatu
319319
help: Laguntza
320320
login: Sartu
321-
manage_memberships:
321+
manage_memberships:
322+
no_memberhsip_warning:
322323
report:
323324
report_title: TXOSTENA
324325
locales:
@@ -383,7 +384,7 @@ eu:
383384
new: Banku berria
384385
show:
385386
contact_information: kontaktuaren informazioa
386-
join_timebank:
387+
join_timebank:
387388
pages:
388389
about:
389390
app-mobile: Mugikorrerako Appa
@@ -393,8 +394,8 @@ eu:
393394
banner-title: Denbora banku bat al zara?
394395
empower-adbdt: ADBdT
395396
empower-adbdt-title: Denbora Bankuen garapenerako elkartea
396-
empower-coopdevs: CoopDevs
397-
empower-coopdevs-title: CoopDevs
397+
empower-coopdevs: Coopdevs
398+
empower-coopdevs-title: Coopdevs
398399
empower-github: Github
399400
empower-github-title: Github
400401
empower-showmap: Mapa ikusi
@@ -416,25 +417,25 @@ eu:
416417
title: Denbora bankuek diseinaturiko softwarea,
417418
title2: Denbora bankuentzat
418419
petitions:
419-
application_sent:
420-
application_sent_body:
421-
application_status:
422-
applications:
423-
apply:
424-
new:
425-
new_body:
420+
application_sent:
421+
application_sent_body:
422+
application_status:
423+
applications:
424+
apply:
425+
new:
426+
new_body:
426427
status:
427-
accepted:
428-
declined:
429-
pending:
430-
sent:
431-
status_applications:
428+
accepted:
429+
declined:
430+
pending:
431+
sent:
432+
status_applications:
432433
posts:
433434
show:
434435
info: "%{type} hau %{organization}(e)ri dagokio."
435436
reports:
436437
download: Jaitsi
437-
download_all:
438+
download_all:
438439
shared:
439440
movements:
440441
delete_reason: Zihur zaude azalpen hau ezabatu nahi duzula?
@@ -521,12 +522,12 @@ eu:
521522
error_amount: Denbora 0 baino handiagoa izan behar da
522523
users:
523524
avatar:
524-
change_your_image:
525-
crop_the_image:
526-
max_size_warning:
525+
change_your_image:
526+
crop_the_image:
527+
max_size_warning:
527528
confirm_email:
528-
email_sent:
529-
please:
529+
email_sent:
530+
please:
530531
edit:
531532
edit_user: Erabiltzailea aldatu
532533
form:
@@ -563,7 +564,7 @@ eu:
563564
from_to: Jatorria/ Helmuga
564565
inactive: "( Ez erabilgarri)"
565566
inactive_user: Erabiltzailea ez dago erabilgarri
566-
invalid_format:
567+
invalid_format:
567568
phone:
568569
one: Telefono zenbakia
569570
other: Telefono zenbakiak
@@ -576,9 +577,9 @@ eu:
576577
active_warning: " %{user} erabiltzailearen kontuaren egoera aldatuko duzu"
577578
cancel_warning: " %{user} erabiltzailea D bankutik ezabatuko duzu"
578579
deactivate: Desaktibatu
579-
delete_membership:
580+
delete_membership:
580581
manage_warning: "%{user} erabiltzailearen onurak aldatuko dituzu"
581-
sure_delete:
582+
sure_delete:
582583
views:
583584
pagination:
584585
first: Lehenengoa

config/locales/fr.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ fr:
319319
help: Aide
320320
login: Connexion
321321
manage_memberships: Gérer les inscriptions
322+
no_memberhsip_warning:
322323
report:
323324
report_title: RAPPORT
324325
locales:
@@ -393,8 +394,8 @@ fr:
393394
banner-title: Êtes-vous une Banque de temps ?
394395
empower-adbdt: ADBdT
395396
empower-adbdt-title: Association pour le développement des Banques de temps
396-
empower-coopdevs: CoopDevs
397-
empower-coopdevs-title: CoopDevs
397+
empower-coopdevs: Coopdevs
398+
empower-coopdevs-title: Coopdevs
398399
empower-github: Github
399400
empower-github-title: Github
400401
empower-showmap: Voir la map
@@ -416,19 +417,19 @@ fr:
416417
title: L'application conçue par et pour
417418
title2: Banques de temps
418419
petitions:
419-
application_sent: Demande envoyée avec succès
420-
application_sent_body: Bonjour! votre demande à %{organization_name} a bien été envoyée.
421-
application_status: Demande %{status}
422-
applications: Applications
423-
apply: Demande à nous rejoindre
424-
new: Nouvelle demande
425-
new_body: Bonjour! Nouvelle demande de %{username}. Gérer vos demandes %{here_link}.
420+
application_sent: Demande d'inscription envoyée avec succès
421+
application_sent_body: Bonjour! votre demande d'inscription à %{organization_name} a bien été envoyée.
422+
application_status: Demande d'inscription %{status}
423+
applications: Demandes d'inscription
424+
apply: Demander à nous rejoindre
425+
new: Nouvelle demande d'inscription
426+
new_body: Bonjour! Nouvelle demande d'inscription de %{username}. Gérer vos demandes %{here_link}.
426427
status:
427428
accepted: acceptée
428429
declined: déclinée
429430
pending: en attente
430431
sent: envoyée
431-
status_applications: "%{status} demandes"
432+
status_applications: Demandes d'inscription %{status}
432433
posts:
433434
show:
434435
info: Cette %{type} appartient à %{organization}.
@@ -505,9 +506,9 @@ fr:
505506
alpha_grouped_index:
506507
maintitle: Tags disponibles
507508
terms:
508-
accept: Accept
509+
accept: Accepter
509510
show:
510-
accept: Accept
511+
accept: Accepter
511512
transfers:
512513
computation:
513514
hour:

0 commit comments

Comments
 (0)