1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 00:28:00 +02:00

Add document title for prize

This commit is contained in:
vrde 2015-10-13 17:02:03 +02:00
parent 66dbf3da71
commit 84d2dd7701
6 changed files with 27 additions and 1 deletions

View File

@ -40,6 +40,7 @@ import DetailProperty from '../../../../ascribe_detail/detail_property';
import ApiUrls from '../../../../../constants/api_urls';
import { mergeOptions } from '../../../../../utils/general_utils';
import { getLangText } from '../../../../../utils/lang_utils';
import { setDocumentTitle } from '../../../../../utils/dom_utils';
/**
@ -112,12 +113,22 @@ let PieceContainer = React.createClass({
// Only show the artist name if you are the participant or if you are a judge and the piece is shortlisted
let artistName = ((this.state.currentUser.is_jury && !this.state.currentUser.is_judge) ||
(this.state.currentUser.is_judge && !this.state.piece.selected )) ?
<span className="glyphicon glyphicon-eye-close" aria-hidden="true"/> : this.state.piece.artist_name;
null : this.state.piece.artist_name;
// Only show the artist email if you are a judge and the piece is shortlisted
let artistEmail = (this.state.currentUser.is_judge && this.state.piece.selected ) ?
<DetailProperty label={getLangText('REGISTREE')} value={ this.state.piece.user_registered } /> : null;
if (artistName === null) {
setDocumentTitle(this.state.piece.title);
} else {
setDocumentTitle([artistName, this.state.piece.title].join(', '));
}
if (artistName === null) {
artistName = <span className="glyphicon glyphicon-eye-close" aria-hidden="true"/>;
}
return (
<Piece
piece={this.state.piece}

View File

@ -6,6 +6,7 @@ import { Link } from 'react-router';
import LoginForm from '../../../ascribe_forms/form_login';
import { getLangText } from '../../../../utils/lang_utils';
import { setDocumentTitle } from '../../../../utils/dom_utils';
let LoginContainer = React.createClass({
@ -14,6 +15,8 @@ let LoginContainer = React.createClass({
},
render() {
setDocumentTitle(getLangText('Log in'));
return (
<div className="ascribe-login-wrapper">
<LoginForm

View File

@ -17,6 +17,7 @@ import AccordionListItemPrize from './ascribe_accordion_list/accordion_list_item
import { mergeOptions } from '../../../../utils/general_utils';
import { getLangText } from '../../../../utils/lang_utils';
import { setDocumentTitle } from '../../../../utils/dom_utils';
let PrizePieceList = React.createClass({
propTypes: {
@ -63,6 +64,8 @@ let PrizePieceList = React.createClass({
},
render() {
setDocumentTitle(getLangText('Collection'));
let orderParams = ['artist_name', 'title'];
if (this.state.currentUser.is_jury) {
orderParams = ['rating', 'title'];

View File

@ -11,6 +11,7 @@ import InputTextAreaToggable from '../../../ascribe_forms/input_textarea_toggabl
import InputCheckbox from '../../../ascribe_forms/input_checkbox';
import { getLangText } from '../../../../utils/lang_utils';
import { setDocumentTitle } from '../../../../utils/dom_utils';
let PrizeRegisterPiece = React.createClass({
@ -32,6 +33,8 @@ let PrizeRegisterPiece = React.createClass({
},
render() {
setDocumentTitle(getLangText('Submit to the prize'));
if(this.state.prize && this.state.prize.active){
return (
<RegisterPiece

View File

@ -24,6 +24,7 @@ import AppConstants from '../../../../constants/application_constants';
import ApiUrls from '../../../../constants/api_urls';
import { getLangText } from '../../../../utils/lang_utils';
import { setDocumentTitle } from '../../../../utils/dom_utils';
let Settings = React.createClass({
@ -45,6 +46,8 @@ let Settings = React.createClass({
},
render() {
setDocumentTitle(getLangText('Account settings'));
let prizeSettings = null;
if (this.state.currentUser.is_admin){
prizeSettings = <PrizeSettings />;

View File

@ -4,6 +4,7 @@ import React from 'react';
import SignupForm from '../../../ascribe_forms/form_signup';
import { getLangText } from '../../../../utils/lang_utils';
import { setDocumentTitle } from '../../../../utils/dom_utils';
let SignupContainer = React.createClass({
propTypes: {
@ -25,6 +26,8 @@ let SignupContainer = React.createClass({
},
render() {
setDocumentTitle(getLangText('Sign up'));
if (this.state.submitted){
return (
<div className="ascribe-login-wrapper">