summaryrefslogtreecommitdiff
path: root/app/views/admin/participants/_form.html.erb
blob: f426ca8c69acd889f6b2fe012df3a29ce8892254 (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
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
<!--
Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de).

This file is part of ECS.

ECS is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

ECS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public
License along with ECS. If not, see <http://www.gnu.org/licenses/>.
-->


<% if @participant.errors.any? %>
<div id="error_explanation">
  <h2><%= pluralize(@participant.errors.count, "error") %> prohibited
    this Participant from being updated</h2>
  <ul>
  <% @participant.errors.full_messages.each do |msg| %>
    <li><%= msg %></li>
  <% end %>
  </ul>
</div>
<% end %>

<p><label for="participant_name" class="box2 table-resource-label">Name:</label>
<%= form.text_field :name %></p>

<p>
<div class="formular-input-width">
<div class="table-border">
<div class="table-header">
  <label class="table-resource-label">Description (optional):</label>
</div>
<%= form.text_area :description, :rows => 2 , :style => "width:99.5%" %>
</div>
</div>

<p>
<table>
<tr>
<td><label for="participant_dns" class="box2 table-resource-label">DNS:</label></td>
<td><%= form.text_field :dns %></td>
</tr>
<tr>
<td><label for="participant_email" class="box2 table-resource-label">Email:</label></td>
<td><%= form.text_field :email %></td>
</tr>
</table>
</p>

<p><label for="participant_organization_id" class="box2 table-resource-label">Organization-Abreviation:</label>
<%= form.collection_select(:organization_id, @organizations, :id, :orgtext) %></p>

<p><label for="participant_community_selfrouting" class="box2 table-resource-label">Community Selfrouting:</label>
<%= form.check_box :community_selfrouting %></p>

<p><label for="participant_events_" class="box2 table-resource-label">Events:</label>
<%= form.check_box :events_ %></p>

<p>
<div class="formular-input-width">
<div class="table-border">
<div class="table-header">
  <label class="table-resource-label">Authentication-IDs:</label>
</div>
  <table border="0" frame="box" rules="none" valign="top" width="100%">
    <tr align="left">
      <th style="width:30%">ID:</th>
      <th style="width:60%">Description (optional):</th>
      <th style="width:10%">delete</th>
    </tr>
    <%= form.fields_for :identities do |ident| %>
      <tr align="left" valign="top">
        <td><%= ident.text_field :name, :style => "width:100%" %></td>
        <TD><%= ident.text_area :description, :rows => 1, :style => "width:100%" %></TD>
        <% unless ident.object.new_record? %>
            <td valign='middle'>
            <%= ident.check_box :_destroy %>
            <!-- %= ident.label :_delete, 'delete' %> -->
            </td>
        <% else %>
            <td></td>
        <% end %>
      </tr>
    <% end %>
  </table>
</div>
</div>

<p>
<div class="formular-input-width">
<div class="table-border">
<div class="table-header">
  <label class="table-resource-label">Communities:</label>
</div>
  <!-- <table border="1" frame="box" rules="all" valign="top"> -->
  <table class="list" width="100%">
  
    <tr align="left">
      <th>Name:</th>
      <th>Description (optional):</th>
      <th>join</th>
    </tr>
  
    <% Community.all.each do |community| %>
  	    <tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>">
  <!--      <tr align="left" valign="top"> -->
          <TD>
            <%= link_to h(community.name), admin_community_path(community) %>
          </TD>
          <TD>
            <%= h(community.description).gsub(/\r\n/,'<BR />') %>
          </TD>
          <td valign='middle'>
            <%= check_box_tag "participant[community_ids][]", community.id, @participant.communities.include?(community) %> 
          </td>
        </tr>
    <% end %>
  </table>
</div>
</div>
</p>