<commit_before><% content_for(:title) do %>Edit your account &amp; profile<% end %>
<% content_for(:extracss) do %>
<style type="text/css" media="screen">
  textarea{width:330px;}
  .usericon{float:left;margin-right:1em;border:2px solid #ddd;}
  #preferencescol .field label{display:inline;}
  #providercol ul{margin:0;padding:0;}
  #providercol li{list-style-type:none;}
</style>
<!--[if lt IE 7]>
  <%= stylesheet_link_tag 'blueprint/ie' %>
<![endif]-->
<% end -%>
<% content_for(:extrajs) do %>
  <script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
      $('#user_prefers_no_email').click(function() {
        $('#notificationpreferences input').attr('checked', !$(this).attr('checked'))
      })
      $('#notificationpreferences input').click(function() {
        $('#user_prefers_no_email').attr('checked', false)
      })
    })
  </script>
  <!--[if lt IE 8]>
  <script src="http://ie7-js.googlecode.com/svn/trunk/lib/IE8.js" type="text/javascript"></script>
  <![endif]-->
<% end %>
<div id="pageheader">
  <div id="nav" class="clear">
    <div class="breadcrumbs">
      <%= link_to 'Back to your profile', 
                  person_by_login_path(:login => current_user.login),
                  :class => 'back crumb' %>
    </div><!-- /#breadcrumbs -->
  </div>
  
  <h2>Edit your account &amp; profile</h2>  
</div>

<div class="column span-18">
  <%= form_for(current_user, :url => person_path(current_user), :builder => DefaultFormBuilder, :html => {:multipart => true}) do |f| %>
    <%= error_messages_for :current_user %>
    <div class="column span-18 stacked">
      <%= image_tag(current_user.icon.url(:thumb), :class => 'usericon left') %>
      <%= f.file_field(:icon, :label => 'Icon/Photo', :class => 'text', :style => 'display: none', :accept => "image/jpg,image/jpeg,image/png,image/gif") %>
      <%= link_to_function('change', "$('#user_icon').show(); $(this).hide()", :class => 'button inlineblock') %>
    </div>
    <div class="column span-9">
      <%= f.text_field(:email, :class => "text", :required => true) %>
      <%= f.text_field(:name, :class => "text") %>
    </div>
    <div class="last column span-9">
      <%= f.time_zone_select(:time_zone, ActiveSupport::TimeZone.us_zones, 
        {:selected => current_user.time_zone}, 
        {:class => 'select', :description => "All your observations will default to this time zone unless you specify otherwise."}) %>
    </div>
    <div class="column span-9">
      <%= f.text_area(:description, :label => "Tell everyone a little about yourself") %>
    </div>
    <div id="preferencescol" class="last column span-9">
      <div id="observationsharingpreferences" class="stacked">
        <label>Automatically share your observations on</label>
        <% for attr_name in User::SHARING_PREFERENCES %>
          <%- service = attr_name.gsub(/share_observations_on_/, '') %>
          <%= f.check_box "prefers_#{attr_name}", 
            :label => service.capitalize, 
            :label_after => true %>
        <% end %>
      </div>
      <div id="notificationpreferences" class="stacked">
        <label>Receive email notifications when people leave you</label>
        <% for attr_name in User::NOTIFICATION_PREFERENCES %>
          <%= f.check_box "prefers_#{attr_name}", 
            :label => attr_name.humanize.capitalize.gsub(/ email notification/, '').pluralize, 
            :label_after => true %>
        <% end %>
      </div>
      
      <div class="stacked">
        <label>Or if you just don't want any email...</label>
        <%= f.check_box "prefers_no_email", 
          :label => "Don't send me any email!", 
          :label_after => true %>
      </div>
      
    </div>
    
    <div class="column span-18">
      <div id="licenses" class="stacked">
        <h3>Licensing</h3>
        <p class="ui description">
          Licensing your content gives other people the legal right to use it
          without asking your permission if they stick to the terms of the
          license. iNat uses your Creative Commons-licensed content to share
          with data partners like
          the <a href="http://www.gbif.org/">Global Biodiversity Information Facility</a> 
          (GBIF), an international, inter-governmental organization that
          compiles and distributes biodiversity information from around the
          world.
          <%= link_to_function "Learn what these licenses mean", 
            "$('#aboutlicenses').dialog({width:'auto', modal:true, title: 'About Creative Commons licenses'})" %>
        </p>
        
        <div class="column span-9 verticalmiddle licensechoices">
          <h4>Default observation license</h4>
          <% for code, name, description in Observation::LICENSES %>
            <%= f.radio_button :preferred_observation_license, code, 
              :label => "#{image_tag("#{code}.png")} #{name}", :label_after => true %>
          <% end %>
          <%= f.radio_button :preferred_observation_license, nil, :label => "No license (all rights reserved)", :label_after => true,
            :description => "You retain full copyright over your content aside from those rights granted to iNat in our Terms of Service." %>
          <%= f.check_box :make_observation_licenses_same, :label => "Update existing observations with new license choices", :label_after => true %>
        </div>
        
        <div class="last column span-9 verticalmiddle licensechoices">
          <h4>Default photo license</h4>
          <% for code, name, description in Observation::LICENSES %>
            <%= f.radio_button :preferred_photo_license, code, 
              :label => "#{image_tag("#{code}.png")} #{name}", :label_after => true %>
          <% end %>
          <%= f.radio_button :preferred_photo_license, nil, :label => "No license  (all rights reserved)", :label_after => true,
            :description => "You retain full copyright over your content aside from those rights granted to iNat in our Terms of Service." %>
          <%= f.check_box :make_photo_licenses_same, :label => "Update existing photos with new license choices", :label_after => true %>
        </div>
        
        <div class="last column span-18">
          <%= link_to_function "<span class='helptip'></span> About these licenses".html_safe, 
            "$('#aboutlicenses').dialog({width:'auto', modal:true, title: 'About Creative Commons licenses'})" %>
          <div id="aboutlicenses" class="dialog" style="display:none">
            <div class="column span-18 verticalmiddle">
              <% for code, name, description in Observation::LICENSES %>
                <div class="column span-9 <%= cycle '', 'last' %>">
                  <h4>
                    <%= image_tag("#{code}.png") %>
                    <%= name %>
                  </h4>
                  <div class="stacked description">
                    <%= description %>
                    <%= link_to "View license", url_for_license(code), :class => "readmore" %>
                  </div>
                </div>
              <% end %>
            </div>
          </div>
          
          <p class="ui description">
            License descriptions and images 
            &copy; <%= Date.today.year %> Creative Commons, used under a <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons &mdash; Attribution 3.0 Unported
              &mdash; CC BY 3.0">Creative Commons Attribution license</a>
            (so meta!)
          </p>
        </div>
      </div>
    </div>
    
    <div class="column span-18">
      <%= f.submit("Save", :class => 'default button', "data-loading-click" => "Saving...") %>
    </div>
  <% end %>
  
</div><!-- end first col -->

<div class="column last span-6">
  <div id="providercol" class="stacked">
    <h3>Connected Accounts</h3>
    <ul>
      <% ProviderAuthorization::PROVIDERS.each do |provider| %>
        <% if current_user.has_provider_auth(provider) %>
          <li class="clear">
            <%= button_to "Disconnect #{provider.capitalize}", omniauth_disconnect_path(provider.downcase),
              :class => "providerlink #{provider.downcase} disabled button", :method => "delete" %>
          </li>
        <% else %>
          <li class="clear">
            <%= link_to "Connect to #{provider.capitalize}", auth_url_for(provider.downcase), 
              :class => "providerlink #{provider.downcase} button" %>
          </li>
        <% end %>
      <% end %>
    </ul>
    <p class="ui description">
      Connecting your iNat account to accounts on other sites will allow you
      to login to iNat using your credentials from those sites.
    </p>
  </div>
  
  <h3>Photo Hosting Accounts</h3>
  <ul>
    <li><%= link_to "Link or unlink your Flickr account", {:controller => "flickr", :action => 'options'}, :class => 'readmore' %></li>
    <li><%= link_to "Link or unlink your Picasa account", {:controller => "picasa", :action => 'options'}, :class => 'readmore' %></li>
    <li><%= link_to "Link or unlink your Facebook account", {:controller => "facebook", :action => 'options'}, :class => 'readmore' %></li>
  </ul>
  
  <%= separator %>
  
  <div class="clear box">
    <%= link_to_toggle current_user.encrypted_password ? "Change your password" : "Set a password", "#passwordform", :class => "ui" %>
    <%= form_for(current_user, :html => {:id => "passwordform", :style => "display:none"}) do %>
      <div class="stacked">
        <%= label(:password, '<PASSWORD>') %>
        <%= password_field_tag(:password, '', :class => 'text') %>
      </div>
      <div class="stacked">
        <%= label(:password_confirmation, '<PASSWORD>') %>
        <%= password_field_tag(:password_confirmation, '', :class => 'text') %>
      </div>
      
      <div class="clear">
        <%= submit_tag("Change Password", :class => 'button') %>
      </div>
    <% end %>
  </div>
  <%= button_to "Delete your account", current_user, :method => :delete, 
    :confirm => "Are you sure you want to delete your account?  This will delete all your data and cannot be undone, and we'll be sorry to see you go.", 
    :class => "minor delete button" %>
</div><!-- end side col -->
<commit_msg>only show sharing options for services the user has authorized<commit_after><% content_for(:title) do %>Edit your account &amp; profile<% end %>
<% content_for(:extracss) do %>
<style type="text/css" media="screen">
  textarea{width:330px;}
  .usericon{float:left;margin-right:1em;border:2px solid #ddd;}
  #preferencescol .field label{display:inline;}
  #providercol ul{margin:0;padding:0;}
  #providercol li{list-style-type:none;}
</style>
<!--[if lt IE 7]>
  <%= stylesheet_link_tag 'blueprint/ie' %>
<![endif]-->
<% end -%>
<% content_for(:extrajs) do %>
  <script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
      $('#user_prefers_no_email').click(function() {
        $('#notificationpreferences input').attr('checked', !$(this).attr('checked'))
      })
      $('#notificationpreferences input').click(function() {
        $('#user_prefers_no_email').attr('checked', false)
      })
    })
  </script>
  <!--[if lt IE 8]>
  <script src="http://ie7-js.googlecode.com/svn/trunk/lib/IE8.js" type="text/javascript"></script>
  <![endif]-->
<% end %>
<div id="pageheader">
  <div id="nav" class="clear">
    <div class="breadcrumbs">
      <%= link_to 'Back to your profile', 
                  person_by_login_path(:login => current_user.login),
                  :class => 'back crumb' %>
    </div><!-- /#breadcrumbs -->
  </div>
  
  <h2>Edit your account &amp; profile</h2>  
</div>

<div class="column span-18">
  <%= form_for(current_user, :url => person_path(current_user), :builder => DefaultFormBuilder, :html => {:multipart => true}) do |f| %>
    <%= error_messages_for :current_user %>
    <div class="column span-18 stacked">
      <%= image_tag(current_user.icon.url(:thumb), :class => 'usericon left') %>
      <%= f.file_field(:icon, :label => 'Icon/Photo', :class => 'text', :style => 'display: none', :accept => "image/jpg,image/jpeg,image/png,image/gif") %>
      <%= link_to_function('change', "$('#user_icon').show(); $(this).hide()", :class => 'button inlineblock') %>
    </div>
    <div class="column span-9">
      <%= f.text_field(:email, :class => "text", :required => true) %>
      <%= f.text_field(:name, :class => "text") %>
    </div>
    <div class="last column span-9">
      <%= f.time_zone_select(:time_zone, ActiveSupport::TimeZone.us_zones, 
        {:selected => current_user.time_zone}, 
        {:class => 'select', :description => "All your observations will default to this time zone unless you specify otherwise."}) %>
    </div>
    <div class="column span-9">
      <%= f.text_area(:description, :label => "Tell everyone a little about yourself") %>
    </div>
    <div id="preferencescol" class="last column span-9">
      <div id="observationsharingpreferences" class="stacked">
        <label>Automatically share your observations on</label>
        <% for attr_name in User::SHARING_PREFERENCES %>
          <%- service = attr_name.gsub(/share_observations_on_/, '') %>
          <%- if current_user.has_provider_auth(service) %>
            <%= f.check_box "prefers_#{attr_name}", 
              :label => service.capitalize, 
              :label_after => true %>
          <% end %>
        <% end %>
      </div>
      <div id="notificationpreferences" class="stacked">
        <label>Receive email notifications when people leave you</label>
        <% for attr_name in User::NOTIFICATION_PREFERENCES %>
          <%= f.check_box "prefers_#{attr_name}", 
            :label => attr_name.humanize.capitalize.gsub(/ email notification/, '').pluralize, 
            :label_after => true %>
        <% end %>
      </div>
      
      <div class="stacked">
        <label>Or if you just don't want any email...</label>
        <%= f.check_box "prefers_no_email", 
          :label => "Don't send me any email!", 
          :label_after => true %>
      </div>
      
    </div>
    
    <div class="column span-18">
      <div id="licenses" class="stacked">
        <h3>Licensing</h3>
        <p class="ui description">
          Licensing your content gives other people the legal right to use it
          without asking your permission if they stick to the terms of the
          license. iNat uses your Creative Commons-licensed content to share
          with data partners like
          the <a href="http://www.gbif.org/">Global Biodiversity Information Facility</a> 
          (GBIF), an international, inter-governmental organization that
          compiles and distributes biodiversity information from around the
          world.
          <%= link_to_function "Learn what these licenses mean", 
            "$('#aboutlicenses').dialog({width:'auto', modal:true, title: 'About Creative Commons licenses'})" %>
        </p>
        
        <div class="column span-9 verticalmiddle licensechoices">
          <h4>Default observation license</h4>
          <% for code, name, description in Observation::LICENSES %>
            <%= f.radio_button :preferred_observation_license, code, 
              :label => "#{image_tag("#{code}.png")} #{name}", :label_after => true %>
          <% end %>
          <%= f.radio_button :preferred_observation_license, nil, :label => "No license (all rights reserved)", :label_after => true,
            :description => "You retain full copyright over your content aside from those rights granted to iNat in our Terms of Service." %>
          <%= f.check_box :make_observation_licenses_same, :label => "Update existing observations with new license choices", :label_after => true %>
        </div>
        
        <div class="last column span-9 verticalmiddle licensechoices">
          <h4>Default photo license</h4>
          <% for code, name, description in Observation::LICENSES %>
            <%= f.radio_button :preferred_photo_license, code, 
              :label => "#{image_tag("#{code}.png")} #{name}", :label_after => true %>
          <% end %>
          <%= f.radio_button :preferred_photo_license, nil, :label => "No license  (all rights reserved)", :label_after => true,
            :description => "You retain full copyright over your content aside from those rights granted to iNat in our Terms of Service." %>
          <%= f.check_box :make_photo_licenses_same, :label => "Update existing photos with new license choices", :label_after => true %>
        </div>
        
        <div class="last column span-18">
          <%= link_to_function "<span class='helptip'></span> About these licenses".html_safe, 
            "$('#aboutlicenses').dialog({width:'auto', modal:true, title: 'About Creative Commons licenses'})" %>
          <div id="aboutlicenses" class="dialog" style="display:none">
            <div class="column span-18 verticalmiddle">
              <% for code, name, description in Observation::LICENSES %>
                <div class="column span-9 <%= cycle '', 'last' %>">
                  <h4>
                    <%= image_tag("#{code}.png") %>
                    <%= name %>
                  </h4>
                  <div class="stacked description">
                    <%= description %>
                    <%= link_to "View license", url_for_license(code), :class => "readmore" %>
                  </div>
                </div>
              <% end %>
            </div>
          </div>
          
          <p class="ui description">
            License descriptions and images 
            &copy; <%= Date.today.year %> Creative Commons, used under a <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons &mdash; Attribution 3.0 Unported
              &mdash; CC BY 3.0">Creative Commons Attribution license</a>
            (so meta!)
          </p>
        </div>
      </div>
    </div>
    
    <div class="column span-18">
      <%= f.submit("Save", :class => 'default button', "data-loading-click" => "Saving...") %>
    </div>
  <% end %>
  
</div><!-- end first col -->

<div class="column last span-6">
  <div id="providercol" class="stacked">
    <h3>Connected Accounts</h3>
    <ul>
      <% ProviderAuthorization::PROVIDERS.each do |provider| %>
        <% if current_user.has_provider_auth(provider) %>
          <li class="clear">
            <%= button_to "Disconnect #{provider.capitalize}", omniauth_disconnect_path(provider.downcase),
              :class => "providerlink #{provider.downcase} disabled button", :method => "delete" %>
          </li>
        <% else %>
          <li class="clear">
            <%= link_to "Connect to #{provider.capitalize}", auth_url_for(provider.downcase), 
              :class => "providerlink #{provider.downcase} button" %>
          </li>
        <% end %>
      <% end %>
    </ul>
    <p class="ui description">
      Connecting your iNat account to accounts on other sites will allow you
      to login to iNat using your credentials from those sites.
    </p>
  </div>
  
  <h3>Photo Hosting Accounts</h3>
  <ul>
    <li><%= link_to "Link or unlink your Flickr account", {:controller => "flickr", :action => 'options'}, :class => 'readmore' %></li>
    <li><%= link_to "Link or unlink your Picasa account", {:controller => "picasa", :action => 'options'}, :class => 'readmore' %></li>
    <li><%= link_to "Link or unlink your Facebook account", {:controller => "facebook", :action => 'options'}, :class => 'readmore' %></li>
  </ul>
  
  <%= separator %>
  
  <div class="clear box">
    <%= link_to_toggle current_user.encrypted_password ? "Change your password" : "Set a password", "#passwordform", :class => "ui" %>
    <%= form_for(current_user, :html => {:id => "passwordform", :style => "display:none"}) do %>
      <div class="stacked">
        <%= label(:password, '<PASSWORD>') %>
        <%= password_field_tag(:password, '', :class => 'text') %>
      </div>
      <div class="stacked">
        <%= label(:password_confirmation, '<PASSWORD>') %>
        <%= password_field_tag(:password_confirmation, '', :class => 'text') %>
      </div>
      
      <div class="clear">
        <%= submit_tag("Change Password", :class => 'button') %>
      </div>
    <% end %>
  </div>
  <%= button_to "Delete your account", current_user, :method => :delete, 
    :confirm => "Are you sure you want to delete your account?  This will delete all your data and cannot be undone, and we'll be sorry to see you go.", 
    :class => "minor delete button" %>
</div><!-- end side col -->

{'fraction_non_alphanumeric': 0.16547497446373852, 'fraction_numerical': 0.0050586118001848335, 'mean_word_length': 2.714543812104788, 'pattern_counts': {'":': 0, '<': 373, '<?xml version=': 0, '>': 501, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1854685', 'n_tokens_mistral': 6411, 'n_tokens_neox': 5994, 'n_words': 1576}