Skip to content

Commit

Permalink
Merge pull request #63 from DemocraciaEnRed/dev2.0_texts
Browse files Browse the repository at this point in the history
Dev2.0 texts
  • Loading branch information
xtian7489 authored Jun 23, 2023
2 parents 19898cb + a5edc98 commit 0b68e7d
Show file tree
Hide file tree
Showing 13 changed files with 462 additions and 179 deletions.
2 changes: 1 addition & 1 deletion ext/lib/site/banner-foro-vecinal/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function BannerForoVecinal (props) {
</div>
<div className='contenedor'>
<div className='fondo-titulo'>
<h1>{props.title}</h1>
<h1>{props.texts['home-nombre']}</h1>
</div>
</div>
</section>
Expand Down
17 changes: 12 additions & 5 deletions ext/lib/site/footer/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@ import { Link } from 'react-router'
import BannerProyectistas from '../banner-proyectistas/component'
import config from 'lib/config'
import forumStore from 'lib/stores/forum-store/forum-store'
import textStore from 'lib/stores/text-store'


class Footer extends Component {
constructor(){
super()
this.state={
forum:null
forum:null,
texts:{}
}
}

componentDidMount(){
forumStore.findOneByName('proyectos')
.then((forum) => {
Promise.all([
forumStore.findOneByName('proyectos'),
textStore.findAllDict()
])
.then(result => {
const [forum, texts] = result
this.setState({
texts,
forum: forum,
name: name
})
Expand All @@ -33,7 +40,7 @@ class Footer extends Component {


render(){
const { forum } = this.state
const { forum, texts } = this.state
return(<div>
{
forum && forum.config.mostrarFormulariosProyectistas && <BannerProyectistas />
Expand Down Expand Up @@ -82,7 +89,7 @@ class Footer extends Component {
<div className='terminos'>
<Link to='/s/terminos-y-condiciones' tabIndex="13"> Términos y condiciones
</Link>
<a href="https://presupuestoparticipativo.unr.edu.ar/?page_id=1551" tabIndex="14" rel="noopener noreferer" target="_blank"> Reglamento
<a href={texts['reglamento-link']} tabIndex="14" rel="noopener noreferer" target="_blank"> Reglamento
</a>
</div>
</div>
Expand Down
26 changes: 18 additions & 8 deletions ext/lib/site/header/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import PopupMessage from 'ext/lib/site/header/popup-message/component'
import MobileMenu from 'ext/lib/site/header/mobile-menu/component'
import AnonUser from 'ext/lib/site/header/anon-user/component'
import forumStore from 'lib/stores/forum-store/forum-store'
import textStore from 'lib/stores/text-store'

class Header extends Component {
constructor (props) {
Expand All @@ -18,18 +19,26 @@ class Header extends Component {
mobileMenu: false,
userMenu: false,
userPrivileges: null,
configForum:null
configForum:null,
texts:{}
}

props.user.onChange(this.onUserStateChange)
}

componentWillMount () {
bus.on('user-form:load', this.onLoadUserForm)
forumStore.findOneByName(config.forumProyectos).then(
forum => this.setState({
configForum:forum.config
Promise.all([
forumStore.findOneByName(config.forumProyectos),
textStore.findAllDict()
])
.then(result =>{
const [forum,texts] = result
this.setState({
configForum:forum.config,
texts
})
}
)
}

Expand Down Expand Up @@ -90,7 +99,7 @@ class Header extends Component {
color: config.headerFontColor,
backgroundColor: config.headerBackgroundColor
}
const { configForum} = this.state
const { configForum, texts} = this.state

const showAdmin = this.state.userPrivileges && this.state.userPrivileges.canChangeTopics

Expand Down Expand Up @@ -142,7 +151,8 @@ class Header extends Component {
form={this.state.userForm}
menuOn={this.state.mobileMenu}
toggleOnClick={this.toggleMobileMenu}
configForum={configForum} />
configForum={configForum}
texts={texts} />

</ul>
</nav>
Expand Down Expand Up @@ -177,7 +187,7 @@ class Header extends Component {
className='header-link'
tabIndex="3"
>
FORO UNR
{texts['foro-pestaña']}
</Link>
</div>
{ configForum && configForum.mostrarSeccionEventos && <div className={`header-item ${window.location.pathname.includes('/agenda') ? 'active' : ''}`}>
Expand All @@ -186,7 +196,7 @@ class Header extends Component {
className='header-link'
tabIndex="4"
>
Agenda
{texts['evento-pestaña']}
</Link>
</div> }
{ showAdmin &&
Expand Down
6 changes: 3 additions & 3 deletions ext/lib/site/header/mobile-menu/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MobileMenu extends Component {
}

render () {
const {configForum} = this.props
const {configForum, texts} = this.props
return (
<nav className='mobile-nav'>
<a
Expand Down Expand Up @@ -54,7 +54,7 @@ class MobileMenu extends Component {
activeStyle={{ color: '#8C1E81' }}
onClick={this.props.toggleOnClick}
tabIndex="3">
FORO UNR
{texts['foro-pestaña']}
</Link>
</div>
{configForum && configForum.mostrarSeccionEventos && <div className='header-item'>
Expand All @@ -64,7 +64,7 @@ class MobileMenu extends Component {
activeStyle={{ color: '#8C1E81' }}
onClick={this.props.toggleOnClick}
tabIndex="4">
Agenda
{texts['evento-pestaña']}
</Link>
</div>}
{/* <div className='header-item mobile-link'>
Expand Down
45 changes: 25 additions & 20 deletions ext/lib/site/home-about/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,27 @@ import Footer from 'ext/lib/site/footer/component'
import Jump from 'ext/lib/site/jump-button/component'
import Anchor from 'ext/lib/site/anchor'
import forumStore from 'lib/stores/forum-store/forum-store'

import textStore from 'lib/stores/text-store'
export default class HomeAbout extends Component {
constructor () {
constructor() {
super()

this.state = {
forum: null,
faqs: null
faqs: null,
texts:{}
}
}

componentDidMount () {
aboutStore
.findAll()
.then((faqs) => this.setState({ faqs }))
componentDidMount() {
Promise.all([
aboutStore.findAll(),
textStore.findAllDict()
]).then(([faqs, texts]) => {
this.setState({ faqs, texts })
})
.catch((err) => {
throw err
throw err
})
const u = new window.URLSearchParams(window.location.search)
if (u.get('scroll') === 'cronograma') return Anchor.goTo('cronograma')
Expand All @@ -38,28 +42,29 @@ export default class HomeAbout extends Component {
})
}

goTop () {
goTop() {
window.scrollTo(0, 0)
}

render () {
const faqs = this.state.faqs
render() {
const {faqs, texts} = this.state

return (
<div>
<section className='banner-static'>
<div className='banner'></div>
<div className='contenedor'>
<div className='fondo-titulo'>
<h1>Presupuesto Participativo</h1>
</div>
</div>
<section className="banner-static-2022">
<h1>INFORMACIÓN</h1>
</section>
{texts && <div className="post-banner-static-2022 container">
<span> {texts['info-bajada']}</span>
</div>}
{texts && <div className=' text-center' dangerouslySetInnerHTML={{ __html: texts['info-reglamento'] }} />}
<br />
<br />
<div id='container'>
<div className='ext-acerca-de container'>
<div>
<div className='faq text-left'>
{faqs &&
{faqs &&
<Accordion startPosition={-1}>
{faqs.map((faq) => (
<div key={faq.id} data-trigger={`${faq.question}`}>
Expand All @@ -82,7 +87,7 @@ export default class HomeAbout extends Component {
</div>
</div>
</Anchor>

</div>
</div>
</div>
Expand Down
14 changes: 9 additions & 5 deletions ext/lib/site/home-propuestas/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import userConnector from 'lib/site/connectors/user'
import tagStore from 'lib/stores/tag-store/tag-store'
import facultadStore from 'lib/stores/facultad-store'
import claustroStore from 'lib/stores/claustro-store'
import textStore from 'lib/stores/text-store'
import TopicCard from './topic-card/component'
import BannerListadoTopics from 'ext/lib/site/banner-listado-topics/component'
import FilterPropuestas from './filter-propuestas/component'
Expand Down Expand Up @@ -54,6 +55,7 @@ class HomePropuestas extends Component {
this.state = {
forum: null,
topics: null,
texts:{},

facultades: [],
facultad: defaultValues.facultad,
Expand Down Expand Up @@ -95,9 +97,10 @@ class HomePropuestas extends Component {
claustroStore.findAll(),
tagStore.findAll(),
forumStore.findOneByName('proyectos'),
topicStore.findAllProyectos()
topicStore.findAllProyectos(),
textStore.findAllDict()
]).then((results) => {
const [facultades, claustros, tags, forum, proyectos] = results
const [facultades, claustros, tags, forum, proyectos, texts] = results
const tagsMap = tags.map((tag) => { return { value: tag.id, name: tag.name } })
const tag = this.props.location.query.tags ? [tagsMap.find((j) => j.name == this.props.location.query.tags).value] : []
const tiposIdea = forum.topicsAttrs.find((a) => a.name == 'state').options.map((state) => { return { value: state.name, name: state.title } })
Expand All @@ -110,6 +113,7 @@ class HomePropuestas extends Component {
tiposIdea,
tipoIdea,
forum,
texts,
// searchableProyectos: proyectos.filter(p => p.attrs.state == (config.votacionVisible ? 'proyecto' : 'pendiente')).map(p => ({label: `${p.mediaTitle}`, value: p._id}))
// searchableProyectos: config.votacionVisible ? proyectos.map(p => p.state == 'proyecto') : proyectos.map(p => p.state == 'pendiente')
searchableProyectos: proyectos.map((p) => ({ label: `#${p.attrs && p.attrs.numero} ${p.mediaTitle}`, value: p._id }))
Expand Down Expand Up @@ -449,7 +453,7 @@ class HomePropuestas extends Component {
forum, topics, facultades,
searchableProyectos, selectedProyecto, dialogVotacion,
claustros, dialogMessage,
dniP, facultadP, claustroP,tipoIdea
dniP, facultadP, claustroP,tipoIdea, texts
} = this.state
const { user } = this.props
// console.log(facultades, claustros)
Expand Down Expand Up @@ -491,7 +495,7 @@ class HomePropuestas extends Component {
{ forum && <BannerListadoTopics
btnText={forum.config.propuestasAbiertas ? 'Subí tu idea' : undefined}
btnLink={forum.config.propuestasAbiertas ? '/formulario-idea' : undefined}
title={forum.config.ideacion ? 'Conocé las ideas del PPUNR' : 'PPUNR 2022'}
title={texts['foro-titulo']}
handlerVotacion={forum && forum.config.votacion && forum && forum.privileges && forum.privileges.canEdit && this.handlerVotacion}
user={user}
voterInformation={voterInformation} />}
Expand Down Expand Up @@ -525,7 +529,7 @@ class HomePropuestas extends Component {
)
} */}
{forum && <div className='notice'>
<h1>{forum.config.noticeTexto }</h1>
<h1>{ texts['foro-bajada'] }</h1>
</div>}
</div>
</div>
Expand Down
16 changes: 12 additions & 4 deletions ext/lib/site/static-pages/pages/agenda.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Footer from 'ext/lib/site/footer/component'
import Jump from 'ext/lib/site/jump-button/component'
import Anchor from 'ext/lib/site/anchor'
import userConnector from 'lib/site/connectors/user'
import textStore from 'lib/stores/text-store'

class Page extends Component {
constructor (props) {
Expand All @@ -14,13 +15,20 @@ class Page extends Component {
futureEvents: [],
pastEvents: [],
buttonPressed: [],
isLoading: true
isLoading: true,
texts:{}
}
}

componentDidMount () {
this.goTop()
this.getAgenda()
textStore.findAllDict()
.then(
texts =>this.setState({
texts
})
)
}

getAgenda = () => {
Expand Down Expand Up @@ -106,16 +114,16 @@ class Page extends Component {
}

render () {
let { agenda, futureEvents, pastEvents, buttonPressed, isLoading } = this.state
let { agenda, futureEvents, pastEvents, buttonPressed, isLoading, texts } = this.state
return (
<Anchor id='container-top'>
<div id="foro-presencial">
<section className="the-banner">
Agenda
{texts['evento-titulo']}
</section>
<div className="the-subbanner-container">
<div className="the-subbanner container">
En estos puntos podrás dejar tus ideas de forma presencial
{texts['evento-bajada']}
</div>
</div>
<div className="the-content">
Expand Down
Loading

0 comments on commit 0b68e7d

Please sign in to comment.