Creating an about page including flash boxes for registration

This commit is contained in:
Rob H
2014-08-21 15:29:23 +10:00
parent 69b1d14cc4
commit 4d106129ee
4 changed files with 73 additions and 15 deletions

View File

@@ -0,0 +1,6 @@
Darkswarm.directive "ofnInlineFlash", ->
restrict: 'E'
controller: ($scope) ->
$scope.visible = true
$scope.closeFlash = ->
$scope.visible = false

View File

@@ -7,20 +7,20 @@ Darkswarm.factory "EnterpriseCreationService", ($http, RegistrationService, Curr
country: availableCountries[0]
create: =>
$http(
method: "POST"
url: "/api/enterprises"
data:
enterprise: @prepare()
params:
token: SpreeApiKey
).success((data) ->
RegistrationService.select('about')
).error((data) ->
console.log angular.toJson(data)
alert('Failed to create your enterprise.\nPlease ensure all fields are completely filled out.')
)
# RegistrationService.select('about')
# $http(
# method: "POST"
# url: "/api/enterprises"
# data:
# enterprise: @prepare()
# params:
# token: SpreeApiKey
# ).success((data) ->
# RegistrationService.select('about')
# ).error((data) ->
# console.log angular.toJson(data)
# alert('Failed to create your enterprise.\nPlease ensure all fields are completely filled out.')
# )
RegistrationService.select('about')
prepare: =>
enterprise = {}

View File

@@ -1 +1,35 @@
Yay! You created an enterprise!
.container#registration-contact
.row.header
%h2 Nice one!
%h5 Now let's flesh out the details about {{ enterprise.name }}.
%ng-include{ src: "'registration/steps.html'" }
.row.content
%ofn-inline-flash.turquoise.small-12.columns{ ng: { show: 'visible' } }
%i.ofn-i_009-close.close-button{ ng: { click: 'closeFlash()' } }
{{ enterprise.name }} has been created on the Open Food Network. If you leave at any point from here onwards, your enterprise will be saved, and you can always login to the admin section to update or continue filling out your enterprise details.
%ofn-inline-flash.brick.small-12.columns{ ng: { show: 'visible' } }
%i.ofn-i_009-close.close-button{ ng: { click: 'closeFlash()' } }
{{ enterprise.name }} won't be visible on the Open Food Network until you enter a long and short description.
.small-12.large-8.columns
.row
.small-12.columns
%label{ for: 'enterprise_description' } Short Description:
%input.chunky.small-12.columns{ id: 'enterprise_description', placeholder: "A short sentence describing your enterprise", ng: { model: 'enterprise.description' } }
.row
.small-12.columns
%label{ for: 'enterprise_long_desc' } Long Description:
%textarea.chunky.small-12.columns{ id: 'enterprise_long_desc', placeholder: "We recommend keeping you description to under 600 characters or 150 words. Why? Cus people are lazy, and don't like to read too much text online. ;)", ng: { model: 'enterprise.long_description' } }
{{ enterprise.long_description.length }} characters used
.small-12.large-4.columns
.row
.small-12.columns
%label{ for: 'enterprise_abn' } ABN:
%input.chunky.small-12.columns{ id: 'enterprise_abn', placeholder: "eg. 99 123 456 789", ng: { model: 'enterprise.abn' } }
.row
.small-12.columns
%label{ for: 'enterprise_acn' } ACN:
%input.chunky.small-12.columns{ id: 'enterprise_acn', placeholder: "eg. 123 456 789", ng: { model: 'enterprise.acn' } }
.row
.small-12.columns
%input.button.primary{ type: "button", value: "Continue", ng: { click: "select('images')" }, style: 'float:right' }

View File

@@ -12,6 +12,24 @@
i
font-size: 150%
ofn-inline-flash
display: block
padding: 15px
position: relative
margin-bottom: 10px
&.brick
background-color: $clr-brick-light
border: 2px solid $clr-brick
color: $clr-brick
&.turquoise
background-color: $clr-turquoise-light
border: 2px solid $clr-turquoise
color: $clr-turquoise
.close-button
position: absolute
top: 0px
right: 0px
input.chunky
padding: 8px
font-size: 105%