<commit_before>import React from 'react/addons';
import Reflux from 'reflux';
import {Link} from 'react-router';

import {dataInterface} from '../dataInterface';
import actions from '../actions';
import stores from '../stores';
import bem from '../bem';
import {
  t,
  assign,
} from '../utils';

class DrawerTitle extends React.Component {
  render () {
    var kls = 'sidebar-title';
    if (this.props.separator) {
      kls += ' separator';
    }
    return (
        <li className={kls}>
          <span>{this.props.label}</span>
        </li>
      );
  }
}
class DrawerLink extends React.Component {
  onClick (evt) {
    if (!this.props.href) {
      evt.preventDefault();
    }
    if (this.props.onClick) {
      this.props.onClick(evt);
    }
  }
  toggleDrawer () {
    stores.pageState.toggleDrawer();
  }
  render () {
    var icon_class = `menu-icon fa fa-fw fa-${this.props['fa-icon'] || 'table'}`;
    var icon = (<span className={icon_class}></span>);

    var link;
    if (this.props.linkto) {
      link = (
            <Link to={this.props.linkto}
                  className='mdl-navigation__link'
                  activeClassName='active'
                  onClick={this.toggleDrawer}>
              {icon} {this.props.label}
            </Link>
            );
    } else {
      link = (
          <a href={this.props.href || '#'}
                    className='mdl-navigation__link'
                    onClick={this.onClick.bind(this)}>{icon} {this.props.label}</a>
        );
    }
    return link;
  }
}
var Drawer = React.createClass({
  mixins: [
    Reflux.connect(stores.session),
    Reflux.connect(stores.pageState),
  ],
  getInitialState () {
    return assign({
      showRecent: true,
    }, stores.pageState.state);
  },
  logout () {
    actions.auth.logout();
  },
  render () {
    return (
          <bem.Drawer m={{
              'toggled': this.state.drawerIsVisible,
                }} className='mdl-layout__drawer mdl-color--blue-grey-800'>
            <span className='mdl-layout-title'>
              <a href='/'>
                <bem.AccountBox__logo />
              </a>
            </span>
            <nav className='mdl-navigation'>
              <div className='drawer-separator'></div>
              <span className='mdl-navigation__heading'>{t('drafts in progress')}</span>

              <DrawerLink label={t('forms')} linkto='forms' fa-icon='files-o' />
              <DrawerLink label={t('library')} linkto='library' fa-icon='book' />
              <DrawerLink label={t('collections')} linkto='collections' fa-icon='folder-o' />

              <div className='drawer-separator'></div>
              <span className='mdl-navigation__heading'>{t('deployed projects')}</span>
              { stores.session.currentAccount ?<commit_msg>removing link in sidebar<commit_after>import React from 'react/addons';
import Reflux from 'reflux';
import {Link} from 'react-router';

import {dataInterface} from '../dataInterface';
import actions from '../actions';
import stores from '../stores';
import bem from '../bem';
import {
  t,
  assign,
} from '../utils';

class DrawerTitle extends React.Component {
  render () {
    var kls = 'sidebar-title';
    if (this.props.separator) {
      kls += ' separator';
    }
    return (
        <li className={kls}>
          <span>{this.props.label}</span>
        </li>
      );
  }
}
class DrawerLink extends React.Component {
  onClick (evt) {
    if (!this.props.href) {
      evt.preventDefault();
    }
    if (this.props.onClick) {
      this.props.onClick(evt);
    }
  }
  toggleDrawer () {
    stores.pageState.toggleDrawer();
  }
  render () {
    var icon_class = `menu-icon fa fa-fw fa-${this.props['fa-icon'] || 'table'}`;
    var icon = (<span className={icon_class}></span>);

    var link;
    if (this.props.linkto) {
      link = (
            <Link to={this.props.linkto}
                  className='mdl-navigation__link'
                  activeClassName='active'
                  onClick={this.toggleDrawer}>
              {icon} {this.props.label}
            </Link>
            );
    } else {
      link = (
          <a href={this.props.href || '#'}
                    className='mdl-navigation__link'
                    onClick={this.onClick.bind(this)}>{icon} {this.props.label}</a>
        );
    }
    return link;
  }
}
var Drawer = React.createClass({
  mixins: [
    Reflux.connect(stores.session),
    Reflux.connect(stores.pageState),
  ],
  getInitialState () {
    return assign({
      showRecent: true,
    }, stores.pageState.state);
  },
  logout () {
    actions.auth.logout();
  },
  render () {
    return (
          <bem.Drawer m={{
              'toggled': this.state.drawerIsVisible,
                }} className='mdl-layout__drawer mdl-color--blue-grey-800'>
            <span className='mdl-layout-title'>
              <a href='/'>
                <bem.AccountBox__logo />
              </a>
            </span>
            <nav className='mdl-navigation'>
              <div className='drawer-separator'></div>
              <span className='mdl-navigation__heading'>{t('drafts in progress')}</span>

              <DrawerLink label={t('forms')} linkto='forms' fa-icon='files-o' />
              <DrawerLink label={t('library')} linkto='library' fa-icon='book' />

              <div className='drawer-separator'></div>
              <span className='mdl-navigation__heading'>{t('deployed projects')}</span>
              { stores.session.currentAccount ?
{'fraction_non_alphanumeric': 0.16004354926510614, 'fraction_numerical': 0.0010887316276537834, 'mean_word_length': 2.072463768115942, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 0, '>': 58, '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': '7564167', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1691, 'n_words': 305}