3296: add comments to applicaiton.defaults.yml describing the user_profile_form_field...
[arvados.git] / apps / workbench / app / views / users / _profile.html.erb
1 <div>
2       <div class="panel panel-default">
3         <div class="panel-heading">
4           <h4 class="panel-title">
5             Profile
6           </h4>
7         </div>
8         <div class="panel-body">
9           <div>
10             <p>You can manage your profile using this page. 
11                Any feilds in <font style="color:red">red</font> are required and missing. 
12                Please fill in those fields before you can accesse Arvados Workbench.</p><br/>
13           </div>
14           <div>
15             <%= form_tag update_profile_path, {method: 'get', id: 'save_profile_form', name: 'save_profile_form', class: 'form-horizontal', remote: true} do %>
16             <% @profile_config.andand.each do |entry| %>
17               <% 
18                   label = entry['required'] ? '* ' : ''
19                   label += entry['form_field_title']
20                   value = @current_user_profile[entry['key'].to_sym] if @current_user_profile
21               %>
22                 <div class="form-group">
23                   <label for="<%=entry['key']%>"
24                          class="col-sm-3 control-label"
25                          style=<%="color:red" if entry['required']&&!value%>> <%=label%>
26                   </label>
27                   <% if entry['type'] == 'select' %>
28                     <div class="col-sm-9">
29                       <select class="form-control" id="<%=entry['key']%>" name="<%=entry['key']%>">
30                         <% entry['options'].each do |option| %>
31                           <option value="<%=option%>" <%='selected' if option==value%>><%=option%></option>
32                         <% end %>
33                       </select>
34                     </div>
35                   <% else %>
36                     <div class="col-sm-9">
37                       <input type="text" class="form-control" id="<%=entry['key']%>" name="<%=entry['key']%>" placeholder="<%=entry['form_field_description']%>" value="<%=value%>" ></input>
38                     </div>
39                   <% end %>
40                 </div>
41               <% end %>
42
43                 <div class="form-group">
44                   <div class="col-sm-offset-2 col-sm-10">
45                     <button type="submit" class="btn btn-primary">Save profile</button>
46                   </div>
47                 </div>
48
49               <% end %>
50           </div>
51         </div>
52       </div>
53 </div>
54