displays failed census calls [#500]
This commit is contained in:
@@ -12,6 +12,17 @@ module AdminHelper
|
|||||||
options
|
options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def humanize_document_type(document_type)
|
||||||
|
case document_type
|
||||||
|
when "1"
|
||||||
|
t "verification.residence.new.document_type.spanish_id"
|
||||||
|
when "2"
|
||||||
|
t "verification.residence.new.document_type.passport"
|
||||||
|
when "3"
|
||||||
|
t "verification.residence.new.document_type.residence_card"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def namespace
|
def namespace
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class User < ActiveRecord::Base
|
|||||||
has_many :debates, -> { with_hidden }, foreign_key: :author_id
|
has_many :debates, -> { with_hidden }, foreign_key: :author_id
|
||||||
has_many :proposals, -> { with_hidden }, foreign_key: :author_id
|
has_many :proposals, -> { with_hidden }, foreign_key: :author_id
|
||||||
has_many :comments, -> { with_hidden }
|
has_many :comments, -> { with_hidden }
|
||||||
|
has_many :failed_census_calls
|
||||||
|
|
||||||
validates :username, presence: true, unless: :organization?
|
validates :username, presence: true, unless: :organization?
|
||||||
validates :username, uniqueness: true, unless: :organization?
|
validates :username, uniqueness: true, unless: :organization?
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<div>
|
||||||
|
<%= humanize_document_type(failed_census_call.document_type) %>
|
||||||
|
<%= failed_census_call.document_number %>
|
||||||
|
<%= l(failed_census_call.date_of_birth) %>
|
||||||
|
<%= failed_census_call.postal_code %>
|
||||||
|
</div>
|
||||||
@@ -17,6 +17,9 @@
|
|||||||
<% @users.each do |user| %>
|
<% @users.each do |user| %>
|
||||||
<li id="<%= dom_id(user) %>">
|
<li id="<%= dom_id(user) %>">
|
||||||
<%= link_to user.name, admin_user_path(user) %>
|
<%= link_to user.name, admin_user_path(user) %>
|
||||||
|
<% if !user.residence_verified? %>
|
||||||
|
<%= render partial: 'failed_census_call', collection: user.failed_census_calls %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user