crowdAI/crowdai

View on GitHub
app/views/participants/edit.html.erb

Summary

Maintainability
Test Coverage
<div class='content'>
  <div class="masthead">
    <div class="row">
      <div class="info">
        <h2>Edit Profile</h2>
      </div>
    </div>
  </div>
  <div class="row">
    <%= form_for @participant, validate: false, html: { class: "sgl-col" } do |f| %>
    <fieldset>
      <label>Username</label>
      <%= f.text_field :name %>
      <label>First name</label>
      <%= f.text_field :first_name %>
      <label>Last name</label>
      <%= f.text_field :last_name %>

      <label>Personal Data</label>
      <p id='gdpr-text'>Download your personal data that has been collected by crowdAI.</p>
      <div class="button-group">
        <%= link_to 'Download',
              gdpr_exports_path,
              method: :post, remote: true,
              id: 'gdpr-button',
              class: 'btn btn-primary' %>
      </div>
      <br/>

      <label>Profile Picture</label>
      <div class="upload">
        <%= concept(Image::Cell,
                        @participant,
                        klass: 'img-thumb',
                        current_participant: current_participant) %>
        <%#= f.file_field :profile_image,
              multiple: false,
              direct_upload: true,
              options: { class: 'file-upload' } %>

        <%= f.file_field :image_file, class: 'file-upload' %>
        <% if @participant.image_file.present? %>
          <%= link_to 'Delete', participant_remove_image_path(@participant) %>
        <% end %>
        <span>Your image will be cropped if necessary. 5MB limit</span>
      </div>
      <label>Affiliation</label>
      <%= f.text_field :affiliation %>
      <label>Address</label>
      <%= f.text_field :address %>
      <label>City</label>
      <%= f.text_field :city %>
      <label>Country</label>
      <%= f.country_select :country_cd, { include_blank: '--- Select a country ---'}, { class: 'country-select-box' }  %>
      <label>Bio</label>
      <%= f.text_area :bio %>
      <label>Github</label>
      <%= f.text_field :github, placeholder: "URL (e.g. www.github.com/crowdai)", class: 'url' %>
      <label>LinkedIn</label>
      <%= f.text_field :linkedin, placeholder: "URL (e.g. www.linkedin.com/in/crowdai)", class: 'url' %>
      <label>Twitter</label>
      <%= f.text_field :twitter, placeholder: "URL (e.g. www.twitter.com/crowdai)", class: 'url' %>
      <label>Website</label>
      <%= f.text_field :website, placeholder: "URL (e.g. www.crowdai.org)", class: 'url' %>
      <div class="button-group">
        <%= f.button "Save", class: 'btn btn-primary' %>
        <%= link_to 'Cancel', participant_path(@participant), class: "btn btn-secondary" %>
      </div>
    </fieldset>
    <% end %>
  </div>
</div>