<commit_before>React = require 'react'
CollectionsManager = require './manager'
alert = require '../lib/alert'

# Shows an icon to logged-in users that pops up a collections manager
module?.exports = React.createClass
  displayName: 'CollectionsManagerIcon'

  propTypes:
    subject: React.PropTypes.object
    user: React.PropTypes.object

  toggleCollectionsManagerPopup: ->
    alert (resolve) =>
      <div className="content-container">
        <CollectionsManager user={@props.user} project={@props.project} subject={@props.subject} onSuccess={resolve} />
      </div>

  render: ->
    <button
      className="collections-manager-icon"
      title="Collect"
      onClick={@toggleCollectionsManagerPopup}>
      <i className="fa fa-list" />
    </button><commit_msg>Use modal-form dialog for collections manager icon<commit_after>React = require 'react'
CollectionsManager = require './manager'
Dialog = require 'modal-form/dialog'

# Shows an icon to logged-in users that pops up a collections manager
module?.exports = React.createClass
  displayName: 'CollectionsManagerIcon'

  propTypes:
    subject: React.PropTypes.object
    user: React.PropTypes.object

  getInitialState: ->
    open: false

  render: ->
    <button
      className="collections-manager-icon"
      title="Collect"
      onClick={@setState.bind this, {open: true}, null}>
      <i className="fa fa-list" />

      {if @state.open
        <Dialog tag="div">
          <CollectionsManager user={@props.user} project={@props.project} subject={@props.subject} onSuccess={@setState.bind this, {open: false}, null} />
        </Dialog>}
    </button>
{'fraction_non_alphanumeric': 0.1276073619631902, 'fraction_numerical': 0.0, 'mean_word_length': 3.633522727272727, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 20, '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': '6417392', 'n_tokens_mistral': 457, 'n_tokens_neox': 455, 'n_words': 115}