fc77ee76d6
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.
80 lines
2.2 KiB
JavaScript
80 lines
2.2 KiB
JavaScript
// License: LGPL-3.0-or-later
|
|
// npm
|
|
const h = require('snabbdom/h')
|
|
const R = require('ramda')
|
|
const notification = require('ff-core/notification')
|
|
const button = require('ff-core/button')
|
|
// local
|
|
const colorPicker = require('../../../components/color-picker.es6')
|
|
const fonts = require('../../../common/brand-fonts')
|
|
|
|
|
|
const message = 'This branding will be applied to your donate buttons, profile page, campaign pages and event pages'
|
|
|
|
var updatedTask = "Select a color and font to make your fundraising tools consistent with your brand."
|
|
const view = state =>
|
|
h('section.branding.settings-pane.nonprofit-settings.hide', [
|
|
h('header.pane-header', [h('h3', 'Branding')])
|
|
, h('div.pane-inner.branding', [
|
|
h('p.pastelBox--yellow.u-padding--10', message)
|
|
, h('br')
|
|
, h('div.branding-settings-wrapper', [
|
|
colorPickWrap(state)
|
|
, fontPicker(state)
|
|
, form(state)
|
|
])
|
|
, preview(state)
|
|
])
|
|
, notification.view(state.notification)
|
|
])
|
|
|
|
const colorPickWrap = state =>
|
|
h('div.color-wrapper', [
|
|
h('p.title', 'Select Brand Color')
|
|
, colorPicker.view(state.colorPicker)
|
|
, h('div.colPick-wrapper.inner#colorpicker')
|
|
])
|
|
|
|
const fontPicker = state =>
|
|
h('div.font-wrapper', [
|
|
h('p.title', 'Select Brand Font')
|
|
, fontListing(state)
|
|
])
|
|
|
|
const fontListing = state =>
|
|
h('ul.inner', R.map(R.apply(fontRow(state)), R.toPairs(fonts)))
|
|
|
|
const fontRow = R.curry((state, key, font) =>
|
|
h('li', {
|
|
style: { fontFamily: font.family }
|
|
, on: {click: [state.font$, R.merge(font, {key: key})]}
|
|
}, font.name)
|
|
)
|
|
|
|
const form = state => {
|
|
var tier = state.nonprofit.tier
|
|
var btn = button({ buttonText: 'Save Branding' , loading$: state.loading$ })
|
|
|
|
return h('form.branding-form', {
|
|
on: {submit: ev => {ev.preventDefault(); state.submit$(state)}}
|
|
}, [btn])
|
|
}
|
|
|
|
const preview = state =>
|
|
h('div.preview-wrapper', [
|
|
h('p.title', 'Preview')
|
|
, previewDonateBtn(state)
|
|
])
|
|
|
|
const previewDonateBtn = state =>
|
|
h('div.branded-donate-button-wrapper', [
|
|
h('p.branded-donate-button', {
|
|
style: {
|
|
background: state.colorPicker.color$()
|
|
, fontFamily: state.font$().family
|
|
}
|
|
}, 'Donate' )
|
|
])
|
|
|
|
module.exports = view
|
|
|