mysociety/alaveteli

View on GitHub
app/views/user_profile/about_me/edit.html.erb

Summary

Maintainability
Test Coverage
<%= foi_error_messages_for :user %>

<%= form_for @user, :url => profile_about_me_path do |f| %>
  <div class="form_note">
    <h1><%= _('Edit text about you') %></h1>

    <p>
      <%= _('What are you investigating using Freedom of Information?') %>
    </p>

    <p>
      <%= _("This will appear on your {{site_name}} profile, to make it " \
            "easier for others to get involved with what you're doing.",
            :site_name => site_name) %>
    </p>
  </div>

  <p>
    <label class="form_label" for="user_about_me">
      <%= _('About you:') %>
    </label>
    <% about_me_opts = { :rows => 5, :cols => 55 } %>
    <% about_me_opts.merge!({ :disabled => 'disabled' }) if @user.suspended? %>
    <%= f.text_area :about_me, about_me_opts %>
  </p>

  <div class="form_note">
    <p>
      <%= _('Include relevant links, such as to a campaign page, your blog ' \
            'or a twitter account. They will be made clickable. e.g.') %>
      <a href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>">
        https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>
      </a>
    </p>
  </div>

  <div class="form_button">
    <%= f.submit _('Save') %>
  </div>
<% end %>