2018-03-25 18:03:08 +00:00
// License: LGPL-3.0-or-later
2018-03-25 17:30:42 +00:00
if ( app . nonprofit . brand _color ) {
require ( '../../components/branded_fundraising' )
}
require ( '../../common/image_uploader' )
require ( '../../components/fundraising/add_header_image' )
if ( app . current _user ) {
require ( '../../campaigns/new/wizard' )
require ( '../../events/new/wizard' )
}
if ( app . current _nonprofit _user ) {
var editable = require ( '../../common/editable' )
editable ( $ ( '.editable' ) , {
placeholder : "Enter your nonprofit's story and impact here. We strongly recommend that this section is filled out with at least 250 words. It will automatically save as you type." ,
sticky : $ ( '.editable' ) . length > 0
} )
require ( './tour' )
var create _info _card = require ( '../../supporters/info-card.es6' )
appl . def ( 'todos_action' , '/profile_todos' )
var todos = require ( '../../components/todos' )
todos ( function ( data ) {
appl . def ( 'todos.items' , [
{ text : "Add logo" , done : data [ 'has_logo' ] , modal _id : 'settingsModal' } ,
{ text : "Add header image" , done : data [ 'has_background' ] , modal _id : 'uploadBackgroundImage' } ,
{ text : "Add summary" , done : data [ 'has_summary' ] , modal _id : 'settingsModal' } ,
{ text : "Add images" , done : data [ 'has_image' ] , modal _id : 'uploadCarouselImages' } ,
{ text : "Add highlights" , done : data [ 'has_highlight' ] , modal _id : 'settingsModal' } ,
{ text : "Add services and impact" , done : data [ 'has_services' ] , link : '#js-servicesAndImpact' }
] )
} )
}
// -- Flimflam
const snabbdom = require ( 'snabbdom' )
const h = require ( 'snabbdom/h' )
const flyd = require ( 'flyd' )
const R = require ( 'ramda' )
const donateWiz = require ( '../../nonprofits/donate/wizard' )
const modal = require ( 'ff-core/modal' )
const render = require ( 'ff-core/render' )
const branding = require ( '../../components/nonprofit-branding' )
function init ( ) {
var state = { }
state . donateWiz = donateWiz . init ( flyd . stream ( { } ) )
state . modalID$ = flyd . stream ( )
return state
}
function view ( state ) {
return h ( 'section.box-r' , [
h ( 'aside' , [
h ( 'a.button--jumbo u-width--full' , {
style : { background : branding . dark }
, on : { click : [ state . modalID$ , 'donationModal' ] }
} , [
` Donate to ${ app . nonprofit . name } `
] )
, h ( 'div.donationModal' , [
modal ( {
thisID : 'donationModal'
, id$ : state . modalID$
, body : donateWiz . view ( state . donateWiz )
// , notCloseable: state.donateWiz.paymentStep.cardForm.loading$()
} )
] )
] )
] )
}
// -- Render
const patch = snabbdom . init ( [
require ( 'snabbdom/modules/eventlisteners' )
, require ( 'snabbdom/modules/class' )
, require ( 'snabbdom/modules/props' )
, require ( 'snabbdom/modules/style' )
] )
var container = document . querySelector ( '.ff-container' )
var state = init ( )
render ( { container , view , patch , state } )