user_prefs = User.limit(1).where(uuid: current_user.uuid).first.prefs
current_user_profile = user_prefs[:profile] if user_prefs
%>
- <div>
- <div class="panel panel-default">
+<div>
+ <div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Profile
</div>
<div class="panel-body">
<div>
- <p>You can manage your profile using this page.
- Any feilds in <font style="color:red">red</font> are required and missing.
- Please fill in those fields before you can accesse Arvados Workbench.</p><br/>
+ <% profile_message = 'You can manage your profile using this page. Any feilds in red are required and missing.
+ Please fill in those fields before you can accesse Arvados Workbench.'
+ profile_config.andand.each do |entry|
+ if entry['message']
+ profile_message = entry['message']
+ break
+ end
+ end %>
+ <p> <%=profile_message%> </p><br/>
</div>
<div>
<%= form_tag update_profile_path, {method: 'put', id: 'save_profile_form', name: 'save_profile_form', class: 'form-horizontal', remote: true} do %>
</div>
<% profile_config.andand.each do |entry| %>
- <%
- label = entry['required'] ? '* ' : ''
- label += entry['form_field_title']
- value = current_user_profile[entry['key'].to_sym] if current_user_profile
- %>
- <div class="form-group">
- <label for="<%=entry['key']%>"
- class="col-sm-3 control-label"
- style=<%="color:red" if entry['required']&&!value%>> <%=label%>
- </label>
- <% if entry['type'] == 'select' %>
- <div class="col-sm-9">
- <select class="form-control" id="<%=entry['key']%>" name="<%=entry['key']%>">
- <% entry['options'].each do |option| %>
- <option value="<%=option%>" <%='selected' if option==value%>><%=option%></option>
- <% end %>
- </select>
- </div>
- <% else %>
- <div class="col-sm-9">
- <input type="text" class="form-control" id="<%=entry['key']%>" name="<%=entry['key']%>" placeholder="<%=entry['form_field_description']%>" value="<%=value%>" ></input>
- </div>
- <% end %>
- </div>
+ <% if entry['key'] %>
+ <%
+ label = entry['required'] ? '* ' : ''
+ label += entry['form_field_title']
+ value = current_user_profile[entry['key'].to_sym] if current_user_profile
+ %>
+ <div class="form-group">
+ <label for="<%=entry['key']%>"
+ class="col-sm-3 control-label"
+ style=<%="color:red" if entry['required']&&!value%>> <%=label%>
+ </label>
+ <% if entry['type'] == 'select' %>
+ <div class="col-sm-9">
+ <select class="form-control" id="<%=entry['key']%>" name="<%=entry['key']%>">
+ <% entry['options'].each do |option| %>
+ <option value="<%=option%>" <%='selected' if option==value%>><%=option%></option>
+ <% end %>
+ </select>
+ </div>
+ <% else %>
+ <div class="col-sm-9">
+ <input type="text" class="form-control" id="<%=entry['key']%>" name="<%=entry['key']%>" placeholder="<%=entry['form_field_description']%>" value="<%=value%>" ></input>
+ </div>
+ <% end %>
+ </div>
+ <% end %>
<% end %>
<div class="form-group">
<% end %>
</div>
</div>
- </div>
+ </div>
</div>
user_profile_form_fields: false
# Below is a sample setting of user_profile_form_fields.
- # This sample configures two fields as represented by the attribute "key".
- # You can specify "type" as "text" or "select".
- # Specify "options" when using the type "select".
- # Set "required" as "true" for any of the fields to make them required.
- # If any of the required fields are missing in the user's profile, the user will be
- # redirected to the "/profile" page before they can access any Workbench features.
+ # Use "message" to configure a message you want to display at the top of the profile page.
+ # This sample configures two fields as represented by the attribute "key". For these fields,
+ # You can specify "type" as "text" or "select".
+ # Specify "options" when using the type "select".
+ # Set "required" as "true" for any of the fields to make them required.
+ # If any of the required fields are missing in the user's profile, the user will be
+ # redirected to the profile page before they can access any Workbench features.
#user_profile_form_fields:
+ # - message: Welcome to Curoverse. Any fields in red are required and missing. Please fill in those fields before you can access Arvados Workbench.
# - key: organization
# type: text
# form_field_title: Institution/Company