_email.html.erb 1009 Bytes
Newer Older
Birger Schacht's avatar
Birger Schacht committed
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
<div class="form-group">
<div class="input-group mb-1">
  <%=
  text_field_tag('localpart', "", class: 'form-control', required: true)
  %>
  <div class="input-group-prepend input-group-append">
    <span class="input-group-text">@</span>
  </div>
  <%=
  domains = ['immerda.ch'] if domains.blank?
  if domains.length == 1
    text_field_tag('domain', domains, class: 'form-control', readonly: true)
  else
    select_tag('domain', options_for_select(domains, 'immerda.ch'), class: 'form-control')
  end
  %>
</div>
<small id="emailHelp" class="form-text text-muted">
  <%= t(:localpart_generate) %> <%= link_to t(:username), 'javascript:;', onclick: "randomUsername(update);"%>, <%= link_to "#{t(:words)} (en)", 'javascript:;', onclick: "randomProjectname(3, update);"%> or <%= link_to "#{t(:words)} (de)", 'javascript:;', onclick: "randomGermanProjectname(3, update);"%>
</small>
</div>
<script>
  function update(name) {
    var v = document.getElementById('localpart');
    v.value = name;
  }
</script>