1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

some minor corrections

This commit is contained in:
Tim Daubenschütz 2015-07-08 10:15:58 +02:00
parent f066008ce9
commit 6d72352580
6 changed files with 14 additions and 16 deletions

View File

@ -1,7 +1,6 @@
'use strict';
import React from 'react';
import { getLangText } from '../../utils/lang_utils.js';
let AccordionListItemTableToggle = React.createClass({

View File

@ -78,7 +78,6 @@ let AclButton = React.createClass({
return (
<ModalWrapper
button={
// TODO translate hidden?
<button className={shouldDisplay ? 'btn btn-default btn-sm ' : 'hidden'}>
{this.props.action.toUpperCase()}
</button>

View File

@ -4,7 +4,6 @@ import React from 'react';
import FileDragAndDropDialog from './file_drag_and_drop_dialog';
import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator';
import { getLangText } from '../../utils/lang_utils.js';
// Taken from: https://github.com/fedosejev/react-file-drag-and-drop
@ -150,7 +149,7 @@ let FileDragAndDrop = React.createClass({
onDragOver={this.handleDragOver}
onDrop={this.handleDrop}
onDragEnd={this.handleDragEnd}>
<FileDragAndDropDialog
<FileDragAndDropDialog
multipleFiles={this.props.multiple}
hasFiles={hasFiles}
onClick={this.handleOnClick}/>

View File

@ -6,9 +6,10 @@ import promise from 'es6-promise';
promise.polyfill();
import fetch from 'isomorphic-fetch';
import AppConstants from '../../constants/application_constants';
import { getCookie } from '../../utils/fetch_api_utils';
import { getLangText } from '../../utils/lang_utils';
import S3Fetcher from '../../fetchers/s3_fetcher';
import fineUploader from 'fineUploader';
@ -144,9 +145,9 @@ var ReactS3FineUploader = React.createClass({
},
// since the csrf header is defined in this component's props,
// everytime the csrf cookie is changed we'll need to reinitalize
// everytime the csrf cookie is changed we'll need to reinitalize
// fineuploader and update the actual csrf token
componentWillUpdate(nextProps, nextState) {
componentWillUpdate() {
let potentiallyNewCSRFToken = getCookie('csrftoken');
if(this.state.csrfToken !== potentiallyNewCSRFToken) {
this.setState({
@ -376,12 +377,12 @@ var ReactS3FineUploader = React.createClass({
onDeleteComplete(id, xhr, isError) {
if(isError) {
let notification = new GlobalNotificationModel('Couldn\'t delete file', 'danger', 10000);
let notification = new GlobalNotificationModel(getLangText('Couldn\'t delete file'), 'danger', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
} else {
this.removeFileWithIdFromFilesToUpload(id);
let notification = new GlobalNotificationModel('File deleted', 'success', 5000);
let notification = new GlobalNotificationModel(getLangText('File deleted'), 'success', 5000);
GlobalNotificationActions.appendGlobalNotification(notification);
}
@ -464,7 +465,7 @@ var ReactS3FineUploader = React.createClass({
// replace filelist with first-element file list
files = tempFilesList;
// TOOD translate?
let notification = new GlobalNotificationModel('Only one file allowed (took first one)', 'danger', 10000);
let notification = new GlobalNotificationModel(getLangText('Only one file allowed (took first one)'), 'danger', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
}

View File

@ -49,9 +49,8 @@ let CoaVerifyForm = React.createClass({
handleSuccess(response){
let notification = null;
if (response.verdict){
// TODO translate?
notification = new GlobalNotificationModel('Certificate of Authenticity successfully verified', 'success');
if (response.verdict) {
notification = new GlobalNotificationModel(getLangText('Certificate of Authenticity successfully verified'), 'success');
GlobalNotificationActions.appendGlobalNotification(notification);
}
},

View File

@ -35,7 +35,6 @@ import GlobalNotificationActions from '../actions/global_notification_actions';
import apiUrls from '../constants/api_urls';
import AppConstants from '../constants/application_constants';
import classNames from 'classnames';
import { getCookie } from '../utils/fetch_api_utils';
import { getLangText } from '../utils/lang_utils';
@ -210,7 +209,7 @@ const CollapsibleButton = React.createClass({
this.setState({expanded: !this.state.expanded});
},
render() {
let isVisible = (this.state.expanded) ? '' : getLangText('invisible');
let isVisible = (this.state.expanded) ? '' : 'invisible';
return (
<span>
<span onClick={this.handleToggle}>
@ -438,7 +437,9 @@ let EditionPublicEditionNote = React.createClass({
handleSuccess: React.PropTypes.func
},
showNotification(){
this.props.handleSuccess();EnterndGlobalNotification(notification);
this.props.handleSuccess();
let notification = new GlobalNotificationModel(getLangText('Public note saved'), 'success');
GlobalNotificationActions.appendGlobalNotification(notification);
},
render() {
let isEditable = this.props.edition.acl.indexOf('edit') > -1;