ArturT/Railstom

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

Summary

Maintainability
Test Coverage
<% content_for :my_account_content do %>
  <h2><%= t('.title') %></h2>

  <%= simple_form_for(current_user, url: user_settings_path) do |f| %>
    <div class="row extra-margin-top">
      <div class="large-12 columns">
        <%= f.input :nickname, label: t('.labels.nickname'), hint: t('.hints.nickname') %>
      </div>
    </div>

    <div class="row">
      <div class="large-12 columns">
        <%= image_tag current_user.avatar.normal.url, class: 'th' %>
      </div>
    </div>
    <div class="row extra-margin-top">
      <div class="large-12 columns">
        <%= f.input :avatar, label: t('.labels.avatar') %>
      </div>
    </div>

    <% if current_user.avatar? %>
      <div class="row extra-margin-top">
        <div class="large-12 columns">
          <%= f.input :remove_avatar, as: :boolean, label: t('.labels.remove_avatar') %>
        </div>
      </div>
    <% end %>

    <div class="row extra-margin-top">
      <div class="large-12 columns">
        <%= f.input :enabled_newsletter, as: :boolean, label: t('.labels.enabled_newsletter') %>
      </div>
    </div>

    <div class="row extra-margin-top">
      <div class="large-12 columns">
        <%= f.input :preferred_language, collection: Locale.collection_of_languages, include_blank: false, label: t('.labels.preferred_language') %>
      </div>
    </div>

    <div class="row extra-margin-top">
      <div class="large-12 columns">
        <%= f.hidden_field :avatar_cache %>
        <%= button_tag t('layouts.application.buttons.save'), data: { 'load-icon' => 'append', 'load-icon-margin' => 'left:10px' } %>
      </div>
    </div>
  <% end %>
<% end %>

<%= render 'common/my_account' %>