<commit_before>React = require 'react'
BoundResourceMixin = require '../lib/bound-resource-mixin'
ChangeListener = require '../components/change-listener'
auth = require '../api/auth'
PromiseRenderer = require '../components/promise-renderer'

UserSettingsPage = React.createClass
  displayName: 'UserSettingsPage'

  mixins: [BoundResourceMixin]

  boundResource: 'user'

  getDefaultProps: ->
    user: {}

  render: ->
    <div className="content-container">
      <table className="standard-table full">
        <tr>
          <th>Credited name</th>
          <td>
            <input type="text" className="standard-input full" name="credited_name" value={@props.user.credited_name} onChange={@handleChange} />
            <div className="form-help">We’ll use this to give acknowledgement in papers, on posters, etc.</div>
          </td>
        </tr>

        <tr>
          <th>Any other stuff?</th>
          <td>
            TODO
          </td>
        </tr>
      </table>

      <p>
        <button type="button" disabled={@state.saveInProgress or not @props.user.hasUnsavedChanges()} onClick={@saveResource}>Save profile</button>{' '}
        {@renderSaveStatus()}
      </p>

      <hr />

      <p><strong>Email preferences</strong></p>

      <p>TODO</p>
    </div>

module.exports = React.createClass
  displayName: 'UserSettingsPageWrapper'

  render: ->
    <ChangeListener target={auth} handler={=>
      <PromiseRenderer promise={auth.checkCurrent()} then={(user) =>
        if user?
          <UserSettingsPage user={user} />
        else
          <div className="content-container">
            <p>You’re not signed in.</p>
          </div>
      } />
    } /><commit_msg>Make space for the avatar<commit_after>React = require 'react'
BoundResourceMixin = require '../lib/bound-resource-mixin'
ChangeListener = require '../components/change-listener'
auth = require '../api/auth'
PromiseRenderer = require '../components/promise-renderer'

UserSettingsPage = React.createClass
  displayName: 'UserSettingsPage'

  mixins: [BoundResourceMixin]

  boundResource: 'user'

  getDefaultProps: ->
    user: {}

  render: ->
    <div>
      <div className="columns-container">
        <div className="content-container">
          TODO: Avatar
        </div>

        <hr />

        <div className="content-container column">
          <table className="standard-table full">
            <tr>
              <th>Credited name</th>
              <td>
                <input type="text" className="standard-input full" name="credited_name" value={@props.user.credited_name} onChange={@handleChange} />
                <div className="form-help">Public; we’ll use this to give acknowledgement in papers, on posters, etc.</div>
              </td>
            </tr>

            <tr>
              <th>Any other stuff?</th>
              <td>
                TODO
              </td>
            </tr>
          </table>

          <p>
            <button type="button" className="standard-button" disabled={@state.saveInProgress or not @props.user.hasUnsavedChanges()} onClick={@saveResource}>Save profile</button>{' '}
            {@renderSaveStatus()}
          </p>
        </div>
      </div>

      <hr />
      <div className="content-container">
        <p><strong>Email preferences</strong></p>
        <p>TODO</p>
      </div>
    </div>

module.exports = React.createClass
  displayName: 'UserSettingsPageWrapper'

  render: ->
    <ChangeListener target={auth} handler={=>
      <PromiseRenderer promise={auth.checkCurrent()} then={(user) =>
        if user?
          <UserSettingsPage user={user} />
        else
          <div className="content-container">
            <p>You’re not signed in.</p>
          </div>
      } />
    } />
{'fraction_non_alphanumeric': 0.14695721498804146, 'fraction_numerical': 0.0, 'mean_word_length': 2.2560553633217992, 'pattern_counts': {'":': 0, '<': 86, '<?xml version=': 0, '>': 96, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5795368', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1071, 'n_words': 229}