forked from openware/barong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.html.erb
137 lines (129 loc) · 3.95 KB
/
show.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<div class="container">
<h4 class="text-center"> Profile </h4>
<ul class="list-group">
<li class="list-group-item">
<b> E-mail: </b>
<%= @account.email%>
</li >
<li class="list-group-item">
<b>Phones:</b>
<% @phones.each do |phone| %>
<%= phone.number%>
<% end %>
</li >
<li class="list-group-item">
<b> First Name: </b>
<%= @profile.first_name%>
</li>
<li class="list-group-item">
<b> Last Name: </b>
<%= @profile.last_name%>
</li>
<li class="list-group-item">
<b> Address: </b>
<%= @profile.address%>
</li>
<li class="list-group-item">
<b> Postcode: </b>
<%= @profile.postcode%>
</li>
<li class="list-group-item">
<b> City: </b>
<%= @profile.city%>
</li>
<li class="list-group-item">
<b> Country: </b>
<%= @profile.country%>
</li>
<li class="list-group-item">
<b> State: </b>
<div class="dropdown show">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<%= @profile.state.upcase_first %>
</a>
<div class="dropdown-menu">
<% Profile::STATES.each do |state|%>
<%= link_to(state.upcase_first, change_state_admin_profile_path(@account.profile, state: state), method: :put, class: 'dropdown-item') unless @account.profile.state == state%>
<% end %>
</div>
</div>
</li>
<li class="list-group-item">
<%= link_to 'Edit', edit_admin_profile_path(@account.profile), class: 'btn btn-primary btn-sm' %>
</li>
</ul>
<br>
<h4 class="text-center"> Phones </h4>
<table class="table table-bordered table-striped table-hover table-sm text-center">
<thead>
<tr>
<th>ID</th>
<th>Country</th>
<th>Number</th>
<th>Vlidated at</th>
</tr>
</thead>
<tbody>
<% @phones.each do |phone| %>
<tr>
<td><%= phone.id %></td>
<td><%= phone.country %></td>
<td><%= phone.number %></td>
<td><%= phone.validated_at %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<h4 class="text-center"> Documents </h4>
<table class="table table-bordered table-striped table-hover table-sm text-center">
<thead>
<tr>
<th>ID</th>
<th>Doc Photo</th>
<th>Doc Name</th>
<th>Doc Type</th>
<th>Doc Number</th>
<th>Doc Expire</th>
</tr>
</thead>
<tbody>
<% @documents.each do |document| %>
<tr>
<td><%= document.id %></td>
<td><%= document.upload.present? ? link_to(image_tag(document.upload.url, width: '100', alt: 'Doc Preview'), asset_path(document.upload), target: '_blank') : ''%></td>
<td><%= document.upload&.file&.filename%></td>
<td><%= document.doc_type %></td>
<td><%= document.doc_number %></td>
<td><%= document.doc_expire %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Label', new_admin_account_label_path(@account.id), class: 'btn btn-success' %>
<br>
<h4 class="text-center"> Labels </h4>
<table class="table table-bordered table-striped table-hover table-sm text-center">
<thead>
<tr>
<th>ID</th>
<th>Key</th>
<th>Value</th>
<th>Scope</th>
</tr>
</thead>
<tbody>
<% @labels.each do |label| %>
<tr>
<td><%= label.id %></td>
<td><%= label.key %></td>
<td><%= label.value %></td>
<td><%= label.scope %></td>
<td><%= link_to 'Edit', edit_admin_account_label_path(id: label.id, account_id: @account.id), class: 'btn btn-primary btn-sm' %></td>
<td><%= link_to 'Delete', admin_account_label_path(id: label.id, account_id: @account.id), class: 'btn btn-danger btn-sm', method: :delete, data: {confirm: 'Are you sure?'} %></td>
</tr>
<% end %>
</tbody>
</table>
</div>