├── .gitignore ├── CNAME ├── _config.yml ├── img ├── left.png ├── .DS_Store ├── about.png ├── add-btn.png ├── bf_logo.png ├── connect.png ├── favicon.ico ├── header.jpg ├── laptop.png ├── learn.png ├── loading.gif ├── right.png ├── star-on.png ├── teach.png ├── trello.gif ├── blue-dot.png ├── cancel-on.png ├── cfa_logo.png ├── close-btn.png ├── flag-icon.gif ├── icon-flag.png ├── icon-like.png ├── icon-star.png ├── plus-step.png ├── promo_vid.png ├── star-half.png ├── star-icon.gif ├── star-off.png ├── teach-dot.png ├── active_dot.gif ├── active_dot.png ├── ajax-loader.gif ├── bf_logo_tiny.png ├── bf_tiny_tiny.png ├── cancel-off.png ├── coming-soon.gif ├── connect-blue.png ├── connect-gray.gif ├── fake-icons.png ├── finished_dot.gif ├── finished_dot.png ├── foursquare.gif ├── green-check.png ├── header_long.jpg ├── heart-icon.gif ├── icon-heart.png ├── learn-blue.png ├── learn-bulb.png ├── learn_gray.gif ├── look-right.gif ├── side_header.jpg ├── teach-blue.png ├── teach-people.png ├── teach_gray.png ├── bf_logo_ribbon.png ├── bf_logo_small.gif ├── celebration_fb.gif ├── celebration_g+.gif ├── celebration_li.gif ├── connect-people.png ├── fb_lesson_icon.gif ├── fs_todo_button.png ├── share-fb-blue.png ├── share-g+-blue.png ├── thumbs-up-icon.gif ├── unfinished_dot.gif ├── unfinished_dot.png ├── BizFriendly-logo.png ├── celebration_flag.gif ├── celebration_heart.gif ├── celebration_like.gif ├── celebration_star.gif ├── fake-instructions.png ├── instruction-logo.png ├── profile-fb-icon.png ├── profile-g+-icon.png ├── profile-li-icon.png ├── profile-site-icon.png ├── share-mail-blue.png ├── share-mail-icon.png ├── socialshare_fb_b.png ├── socialshare_fb_o.png ├── upload-image-icon.png ├── celebration_twitter.gif ├── instruction-header.png ├── profile-email-icon.png ├── socialshare_email_b.png ├── socialshare_email_o.png ├── teaching-guide │ ├── open.png │ ├── text.png │ ├── tg1.png │ ├── tg2.png │ ├── tg3.png │ ├── arrows.png │ ├── image.png │ ├── login.png │ ├── elements.png │ ├── icons_img.png │ ├── trello_ss.png │ ├── color_picker.png │ ├── green_zone.png │ ├── simple_step.png │ ├── vimeo_embed.png │ └── edit_lesson_name.png ├── digital-skills-chart.png ├── glyphicons-halflings.png ├── profile-twitter-icon.png ├── socialshare_google_b.png ├── socialshare_google_o.png ├── socialshare_linked_b.png ├── socialshare_linkedin_o.png ├── socialshare_twitter_b.png ├── socialshare_twitter_o.png ├── socialshare_website_b.png ├── BizFriendlyArchitecture.png ├── bizfriendly_weblogo_beta.png ├── foursquare_instructions.png ├── bizfriendly_weblogo_alpha.png └── glyphicons-halflings-white.png ├── js ├── .DS_Store ├── vendor │ ├── .DS_Store │ ├── jquery.iecors.js │ ├── jquery.popupwindow.js │ ├── jquery.cookie.js │ ├── jquery.raty.min.js │ └── jquery.iframe-transport.js ├── config.js ├── lesson.js ├── learn.js ├── service.js ├── new-category.js ├── editProfile.js ├── connect.js └── profile.js ├── ico ├── .DS_Store └── favicon.ico ├── fonts ├── Museo_Slab_500_2.otf ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.ttf └── glyphicons-halflings-regular.woff ├── docs ├── public │ ├── fonts │ │ ├── aller-bold.eot │ │ ├── aller-bold.ttf │ │ ├── aller-bold.woff │ │ ├── aller-light.eot │ │ ├── aller-light.ttf │ │ ├── aller-light.woff │ │ ├── novecento-bold.eot │ │ ├── novecento-bold.ttf │ │ └── novecento-bold.woff │ └── stylesheets │ │ └── normalize.css ├── __init__.html ├── init.html ├── config.html ├── put.html ├── index.html ├── settings.html ├── forms.html ├── pycco.css └── api.html ├── civic.json ├── invite.html ├── _layouts ├── docs.html ├── instructions.html ├── teach-layout.html └── default.html ├── request-content.html ├── _includes ├── css.html ├── footer_scripts.html ├── footer.html ├── header.html └── scripts.html ├── request-password-reset.html ├── reset-password.html ├── signin.html ├── signup.html ├── learn.html ├── index.html ├── preview-instructions.html ├── instructions.html ├── service.html ├── connect.html ├── profile.html ├── edit-profile.html ├── css └── bootstrap-select.min.css ├── new-category.html ├── teach.html ├── about.html └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | _site/ -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | staging.bizfriend.ly -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | destination: _site 2 | include: ['__init__.html'] -------------------------------------------------------------------------------- /img/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/left.png -------------------------------------------------------------------------------- /js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/js/.DS_Store -------------------------------------------------------------------------------- /ico/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/ico/.DS_Store -------------------------------------------------------------------------------- /ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/ico/favicon.ico -------------------------------------------------------------------------------- /img/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/.DS_Store -------------------------------------------------------------------------------- /img/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/about.png -------------------------------------------------------------------------------- /img/add-btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/add-btn.png -------------------------------------------------------------------------------- /img/bf_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/bf_logo.png -------------------------------------------------------------------------------- /img/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/connect.png -------------------------------------------------------------------------------- /img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/favicon.ico -------------------------------------------------------------------------------- /img/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/header.jpg -------------------------------------------------------------------------------- /img/laptop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/laptop.png -------------------------------------------------------------------------------- /img/learn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/learn.png -------------------------------------------------------------------------------- /img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/loading.gif -------------------------------------------------------------------------------- /img/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/right.png -------------------------------------------------------------------------------- /img/star-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/star-on.png -------------------------------------------------------------------------------- /img/teach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teach.png -------------------------------------------------------------------------------- /img/trello.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/trello.gif -------------------------------------------------------------------------------- /img/blue-dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/blue-dot.png -------------------------------------------------------------------------------- /img/cancel-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/cancel-on.png -------------------------------------------------------------------------------- /img/cfa_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/cfa_logo.png -------------------------------------------------------------------------------- /img/close-btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/close-btn.png -------------------------------------------------------------------------------- /img/flag-icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/flag-icon.gif -------------------------------------------------------------------------------- /img/icon-flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/icon-flag.png -------------------------------------------------------------------------------- /img/icon-like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/icon-like.png -------------------------------------------------------------------------------- /img/icon-star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/icon-star.png -------------------------------------------------------------------------------- /img/plus-step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/plus-step.png -------------------------------------------------------------------------------- /img/promo_vid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/promo_vid.png -------------------------------------------------------------------------------- /img/star-half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/star-half.png -------------------------------------------------------------------------------- /img/star-icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/star-icon.gif -------------------------------------------------------------------------------- /img/star-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/star-off.png -------------------------------------------------------------------------------- /img/teach-dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teach-dot.png -------------------------------------------------------------------------------- /img/active_dot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/active_dot.gif -------------------------------------------------------------------------------- /img/active_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/active_dot.png -------------------------------------------------------------------------------- /img/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/ajax-loader.gif -------------------------------------------------------------------------------- /img/bf_logo_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/bf_logo_tiny.png -------------------------------------------------------------------------------- /img/bf_tiny_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/bf_tiny_tiny.png -------------------------------------------------------------------------------- /img/cancel-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/cancel-off.png -------------------------------------------------------------------------------- /img/coming-soon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/coming-soon.gif -------------------------------------------------------------------------------- /img/connect-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/connect-blue.png -------------------------------------------------------------------------------- /img/connect-gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/connect-gray.gif -------------------------------------------------------------------------------- /img/fake-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/fake-icons.png -------------------------------------------------------------------------------- /img/finished_dot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/finished_dot.gif -------------------------------------------------------------------------------- /img/finished_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/finished_dot.png -------------------------------------------------------------------------------- /img/foursquare.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/foursquare.gif -------------------------------------------------------------------------------- /img/green-check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/green-check.png -------------------------------------------------------------------------------- /img/header_long.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/header_long.jpg -------------------------------------------------------------------------------- /img/heart-icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/heart-icon.gif -------------------------------------------------------------------------------- /img/icon-heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/icon-heart.png -------------------------------------------------------------------------------- /img/learn-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/learn-blue.png -------------------------------------------------------------------------------- /img/learn-bulb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/learn-bulb.png -------------------------------------------------------------------------------- /img/learn_gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/learn_gray.gif -------------------------------------------------------------------------------- /img/look-right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/look-right.gif -------------------------------------------------------------------------------- /img/side_header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/side_header.jpg -------------------------------------------------------------------------------- /img/teach-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teach-blue.png -------------------------------------------------------------------------------- /img/teach-people.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teach-people.png -------------------------------------------------------------------------------- /img/teach_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teach_gray.png -------------------------------------------------------------------------------- /js/vendor/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/js/vendor/.DS_Store -------------------------------------------------------------------------------- /img/bf_logo_ribbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/bf_logo_ribbon.png -------------------------------------------------------------------------------- /img/bf_logo_small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/bf_logo_small.gif -------------------------------------------------------------------------------- /img/celebration_fb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/celebration_fb.gif -------------------------------------------------------------------------------- /img/celebration_g+.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/celebration_g+.gif -------------------------------------------------------------------------------- /img/celebration_li.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/celebration_li.gif -------------------------------------------------------------------------------- /img/connect-people.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/connect-people.png -------------------------------------------------------------------------------- /img/fb_lesson_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/fb_lesson_icon.gif -------------------------------------------------------------------------------- /img/fs_todo_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/fs_todo_button.png -------------------------------------------------------------------------------- /img/share-fb-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/share-fb-blue.png -------------------------------------------------------------------------------- /img/share-g+-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/share-g+-blue.png -------------------------------------------------------------------------------- /img/thumbs-up-icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/thumbs-up-icon.gif -------------------------------------------------------------------------------- /img/unfinished_dot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/unfinished_dot.gif -------------------------------------------------------------------------------- /img/unfinished_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/unfinished_dot.png -------------------------------------------------------------------------------- /img/BizFriendly-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/BizFriendly-logo.png -------------------------------------------------------------------------------- /img/celebration_flag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/celebration_flag.gif -------------------------------------------------------------------------------- /img/celebration_heart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/celebration_heart.gif -------------------------------------------------------------------------------- /img/celebration_like.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/celebration_like.gif -------------------------------------------------------------------------------- /img/celebration_star.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/celebration_star.gif -------------------------------------------------------------------------------- /img/fake-instructions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/fake-instructions.png -------------------------------------------------------------------------------- /img/instruction-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/instruction-logo.png -------------------------------------------------------------------------------- /img/profile-fb-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/profile-fb-icon.png -------------------------------------------------------------------------------- /img/profile-g+-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/profile-g+-icon.png -------------------------------------------------------------------------------- /img/profile-li-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/profile-li-icon.png -------------------------------------------------------------------------------- /img/profile-site-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/profile-site-icon.png -------------------------------------------------------------------------------- /img/share-mail-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/share-mail-blue.png -------------------------------------------------------------------------------- /img/share-mail-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/share-mail-icon.png -------------------------------------------------------------------------------- /img/socialshare_fb_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_fb_b.png -------------------------------------------------------------------------------- /img/socialshare_fb_o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_fb_o.png -------------------------------------------------------------------------------- /img/upload-image-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/upload-image-icon.png -------------------------------------------------------------------------------- /fonts/Museo_Slab_500_2.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/fonts/Museo_Slab_500_2.otf -------------------------------------------------------------------------------- /img/celebration_twitter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/celebration_twitter.gif -------------------------------------------------------------------------------- /img/instruction-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/instruction-header.png -------------------------------------------------------------------------------- /img/profile-email-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/profile-email-icon.png -------------------------------------------------------------------------------- /img/socialshare_email_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_email_b.png -------------------------------------------------------------------------------- /img/socialshare_email_o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_email_o.png -------------------------------------------------------------------------------- /img/teaching-guide/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/open.png -------------------------------------------------------------------------------- /img/teaching-guide/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/text.png -------------------------------------------------------------------------------- /img/teaching-guide/tg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/tg1.png -------------------------------------------------------------------------------- /img/teaching-guide/tg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/tg2.png -------------------------------------------------------------------------------- /img/teaching-guide/tg3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/tg3.png -------------------------------------------------------------------------------- /img/digital-skills-chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/digital-skills-chart.png -------------------------------------------------------------------------------- /img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /img/profile-twitter-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/profile-twitter-icon.png -------------------------------------------------------------------------------- /img/socialshare_google_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_google_b.png -------------------------------------------------------------------------------- /img/socialshare_google_o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_google_o.png -------------------------------------------------------------------------------- /img/socialshare_linked_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_linked_b.png -------------------------------------------------------------------------------- /img/socialshare_linkedin_o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_linkedin_o.png -------------------------------------------------------------------------------- /img/socialshare_twitter_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_twitter_b.png -------------------------------------------------------------------------------- /img/socialshare_twitter_o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_twitter_o.png -------------------------------------------------------------------------------- /img/socialshare_website_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/socialshare_website_b.png -------------------------------------------------------------------------------- /img/teaching-guide/arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/arrows.png -------------------------------------------------------------------------------- /img/teaching-guide/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/image.png -------------------------------------------------------------------------------- /img/teaching-guide/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/login.png -------------------------------------------------------------------------------- /docs/public/fonts/aller-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/aller-bold.eot -------------------------------------------------------------------------------- /docs/public/fonts/aller-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/aller-bold.ttf -------------------------------------------------------------------------------- /img/BizFriendlyArchitecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/BizFriendlyArchitecture.png -------------------------------------------------------------------------------- /img/bizfriendly_weblogo_beta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/bizfriendly_weblogo_beta.png -------------------------------------------------------------------------------- /img/foursquare_instructions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/foursquare_instructions.png -------------------------------------------------------------------------------- /img/teaching-guide/elements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/elements.png -------------------------------------------------------------------------------- /img/teaching-guide/icons_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/icons_img.png -------------------------------------------------------------------------------- /img/teaching-guide/trello_ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/trello_ss.png -------------------------------------------------------------------------------- /docs/public/fonts/aller-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/aller-bold.woff -------------------------------------------------------------------------------- /docs/public/fonts/aller-light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/aller-light.eot -------------------------------------------------------------------------------- /docs/public/fonts/aller-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/aller-light.ttf -------------------------------------------------------------------------------- /docs/public/fonts/aller-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/aller-light.woff -------------------------------------------------------------------------------- /img/bizfriendly_weblogo_alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/bizfriendly_weblogo_alpha.png -------------------------------------------------------------------------------- /img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /img/teaching-guide/color_picker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/color_picker.png -------------------------------------------------------------------------------- /img/teaching-guide/green_zone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/green_zone.png -------------------------------------------------------------------------------- /img/teaching-guide/simple_step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/simple_step.png -------------------------------------------------------------------------------- /img/teaching-guide/vimeo_embed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/vimeo_embed.png -------------------------------------------------------------------------------- /civic.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": null, 3 | "tags": [ 4 | "what", 5 | "ever", 6 | "okay", 7 | "sure" 8 | ] 9 | } -------------------------------------------------------------------------------- /docs/public/fonts/novecento-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/novecento-bold.eot -------------------------------------------------------------------------------- /docs/public/fonts/novecento-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/novecento-bold.ttf -------------------------------------------------------------------------------- /docs/public/fonts/novecento-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/docs/public/fonts/novecento-bold.woff -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /img/teaching-guide/edit_lesson_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforamerica/bizfriendly-web-staging/gh-pages/img/teaching-guide/edit_lesson_name.png -------------------------------------------------------------------------------- /invite.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: invite a friend 4 | --- 5 | 6 |
7 |
8 | 9 |
10 |
-------------------------------------------------------------------------------- /_layouts/docs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BizFriend.ly | Docs | {{ page.title }} 6 | 7 | 8 | 9 | {{ content }} 10 | 11 | -------------------------------------------------------------------------------- /request-content.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: request content 4 | --- 5 | 6 |
7 |
8 | 9 |
10 |
-------------------------------------------------------------------------------- /js/config.js: -------------------------------------------------------------------------------- 1 | // GLOBAL VARIABLES 2 | var config = { 3 | // debug : true, 4 | bfUrl : 'http://app.bizfriend.ly', 5 | // bfUrl : 'http://howtocity.herokuapp.com', 6 | // bfUrl : 'http://app-staging.bizfriend.ly', 7 | // bfUrl : 'http://127.0.0.1:8000', 8 | // bfUrl : 'http://0.0.0.0:5000', 9 | bfApiVersion : '/api/v1' 10 | } 11 | -------------------------------------------------------------------------------- /_layouts/instructions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BizFriend.ly | {{ page.title }} 5 | 6 | 7 | 8 | 9 | {% include css.html %} 10 | {% include scripts.html %} 11 | 12 | 13 | 14 | 15 | {{ content }} 16 | 17 | 18 | 19 | {% include footer_scripts.html %} 20 | 21 | -------------------------------------------------------------------------------- /_layouts/teach-layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BizFriend.ly | {{ page.title }} 5 | 6 | 7 | 8 | 9 | {% include css.html %} 10 | {% include scripts.html %} 11 | 12 | 13 | 14 |
15 | {% include header.html %} 16 |
17 | 18 | {{ content }} 19 | 20 | 21 | 22 | {% include footer_scripts.html %} 23 | 24 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BizFriend.ly | {{ page.title }} 5 | 6 | 7 | 8 | 9 | {% include css.html %} 10 | {% include scripts.html %} 11 | 12 | 13 | 14 | 15 | {% include header.html %} 16 | 17 | {{ content }} 18 | 19 | {% include footer.html %} 20 | 21 | 22 | 23 | {% include footer_scripts.html %} 24 | 25 | -------------------------------------------------------------------------------- /_includes/css.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% if page.js == 'teach' %} 5 | 6 | {% endif %} 7 | {% if page.js == 'new-service' %} 8 | 9 | {% endif %} 10 | {% if page.js == 'instructions' %} 11 | 12 | {% endif %} -------------------------------------------------------------------------------- /_includes/footer_scripts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% if page.js %}{% endif %} 4 | 5 | -------------------------------------------------------------------------------- /_includes/footer.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /request-password-reset.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: request password reset 4 | --- 5 | 6 |
7 |

Reset Your Password

8 |
9 |
10 | 11 | 12 |
13 | Send Password Reset Email 14 |
15 | 16 |
17 | 18 |
19 |

20 |
-------------------------------------------------------------------------------- /_includes/header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /reset-password.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: password reset 4 | --- 5 | 6 |
7 |

Reset Your Password

8 |
9 |
10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 |

22 |
23 | -------------------------------------------------------------------------------- /signin.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: sign in 4 | --- 5 | 6 |
7 |

Returning to BizFriend.ly?

8 |
9 |
10 | 11 | 12 |
13 |
14 | 15 | 16 |
17 | 18 | Reset Password 19 |
20 | 21 |
22 | 23 |
24 |

25 |
-------------------------------------------------------------------------------- /signup.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: sign up 4 | --- 5 | 6 |
7 |

New to BizFriend.ly?

8 |
9 |
10 | 11 | 12 |
13 |
14 | 15 | 16 |
17 |
18 | 19 | 20 |
21 | 22 |
23 |
24 | 25 |
26 |

27 |
-------------------------------------------------------------------------------- /learn.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: learn 4 | js: learn 5 | --- 6 | 7 |
8 |
9 |

We've collected the top digital skills for your business.
To get started, select the one you're most interested in.

10 |

Under each skill, you'll find web services that will help you learn how to do that skill for your business.

11 |
12 |
13 | 14 |
15 | 16 |
17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | 29 |
30 |
-------------------------------------------------------------------------------- /docs/__init__.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | __init__.py 6 | 7 | 8 | 9 |
10 |
11 |
12 |

__init__.py

13 |
14 |
15 |
16 |
17 |
18 | # 19 |
20 |

BizFriendly is setup as a contained python module. 21 | This file creates the Flask app then imports the other parts of the module.

22 |
23 |
24 |
from flask import Flask
25 | 
26 | app = Flask(__name__)
27 | 
28 | import settings, admin, routes, api
29 | 
30 | 
31 |
32 |
33 |
34 |
35 | 36 | -------------------------------------------------------------------------------- /js/vendor/jquery.iecors.js: -------------------------------------------------------------------------------- 1 | (function( jQuery ) { 2 | // Create the request object 3 | // (This is still attached to ajaxSettings for backward compatibility) 4 | jQuery.ajaxSettings.xdr = function() { 5 | return (window.XDomainRequest ? new window.XDomainRequest() : null); 6 | }; 7 | 8 | // Determine support properties 9 | (function( xdr ) { 10 | jQuery.extend( jQuery.support, { iecors: !!xdr }); 11 | })( jQuery.ajaxSettings.xdr() ); 12 | 13 | // Create transport if the browser can provide an xdr 14 | if ( jQuery.support.iecors ) { 15 | 16 | jQuery.ajaxTransport(function( s ) { 17 | var callback, 18 | xdr = s.xdr(); 19 | 20 | return { 21 | send: function( headers, complete ) { 22 | xdr.onload = function() { 23 | var headers = { 'Content-Type': xdr.contentType }; 24 | complete(200, 'OK', { text: xdr.responseText }, headers); 25 | }; 26 | 27 | xdr.onprogress = function () { }; 28 | xdr.ontimeout = function () { }; 29 | xdr.onerror = function () { }; 30 | 31 | // Apply custom fields if provided 32 | if ( s.xhrFields ) { 33 | xhr.onerror = s.xhrFields.error; 34 | xhr.ontimeout = s.xhrFields.timeout; 35 | } 36 | 37 | xdr.open( s.type, s.url ); 38 | 39 | // XDR has no method for setting headers O_o 40 | 41 | xdr.send( ( s.hasContent && s.data ) || null ); 42 | }, 43 | 44 | abort: function() { 45 | xdr.abort(); 46 | } 47 | }; 48 | }); 49 | } 50 | })( jQuery ); -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: home 4 | --- 5 | 6 | 18 | 19 |
20 | 25 | 30 | 35 |
-------------------------------------------------------------------------------- /docs/init.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | __init__.py 6 | 7 | 8 | 9 |
10 |
11 |
12 |

__init__.py

13 |
14 |
15 |
16 |
17 |
18 | # 19 |
20 | 21 |
22 |
23 |
from flask import Flask
24 |
25 |
26 |
27 |
28 |
29 |
30 | # 31 |
32 |
33 |

initialization

34 |
35 |
36 |
app = Flask(__name__)
37 | 
38 | import config, admin, routes, api
39 | 
40 | 
41 |
42 |
43 |
44 |
45 | 46 | -------------------------------------------------------------------------------- /preview-instructions.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: instructions-layout 3 | title: instructions 4 | js: preview-instructions 5 | --- 6 | 7 | 8 | 9 |
10 | 11 |
12 |

13 |

Created by

14 |
    15 |
    16 | 17 |
    18 |
    19 | 20 | 21 | 28 |
    29 | 30 |
    31 | 32 | 33 |
    34 |
    35 | 36 |
    37 |
    38 | 39 | -------------------------------------------------------------------------------- /instructions.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: instructions 3 | title: instructions 4 | js: instructions 5 | --- 6 | 7 | 8 |
    9 | 10 |
    11 |
    12 |

    13 |

    Created by

    14 |
      15 |
      16 |
      17 | 18 |
      19 | 20 | 27 | 28 | 29 |
      30 | 31 |
      32 | 33 |
      34 | 35 | 36 |
      37 |
      38 | 39 |
      40 |
      41 | 42 | 57 |
      58 |
      -------------------------------------------------------------------------------- /docs/config.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | config.js 6 | 7 | 8 | 9 |
      10 |
      11 |
      12 |

      config.js

      13 |
      14 |
      15 |
      16 |
      17 |
      18 | # 19 |
      20 |

      GLOBAL VARIABLES

      21 |
      22 |
      23 |
      var config = {
      24 |   debug : true,
      25 |
      26 |
      27 |
      28 |
      29 |
      30 |
      31 | # 32 |
      33 |

      bfUrl : 'https://howtocity.herokuapp.com',

      34 |
      35 |
      36 |
        bfUrl : 'http://app-staging.bizfriend.ly',
      37 |
      38 |
      39 |
      40 |
      41 |
      42 |
      43 | # 44 |
      45 |

      bfUrl : 'http://127.0.0.1:8000', 46 | bfUrl : 'http://0.0.0.0:5000',

      47 |
      48 |
      49 |
        bfApiVersion : '/api/v1'
      50 | }
      51 | 
      52 | 
      53 |
      54 |
      55 |
      56 |
      57 | 58 | -------------------------------------------------------------------------------- /service.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: service 4 | js: service 5 | --- 6 | 7 |
      8 | 9 |
      10 | 11 |
      12 |
      13 |
      14 | 15 |

      16 |
      17 |
      18 |
      19 |
      20 |
      21 | 22 |

      Keep in Mind

      23 |
        24 |
      25 |
      26 |

      Additional Resources

      27 |
        28 |
      29 |
      30 |
      31 |
      32 |
      33 |
      34 |
      35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
      LessonsLearners
      45 | 46 |
      47 | 48 |

      Already using for your business? Help teach other business owners!

      49 |
      50 |
      51 | 52 |
      53 | 54 | 55 | -------------------------------------------------------------------------------- /_includes/scripts.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | {% if page.js == 'new-service' %} 9 | 10 | 11 | 12 | 13 | 14 | 15 | {% endif %} 16 | 17 | {% if page.js == 'teach' %} 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 30 | {% endif %} 31 | 32 | {% if page.js == 'profile' %} 33 | 34 | {% endif %} 35 | 36 | {% if page.js == 'instructions' %} 37 | 38 | 39 | 44 | {% endif %} -------------------------------------------------------------------------------- /js/lesson.js: -------------------------------------------------------------------------------- 1 | var lesson = (function (lesson) { 2 | 3 | var lesson = {}; 4 | 5 | // PUBLIC METHODS 6 | // initialize variables and load JSON 7 | function init(){ 8 | if (config.debug) console.log('init'); 9 | lessonId = window.location.search.split('?')[1]; 10 | // Call the API and get that lesson 11 | _loading(); 12 | $.getJSON(config.bfUrl+config.bfApiVersion+'/lessons/'+lessonId, _main); 13 | } 14 | 15 | // PRIVATE METHODS 16 | function _loading(){ 17 | // console.log('Loading'); 18 | $('#main').toggle(); 19 | } 20 | 21 | function _main(response){ 22 | $('#loading').toggle(); 23 | $('#main').toggle(); 24 | lesson = response; 25 | _makeSummary(); 26 | _checkIfLoggedIn(); 27 | } 28 | 29 | function _makeSummary(){ 30 | if (lesson.third_party_service == 'facebook'){ 31 | $('#main-video').html(''); 32 | } 33 | else if (lesson.third_party_service == 'foursquare'){ 34 | $('#main-video').html(''); 35 | } 36 | else { 37 | $('#main-video').html(''); 38 | } 39 | $('#main #main-text .lesson-name').html(lesson.name); 40 | $('#main #main-text .lesson-description').html(lesson.long_description); 41 | $('#additional_resources ul').html(lesson.additional_resources); 42 | $('#tips ul').html(lesson.tips); 43 | $('#main #main-text a').click(_instructionsLinkClicked); 44 | } 45 | 46 | function _checkIfLoggedIn(){ 47 | if (!BfUser.bfAccessToken){ 48 | $('#main-text .btn').hide(); 49 | $('.login-required').show(); 50 | } 51 | } 52 | 53 | function _instructionsLinkClicked(evt){ 54 | var url = 'instructions.html?'+lessonId; 55 | var width = 340; 56 | var height = window.screen.height; 57 | var left = window.screen.width - 340; 58 | var instructionOptions = "height="+height+",width="+width+",left="+left; 59 | window.open(url,"instructions",instructionOptions); 60 | } 61 | // add public methods to the returned module and return it 62 | lesson.init = init; 63 | return lesson; 64 | }(lesson || {})); 65 | 66 | // initialize the module 67 | lesson.init() -------------------------------------------------------------------------------- /js/vendor/jquery.popupwindow.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Display popup window. 3 | * 4 | * Requires: jQuery v1.3.2 5 | */ 6 | (function($) { 7 | var defaults = { 8 | height: 500, 9 | width: 500, 10 | toolbar: false, 11 | scrollbars: false, // os x always adds scrollbars 12 | status: false, 13 | resizable: false, 14 | left: 0, 15 | top: 0, 16 | center: true, 17 | createNew: true, 18 | name: null, 19 | location: false, 20 | menubar: false, 21 | onUnload: null 22 | }; 23 | 24 | $.popupWindow = function(url, opts) { 25 | var options = $.extend({}, defaults, opts); 26 | 27 | // center the window 28 | if (options.center) { 29 | // 50px is a rough estimate for the height of the chrome above the document area 30 | options.top = ((screen.height - options.height) / 2) - 50; 31 | options.left = (screen.width - options.width) / 2; 32 | } 33 | 34 | // params 35 | var params = []; 36 | params.push('location=' + (options.location ? 'yes' : 'no')); 37 | params.push('menubar=' + (options.menubar ? 'yes' : 'no')); 38 | params.push('toolbar=' + (options.toolbar ? 'yes' : 'no')); 39 | params.push('scrollbars=' + (options.scrollbars ? 'yes' : 'no')); 40 | params.push('status=' + (options.status ? 'yes' : 'no')); 41 | params.push('resizable=' + (options.resizable ? 'yes' : 'no')); 42 | params.push('height=' + options.height); 43 | params.push('width=' + options.width); 44 | params.push('left=' + options.left); 45 | params.push('top=' + options.top); 46 | 47 | // open window 48 | var random = new Date().getTime(); 49 | var name = options.name || (options.createNew ? 'popup_window_' + random : 'popup_window'); 50 | var win = window.open(url, name, params.join(',')); 51 | // unload handler 52 | if (options.onUnload && typeof options.onUnload === 'function') { 53 | var unloadInterval = setInterval(function() { 54 | if (!win || win.closed) { 55 | clearInterval(unloadInterval); 56 | options.onUnload(); 57 | } 58 | }, 50); 59 | } 60 | 61 | // focus window 62 | if (win && win.focus) win.focus(); 63 | 64 | // return handle to window 65 | return win; 66 | }; 67 | })(jQuery); -------------------------------------------------------------------------------- /js/vendor/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.3.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD. Register as anonymous module. 11 | define(['jquery'], factory); 12 | } else { 13 | // Browser globals. 14 | factory(jQuery); 15 | } 16 | }(function ($) { 17 | 18 | var pluses = /\+/g; 19 | 20 | function raw(s) { 21 | return s; 22 | } 23 | 24 | function decoded(s) { 25 | return decodeURIComponent(s.replace(pluses, ' ')); 26 | } 27 | 28 | function converted(s) { 29 | if (s.indexOf('"') === 0) { 30 | // This is a quoted cookie as according to RFC2068, unescape 31 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 32 | } 33 | try { 34 | return config.json ? JSON.parse(s) : s; 35 | } catch(er) {} 36 | } 37 | 38 | var config = $.cookie = function (key, value, options) { 39 | 40 | // write 41 | if (value !== undefined) { 42 | options = $.extend({}, config.defaults, options); 43 | 44 | if (typeof options.expires === 'number') { 45 | var days = options.expires, t = options.expires = new Date(); 46 | t.setDate(t.getDate() + days); 47 | } 48 | 49 | value = config.json ? JSON.stringify(value) : String(value); 50 | 51 | return (document.cookie = [ 52 | config.raw ? key : encodeURIComponent(key), 53 | '=', 54 | config.raw ? value : encodeURIComponent(value), 55 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 56 | options.path ? '; path=' + options.path : '', 57 | options.domain ? '; domain=' + options.domain : '', 58 | options.secure ? '; secure' : '' 59 | ].join('')); 60 | } 61 | 62 | // read 63 | var decode = config.raw ? raw : decoded; 64 | var cookies = document.cookie.split('; '); 65 | var result = key ? undefined : {}; 66 | for (var i = 0, l = cookies.length; i < l; i++) { 67 | var parts = cookies[i].split('='); 68 | var name = decode(parts.shift()); 69 | var cookie = decode(parts.join('=')); 70 | 71 | if (key && key === name) { 72 | result = converted(cookie); 73 | break; 74 | } 75 | 76 | if (!key) { 77 | result[name] = converted(cookie); 78 | } 79 | } 80 | 81 | return result; 82 | }; 83 | 84 | config.defaults = {}; 85 | 86 | $.removeCookie = function (key, options) { 87 | if ($.cookie(key) !== undefined) { 88 | // Must not alter options, thus extending a fresh object... 89 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 90 | return true; 91 | } 92 | return false; 93 | }; 94 | 95 | })); 96 | -------------------------------------------------------------------------------- /js/learn.js: -------------------------------------------------------------------------------- 1 | var learn = (function (learn) { 2 | // private properties 3 | var categories = []; 4 | // var featuredCategory; 5 | var selectedCategory = 1; 6 | 7 | // PUBLIC METHODS 8 | // initialize variables and load JSON 9 | function init(){ 10 | if (config.debug) console.log('init'); 11 | // Call the API and get that lesson, pass response to _main 12 | _loading(); 13 | $.getJSON(config.bfUrl+config.bfApiVersion+'/categories', _main); 14 | } 15 | 16 | // PRIVATE METHODS 17 | function _loading(){ 18 | // console.log('Loading'); 19 | $('#main').toggle(); 20 | } 21 | 22 | function _alphabetize(a, b) { 23 | // Pass to Array.sort() method as a comparison function for categories, based on the 'name' property. 24 | return (a.name < b.name) ? -1 : ((a.name > b.name) ? 1 : 0); 25 | } 26 | 27 | function _main(response){ 28 | $('#loading').toggle(); 29 | $('#main').toggle(); 30 | allCategories = response.objects.sort(_alphabetize); 31 | 32 | for (var i in allCategories) { 33 | if (allCategories[i].state == "published") { 34 | categories.push(allCategories[i]) 35 | } 36 | } 37 | 38 | $(categories).each(function(i){ 39 | if (config.debug) console.log(categories[i].name); 40 | 41 | if (i < (categories.length / 2)) { 42 | $("#category-left").append(''+categories[i].name+'

      ') 43 | } else { 44 | $("#category-right").append('
      '+categories[i].name+'

      ') 45 | } 46 | 47 | var html = '
      \ 48 | \ 49 |

      '+categories[i].name+'

      \ 50 |

      '+categories[i].description+'

      \ 51 |
      '; 52 | 53 | var services = categories[i].services; 54 | $.each(services, function(x){ 55 | if (services[x].state == "published"){ 56 | // console.log("SERVICE STATE: "+services[x].state); 57 | // TODO: WHEN MORE THAN 4, ADD A NEW ROW 58 | // if (x % 4 == 0) { 59 | // html += '
      '; 60 | // } 61 | html += '
      \ 62 |
      \ 63 | \ 64 | '+services[x].name+'
      \ 65 |
      \ 66 |
      \ 67 |

      '+services[x].short_description+'

      \ 68 |
      '; 69 | } 70 | }) 71 | html += '
      \ 72 |
      \ 73 |
      \ 74 | \ 75 |
      \ 76 |
      \ 77 |

      Already '+categories[i].name+'?


      \ 78 |

      Help teach other business owners!

      \ 79 |
      \ 80 |
      \ 81 |
      \ 82 |
      \ 83 |
      \ 84 |
      '; 85 | 86 | $("#categories").append(html); 87 | }) 88 | } 89 | 90 | // add public methods to the returned module and return it 91 | learn.init = init; 92 | return learn; 93 | }(learn || {})); 94 | 95 | // initialize the module 96 | learn.init() 97 | -------------------------------------------------------------------------------- /connect.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: connect 4 | js: connect 5 | published: true 6 | --- 7 | 8 |
      9 |
      10 |
      11 |

      Nice work! Here's where you can see everything you've done on BizFriend.ly

      12 |
      13 |
      14 | 15 |
      16 |
      17 |
      18 |
      19 |

      Hi,

      20 |

      21 |

      22 | 29 |

      Brief intro to the community.

      30 |
      31 |
      32 | 39 |
      40 | 41 |
      42 |
      43 |

      Leader Boards

      44 |
      45 |
      46 |

      Top Learners

      47 |
      48 |
      49 |
      50 |

      Top Teachers

      51 |
      52 |
      53 |
      54 | 64 |
      65 |
      66 |

      Latest Activity

      67 |
      68 |
      69 |
      70 |
      -------------------------------------------------------------------------------- /profile.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: profile 4 | js: profile 5 | --- 6 | 7 |
      8 |
      9 |
      10 |

      Nice work! Here's where you can see everything you've done on BizFriend.ly

      11 |
      12 | 15 |
      16 | 17 |
      18 |
      19 |

      Hi,

      20 |

      21 |

      22 | 29 |

      30 | Edit Your Profile 31 |
      32 |
      33 |
      34 |

      Accomplishments

      35 |
      36 |
      37 |
      38 | lessons complete 39 |
      40 | 44 |
      45 |
      46 | lessons created 47 |
      48 |
      49 |
      50 | lessons taught 51 |
      52 |
      53 |
      54 |
      55 |

      Learning

      56 |
      57 |
      58 |
      59 |
      60 |

      Teaching

      61 |
      62 |
      63 |

      Drafts

      64 |
      65 |
      66 |

      Submitted

      67 |
      68 |
      69 |

      Published

      70 |
      71 |
      72 |
      73 | 90 |
      91 |
      92 |
      -------------------------------------------------------------------------------- /docs/put.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | put.py 6 | 7 | 8 | 9 |
      10 |
      11 |
      12 |

      put.py

      13 |
      14 |
      15 |
      16 |
      17 |
      18 | # 19 |
      20 | 21 |
      22 |
      23 |
      import requests, json
      24 | 
      25 | data = {
      26 | 	"id" : 4,
      27 |     "name" : "WHATEVER"
      28 | }
      29 |
      30 |
      31 |
      32 |
      33 |
      34 |
      35 | # 36 |
      37 |

      headers = { 38 | 'Content-Type' : 'application/json' 39 | }

      40 |
      41 |
      42 |
      43 |
      44 |
      45 |
      46 |
      47 |
      48 |
      49 | # 50 |
      51 |

      filters = [dict(name='id', op='==', val='4')] 52 | params = dict(q=json.dumps(dict(filters=filters)))

      53 |
      54 |
      55 |
      56 |
      57 |
      58 |
      59 |
      60 |
      61 |
      62 | # 63 |
      64 |

      print params 65 | r = requests.get("http://127.0.0.1:8000/api/thing/", params=params, headers=headers)

      66 |
      67 |
      68 |
      url = 'http://127.0.0.1:8000/api/v1/lessons/70'
      69 | '?q={"filters":[{"name": "id", "op": "==", "val": 4}],"single":true}'
      70 | headers = {'Content-Type': 'application/json'}
      71 | 
      72 | filters = [dict(name='name', op='like', val='%w%')]
      73 | params = dict(q=json.dumps(dict(filters=filters)))
      74 | 
      75 | response = requests.delete(url, headers=headers)
      76 | print response.text
      77 | 
      78 | 
      79 |
      80 |
      81 |
      82 |
      83 | 84 | -------------------------------------------------------------------------------- /edit-profile.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Edit your profile 4 | js: editProfile 5 | --- 6 | 7 |
      8 |
      9 |
      10 |

      Use the fields below to edit your profile information.

      11 |
      12 | 15 |
      16 | 17 |
      18 |
      19 |

      Hi,

      20 |

      21 |

      22 | 29 |

      30 | 31 |
      32 | 33 |
      34 | About You 35 |
      36 | 37 | 38 |
      39 |
      40 | 41 | 42 |
      43 |
      44 | 45 | 46 |
      47 |
      48 | 49 |

      Write a brief intro to the community to let everyone get to know you.

      50 | 51 |
      52 | Social Networks and Web Links 53 |
      54 | 55 | 56 |
      57 |
      58 | 59 | 60 |
      61 |
      62 | 63 | 64 |
      65 |
      66 | 67 | 68 |
      69 |
      70 | 71 | 72 |
      73 | 74 | 75 |
      76 |
      77 | 78 |
      -------------------------------------------------------------------------------- /css/bootstrap-select.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * bootstrap-select v1.3.1 3 | * http://silviomoreto.github.io/bootstrap-select/ 4 | * 5 | * Copyright 2013 bootstrap-select 6 | * Licensed under the MIT license 7 | */.bootstrap-select.btn-group,.bootstrap-select.btn-group[class*="span"]{float:none;display:inline-block;margin-bottom:10px;margin-left:0}.form-search .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group{margin-bottom:0}.bootstrap-select.btn-group.pull-right,.bootstrap-select.btn-group[class*="span"].pull-right,.row-fluid .bootstrap-select.btn-group[class*="span"].pull-right{float:right}.input-append .bootstrap-select.btn-group{margin-left:-1px}.input-prepend .bootstrap-select.btn-group{margin-right:-1px}.bootstrap-select:not([class*="span"]){width:220px}.bootstrap-select{width:220px\0}.bootstrap-select>.btn{width:100%}.error .bootstrap-select .btn{border:1px solid #b94a48}.dropdown-menu{z-index:2000}.bootstrap-select.show-menu-arrow.open>.btn{z-index:2051}.bootstrap-select .btn:focus{outline:thin dotted #333 !important;outline:5px auto -webkit-focus-ring-color !important;outline-offset:-2px}.bootstrap-select.btn-group .btn .filter-option{overflow:hidden;position:absolute;left:12px;right:25px;text-align:left}.bootstrap-select.btn-group .btn .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group>.disabled,.bootstrap-select.btn-group .dropdown-menu li.disabled>a{cursor:not-allowed}.bootstrap-select.btn-group>.disabled:focus{outline:none !important}.bootstrap-select.btn-group[class*="span"] .btn{width:100%}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;border:0;padding:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu dt{display:block;padding:3px 20px;cursor:default}.bootstrap-select.btn-group .div-contain{overflow:hidden}.bootstrap-select.btn-group .dropdown-menu li{position:relative}.bootstrap-select.btn-group .dropdown-menu li>a.opt{position:relative;padding-left:35px}.bootstrap-select.btn-group .dropdown-menu li>a{cursor:pointer}.bootstrap-select.btn-group .dropdown-menu li>dt small{font-weight:normal}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a i.check-mark{display:inline-block;position:absolute;right:15px;margin-top:2.5px}.bootstrap-select.btn-group .dropdown-menu li a i.check-mark{display:none}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu li:not(.disabled)>a:hover small,.bootstrap-select.btn-group .dropdown-menu li:not(.disabled)>a:focus small{color:#64b1d8;color:rgba(255,255,255,0.4)}.bootstrap-select.btn-group .dropdown-menu li>dt small{font-weight:normal}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #CCC;border-bottom-color:rgba(0,0,0,0.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid white;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after{display:block}.mobile-device{position:absolute;top:0;left:0;display:block !important;width:100%;height:100% !important;opacity:0}.bootstrap-select.fit-width{width:auto !important}.bootstrap-select.btn-group.fit-width .btn .filter-option{position:static}.bootstrap-select.btn-group.fit-width .btn .caret{position:static;top:auto;margin-top:-1px}.control-group.error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select-searchbox{padding:4px 8px} 8 | -------------------------------------------------------------------------------- /js/service.js: -------------------------------------------------------------------------------- 1 | var service = (function (service) { 2 | 3 | var service = {}; 4 | var lessons = []; 5 | var lessonCompleted; 6 | 7 | 8 | // PUBLIC METHODS 9 | // initialize variables and load JSON 10 | function init(){ 11 | if (config.debug) console.log('init'); 12 | serviceId = window.location.search.split('?')[1]; 13 | // Call the API and get that service 14 | _loading(); 15 | $.getJSON(config.bfUrl+config.bfApiVersion+'/services/'+serviceId, _main); 16 | } 17 | 18 | // PRIVATE METHODS 19 | function _loading(){ 20 | // console.log('Loading'); 21 | $('#main').toggle(); 22 | } 23 | 24 | function _main(response){ 25 | $('#loading').toggle(); 26 | $('#main').toggle(); 27 | service = response; 28 | lessons = service.lessons; 29 | // _makeSummary(); 30 | _checkIfLoggedIn(); 31 | _showService(); 32 | } 33 | 34 | function _checkIfLoggedIn(){ 35 | if (!BfUser.bfAccessToken){ 36 | $('#main-text .btn').hide(); 37 | $('.login-required').show(); 38 | } 39 | } 40 | 41 | function _showService(){ 42 | if (config.debug) console.log(service); 43 | $("#service-icon").attr("src",service.icon); 44 | $("#service-name").text(service.name); 45 | $("#service-description").html(service.long_description); 46 | $("#tips").html(service.tips) 47 | $("#additional-resources").html(service.additional_resources); 48 | $("#tips").html(service.tips) 49 | $("#service-media").html(service.media); 50 | _lessonTable(); 51 | $("#teach-callout .service-name").text(service.name); 52 | } 53 | 54 | function _lessonTable(){ 55 | // Fill up table tbody 56 | $.each(lessons, function(i, lesson){ 57 | if (lesson.state == "published"){ 58 | var html = ''; 59 | var numberOfLearners; 60 | lessonCompleted = false; 61 | // Get number of learners 62 | var filters = [{"name": "lesson_id", "op": "==", "val": lesson.id}]; 63 | $.ajax({ 64 | url: config.bfUrl+config.bfApiVersion+'/userlessons', 65 | data: {"q": JSON.stringify({"filters": filters})}, 66 | dataType: "json", 67 | contentType: "application/json", 68 | success: function(data) { 69 | numberOfLearners = data.num_results; 70 | $.each(data.objects, function(i,userLesson){ 71 | if (userLesson.completed && userLesson.user_id == BfUser.id){ 72 | lessonCompleted = true; 73 | } 74 | }) 75 | }, 76 | error : function(error){ 77 | console.log(error); 78 | } 79 | }).done(function(){ 80 | if (config.debug) console.log(lessons); 81 | html += '' 82 | if (lessonCompleted){ 83 | html += '' 84 | } 85 | html +=''+lesson.name+''; 86 | html += '

      Created by

      '; 87 | html += ''+numberOfLearners+''; 88 | $("#tbody").append(html); 89 | _getCreatorName(lesson.id); 90 | $("#"+lesson.id).click(_instructionsLinkClicked); 91 | }) 92 | } 93 | }) 94 | } 95 | 96 | function _getCreatorName(lessonId){ 97 | $.getJSON(config.bfUrl+config.bfApiVersion+"/lessons/"+lessonId, function(response){ 98 | $('.author-name'+response.creator_id).text(response.creator.name); 99 | }) 100 | } 101 | 102 | 103 | function _instructionsLinkClicked(evt){ 104 | // Make sure they are logged in first 105 | if (!BfUser.signedIn) { 106 | $('.alert').text("Whoa! You need to log in first.").removeClass('hidden'); 107 | } else { 108 | // Open the lesson and the modal. 109 | $('#instructionsModal').modal() 110 | // 10 seconds later the modal closes. 111 | setTimeout(function(){ 112 | $('#instructionsModal').modal('hide') 113 | },10000); 114 | lessonId = $(this).attr("id"); 115 | var url = 'instructions.html?'+lessonId; 116 | var width = 340; 117 | var height = window.screen.height; 118 | var left = window.screen.width - 340; 119 | var instructionOptions = "height="+height+",width="+width+",left="+left; 120 | window.open(url,"instructions",instructionOptions); 121 | } 122 | } 123 | 124 | // add public methods to the returned module and return it 125 | service.init = init; 126 | return service; 127 | }(service || {})); 128 | 129 | // initialize the module 130 | service.init() -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: docs 3 | title: docs 4 | --- 5 | 6 |
      7 |
      8 |
      9 |

      Documentation for BizFriend.ly

      10 |
      11 |
      12 |
      13 |
      14 |
      15 | # 16 |
      17 |

      Table of Contents

      18 |
        19 |
      • Architecture
      • 20 |
      • Description of Tech
      • 21 |
      • Class Reference: A comprehensive listing of functionality.
      • 22 | 26 |
      • Developers Guide: A conversational written guide to using the API.
      • 27 |
      • How to add APIs
      • 28 |
      • How to build a new Frontend
      • 29 |
      • How to clone the website
      • 30 |
      • How to fix broken APIs
      • 31 |
      • How to redeploy the Backend
      • 32 |
      • Code Samples: A set of examples showing typical API usage.
      • 33 |
      • Changelog: A reference of what changes in each API version.
      • 34 |
      35 |
      36 |
      37 |
      38 |
      39 |
      40 |
      41 |
      42 |
      43 |
      44 | # 45 |
      46 |

      The Architecture

      47 |

      BizFriend.ly is split into two separate code repositories. The website and the API. We split the code up for several reasons: 48 |

        49 |
      1. Allow for many white labeled frontends.
      2. 50 |
      3. Easily build new mobile frontends.
      4. 51 |
      5. Easily redeploy the back end
      6. 52 |
      53 |
      54 |
      55 |
      56 | 57 |
      58 |
      59 |
      60 |
      61 |
      62 |
      63 | # 64 |
      65 |

      Description of Tech

      66 |
        67 |
      • Hosted on Github Pages and Heroku
      • 68 |
      • Backend written in Python 2.7.4
      • 69 |
      • Uses the Flask microframework
      • 70 |
      • Website is simply jQuery
      • 71 |
      • We use Jekyll templates
      • 72 |
      • Pycco helped me write these docs.
      • 73 |
      74 |
      75 |
      76 |
      77 |
      78 |
      79 |
      80 |
      81 |
      82 |
      83 | # 84 |
      85 |

      BizFriend.ly API

      86 | 94 |
      95 |
      96 |
      97 |
      98 |
      99 |
      100 |
      101 |
      102 |
      103 | # 104 |
      105 |

      BizFriend.ly Website

      106 | 114 |
      115 |
      116 |
      117 |
      118 |
      119 |
      120 |
      121 | -------------------------------------------------------------------------------- /new-category.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Add a new category 4 | js: new-category 5 | --- 6 | 7 |
      8 | 15 |
      16 |
      17 |

      Use the form below to add a skill category to BizFriend.ly

      18 |

      If you're new to creating content, we recommend checking out the Teaching Guide before you begin.

      19 |
      20 | 23 |
      24 | 25 |
      26 |
      27 | Skill Category Information 28 |

      To teach a skill that is new to BizFriend.ly, you'll have to provide some information that helps others know why they should learn this skill.

      29 |
      30 | 31 |
      32 |
      33 | 34 |
      35 |
      36 | 37 | 38 | 39 |
      40 |
      41 | Agree to Terms 42 |

      When you create new content on BizFriend.ly you’re agreeing to share with the community. All content on BizFriend.ly is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

      43 |
      44 | 45 |
      46 |
      47 | 48 | 49 | 64 | 65 | 66 | 82 |
      -------------------------------------------------------------------------------- /js/new-category.js: -------------------------------------------------------------------------------- 1 | var newCategory = (function (newCategory) { 2 | // private properties 3 | var editingExisitingCategory = false; 4 | var categoryId; 5 | 6 | // PUBLIC METHODS 7 | // initialize variables and load JSON 8 | function init(){ 9 | _main() 10 | } 11 | 12 | // PRIVATE METHODS 13 | function _main(response){ 14 | // Make sure they are logged in 15 | _checkIfLoggedIn(); 16 | _newOrEdit(); 17 | $("#preview").click(_previewClicked); 18 | $("#save-draft").click(function(){ 19 | _submitClicked("draft") 20 | }); 21 | $("#submit").click(function(){ 22 | _submitClicked("submitted") 23 | }); 24 | } 25 | 26 | function _checkIfLoggedIn(){ 27 | if (!BfUser.bfAccessToken){ 28 | $('#main').hide(); 29 | $('.login-required').show(); 30 | } 31 | } 32 | 33 | function _newOrEdit(){ 34 | if (window.location.search.split('?')[1]){ 35 | editingExisitingCategory = true; 36 | _getExistingCategory(); 37 | } 38 | } 39 | 40 | function _getExistingCategory(){ 41 | categoryId = window.location.search.split('?')[1]; 42 | $.getJSON(config.bfUrl+config.bfApiVersion+'/categories/'+categoryId, function(response){ 43 | $("#new-skill-name").val(response.name); 44 | $("#new-skill-description").val(response.description); 45 | }); 46 | } 47 | 48 | function _previewClicked(){ 49 | $("#previewModal .modal-title").text($("#new-skill-name").val()); 50 | $("#previewModal .modal-body").text($("#new-skill-description").val()); 51 | $('#previewModal').modal(); 52 | } 53 | 54 | function _submitClicked(state){ 55 | // Validate form 56 | if (!$("#new-skill-description").val()) { 57 | $("#form-alert").text("Please enter a description for your new skill.").removeClass("hidden"); 58 | } 59 | if (!$("#new-skill-name").val()) { 60 | $("#form-alert").text("Please enter a name for your new skill.").removeClass("hidden"); 61 | } 62 | if ($("#new-skill-name").val() && $("#new-skill-description").val()) 63 | { 64 | $("#form-alert").hide(); 65 | // Put or Post 66 | if (editingExisitingCategory){ 67 | _putCategory(state); 68 | } else { 69 | _checkOnCategory(state); 70 | } 71 | } 72 | } 73 | 74 | function _checkOnCategory(state){ 75 | var filters = [{"name": "name", "op": "==", "val": $("#new-skill-name").val()}]; 76 | $.ajax({ 77 | url: config.bfUrl+config.bfApiVersion+'/categories', 78 | data: {"q": JSON.stringify({"filters": filters}), "single" : true}, 79 | dataType: "json", 80 | contentType: "application/json", 81 | success: function(data) { 82 | // Service already exists, give user a warning 83 | if (data.num_results){ 84 | $("#form-alert").text("A category with that name already exists").removeClass("hidden"); 85 | } else { 86 | // Lesson doesn't exist, post it 87 | _postCategory(state); 88 | } 89 | }, 90 | error : function(error){ 91 | $("#form-alert").text(error).removeClass("hidden"); 92 | } 93 | }); 94 | } 95 | 96 | function _postCategory(state){ 97 | newCategory = { 98 | name : $("#new-skill-name").val(), 99 | description : $("#new-skill-description").val(), 100 | state : state, 101 | creator_id : BfUser.id 102 | } 103 | $.ajax({ 104 | type: "POST", 105 | contentType: "application/json", 106 | url: config.bfUrl+config.bfApiVersion+'/categories', 107 | data: JSON.stringify(newCategory), 108 | dataType: "json", 109 | success : function(){ 110 | $("#submissionModal .skill-name").text($("#new-skill-name").val()); 111 | $('#submissionModal').modal(); 112 | 113 | // Send an email to admins 114 | if (newCategory.state == "submitted"){ 115 | $.post(config.bfUrl+"/new_content_email", newCategory, function(response){ 116 | if (config.debug) console.log("Email sent to admins.") 117 | if (config.debug) console.log(response); 118 | }) 119 | } 120 | 121 | }, 122 | error : function(error){ 123 | $("#form-alert").text(error).removeClass("hidden"); 124 | } 125 | }); 126 | } 127 | 128 | function _putCategory(state){ 129 | existingCategory = { 130 | name : $("#new-skill-name").val(), 131 | description : $("#new-skill-description").val(), 132 | state : state 133 | } 134 | $.ajax({ 135 | type: "PUT", 136 | contentType: "application/json", 137 | url: config.bfUrl+config.bfApiVersion+'/categories/'+categoryId, 138 | data: JSON.stringify(existingCategory), 139 | dataType: "json", 140 | success : function(){ 141 | $("#submissionModal .skill-name").text($("#new-skill-name").val()); 142 | $('#submissionModal').modal(); 143 | 144 | // Send an email to admins 145 | if (newCategory.state == "submitted"){ 146 | $.post(config.bfUrl+"/new_content_email", newCategory, function(response){ 147 | if (config.debug) console.log("Email sent to admins.") 148 | if (config.debug) console.log(response); 149 | }) 150 | } 151 | 152 | }, 153 | error : function(error){ 154 | $("#form-alert").text(error).removeClass("hidden"); 155 | } 156 | }); 157 | } 158 | 159 | // add public methods to the returned module and return it 160 | newCategory.init = init; 161 | return newCategory; 162 | }(newCategory || {})); 163 | 164 | // initialize the module 165 | newCategory.init() 166 | -------------------------------------------------------------------------------- /docs/settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | settings.py 6 | 7 | 8 | 9 |
      10 |
      11 |
      12 |

      settings.py

      13 |
      14 |
      15 |
      16 |
      17 |
      18 | # 19 |
      20 | 21 |
      22 |
      23 |
      from bizfriendly import app
      24 | from flask.ext.heroku import Heroku
      25 | import os
      26 | 
      27 | heroku = Heroku(app) # Sets CONFIG automagically
      28 | app.config.update(
      29 |     DEBUG = True,
      30 |
      31 |
      32 |
      33 |
      34 |
      35 |
      36 | # 37 |
      38 |

      SQLALCHEMY_DATABASE_URI = 'postgres://hackyourcity@localhost/howtocity', 39 | SQLALCHEMY_DATABASE_URI = 'postgres://postgres:root@localhost/howtocity', 40 | SECRET_KEY = '123456'

      41 |
      42 |
      43 |
      )
      44 | 
      45 | app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY')
      46 | app.config['MAIL_GUN_KEY'] = os.environ.get('MAIL_GUN_KEY')
      47 | app.config['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID')
      48 | app.config['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY')
      49 | app.config['S3_BUCKET_NAME'] = os.environ.get('S3_BUCKET_NAME')
      50 |
      51 |
      52 |
      53 |
      54 |
      55 |
      56 | # 57 |
      58 | 59 |
      60 |
      61 |
      def add_cors_header(response):
      62 |     response.headers['Access-Control-Allow-Origin'] = '*'
      63 |     response.headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type'
      64 |     response.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, PATCH, DELETE, OPTIONS'
      65 |     return response
      66 | app.after_request(add_cors_header)
      67 | 
      68 | 
      69 |
      70 |
      71 |
      72 |
      73 | 74 | -------------------------------------------------------------------------------- /teach.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: teach 4 | --- 5 |
      6 | 13 |
      14 |
      15 |

      What would you like to teach? BizFriend.ly makes it easy to add and request new content.

      16 |

      If you're new to creating content, we recommend checking out the Teaching Guide before you begin.

      17 |
      18 | 21 |
      22 | 23 |
      24 |
      25 |
      26 |

      Lesson

      27 |
      28 |
      29 | Lessons are what most people create on BizFriend.ly. It’s the content you see in the right hand helper window. 30 |
      31 |
      32 |

      To create a lesson you’ll need:

      33 |
        34 |
      • An idea for a lesson that doesn’t exist yet on BizFriend.ly
      • 35 |
      • A lesson name
      • 36 |
      • Time to write and iterate on your lesson
      • 37 |
      38 |
      39 | Create Lesson 40 |
      41 |
      42 |
      43 |

      Web Service

      44 |
      45 |
      46 | Web services are what lessons are about, such as Facebook or Trello. You can add any website or service for lessons. 47 |
      48 |
      49 |

      To add a service you’ll need:

      50 |
        51 |
      • Web service name & URL
      • 52 |
      • A brief description of the service and why it’s valuable to business owners
      • 53 |
      • Up to 3 key points to keep in mind
      • 54 |
      • Up to 5 additional resource links
      • 55 |
      • Icon for the service
      • 56 |
      • Screenshot of the service or a testimonial video
      • 57 |
      58 |
      59 | Add Service 60 |
      61 |
      62 |
      63 |

      Skill

      64 |
      65 |
      66 | Skills are what appear at the top of the Learn section. Web services and lessons live within them. 67 |
      68 |
      69 |

      To create a skill you’ll need:

      70 |
        71 |
      • An idea for a skill that doesn’t exist yet on BizFriend.ly
      • 72 |
      • A skill name
      • 73 |
      • A brief description of the skill and why it’s valuable to business owners
      • 74 |
      75 |
      76 | New Skill 77 |
      78 |
      79 |
      80 |
      81 |
      82 |

      Teaching Guide

      83 |
      84 |

      85 | Before you get started, we recommend reading the Teaching Guide. It gives you all of the basics to creating great lessons and new content for BizFriend.ly! 86 |

      87 | 90 |
      91 |
      92 |

      Request Content

      93 |
      94 |

      Not ready to build new content for BizFriend.ly? No problem! You can request that another teacher creates a lesson, skill, or category. What do you want to learn?

      95 |
      96 | Make a Request 97 |
      98 |
      99 |
      100 |

      See Requests

      101 |
      102 |

      Not sure what you want to teach? See the requests made by fellow learners.

      103 |
      104 | See Requests 105 |
      106 |
      107 |
      108 |
      109 |
      -------------------------------------------------------------------------------- /about.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: about 4 | published: true 5 | --- 6 | 7 |
      8 |
      9 | 10 | 11 | 12 |
      13 |
      14 | 15 |
      16 |

      What’s BizFriend.ly?

      17 |

      BizFriend.ly is a go-to resource where small to mid-sized businesses can find empowering, easy-to-use online tools as well as a learning and sharing community that help entrepreneurs start, run and grow great businesses.

      18 | 19 | 20 |

      Who’s it for?

      21 |

      BizFriend.ly brings together small and mid-sized business owners, their employees, community experts and providers of web services all in one place to learn and share. BizFriend.ly is built for small business owners who are:

      22 |
    • focused on trying to run a business and don’t have time to find new tech
    • 23 |
    • find learning tech too hard or time consuming
    • 24 |
    • wanting to find out what tools other businesses use & see how you compare
    • 25 | 26 |

      What does it do?

      27 |

      BizFriend.ly puts the web to work for YOUR business. 28 |

    • Lessons are created for entrepreneurs by entrepreneurs, business experts, and community organizations.
    • 29 |
    • Lessons provide entrepreneurs with an easy-to-follow, real-time, step-by-step guide to various programs and web-based services. Check them out!
    • 30 |
    • Multiple lessons are available under each service, so users can pick the lessons that best fit their needs. Try one out!
    • 31 |
    • Users are able to easily create their own lessons, to keep content up-to-date, and share their expertise with the community. Share the skills you’re best at!
    • 32 |
    • BizFriend.ly is a safe, trusted platform for learning and sharing.
    • 33 | 34 |

      Why are we building it?

      35 |

      Charged with the topic of economic development, the Code for America fellows conducted a research and ideation process and discovered a need for improving digital literacy in Kansas City as means to economic development.

      36 | 37 |

      Kansas City has an amazing business community with over 48,000 small businesses. That’s in the top 3% among the nation’s 938 metropolitan and micropolitan areas! Kansas City also has a digital advantage by becoming one of the most Internet-connected cities in the country through Google Fiber and other local initiatives, such as Connecting for Good.

      38 | 39 |

      But amongst Kansas Citians, there’s a drop off in web skills beyond the very basics.

      40 | 41 |

      There’s room for improvement to to make Kansas City small business owners the most digitally literate in the country and BizFriend.ly will help achieve that.

      42 |
      43 | 44 |

      Can I use BizFriend.ly in my city?

      45 |

      A resounding yes! 46 | While created with Kansas City, we’d love to see more cities use BizFriend.ly as it can help people learn and teach online absolutely anywhere. There are two types of resue: 47 |

    • Reaching Business Owners: If you’d also like to reach business owners in your city, you can link directly to BizFriend.ly as it currently exists. Most of the content on BizFriend.ly is general to the web and usable by business owners regardless of location. If you’d like to add specific content about doing business with your city or state, you can add new content under Doing Business With Your City or Doing Business With Your State. Please also let us know if you’d like to start using BizFriend.ly in your community.

    • 48 |
    • Reaching Other Audiences: The core platform is built in a way that you can easily reuse BizFriend.ly to reach new audiences. You’d want to create a new brand, and likely new content focused on the audience. You can find out more about the technical side of reusing the platform on our Github repository.
    • 49 | 50 |

      How are the content and code licensed?

      51 |

    • Code is BSD3-clause licensed
    • 52 |
    • Content created by users for lessons, skills, web services is CreativeCommons0
    • 53 |
    • Design including logo and brand are Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
    • 54 |
    • Videos created by BizFriend.ly are Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
    • 55 | 56 |

      Who's behind BizFriend.ly?

      57 | 58 |

      59 |

      BizFriend.ly is a project created in collaboration with Kansas City, Missouri, the Unified Government of Wyandotte County and Kansas City, Kansas and the 2013 Code for America Fellows.

      60 | 61 |

      The 2013 Code for America Fellows: Andrew Hyder and Ariel Kennan

      62 |

      Mayor Sly James' Office: John McGurk, David Rowe, and Ashley Hand

      63 |

      Mayor Mark Holland's Office: Maureen Mahoney, Jason Banks, Brett Deichler, and Chris Cooley

      64 |

      Local Kansas City Funders: The Ewing Marion Kauffman Foundation, Google Fiber, Cerner, Sprint, Hall Family Foundation, Hallmark Corporate, and H&R Block Foundation

      65 |

      With contributions from: Sheila Dugan and Tylor Louis 66 |

      67 |

      Thank you to everyone who has helped make this possible!

      68 |
      69 |
      70 | 71 | -------------------------------------------------------------------------------- /docs/forms.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | forms.py 6 | 7 | 8 | 9 |
      10 |
      11 |
      12 |

      forms.py

      13 |
      14 |
      15 |
      16 |
      17 |
      18 | # 19 |
      20 | 21 |
      22 |
      23 |
      from flask.ext.wtf import Form
      24 | from wtforms import TextField, PasswordField
      25 | from models import Bf_user
      26 | from datetime import date
      27 | 
      28 | from bizfriendly import app
      29 |
      30 |
      31 |
      32 |
      33 |
      34 |
      35 | # 36 |
      37 | 38 |
      39 |
      40 |
      class LoginForm(Form):
      41 |     email = TextField()
      42 |     password = PasswordField()
      43 |
      44 |
      45 |
      46 |
      47 |
      48 |
      49 | # 50 |
      51 | 52 |
      53 |
      54 |
          def __init__(self, *args, **kwargs):
      55 |         Form.__init__(self, *args, **kwargs)
      56 |         self.user = None
      57 |
      58 |
      59 |
      60 |
      61 |
      62 |
      63 | # 64 |
      65 | 66 |
      67 |
      68 |
          def validate(self):
      69 |         if not Form.validate(self):
      70 |             return False
      71 | 
      72 |         user = Bf_user.query.filter_by(email=self.email.data).first()
      73 |         if user is None:
      74 |             self.email.errors.append('Unknown email')
      75 |             return False
      76 | 
      77 |         if not user.check_pw(self.password.data):
      78 |             self.password.errors.append('Invalid password')
      79 |             return False
      80 | 
      81 |         if user.role != 'admin':
      82 |             self.email.errors.append('Not an admin.')
      83 |             return False
      84 | 
      85 |         self.user = user
      86 |         return True
      87 | 
      88 | 
      89 |
      90 |
      91 |
      92 |
      93 | 94 | -------------------------------------------------------------------------------- /js/editProfile.js: -------------------------------------------------------------------------------- 1 | var editProfile = (function (editProfile) { 2 | 3 | // private properties 4 | var user_id = BfUser.id; 5 | var user_name = BfUser.name; 6 | var lessonsCompleted = []; 7 | var lessonsCreated = []; 8 | var profileID; 9 | 10 | // PUBLIC METHODS 11 | // initialize variables and load JSON 12 | function init(){ 13 | if (config.debug) console.log('init'); 14 | _loading(); 15 | _main(); 16 | } 17 | 18 | // PRIVATE METHODS 19 | function _loading(){ 20 | // console.log('Loading'); 21 | $('#main').toggle(); 22 | } 23 | 24 | function _main(){ 25 | $('#loading').toggle(); 26 | $('#main').toggle(); 27 | _checkIfLoggedIn(); 28 | _getUserInfo(BfUser.id); 29 | _editProfileForm(); 30 | } 31 | 32 | function _checkIfLoggedIn(){ 33 | // Check if user is logged in 34 | if (!BfUser.bfAccessToken){ 35 | $('#main').hide(); 36 | $('.login-required').show(); 37 | } 38 | } 39 | 40 | function _getUserInfo(userID){ 41 | // Display the user profile info 42 | $.getJSON(config.bfUrl+config.bfApiVersion+'/users/'+userID, function(response){ 43 | $(".user-name").append(response.name); 44 | if (response.location) { 45 | $(".location").text(response.location); 46 | } 47 | if (response.business_name) { 48 | $(".biz-name").text(response.business_name); 49 | } 50 | if (response.linkedin) { 51 | $("#profile-li").attr("href",response.linkedin); 52 | } else { 53 | $("#profile-li").hide(); 54 | } 55 | if (response.gplus) { 56 | $("#profile-gplus").attr("href",response.gplus); 57 | } else { 58 | $("#profile-gplus").hide(); 59 | } 60 | if (response.facebook) { 61 | $("#profile-fb").attr("href",response.facebook); 62 | } else { 63 | $("#profile-fb").hide(); 64 | } 65 | if (response.twitter) { 66 | $("#profile-twitter").attr("href",response.twitter); 67 | } else { 68 | $("#profile-twitter").hide(); 69 | } 70 | if (response.business_url) { 71 | $("#profile-site").attr("href",response.business_url); 72 | } else { 73 | $("#profile-site").hide(); 74 | } 75 | $(".profile-description").text(response.description); 76 | 77 | // Fill form with current info 78 | $("#form-name").val(response.name); 79 | $("#form-biz-name").val(response.business_name); 80 | $("#form-location").val(response.location); 81 | $("#form-linkedin").val(response.linkedin); 82 | $("#form-gplus").val(response.gplus); 83 | $("#form-fb").val(response.fb); 84 | $("#form-twitter").val(response.twitter); 85 | $("#form-site").val(response.site); 86 | $("#form-description").val(response.description); 87 | }); 88 | } 89 | 90 | function _editProfileForm(){ 91 | // Submit edited profile info 92 | $("#submit").click(function(evt){ 93 | updatedUser = { 94 | name : $("#form-name").val(), 95 | location : $("#form-location").val(), 96 | business_name : $("#form-biz-name").val(), 97 | business_url : $("#form-url").val(), 98 | description : $("#form-description").val(), 99 | linkedin : $("#form-linkedin").val(), 100 | gplus : $("#form-gplus").val(), 101 | facebook : $("#form-facebook").val(), 102 | twitter : $("#form-twitter").val() 103 | } 104 | // Clean up updatedUser 105 | // if (!$("#form-name").val()) { 106 | // delete updatedUser.name; 107 | // } 108 | // if (!$("#form-location").val()) { 109 | // delete updatedUser.location; 110 | // } 111 | // if (!$("#form-biz-name").val()) { 112 | // delete updatedUser.business_name; 113 | // } 114 | // if (!$("#form-url").val()) { 115 | // delete updatedUser.business_url; 116 | // } 117 | // if (!$("#form-description").val()) { 118 | // delete updatedUser.description; 119 | // } 120 | // if (!$("#form-linkedin").val()) { 121 | // delete updatedUser.linkedin; 122 | // } 123 | // if (!$("#form-gplus").val()) { 124 | // delete updatedUser.gplus; 125 | // } 126 | // if (!$("#form-facebook").val()) { 127 | // delete updatedUser.facebook; 128 | // } 129 | // if (!$("#form-twitter").val()) { 130 | // delete updatedUser.twitter; 131 | // } 132 | $.ajax({ 133 | type: "PUT", 134 | contentType: "application/json", 135 | url: config.bfUrl+config.bfApiVersion+'/users/'+BfUser.id, 136 | data: JSON.stringify(updatedUser), 137 | dataType: "json", 138 | success : function(){ 139 | // $("#form-alert").text("Great!").addClass("alert-success").removeClass("alert-danger").removeClass("hidden"); 140 | // if ($("#form-name").val()) { 141 | // $(".user-name").text("Hi, " + $("#form-name").val()); 142 | // $("#bfUserName").text($("#form-name").val()); 143 | // BfUser.name = $("#form-name").val(); 144 | // } 145 | // if ($("#form-location").val()) { 146 | // $(".location").text($("#form-location").val()); 147 | // } 148 | // if ($("#form-biz-name").val()) { 149 | // $(".biz-name").text($("#form-biz-name").val()); 150 | // } 151 | // if ($("#form-linkedin").val()) { 152 | // $("#profile-li").attr("href",$("#form-linkedin").val()); 153 | // } 154 | // if ($("#form-gplus").val()) { 155 | // $("#profile-gplus").attr("href",$("#form-gplus").val()); 156 | // } 157 | // if ($("#form-facebook").val()) { 158 | // $("#profile-fb").attr("href",$("#form-facebook").val()); 159 | // } 160 | // if ($("#form-twitter").val()) { 161 | // $("#profile-twitter").attr("href",$("#form-twitter").val()); 162 | // } 163 | // if ($("#form-description").val()) { 164 | // $(".profile-description").text($("#form-description").val()); 165 | // } 166 | window.location.href="profile.html"; 167 | }, 168 | error : function(error){ 169 | $("#form-alert").text(error).removeClass("hidden"); 170 | } 171 | }); 172 | }); 173 | } 174 | 175 | // add public methods to the returned module and return it 176 | editProfile.init = init; 177 | return editProfile; 178 | }(editProfile|| {})); 179 | 180 | // initialize the module 181 | editProfile.init() -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/codeforamerica/bizfriendly-api.png)](https://travis-ci.org/codeforamerica/bizfriendly-api) 2 | 3 | BizFriend.ly Web Site 4 | ========= 5 | 6 | http://BizFriend.ly teaches you how to use the internet to increase your quality of life, be more effecient at work, and perhaps even how to be a better citizen. 7 | 8 | ## About 9 | This is the main website for the BizFriend.ly service. It is powered by the [BizFriend.ly API](http://github.com/codeforamerica/bizfriendly-api) 10 | 11 | ## Made in Kansas City 12 | 13 |
       14 | 
       15 | 
       16 |        oyyyyyyyyyyy+          .yyyyyyyyyyyy       
       17 |        ``:yyyyyyy-``       ``` ```osyyyyyo:`      
       18 |           oyyyyyo`:/+ossyyyyyyyysso+////-+yy/`    
       19 |           oyyyyyo.yyyyyyyyyyyyyyyyyyyyyyo/+yyy/`  
       20 |           oyyyyyo.yyo+/:-..`.//////+oyyyyyyyyyyy/`
       21 |        .+-oyyyyyo`.       `/yyyyyy+`  .:oyyyyyyys:
       22 |      `oyy-oyyyyyo       `/yyyyyyo.       `:oyys:  
       23 |     :yyyy-oyyyyyo     `/yyyyyyo.            .-    
       24 |    /yyyyy-oyyyyyo   `/yyyyyyo.                    
       25 |   :yyyyy/ oyyyyyo `/yyyyyyo.                      
       26 |  `yyyyy+  oyyyyyo/yyyyyyy/                        
       27 |  /yyyyy`  oyyyyyyyyyyyyyyyo.                      
       28 | :yyyyys   oyyyyyyyyyoyyyyyyy/`                    
       29 | .yyyyy+   oyyyyyyy+. .oyyyyyys:                   
       30 |  /yyyys   oyyyyys`     -syyyyyyo.                 
       31 |  `syyyy:  oyyyyyo        /yyyyyyy+`               
       32 |   -yyyyy- oyyyyyo         `+yyyyyyy:              
       33 |    -yyyyy:.syyyyo           -syyyyyys.         ./-
       34 |     .syyyyo-/yyyo             :yyyyyyy+`     `/yy/
       35 |       /yyyyyo-:++              `+yyyyyyy:  `/yyyy:
       36 |        `/syyyys/.                .oyyyyyys-/ys+-.`
       37 |           -+syyyyyo/-.`           `:syyyyyy+-     
       38 |           o+:-:+syyyyyyyssooooossyyo./yyyyyyy/    
       39 |        ``.syyys+:--::/+oossssssoo+/:-`.syyyyyys-` 
       40 |        oyyyyyyyyyyy+                :yyyyyyyyyyyy/
       41 | 
       42 | 
       43 |                      `..----..`                    
       44 |                  .-://////////:-.                 
       45 |                .:////////////////:.               
       46 |               -////////////////////-              
       47 |              -////////-....-////////-             
       48 |             `://////:`      `://////:`            
       49 |             .///////.        .///////.            
       50 |             `///////-       `:///////`            
       51 |   `-:::-.    -///////:`    `:///////-    .::::-`  
       52 |   ://////-    :///////:`  `:///////-    -//////:  
       53 |   :///////-    -///////: `:///////-    -///////:  
       54 |   `:///////:    -/////:`.:///////-    :///////:`  
       55 |    `:///////:`   .///:`.////////-   `:///////:`   
       56 |     `:///////:`   .::`.////////-   `:///////:`    
       57 |      `:///////:`   ``.////////-   `:///////:`     
       58 |       `:///////:.   .////////-   `:///////:`      
       59 |         -///////:. -////////-`. `:///////:`       
       60 |         `:////////:////////-`:/-:///////:`        
       61 |           :///////////////.`://////////:`         
       62 |            -/////////////.`://////////:           
       63 |             -///////////- ://////////:            
       64 |              -/////////-  `:////////-`            
       65 |               -///////.    .://////:              
       66 |                `.---.`      `.----.               
       67 |                                                   
       68 | 
       69 | 
      70 | 71 | ## Development Setup 72 | #### Previewing Your Changes Using Jekit 73 | 74 | Don't want to install anything? You can use the nifty [Jekit](https://jekit.codeforamerica.org/) app to preview changes you make to this site remotely. 75 | 76 | To do this, fork this repo, and commit your changes on a branch to your fork. You can then preview what your changes look like by navigating to: 77 | 78 | https://jekit.codeforamerica.org/USERNAME/bizfriendly-web/BRANCHNAME/ 79 | 80 | For a basic example of its usage, if GitHub user **@lolname** has made changes to the about.html page on their fork, they can preview their changes using Jekit by going to: 81 | 82 | https://jekit.codeforamerica.org/lolname/bizfriendly-web/gh-pages/about.html 83 | 84 | #### Running the Site Locally on Your Computer 85 | To run the site locally on your own computer (most helpful for previewing your own changes), you will need Jekyll installed ([click here for Jekyll installation instructions](http://jekyllrb.com/docs/installation/).) 86 | 87 | Fork and clone the repository, then run the following command in the root directory of the repo: 88 | 89 | `jekyll serve -w` 90 | 91 | Your computer should now be serving your local copy of the site at: 92 | 93 | [http://localhost:4000](http://localhost:4000). 94 | 95 | ## Technology Patterns 96 | Uses Jekyll for templating – converted HTML files are in the _site folder. 97 | 98 | ## Contributing 99 | 100 | The list of [beginner friendly](https://github.com/codeforamerica/bizfriendly-web/issues?labels=beginner+friendly&page=1&state=open) issues is a great place to start! 101 | 102 | We sort the importance of our issues using the star labels. [Three stars](https://github.com/codeforamerica/bizfriendly-web/issues?labels=%E2%98%85%E2%98%85%E2%98%85&page=1&state=open) are the most important issues. 103 | 104 | In the spirit of [free software][free-sw], **everyone** is encouraged to help 105 | improve this project. 106 | 107 | [free-sw]: http://www.fsf.org/licensing/essays/free-sw.html 108 | 109 | Here are some ways *you* can contribute: 110 | 111 | * by using alpha, beta, and prerelease versions 112 | * by reporting bugs 113 | * by suggesting new features 114 | * by translating to a new language 115 | * by writing or editing documentation 116 | * by writing specifications 117 | * by writing code (**no patch is too small**: fix typos, add comments, clean up 118 | inconsistent whitespace) 119 | * by refactoring code 120 | * by closing [issues][] 121 | * by reviewing patches 122 | * [financially][] 123 | 124 | [issues]: https://github.com/codeforamerica/bizfriendly-web/issues 125 | [financially]: https://secure.codeforamerica.org/page/contribute 126 | 127 | ## Submitting an Issue 128 | We use the [GitHub issue tracker][issues] to track bugs and features. Before 129 | submitting a bug report or feature request, check to make sure it hasn't 130 | already been submitted. You can indicate support for an existing issue by 131 | voting it up. When submitting a bug report, please include a [Gist][] that 132 | includes a stack trace and any details that may be necessary to reproduce the 133 | bug. 134 | 135 | [gist]: https://gist.github.com/ 136 | 137 | ## Submitting a Pull Request 138 | 1. Fork the project. 139 | 2. Create a topic branch. 140 | 3. Implement your feature or bug fix. 141 | 4. Commit and push your changes. 142 | 5. Submit a pull request. 143 | 144 | ## Copyright 145 | Copyright (c) 2013 Code for America. See [LICENSE][] for details. 146 | 147 | [license]: https://github.com/codeforamerica/bizfriendly-web 148 | 149 | [![Code for America Tracker](http://stats.codeforamerica.org/codeforamerica/bizfriendly-web.png)](http://stats.codeforamerica.org/projects/bizfriendly-web) 150 | -------------------------------------------------------------------------------- /docs/pycco.css: -------------------------------------------------------------------------------- 1 | /*--------------------- Layout and Typography ----------------------------*/ 2 | body { 3 | font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 4 | font-size: 16px; 5 | line-height: 24px; 6 | color: #252519; 7 | margin: 0; padding: 0; 8 | } 9 | a { 10 | color: #261a3b; 11 | } 12 | a:visited { 13 | color: #261a3b; 14 | } 15 | p { 16 | margin: 0 0 15px 0; 17 | } 18 | h1, h2, h3, h4, h5, h6 { 19 | margin: 40px 0 15px 0; 20 | } 21 | h2, h3, h4, h5, h6 { 22 | margin-top: 0; 23 | } 24 | #container, div.section { 25 | position: relative; 26 | } 27 | #background { 28 | position: fixed; 29 | top: 0; left: 580px; right: 0; bottom: 0; 30 | background: #f5f5ff; 31 | border-left: 1px solid #e5e5ee; 32 | z-index: -1; 33 | } 34 | #jump_to, #jump_page { 35 | background: white; 36 | -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777; 37 | -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; 38 | font: 10px Arial; 39 | text-transform: uppercase; 40 | cursor: pointer; 41 | text-align: right; 42 | } 43 | #jump_to, #jump_wrapper { 44 | position: fixed; 45 | right: 0; top: 0; 46 | padding: 5px 10px; 47 | } 48 | #jump_wrapper { 49 | padding: 0; 50 | display: none; 51 | } 52 | #jump_to:hover #jump_wrapper { 53 | display: block; 54 | } 55 | #jump_page { 56 | padding: 5px 0 3px; 57 | margin: 0 0 25px 25px; 58 | } 59 | #jump_page .source { 60 | display: block; 61 | padding: 5px 10px; 62 | text-decoration: none; 63 | border-top: 1px solid #eee; 64 | } 65 | #jump_page .source:hover { 66 | background: #f5f5ff; 67 | } 68 | #jump_page .source:first-child { 69 | } 70 | div.docs { 71 | float: left; 72 | max-width: 500px; 73 | min-width: 500px; 74 | min-height: 5px; 75 | padding: 10px 25px 1px 50px; 76 | vertical-align: top; 77 | text-align: left; 78 | } 79 | .docs pre { 80 | margin: 15px 0 15px; 81 | padding-left: 15px; 82 | } 83 | .docs p tt, .docs p code { 84 | background: #f8f8ff; 85 | border: 1px solid #dedede; 86 | font-size: 12px; 87 | padding: 0 0.2em; 88 | } 89 | .octowrap { 90 | position: relative; 91 | } 92 | .octothorpe { 93 | font: 12px Arial; 94 | text-decoration: none; 95 | color: #454545; 96 | position: absolute; 97 | top: 3px; left: -20px; 98 | padding: 1px 2px; 99 | opacity: 0; 100 | -webkit-transition: opacity 0.2s linear; 101 | } 102 | div.docs:hover .octothorpe { 103 | opacity: 1; 104 | } 105 | div.code { 106 | margin-left: 580px; 107 | padding: 14px 15px 16px 50px; 108 | vertical-align: top; 109 | } 110 | .code pre, .docs p code { 111 | font-size: 12px; 112 | } 113 | pre, tt, code { 114 | line-height: 18px; 115 | font-family: Monaco, Consolas, "Lucida Console", monospace; 116 | margin: 0; padding: 0; 117 | } 118 | div.clearall { 119 | clear: both; 120 | } 121 | 122 | 123 | /*---------------------- Syntax Highlighting -----------------------------*/ 124 | td.linenos { background-color: #f0f0f0; padding-right: 10px; } 125 | span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } 126 | body .hll { background-color: #ffffcc } 127 | body .c { color: #408080; font-style: italic } /* Comment */ 128 | body .err { border: 1px solid #FF0000 } /* Error */ 129 | body .k { color: #954121 } /* Keyword */ 130 | body .o { color: #666666 } /* Operator */ 131 | body .cm { color: #408080; font-style: italic } /* Comment.Multiline */ 132 | body .cp { color: #BC7A00 } /* Comment.Preproc */ 133 | body .c1 { color: #408080; font-style: italic } /* Comment.Single */ 134 | body .cs { color: #408080; font-style: italic } /* Comment.Special */ 135 | body .gd { color: #A00000 } /* Generic.Deleted */ 136 | body .ge { font-style: italic } /* Generic.Emph */ 137 | body .gr { color: #FF0000 } /* Generic.Error */ 138 | body .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 139 | body .gi { color: #00A000 } /* Generic.Inserted */ 140 | body .go { color: #808080 } /* Generic.Output */ 141 | body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ 142 | body .gs { font-weight: bold } /* Generic.Strong */ 143 | body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 144 | body .gt { color: #0040D0 } /* Generic.Traceback */ 145 | body .kc { color: #954121 } /* Keyword.Constant */ 146 | body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */ 147 | body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */ 148 | body .kp { color: #954121 } /* Keyword.Pseudo */ 149 | body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */ 150 | body .kt { color: #B00040 } /* Keyword.Type */ 151 | body .m { color: #666666 } /* Literal.Number */ 152 | body .s { color: #219161 } /* Literal.String */ 153 | body .na { color: #7D9029 } /* Name.Attribute */ 154 | body .nb { color: #954121 } /* Name.Builtin */ 155 | body .nc { color: #0000FF; font-weight: bold } /* Name.Class */ 156 | body .no { color: #880000 } /* Name.Constant */ 157 | body .nd { color: #AA22FF } /* Name.Decorator */ 158 | body .ni { color: #999999; font-weight: bold } /* Name.Entity */ 159 | body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ 160 | body .nf { color: #0000FF } /* Name.Function */ 161 | body .nl { color: #A0A000 } /* Name.Label */ 162 | body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ 163 | body .nt { color: #954121; font-weight: bold } /* Name.Tag */ 164 | body .nv { color: #19469D } /* Name.Variable */ 165 | body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ 166 | body .w { color: #bbbbbb } /* Text.Whitespace */ 167 | body .mf { color: #666666 } /* Literal.Number.Float */ 168 | body .mh { color: #666666 } /* Literal.Number.Hex */ 169 | body .mi { color: #666666 } /* Literal.Number.Integer */ 170 | body .mo { color: #666666 } /* Literal.Number.Oct */ 171 | body .sb { color: #219161 } /* Literal.String.Backtick */ 172 | body .sc { color: #219161 } /* Literal.String.Char */ 173 | body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */ 174 | body .s2 { color: #219161 } /* Literal.String.Double */ 175 | body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ 176 | body .sh { color: #219161 } /* Literal.String.Heredoc */ 177 | body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ 178 | body .sx { color: #954121 } /* Literal.String.Other */ 179 | body .sr { color: #BB6688 } /* Literal.String.Regex */ 180 | body .s1 { color: #219161 } /* Literal.String.Single */ 181 | body .ss { color: #19469D } /* Literal.String.Symbol */ 182 | body .bp { color: #954121 } /* Name.Builtin.Pseudo */ 183 | body .vc { color: #19469D } /* Name.Variable.Class */ 184 | body .vg { color: #19469D } /* Name.Variable.Global */ 185 | body .vi { color: #19469D } /* Name.Variable.Instance */ 186 | body .il { color: #666666 } /* Literal.Number.Integer.Long */ 187 | -------------------------------------------------------------------------------- /js/vendor/jquery.raty.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Raty - A Star Rating Plugin 3 | * 4 | * Licensed under The MIT License 5 | * 6 | * @version 2.5.2 7 | * @author Washington Botelho 8 | * @documentation wbotelhos.com/raty 9 | * 10 | */ 11 | 12 | ;(function(b){var a={init:function(c){return this.each(function(){a.destroy.call(this);this.opt=b.extend(true,{},b.fn.raty.defaults,c);var e=b(this),g=["number","readOnly","score","scoreName"];a._callback.call(this,g);if(this.opt.precision){a._adjustPrecision.call(this);}this.opt.number=a._between(this.opt.number,0,this.opt.numberMax);this.opt.path=this.opt.path||"";if(this.opt.path&&this.opt.path.slice(this.opt.path.length-1,this.opt.path.length)!=="/"){this.opt.path+="/";}this.stars=a._createStars.call(this);this.score=a._createScore.call(this);a._apply.call(this,this.opt.score);var f=this.opt.space?4:0,d=this.opt.width||(this.opt.number*this.opt.size+this.opt.number*f);if(this.opt.cancel){this.cancel=a._createCancel.call(this);d+=(this.opt.size+f);}if(this.opt.readOnly){a._lock.call(this);}else{e.css("cursor","pointer");a._binds.call(this);}if(this.opt.width!==false){e.css("width",d);}a._target.call(this,this.opt.score);e.data({settings:this.opt,raty:true});});},_adjustPrecision:function(){this.opt.targetType="score";this.opt.half=true;},_apply:function(c){if(c&&c>0){c=a._between(c,0,this.opt.number);this.score.val(c);}a._fill.call(this,c);if(c){a._roundStars.call(this,c);}},_between:function(e,d,c){return Math.min(Math.max(parseFloat(e),d),c);},_binds:function(){if(this.cancel){a._bindCancel.call(this);}a._bindClick.call(this);a._bindOut.call(this);a._bindOver.call(this);},_bindCancel:function(){a._bindClickCancel.call(this);a._bindOutCancel.call(this);a._bindOverCancel.call(this);},_bindClick:function(){var c=this,d=b(c);c.stars.on("click.raty",function(e){c.score.val((c.opt.half||c.opt.precision)?d.data("score"):this.alt);if(c.opt.click){c.opt.click.call(c,parseFloat(c.score.val()),e);}});},_bindClickCancel:function(){var c=this;c.cancel.on("click.raty",function(d){c.score.removeAttr("value");if(c.opt.click){c.opt.click.call(c,null,d);}});},_bindOut:function(){var c=this;b(this).on("mouseleave.raty",function(d){var e=parseFloat(c.score.val())||undefined;a._apply.call(c,e);a._target.call(c,e,d);if(c.opt.mouseout){c.opt.mouseout.call(c,e,d);}});},_bindOutCancel:function(){var c=this;c.cancel.on("mouseleave.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOff);if(c.opt.mouseout){c.opt.mouseout.call(c,c.score.val()||null,d);}});},_bindOverCancel:function(){var c=this;c.cancel.on("mouseover.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOn);c.stars.attr("src",c.opt.path+c.opt.starOff);a._target.call(c,null,d);if(c.opt.mouseover){c.opt.mouseover.call(c,null);}});},_bindOver:function(){var c=this,d=b(c),e=c.opt.half?"mousemove.raty":"mouseover.raty";c.stars.on(e,function(g){var h=parseInt(this.alt,10);if(c.opt.half){var f=parseFloat((g.pageX-b(this).offset().left)/c.opt.size),j=(f>0.5)?1:0.5;h=h-1+j;a._fill.call(c,h);if(c.opt.precision){h=h-j+f;}a._roundStars.call(c,h);d.data("score",h);}else{a._fill.call(c,h);}a._target.call(c,h,g);if(c.opt.mouseover){c.opt.mouseover.call(c,h,g);}});},_callback:function(c){for(i in c){if(typeof this.opt[c[i]]==="function"){this.opt[c[i]]=this.opt[c[i]].call(this);}}},_createCancel:function(){var e=b(this),c=this.opt.path+this.opt.cancelOff,d=b("",{src:c,alt:"x",title:this.opt.cancelHint,"class":"raty-cancel"});if(this.opt.cancelPlace=="left"){e.prepend(" ").prepend(d);}else{e.append(" ").append(d);}return d;},_createScore:function(){return b("",{type:"hidden",name:this.opt.scoreName}).appendTo(this);},_createStars:function(){var e=b(this);for(var c=1;c<=this.opt.number;c++){var f=a._getHint.call(this,c),d=(this.opt.score&&this.opt.score>=c)?"starOn":"starOff";d=this.opt.path+this.opt[d];b("",{src:d,alt:c,title:f}).appendTo(this);if(this.opt.space){e.append((ce){var j=m.opt.iconRange[e],h=j.on||m.opt.starOn,c=j.off||m.opt.starOff,k=l?h:c;if(f<=j.range){g.attr("src",m.opt.path+k);}if(f==j.range){e++;}}else{var k=l?"starOn":"starOff";g.attr("src",this.opt.path+this.opt[k]);}}},_getHint:function(d){var c=this.opt.hints[d-1];return(c==="")?"":(c||d);},_lock:function(){var d=parseInt(this.score.val(),10),c=d?a._getHint.call(this,d):this.opt.noRatedMsg;b(this).data("readonly",true).css("cursor","").attr("title",c);this.score.attr("readonly","readonly");this.stars.attr("title",c);if(this.cancel){this.cancel.hide();}},_roundStars:function(e){var d=(e-Math.floor(e)).toFixed(2);if(d>this.opt.round.down){var c="starOn";if(this.opt.halfShow&&d1)?d:d[0];},readOnly:function(c){return this.each(function(){var d=b(this);if(d.data("readonly")!==c){if(c){d.off(".raty").children("img").off(".raty");a._lock.call(this);}else{a._binds.call(this);a._unlock.call(this);}d.data("readonly",c);}});},reload:function(){return a.set.call(this,{});},score:function(){return arguments.length?a.setScore.apply(this,arguments):a.getScore.call(this);},set:function(c){return this.each(function(){var e=b(this),f=e.data("settings"),d=b.extend({},f,c);e.raty(d);});},setScore:function(c){return b(this).each(function(){if(b(this).data("readonly")!==true){a._apply.call(this,c);a._target.call(this,c);}});}};b.fn.raty=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments);}else{b.error("Method "+c+" does not exist!");}}};b.fn.raty.defaults={cancel:false,cancelHint:"Cancel this rating!",cancelOff:"img/cancel-off.png",cancelOn:"img/cancel-on.png",cancelPlace:"left",click:undefined,half:false,halfShow:true,hints:["bad","poor","regular","good","gorgeous"],iconRange:undefined,mouseout:undefined,mouseover:undefined,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:"",precision:false,readOnly:false,round:{down:0.25,full:0.6,up:0.76},score:undefined,scoreName:"score",single:false,size:16,space:true,starHalf:"img/star-half.png",starOff:"img/star-off.png",starOn:"img/star-on.png",target:undefined,targetFormat:"{score}",targetKeep:false,targetText:"",targetType:"hint",width:undefined};})(jQuery); 13 | -------------------------------------------------------------------------------- /js/connect.js: -------------------------------------------------------------------------------- 1 | var connect = (function (connect) { 2 | 3 | // private properties 4 | var user_id = BfUser.id; 5 | var numOfTeachers; 6 | 7 | // PUBLIC METHODS 8 | // initialize variables and load JSON 9 | function init(){ 10 | if (config.debug) console.log('init'); 11 | // Call the API and get that lesson, pass response to _main 12 | _loading(); 13 | $.getJSON(config.bfUrl+config.bfApiVersion+'/userlessons', _main); 14 | } 15 | 16 | // PRIVATE METHODS 17 | function _loading(){ 18 | // console.log('Loading'); 19 | // $('#main').toggle(); 20 | } 21 | 22 | function _main(response){ 23 | // $('#loading').toggle(); 24 | // $('#main').toggle(); 25 | _checkIfLoggedIn(); 26 | // Get top learners 27 | _getTopLearners(response); 28 | // Get Top Teachers 29 | _getTopTeachers(response); 30 | // Get latest activity 31 | _getLatestActivity(response); 32 | } 33 | 34 | function _checkIfLoggedIn(){ 35 | if (!BfUser.bfAccessToken){ 36 | $("#profile-info").hide(); 37 | } else { 38 | _getUserInfo(BfUser.id); 39 | } 40 | } 41 | 42 | function _getUserInfo(userID){ 43 | $.getJSON(config.bfUrl+config.bfApiVersion+'/users/'+userID, function(response){ 44 | $(".user-name").append(response.name); 45 | if (response.location) { 46 | $(".location").text(response.location); 47 | } 48 | if (response.business_name) { 49 | $(".biz-name").text(response.business_name); 50 | } 51 | if (response.linkedin) { 52 | $("#profile-li").attr("href",response.linkedin); 53 | } else { 54 | $("#profile-li").hide(); 55 | } 56 | if (response.gplus) { 57 | $("#profile-gplus").attr("href",response.gplus); 58 | } else { 59 | $("#profile-gplus").hide(); 60 | } 61 | if (response.facebook) { 62 | $("#profile-fb").attr("href",response.facebook); 63 | } else { 64 | $("#profile-fb").hide(); 65 | } 66 | if (response.twitter) { 67 | $("#profile-twitter").attr("href",response.twitter); 68 | } else { 69 | $("#profile-twitter").hide(); 70 | } 71 | if (response.business_url) { 72 | $("#profile-site").attr("href",response.business_url); 73 | } else { 74 | $("#profile-site").hide(); 75 | } 76 | $(".profile-description").text(response.description); 77 | }); 78 | } 79 | 80 | function _getTopLearners(response){ 81 | var userLessonCounts = []; 82 | // Build an object of user ids and counts of lessons completed. 83 | $.each(response.objects, function(i,userLesson){ 84 | var userLessonCount = {}; 85 | // If user isn't in the list yet, add them. 86 | var inList = false; 87 | $.each(userLessonCounts, function(i){ 88 | if (userLessonCounts[i].user.id == userLesson.user.id) { 89 | // If they've finished a lesson, then plus one to the count. 90 | if (userLesson.completed){ 91 | userLessonCounts[i].count += 1; 92 | } 93 | inList = true; 94 | } 95 | }); 96 | if (!inList) { 97 | userLessonCount.user = userLesson.user; 98 | userLessonCount.count = 0; 99 | userLessonCounts.push(userLessonCount); 100 | } 101 | }); 102 | // Sort 103 | userLessonCounts.sort(function(a,b){ 104 | if (a.count > b.count) return -1; 105 | if (a.count < b.count) return 1; 106 | return 0; 107 | }) 108 | // Add to page 109 | var html = ""; 110 | $.each(userLessonCounts, function(i,userLessonCount){ 111 | if (i < 5){ // Top five learners 112 | html += '
      '; 113 | html += '
      '; 114 | html += '

      '+userLessonCount.count; 115 | html += '
      lessons

      '; 116 | html += '
      '; 117 | html += '
      '; 118 | html += ''+userLessonCount.user.name+'
      '; 119 | if (userLessonCount.user.business_name) { 120 | html += userLessonCount.user.business_name; 121 | } 122 | html += '
      '; 123 | html += '
      '; 124 | html += '
      '; 125 | } 126 | }) 127 | // Add to the page 128 | $("#top-learners").append(html); 129 | } 130 | 131 | function _getTopTeachers(response){ 132 | teacherCounts = {}; 133 | var numberOfTeachers = 0; 134 | $.each(response.objects, function(i,userLesson){ 135 | // If teacher isn't in the object, add it 136 | if (!teacherCounts[userLesson.lesson.creator_id]){ 137 | teacherCounts[userLesson.lesson.creator_id] = 0; 138 | numberOfTeachers += 1; 139 | } 140 | if (userLesson.completed){ 141 | teacherCounts[userLesson.lesson.creator_id] += 1 142 | } 143 | }) 144 | // Get names of teachers 145 | namedCounts = []; 146 | $.each(teacherCounts, function(id,count){ 147 | $.getJSON(config.bfUrl+config.bfApiVersion+'/users/'+id, function(response){ 148 | namedCount = {}; 149 | namedCount["id"] = response.id; 150 | namedCount["name"] = response.name; 151 | namedCount["business_name"] = response.business_name; 152 | namedCount["count"] = count; 153 | namedCounts.push(namedCount); 154 | numberOfTeachers -= 1; 155 | if (!numberOfTeachers){ 156 | // Sort 157 | namedCounts = namedCounts.sort(function(a,b){ 158 | if (a.count > b.count) return -1; 159 | if (a.count < b.count) return 1; 160 | return 0; 161 | }) 162 | // Add to the page 163 | var html = ""; 164 | $.each(namedCounts, function(i,namedCount){ 165 | if (i < 5){ // Top five learners 166 | console.log(namedCount); 167 | html += '
      '; 168 | html += '
      '; 169 | html += '

      '+namedCount.count; 170 | html += '
      lessons

      '; 171 | html += '
      '; 172 | html += '
      '; 173 | html += ''+namedCount.name+'
      '; 174 | if (namedCount.business_name) { 175 | html += namedCount.business_name; 176 | } 177 | html += '
      '; 178 | html += '
      '; 179 | html += '
      '; 180 | } 181 | }) 182 | $("#top-teachers").append(html); 183 | } 184 | }); 185 | }); 186 | 187 | } 188 | 189 | function _getLatestActivity(response){ 190 | var completedLessons = [] 191 | // Get finished lessons 192 | $.each(response.objects, function(i,userLesson){ 193 | if (userLesson.completed){ 194 | completedLessons.push(userLesson); 195 | } 196 | }); 197 | // Sort by time 198 | completedLessons = completedLessons.sort(function(a,b){ 199 | if (Date.parse(a.end_dt) > Date.parse(b.end_dt)) return -1; 200 | if (Date.parse(a.end_dt) < Date.parse(b.end_dt)) return 1; 201 | return 0; 202 | }) 203 | // Add to page 204 | var html = "" 205 | $.each(completedLessons, function(i,userLesson){ 206 | if (i < 10){ 207 | html += '

      '+userLesson.user.name+''; 208 | html += " recently finished "; 209 | html += ''+userLesson.lesson.name+'

      '; 210 | html += '
      '; 211 | } 212 | }) 213 | // Add to the page 214 | $("#latest-activity").append(html); 215 | } 216 | 217 | // add public methods to the returned module and return it 218 | connect.init = init; 219 | return connect; 220 | }(connect|| {})); 221 | 222 | // initialize the module 223 | connect.init() 224 | -------------------------------------------------------------------------------- /docs/api.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | api.py 6 | 7 | 8 | 9 |
      10 |
      11 |
      12 |

      api.py

      13 |
      14 |
      15 |
      16 |
      17 |
      18 | # 19 |
      20 |

      Using the flask-restless plugin to automatically create an API based off of our models. Its rad. Check it out at (flask-restless)[http://flask-restless.com] 21 | Import our app and all of our models

      22 |
      23 |
      24 |
      import flask.ext.restless
      25 | from bizfriendly import app
      26 | from models import *
      27 |
      28 |
      29 |
      30 |
      31 |
      32 |
      33 | # 34 |
      35 |

      Best practice is to version your api, so you can support after you've made big changes

      36 |
      37 |
      38 |
      api_version = '/api/v1'
      39 | 
      40 | 
      41 | manager = flask.ext.restless.APIManager(app, flask_sqlalchemy_db=db)
      42 | columns = ['creator.password','creator.reset_token','creator.access_token','creator.role']
      43 | manager.create_api(Category, exclude_columns=columns, methods=['GET', 'POST', 'PUT'], url_prefix=api_version, collection_name='categories', max_results_per_page=-1)
      44 | manager.create_api(Service, exclude_columns=columns, methods=['GET', 'POST', 'PUT'], url_prefix=api_version, collection_name='services', max_results_per_page=-1)
      45 | manager.create_api(Lesson, exclude_columns=columns, methods=['GET', 'POST', 'PUT'], url_prefix=api_version, collection_name='lessons', max_results_per_page=-1)
      46 | manager.create_api(Step, exclude_columns=columns, methods=['GET', 'POST', 'PUT','DELETE'], url_prefix=api_version, collection_name='steps', max_results_per_page=-1)
      47 | columns = ['password','reset_token','access_token','role','connections.access_token']
      48 | manager.create_api(Bf_user, exclude_columns=columns,methods=['GET'], url_prefix=api_version, collection_name='users', max_results_per_page=-1)
      49 | columns = ['user.password','user.reset_token','user.access_token','user.role']
      50 | manager.create_api(UserLesson, exclude_columns=columns, methods=['GET'], url_prefix=api_version, collection_name='userlessons', max_results_per_page=-1)
      51 | 
      52 | 
      53 |
      54 |
      55 |
      56 |
      57 | 58 | -------------------------------------------------------------------------------- /docs/public/stylesheets/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v2.0.1 | MIT License | git.io/normalize */ 2 | 3 | /* ========================================================================== 4 | HTML5 display definitions 5 | ========================================================================== */ 6 | 7 | /* 8 | * Corrects `block` display not defined in IE 8/9. 9 | */ 10 | 11 | article, 12 | aside, 13 | details, 14 | figcaption, 15 | figure, 16 | footer, 17 | header, 18 | hgroup, 19 | nav, 20 | section, 21 | summary { 22 | display: block; 23 | } 24 | 25 | /* 26 | * Corrects `inline-block` display not defined in IE 8/9. 27 | */ 28 | 29 | audio, 30 | canvas, 31 | video { 32 | display: inline-block; 33 | } 34 | 35 | /* 36 | * Prevents modern browsers from displaying `audio` without controls. 37 | * Remove excess height in iOS 5 devices. 38 | */ 39 | 40 | audio:not([controls]) { 41 | display: none; 42 | height: 0; 43 | } 44 | 45 | /* 46 | * Addresses styling for `hidden` attribute not present in IE 8/9. 47 | */ 48 | 49 | [hidden] { 50 | display: none; 51 | } 52 | 53 | /* ========================================================================== 54 | Base 55 | ========================================================================== */ 56 | 57 | /* 58 | * 1. Sets default font family to sans-serif. 59 | * 2. Prevents iOS text size adjust after orientation change, without disabling 60 | * user zoom. 61 | */ 62 | 63 | html { 64 | font-family: sans-serif; /* 1 */ 65 | -webkit-text-size-adjust: 100%; /* 2 */ 66 | -ms-text-size-adjust: 100%; /* 2 */ 67 | } 68 | 69 | /* 70 | * Removes default margin. 71 | */ 72 | 73 | body { 74 | margin: 0; 75 | } 76 | 77 | /* ========================================================================== 78 | Links 79 | ========================================================================== */ 80 | 81 | /* 82 | * Addresses `outline` inconsistency between Chrome and other browsers. 83 | */ 84 | 85 | a:focus { 86 | outline: thin dotted; 87 | } 88 | 89 | /* 90 | * Improves readability when focused and also mouse hovered in all browsers. 91 | */ 92 | 93 | a:active, 94 | a:hover { 95 | outline: 0; 96 | } 97 | 98 | /* ========================================================================== 99 | Typography 100 | ========================================================================== */ 101 | 102 | /* 103 | * Addresses `h1` font sizes within `section` and `article` in Firefox 4+, 104 | * Safari 5, and Chrome. 105 | */ 106 | 107 | h1 { 108 | font-size: 2em; 109 | } 110 | 111 | /* 112 | * Addresses styling not present in IE 8/9, Safari 5, and Chrome. 113 | */ 114 | 115 | abbr[title] { 116 | border-bottom: 1px dotted; 117 | } 118 | 119 | /* 120 | * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome. 121 | */ 122 | 123 | b, 124 | strong { 125 | font-weight: bold; 126 | } 127 | 128 | /* 129 | * Addresses styling not present in Safari 5 and Chrome. 130 | */ 131 | 132 | dfn { 133 | font-style: italic; 134 | } 135 | 136 | /* 137 | * Addresses styling not present in IE 8/9. 138 | */ 139 | 140 | mark { 141 | background: #ff0; 142 | color: #000; 143 | } 144 | 145 | 146 | /* 147 | * Corrects font family set oddly in Safari 5 and Chrome. 148 | */ 149 | 150 | code, 151 | kbd, 152 | pre, 153 | samp { 154 | font-family: monospace, serif; 155 | font-size: 1em; 156 | } 157 | 158 | /* 159 | * Improves readability of pre-formatted text in all browsers. 160 | */ 161 | 162 | pre { 163 | white-space: pre; 164 | white-space: pre-wrap; 165 | word-wrap: break-word; 166 | } 167 | 168 | /* 169 | * Sets consistent quote types. 170 | */ 171 | 172 | q { 173 | quotes: "\201C" "\201D" "\2018" "\2019"; 174 | } 175 | 176 | /* 177 | * Addresses inconsistent and variable font size in all browsers. 178 | */ 179 | 180 | small { 181 | font-size: 80%; 182 | } 183 | 184 | /* 185 | * Prevents `sub` and `sup` affecting `line-height` in all browsers. 186 | */ 187 | 188 | sub, 189 | sup { 190 | font-size: 75%; 191 | line-height: 0; 192 | position: relative; 193 | vertical-align: baseline; 194 | } 195 | 196 | sup { 197 | top: -0.5em; 198 | } 199 | 200 | sub { 201 | bottom: -0.25em; 202 | } 203 | 204 | /* ========================================================================== 205 | Embedded content 206 | ========================================================================== */ 207 | 208 | /* 209 | * Removes border when inside `a` element in IE 8/9. 210 | */ 211 | 212 | img { 213 | border: 0; 214 | } 215 | 216 | /* 217 | * Corrects overflow displayed oddly in IE 9. 218 | */ 219 | 220 | svg:not(:root) { 221 | overflow: hidden; 222 | } 223 | 224 | /* ========================================================================== 225 | Figures 226 | ========================================================================== */ 227 | 228 | /* 229 | * Addresses margin not present in IE 8/9 and Safari 5. 230 | */ 231 | 232 | figure { 233 | margin: 0; 234 | } 235 | 236 | /* ========================================================================== 237 | Forms 238 | ========================================================================== */ 239 | 240 | /* 241 | * Define consistent border, margin, and padding. 242 | */ 243 | 244 | fieldset { 245 | border: 1px solid #c0c0c0; 246 | margin: 0 2px; 247 | padding: 0.35em 0.625em 0.75em; 248 | } 249 | 250 | /* 251 | * 1. Corrects color not being inherited in IE 8/9. 252 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 253 | */ 254 | 255 | legend { 256 | border: 0; /* 1 */ 257 | padding: 0; /* 2 */ 258 | } 259 | 260 | /* 261 | * 1. Corrects font family not being inherited in all browsers. 262 | * 2. Corrects font size not being inherited in all browsers. 263 | * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome 264 | */ 265 | 266 | button, 267 | input, 268 | select, 269 | textarea { 270 | font-family: inherit; /* 1 */ 271 | font-size: 100%; /* 2 */ 272 | margin: 0; /* 3 */ 273 | } 274 | 275 | /* 276 | * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in 277 | * the UA stylesheet. 278 | */ 279 | 280 | button, 281 | input { 282 | line-height: normal; 283 | } 284 | 285 | /* 286 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 287 | * and `video` controls. 288 | * 2. Corrects inability to style clickable `input` types in iOS. 289 | * 3. Improves usability and consistency of cursor style between image-type 290 | * `input` and others. 291 | */ 292 | 293 | button, 294 | html input[type="button"], /* 1 */ 295 | input[type="reset"], 296 | input[type="submit"] { 297 | -webkit-appearance: button; /* 2 */ 298 | cursor: pointer; /* 3 */ 299 | } 300 | 301 | /* 302 | * Re-set default cursor for disabled elements. 303 | */ 304 | 305 | button[disabled], 306 | input[disabled] { 307 | cursor: default; 308 | } 309 | 310 | /* 311 | * 1. Addresses box sizing set to `content-box` in IE 8/9. 312 | * 2. Removes excess padding in IE 8/9. 313 | */ 314 | 315 | input[type="checkbox"], 316 | input[type="radio"] { 317 | box-sizing: border-box; /* 1 */ 318 | padding: 0; /* 2 */ 319 | } 320 | 321 | /* 322 | * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome. 323 | * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome 324 | * (include `-moz` to future-proof). 325 | */ 326 | 327 | input[type="search"] { 328 | -webkit-appearance: textfield; /* 1 */ 329 | -moz-box-sizing: content-box; 330 | -webkit-box-sizing: content-box; /* 2 */ 331 | box-sizing: content-box; 332 | } 333 | 334 | /* 335 | * Removes inner padding and search cancel button in Safari 5 and Chrome 336 | * on OS X. 337 | */ 338 | 339 | input[type="search"]::-webkit-search-cancel-button, 340 | input[type="search"]::-webkit-search-decoration { 341 | -webkit-appearance: none; 342 | } 343 | 344 | /* 345 | * Removes inner padding and border in Firefox 4+. 346 | */ 347 | 348 | button::-moz-focus-inner, 349 | input::-moz-focus-inner { 350 | border: 0; 351 | padding: 0; 352 | } 353 | 354 | /* 355 | * 1. Removes default vertical scrollbar in IE 8/9. 356 | * 2. Improves readability and alignment in all browsers. 357 | */ 358 | 359 | textarea { 360 | overflow: auto; /* 1 */ 361 | vertical-align: top; /* 2 */ 362 | } 363 | 364 | /* ========================================================================== 365 | Tables 366 | ========================================================================== */ 367 | 368 | /* 369 | * Remove most spacing between table cells. 370 | */ 371 | 372 | table { 373 | border-collapse: collapse; 374 | border-spacing: 0; 375 | } -------------------------------------------------------------------------------- /js/profile.js: -------------------------------------------------------------------------------- 1 | var profile = (function (profile) { 2 | 3 | // private properties 4 | var user_id = BfUser.id; 5 | var user_name = BfUser.name; 6 | var lessonsCompleted = []; 7 | var lessonsCreated = []; 8 | var profileID; 9 | 10 | // PUBLIC METHODS 11 | // initialize variables and load JSON 12 | function init(){ 13 | if (config.debug) console.log('init'); 14 | _loading(); 15 | _main(); 16 | } 17 | 18 | // PRIVATE METHODS 19 | function _loading(){ 20 | // console.log('Loading'); 21 | $('#main').toggle(); 22 | } 23 | 24 | function _main(){ 25 | $('#loading').toggle(); 26 | $('#main').toggle(); 27 | 28 | // Who's profile? 29 | profileID = window.location.search.split('?')[1]; 30 | // If id included in url, then show the public profile of that user 31 | if (profileID){ 32 | _getUserInfo(profileID); 33 | _getActivity(profileID); 34 | _getContentCreated(profileID); 35 | // Hide draft and submitted lessons 36 | if (profileID != BfUser.id) { 37 | $("#draft").hide(); 38 | $("#submitted").hide(); 39 | $("#edit-profile-btn").hide(); 40 | } 41 | } else { 42 | // If not, show logged in users private profile 43 | _checkIfLoggedIn(); 44 | _getUserInfo(BfUser.id); 45 | _getActivity(BfUser.id); 46 | _getContentCreated(BfUser.id); 47 | } 48 | } 49 | 50 | function _getUserInfo(userID){ 51 | // Display the user profile info 52 | $.getJSON(config.bfUrl+config.bfApiVersion+'/users/'+userID, function(response){ 53 | $(".user-name").append(response.name); 54 | if (response.location) { 55 | $(".location").text(response.location); 56 | } 57 | if (response.business_name) { 58 | $(".biz-name").text(response.business_name); 59 | } 60 | if (response.description) { 61 | $(".profile-description").text(response.description); 62 | } 63 | if (response.linkedin) { 64 | $("#profile-li").attr("href",response.linkedin); 65 | } else { 66 | $("#profile-li").hide(); 67 | } 68 | if (response.gplus) { 69 | $("#profile-gplus").attr("href",response.gplus); 70 | } else { 71 | $("#profile-gplus").hide(); 72 | } 73 | if (response.facebook) { 74 | $("#profile-fb").attr("href",response.facebook); 75 | } else { 76 | $("#profile-fb").hide(); 77 | } 78 | if (response.twitter) { 79 | $("#profile-twitter").attr("href",response.twitter); 80 | } else { 81 | $("#profile-twitter").hide(); 82 | } 83 | if (response.business_url) { 84 | $("#profile-site").attr("href",response.business_url); 85 | } else { 86 | $("#profile-site").hide(); 87 | } 88 | }); 89 | 90 | 91 | } 92 | 93 | function _checkIfLoggedIn(){ 94 | // Check if user is logged in 95 | if (!BfUser.bfAccessToken){ 96 | $('#main').hide(); 97 | $('.login-required').show(); 98 | } 99 | } 100 | 101 | function _getActivity(userID){ 102 | // Display number of lessons completed in the profile activity. 103 | $.getJSON(config.bfUrl+config.bfApiVersion+'/userlessons', function(response){ 104 | $.each(response.objects, function(i,userLesson){ 105 | if (userLesson.user.id == userID){ 106 | if (userLesson.completed){ 107 | lessonsCompleted.push(userLesson); 108 | } 109 | } 110 | }) 111 | $("#lessons-complete").prepend(''+lessonsCompleted.length+''); 112 | _displayLessonsCompleted(); 113 | }); 114 | 115 | // Display number of lessons created in the profile activity. 116 | $.getJSON(config.bfUrl+config.bfApiVersion+'/lessons', function(response){ 117 | var numOfLessonsCreated = 0; 118 | $.each(response.objects, function(i){ 119 | if (response.objects[i].creator_id == userID){ 120 | lessonsCreated.push(response.objects[i]); 121 | } 122 | }) 123 | $("#lessons-created").prepend(''+lessonsCreated.length+''); 124 | }); 125 | 126 | // Display number of lessons taught in the profile activity. 127 | $.getJSON(config.bfUrl+config.bfApiVersion+'/userlessons', function(response){ 128 | var numOfLessonsTaught = 0; 129 | $.each(response.objects, function(i,userLesson){ 130 | if (userLesson.lesson.creator_id == userID){ 131 | if (userLesson.completed){ 132 | numOfLessonsTaught++; 133 | } 134 | } 135 | }) 136 | $("#lessons-taught").prepend(''+numOfLessonsTaught+''); 137 | }); 138 | } 139 | 140 | function _displayLessonsCompleted(){ 141 | // Display specific lessons completed in the learning section 142 | if (!lessonsCompleted){ 143 | html = "

      We see you haven't started learning on BizFriend.ly yet.

      " 144 | html += "

      Find a skill to start learning today.

      " 145 | html += '' 146 | $("#services-learned").append(html); 147 | } else { 148 | var lessonsByService = {}; 149 | $.each(lessonsCompleted, function(i,lessonCompleted){ 150 | lessonsByService[lessonCompleted.lesson.service_id] = lessonsByService[lessonCompleted.lesson.service_id] || []; 151 | lessonsByService[lessonCompleted.lesson.service_id].push(lessonCompleted); 152 | }); 153 | $.each(Object.keys(lessonsByService), function(i, service_id){ 154 | var html = ""; 155 | html += '
      '; 156 | url = config.bfUrl+config.bfApiVersion+'/services/'+service_id; 157 | $.getJSON(url, function(response) { 158 | html += ''+response.name+''; 159 | $.each(lessonsByService[service_id], function(x, lesson){ 160 | html += '
      '; 161 | html += ''+lesson.lesson.name+''; 162 | html += ''+moment(lesson.end_dt).format("MMM Do YY")+''; 163 | }) 164 | html += '
      '; 165 | $("#services-learned").append(html); 166 | }); 167 | }); 168 | } 169 | } 170 | 171 | function _getContentCreated(userID){ 172 | // Gather all the content created by user 173 | if (!lessonsCreated){ 174 | html = "

      We see you haven't started teaching on BizFriend.ly yet.

      " 175 | html += '' 176 | $("#services-created").append(html); 177 | } else { 178 | $.getJSON(config.bfUrl+config.bfApiVersion+'/categories', function(response){ 179 | $.each(response.objects, function(i, category){ 180 | if (category.creator_id == userID){ 181 | _displayContent(category, "skill"); // Called skill on web site. 182 | } 183 | }); 184 | }); 185 | $.getJSON(config.bfUrl+config.bfApiVersion+'/services', function(response){ 186 | $.each(response.objects, function(i, service){ 187 | if (service.creator_id == userID){ 188 | _displayContent(service, "service"); 189 | } 190 | }); 191 | }); 192 | $.getJSON(config.bfUrl+config.bfApiVersion+'/lessons', function(response){ 193 | $.each(response.objects, function(i, lesson){ 194 | if (lesson.creator_id == userID){ 195 | _displayContent(lesson, "lesson"); 196 | } 197 | }); 198 | }); 199 | } 200 | } 201 | 202 | function _displayContent(content, content_type){ 203 | // Display the content in the teaching section. 204 | var html = '
      '; 205 | html += '
      '+content.name+'
      '; 206 | html += '
      '+content_type+'
      '; 207 | html += '
      '; 208 | // If its your profile, show edit buttons 209 | if (!profileID || profileID == BfUser.id) { 210 | if (content_type == "lesson"){ 211 | html += 'Edit'; 212 | } else if (content_type == "service") { 213 | html += 'Edit'; 214 | } else if (content_type == "skill") { 215 | html += 'Edit'; 216 | } 217 | }; 218 | html += '
      '; 219 | html += '
      '; 220 | $("#"+content.state).append(html); 221 | } 222 | 223 | // add public methods to the returned module and return it 224 | profile.init = init; 225 | return profile; 226 | }(profile|| {})); 227 | 228 | // initialize the module 229 | profile.init() 230 | -------------------------------------------------------------------------------- /js/vendor/jquery.iframe-transport.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Iframe Transport Plugin 1.7 3 | * https://github.com/blueimp/jQuery-File-Upload 4 | * 5 | * Copyright 2011, Sebastian Tschan 6 | * https://blueimp.net 7 | * 8 | * Licensed under the MIT license: 9 | * http://www.opensource.org/licenses/MIT 10 | */ 11 | 12 | /*jslint unparam: true, nomen: true */ 13 | /*global define, window, document */ 14 | 15 | (function (factory) { 16 | 'use strict'; 17 | if (typeof define === 'function' && define.amd) { 18 | // Register as an anonymous AMD module: 19 | define(['jquery'], factory); 20 | } else { 21 | // Browser globals: 22 | factory(window.jQuery); 23 | } 24 | }(function ($) { 25 | 'use strict'; 26 | 27 | // Helper variable to create unique names for the transport iframes: 28 | var counter = 0; 29 | 30 | // The iframe transport accepts three additional options: 31 | // options.fileInput: a jQuery collection of file input fields 32 | // options.paramName: the parameter name for the file form data, 33 | // overrides the name property of the file input field(s), 34 | // can be a string or an array of strings. 35 | // options.formData: an array of objects with name and value properties, 36 | // equivalent to the return data of .serializeArray(), e.g.: 37 | // [{name: 'a', value: 1}, {name: 'b', value: 2}] 38 | $.ajaxTransport('iframe', function (options) { 39 | if (options.async) { 40 | var form, 41 | iframe, 42 | addParamChar; 43 | return { 44 | send: function (_, completeCallback) { 45 | form = $('
      '); 46 | form.attr('accept-charset', options.formAcceptCharset); 47 | addParamChar = /\?/.test(options.url) ? '&' : '?'; 48 | // XDomainRequest only supports GET and POST: 49 | if (options.type === 'DELETE') { 50 | options.url = options.url + addParamChar + '_method=DELETE'; 51 | options.type = 'POST'; 52 | } else if (options.type === 'PUT') { 53 | options.url = options.url + addParamChar + '_method=PUT'; 54 | options.type = 'POST'; 55 | } else if (options.type === 'PATCH') { 56 | options.url = options.url + addParamChar + '_method=PATCH'; 57 | options.type = 'POST'; 58 | } 59 | // javascript:false as initial iframe src 60 | // prevents warning popups on HTTPS in IE6. 61 | // IE versions below IE8 cannot set the name property of 62 | // elements that have already been added to the DOM, 63 | // so we set the name along with the iframe HTML markup: 64 | counter += 1; 65 | iframe = $( 66 | '' 68 | ).bind('load', function () { 69 | var fileInputClones, 70 | paramNames = $.isArray(options.paramName) ? 71 | options.paramName : [options.paramName]; 72 | iframe 73 | .unbind('load') 74 | .bind('load', function () { 75 | var response; 76 | // Wrap in a try/catch block to catch exceptions thrown 77 | // when trying to access cross-domain iframe contents: 78 | try { 79 | response = iframe.contents(); 80 | // Google Chrome and Firefox do not throw an 81 | // exception when calling iframe.contents() on 82 | // cross-domain requests, so we unify the response: 83 | if (!response.length || !response[0].firstChild) { 84 | throw new Error(); 85 | } 86 | } catch (e) { 87 | response = undefined; 88 | } 89 | // The complete callback returns the 90 | // iframe content document as response object: 91 | completeCallback( 92 | 200, 93 | 'success', 94 | {'iframe': response} 95 | ); 96 | // Fix for IE endless progress bar activity bug 97 | // (happens on form submits to iframe targets): 98 | $('') 99 | .appendTo(form); 100 | window.setTimeout(function () { 101 | // Removing the form in a setTimeout call 102 | // allows Chrome's developer tools to display 103 | // the response result 104 | form.remove(); 105 | }, 0); 106 | }); 107 | form 108 | .prop('target', iframe.prop('name')) 109 | .prop('action', options.url) 110 | .prop('method', options.type); 111 | if (options.formData) { 112 | $.each(options.formData, function (index, field) { 113 | $('') 114 | .prop('name', field.name) 115 | .val(field.value) 116 | .appendTo(form); 117 | }); 118 | } 119 | if (options.fileInput && options.fileInput.length && 120 | options.type === 'POST') { 121 | fileInputClones = options.fileInput.clone(); 122 | // Insert a clone for each file input field: 123 | options.fileInput.after(function (index) { 124 | return fileInputClones[index]; 125 | }); 126 | if (options.paramName) { 127 | options.fileInput.each(function (index) { 128 | $(this).prop( 129 | 'name', 130 | paramNames[index] || options.paramName 131 | ); 132 | }); 133 | } 134 | // Appending the file input fields to the hidden form 135 | // removes them from their original location: 136 | form 137 | .append(options.fileInput) 138 | .prop('enctype', 'multipart/form-data') 139 | // enctype must be set as encoding for IE: 140 | .prop('encoding', 'multipart/form-data'); 141 | } 142 | form.submit(); 143 | // Insert the file input fields at their original location 144 | // by replacing the clones with the originals: 145 | if (fileInputClones && fileInputClones.length) { 146 | options.fileInput.each(function (index, input) { 147 | var clone = $(fileInputClones[index]); 148 | $(input).prop('name', clone.prop('name')); 149 | clone.replaceWith(input); 150 | }); 151 | } 152 | }); 153 | form.append(iframe).appendTo(document.body); 154 | }, 155 | abort: function () { 156 | if (iframe) { 157 | // javascript:false as iframe src aborts the request 158 | // and prevents warning popups on HTTPS in IE6. 159 | // concat is used to avoid the "Script URL" JSLint error: 160 | iframe 161 | .unbind('load') 162 | .prop('src', 'javascript'.concat(':false;')); 163 | } 164 | if (form) { 165 | form.remove(); 166 | } 167 | } 168 | }; 169 | } 170 | }); 171 | 172 | // The iframe transport returns the iframe content document as response. 173 | // The following adds converters from iframe to text, json, html, xml 174 | // and script. 175 | // Please note that the Content-Type for JSON responses has to be text/plain 176 | // or text/html, if the browser doesn't include application/json in the 177 | // Accept header, else IE will show a download dialog. 178 | // The Content-Type for XML responses on the other hand has to be always 179 | // application/xml or text/xml, so IE properly parses the XML response. 180 | // See also 181 | // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation 182 | $.ajaxSetup({ 183 | converters: { 184 | 'iframe text': function (iframe) { 185 | return iframe && $(iframe[0].body).text(); 186 | }, 187 | 'iframe json': function (iframe) { 188 | return iframe && $.parseJSON($(iframe[0].body).text()); 189 | }, 190 | 'iframe html': function (iframe) { 191 | return iframe && $(iframe[0].body).html(); 192 | }, 193 | 'iframe xml': function (iframe) { 194 | var xmlDoc = iframe && iframe[0]; 195 | return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc : 196 | $.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) || 197 | $(xmlDoc.body).html()); 198 | }, 199 | 'iframe script': function (iframe) { 200 | return iframe && $.globalEval($(iframe[0].body).text()); 201 | } 202 | } 203 | }); 204 | 205 | })); 206 | --------------------------------------------------------------------------------