<% if current_user.scholar %>
  <h2>Scholarship</h2>
  <h3>
    Congratulations on your DEV scholarship! Your scholarship ends
    <%= current_user.workshop_expiration.nil? ? "never" : current_user.workshop_expiration.strftime("%b %d, %Y") %>.
    <br>
    <br>
      <a href="/events">See our events for the month!</a>
  </h3>
<% end %>

<h2>Features</h2>
<%= form_for(@user) do |f| %>
    <div class="sub-field">
      <%= f.label :editor_version, "Editor version: v1 or v2" %>
      <%= f.text_field :editor_version %>
      <sub><em>v2 is currently in beta</em></sub>
    </div>
    <div class="field">
      <label></label>
      <%= f.hidden_field :tab, value: @tab %>
      <%= f.submit "SUBMIT", class: "cta" %>
    </div>
<% end %>
<h2>Languages</h2>
<h3>Select which languages you'd prefer to see in your feed <span style="color:#e05252">(beta)</span></h3>
<h4 style="font-weight:400">
  This setting controls which languages you are more likely to see throughout the site, but you may still see other languages, especially English.
</h4>

<%= form_for(@user) do |f| %>
  <div class="checkbox-field">
    <div class="sub-field">
      <%= f.check_box :prefer_language_en %>
      <%= f.label :prefer_language_en, "English" %>
    </div>
    <div class="sub-field">
      <%= f.check_box :prefer_language_ja %>
      <%= f.label :prefer_language_ja, "Japanese" %>
    </div>
    <div class="sub-field">
      <%= f.check_box :prefer_language_es %>
      <%= f.label :prefer_language_es, "Spanish" %>
    </div>
    <div class="sub-field">
      <%= f.check_box :prefer_language_fr %>
      <%= f.label :prefer_language_fr, "French" %>
    </div>
    <div class="sub-field">
      <%= f.check_box :prefer_language_it %>
      <%= f.label :prefer_language_it, "Italian" %>
    </div>
  </div>
  <div class="field">
    <label></label>
    <%= f.hidden_field :tab, value: @tab %>
    <%= f.submit "SUBMIT", class: "cta" %>
  </div>

<% end %>

<h3>
  This feature is in beta and will improve over time. Another way to tailor your feed is to discover and follow members who write in your preferred language.
</h3>

<h2>Sponsors</h2>
<h4 style="font-weight:400">
  You have the option to remove sponsor messaging (where it is practical to do so). Our wonderful sponsors help sustain the platform and improve your experience, and we strive to make their presence constructive to the community, but feel free to use this setting if you wish.
</h4>

<%= form_for(@user) do |f| %>
  <div class="checkbox-field">
    <div class="sub-field">
      <%= f.check_box :display_sponsors %>
      <%= f.label :display_sponsors, "Display Sponsors (When browsing)" %>
    </div>
    <div class="sub-field">
      <%= f.check_box :permit_adjacent_sponsors %>
      <%= f.label :permit_adjacent_sponsors, "Permit Nearby Sponsors (When publishing)" %>
    </div>
  </div>
  <div class="field">
    <label></label>
    <%= f.hidden_field :tab, value: @tab %>
    <%= f.submit "SUBMIT", class: "cta" %>
  </div>
<% end %>

<h2>Export posts</h2>

<% if @user.export_requested? %>
  <h4 style="font-weight:400">
    You have recently requested an export of your data.
    Please check your email.
  </h4>
<% else %>
  <h4 style="font-weight:400">
    You can request an export of all your data.
    Currently we only support the export of posts.
    It will be emailed to your inbox.
  </h4>

  <%= form_for(@user) do |f| %>
    <div class="checkbox-field">
      <div class="sub-field">
        <%= f.check_box :export_requested %>
        <%= f.label :export_requested, "Request an export of your data" %>
      </div>
    </div>
    <div class="field">
      <label></label>
      <%= f.hidden_field :tab, value: @tab %>
      <%= f.submit "SUBMIT", class: "cta" %>
    </div>
  <% end %>
<% end %>
