@@ -9,7 +9,7 @@ class AgentsController < ApplicationController |
||
| 9 | 9 |
end |
| 10 | 10 |
|
| 11 | 11 |
def list |
| 12 |
- @users = User.all |
|
| 12 |
+ @users = User.all.where("sign_in_count > ?", 0).where("first_name != ?", "").order('created_at DESC')
|
|
| 13 | 13 |
end |
| 14 | 14 |
|
| 15 | 15 |
def show |
@@ -1,11 +1,53 @@ |
||
| 1 |
-<%= content_tag(:div, class: 'container top-container') do %> |
|
| 1 |
+<% title "#{t 'mission.agent_list'} - #{@config.website_name}" %>
|
|
| 2 |
+<%= render :partial => 'layouts/flash' %> |
|
| 3 |
+ |
|
| 4 |
+<%= content_tag(:div, class: 'container top-container last-container') do %> |
|
| 2 | 5 |
<%= content_tag(:div, class: 'row') do %> |
| 3 | 6 |
<%= content_tag(:div, class: 'span12') do %> |
| 4 | 7 |
<% # Page Content %> |
| 5 |
- <%= bootstrap_flash %> |
|
| 6 | 8 |
<%= content_tag(:div, class: 'page-header') do %> |
| 7 | 9 |
<%= content_tag(:h1, (t 'agent.agents')) %> |
| 8 | 10 |
<% end %> |
| 9 | 11 |
<% end %> |
| 10 | 12 |
<% end %> |
| 13 |
+ <%= content_tag(:div, class: 'row') do %> |
|
| 14 |
+ <%= content_tag(:div, class: 'span12') do %> |
|
| 15 |
+ <% @users.each do |user| %> |
|
| 16 |
+ <div class="media thumbnail" style="padding: 10px; padding-bottom: 5px;"> |
|
| 17 |
+ <span class="pull-left"> |
|
| 18 |
+ <% if user.avatar.file != nil %> |
|
| 19 |
+ <%= image_tag user.avatar.to_s, size: "50x50", :class => 'img-circle' %> |
|
| 20 |
+ <% else %> |
|
| 21 |
+ <%= image_tag "user.png", size: "50x50", :class => 'img-circle' %> |
|
| 22 |
+ <% end %> |
|
| 23 |
+ </span> |
|
| 24 |
+ <div class="media-body pull-left" style="min-width: 180px;"> |
|
| 25 |
+ <h4 class="media-heading"><%= user.full_name %></h4> |
|
| 26 |
+ <p style="margin-bottom: 0px;"><%= user.bio != nil ? user.bio : (t 'agent.empty_description') %></p> |
|
| 27 |
+ </div> |
|
| 28 |
+ |
|
| 29 |
+ <% # Mission Count %> |
|
| 30 |
+ <%= content_tag(:div, class: 'pull-right', style: 'padding: 5px; padding-bottom: 0px; padding-top: 0px; margin-top: -6px; text-align: center; margin-left: 25px;') do %> |
|
| 31 |
+ <%= content_tag(:div, class: 'dashboard-stats', style: 'width: 100%;') do %> |
|
| 32 |
+ <%= content_tag(:p, style: 'font-size: 24px; line-height: 30px; padding-top: 6px;') do %> |
|
| 33 |
+ <%= content_tag(:i, '', class: 'icon-radar') %> |
|
| 34 |
+ <%= content_tag(:span, user.directing_missions_count) %> |
|
| 35 |
+ <% end %> |
|
| 36 |
+ <%= content_tag(:p, (t 'mission.directing_missions'), style: 'margin-bottom: 1px;') %> |
|
| 37 |
+ <% end %> |
|
| 38 |
+ <% end %> |
|
| 39 |
+ <%= content_tag(:div, class: 'pull-right', style: 'padding: 5px; padding-bottom: 0px; padding-top: 0px; margin-top: -6px; text-align: center; margin-left: 25px;') do %> |
|
| 40 |
+ <%= content_tag(:div, class: 'dashboard-stats', style: 'width: 100%;') do %> |
|
| 41 |
+ <%= content_tag(:p, style: 'font-size: 24px; line-height: 30px; padding-top: 6px;') do %> |
|
| 42 |
+ <%= content_tag(:i, '', class: 'icon-mission') %> |
|
| 43 |
+ <%= content_tag(:span, user.mission_agents.count) %> |
|
| 44 |
+ <% end %> |
|
| 45 |
+ <%= content_tag(:p, (t 'mission.missions'), style: 'margin-bottom: 1px;') %> |
|
| 46 |
+ <% end %> |
|
| 47 |
+ <% end %> |
|
| 48 |
+ </div> |
|
| 49 |
+ <% end %> |
|
| 50 |
+ |
|
| 51 |
+ <% end %> |
|
| 52 |
+ <% end %> |
|
| 11 | 53 |
<% end %> |
@@ -4,6 +4,7 @@ en: |
||
| 4 | 4 |
missions: 'Missions' |
| 5 | 5 |
agents: 'Agents' |
| 6 | 6 |
agent: 'Agent' |
| 7 |
+ agent_list: 'Agent List' |
|
| 7 | 8 |
notification: 'Notification' |
| 8 | 9 |
step: 'Step' |
| 9 | 10 |
mission_control: 'Mission Control' |
@@ -4,6 +4,7 @@ pt-BR: |
||
| 4 | 4 |
missions: 'Missões' |
| 5 | 5 |
agents: 'Agentes' |
| 6 | 6 |
agent: 'Agente' |
| 7 |
+ agent_list: 'Lista de agentes' |
|
| 7 | 8 |
notification: 'Notificação' |
| 8 | 9 |
step: 'Passo' |
| 9 | 10 |
mission_control: 'Base de Comando' |