houdini/client/js/nonprofits/show/page.js
Bradley M. Kuhn fc77ee76d6 Relicense Javascript code in accordance with project's new license
The primary license of the project is changing to:
  AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later

The Additional Permission is designed to permit publicly distributed
Javascript code to be relicensed under LGPL-3.0-or-later, but not server-side
Javascript code.  As such, we've relicensed here static Javscript files under
LGPL-3.0-or-later, and those that run as part of build and/or server side
under AGPL-3.0-or-later.

Note that in future, Javascript files may be updated to be stronger copyleft
license with the Additional Permission, particularly if they adapted to run
on server side and/or turned into templates.  Of course, we'd seek public
discussion with the contributor community about such changes.

This commit is one of the many steps to relicense the entire codebase.

Documentation granting permission for this relicensing (from all past
contributors who hold copyrights) is on file with Software Freedom
Conservancy, Inc.
2018-03-25 15:10:40 -04:00

88 lines
2.7 KiB
JavaScript
Executable file

// License: LGPL-3.0-or-later
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})