aboutsummaryrefslogtreecommitdiff
path: root/app/views/agents/_agent.html.erb
blob: fda8bd0bced97a6461f9950bfd4c09eec2176bc3 (plain)
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
<article class="agent" id="agent-<%= agent.to_param %>">
    <header>
        <h1><%= link_to agent.name, agent_url(agent) %></h1>
        <h2><%= link_to agent_url(agent) %></h1>
    </head>
    <% if current_agent == agent %>
        <section class="agent-info">
            <h3>Vous faîtes partie de cet agent</h3>
            <p>Ainsi que <%= pluralize(agent.members.count, 'membre') %>.</p>
            <nav>
                <ul>
                    <li><%= link_to 'Edit', edit_agent_url(agent) %></li>
                </ul>
            </nav>
        </section>
    <% end %>
    <section id="stats">
        <h3>Statistiques</h3>
        <ul>
            <li><%= link_to pluralize(agent.resources.count, 'Resource'), agent_resources_url(agent) %></li>
            <li><%= link_to pluralize(agent.taxonomies.count, 'Taxonomy'), agent_taxonomies_url(agent) %> with
                <%= pluralize(agent.categories.count, 'Category') %> and
                <%= pluralize(agent.sections.count, 'Section') %>.</li>
        </ul>
    </section>
</article>

<% content_for :debug do %>
<%=tag.pre agent.inspect %>
<% end %>