create.html.erb 912 Bytes
Newer Older
o@immerda.ch's avatar
o@immerda.ch committed
1
2
<h3> <%= t(:new_resource) %></h3>

3
4
<nav>
  <div class="nav nav-tabs" id="nav-tab" role="tablist">
5
    <% @resource_names.sort.each do |pane| %>
6
7
8
      <a class="nav-item nav-link <%= if pane == @resource_name then "active" else "" end %>"
           href="?resource_name=<%= pane %>"
         role="tab">
9
         <%= t(pane) %>
10
11
12
13
14
15
16
17
      </a>
    <% end %>
  </div>
</nav>

<p>

<% if @resource_name  && !@disabled %>
o@immerda.ch's avatar
o@immerda.ch committed
18
19
20
21
22
23

<%
q = @resource_quota[@resource_name]
allowed = [q['max'].to_i - q['cur'].to_i, 0].max
%>

o@immerda.ch's avatar
o@immerda.ch committed
24
25
<div class="alert" role="alert">
  <%= t("#{@resource_name}_description") %>
o@immerda.ch's avatar
o@immerda.ch committed
26
27
  <br />
  <%= t(:quota_msg, count: allowed) %>
o@immerda.ch's avatar
o@immerda.ch committed
28
29
</div>

o@immerda.ch's avatar
o@immerda.ch committed
30
31
32

<% if allowed > 0 %>

33
34
35
<%= form_tag do %>
  <%= hidden_field_tag 'resource_name', @resource_name %>

Birger Schacht's avatar
Birger Schacht committed
36
  <%= render 'email', domains: @resource_schema['domain'] %>
37
38
39
40

  <%= submit_tag t(:create), name: 'create', class: "btn btn-primary" %>
<% end %>
<% end %>
o@immerda.ch's avatar
o@immerda.ch committed
41
<% end %>
42
43

</p>