├── fedorasummerofhardware ├── scripts │ ├── __init__.py │ └── initializedb.py ├── static │ ├── img │ │ ├── logo.png │ │ ├── fedora.png │ │ ├── logo-olpc.png │ │ ├── starburst.png │ │ ├── logo-raspi.png │ │ ├── photo-olpc.png │ │ ├── photo-raspi.png │ │ └── photo-arduino.png │ ├── fonts │ │ ├── chewy-webfont.woff │ │ ├── chewy-webfont.woff.1 │ │ ├── Comfortaa_Regular-webfont.ttf │ │ └── Comfortaa_Regular-webfont.woff │ ├── less │ │ ├── grid.less │ │ ├── utilities.less │ │ ├── component-animations.less │ │ ├── layouts.less │ │ ├── hero-unit.less │ │ ├── breadcrumbs.less │ │ ├── wells.less │ │ ├── scaffolding.less │ │ ├── close.less │ │ ├── pager.less │ │ ├── accordion.less │ │ ├── tooltip.less │ │ ├── thumbnails.less │ │ ├── pagination.less │ │ ├── alerts.less │ │ ├── popovers.less │ │ ├── bootstrap.less │ │ ├── code.less │ │ ├── labels-badges.less │ │ ├── modals.less │ │ ├── carousel.less │ │ ├── progress-bars.less │ │ ├── reset.less │ │ ├── dropdowns.less │ │ ├── type.less │ │ ├── tables.less │ │ ├── buttons.less │ │ ├── button-groups.less │ │ ├── variables.less │ │ ├── navs.less │ │ ├── navbar.less │ │ ├── sprites.less │ │ └── forms.less │ └── js │ │ ├── bootstrap-transition.min.js │ │ ├── charCount.min.js │ │ ├── bootstrap-alert.min.js │ │ ├── bootstrap-dropdown.min.js │ │ ├── bootstrap-button.min.js │ │ ├── bootstrap-popover.min.js │ │ ├── bootstrap-tab.min.js │ │ ├── bootstrap-scrollspy.min.js │ │ ├── charCount.js │ │ ├── bootstrap-collapse.min.js │ │ ├── bootstrap-transition.js │ │ ├── bootstrap-carousel.min.js │ │ ├── bootstrap-alert.js │ │ ├── bootstrap-modal.min.js │ │ ├── bootstrap-button.js │ │ ├── bootstrap-dropdown.js │ │ ├── bootstrap-popover.js │ │ ├── bootstrap-typeahead.min.js │ │ ├── bootstrap-tooltip.min.js │ │ ├── bootstrap-tab.js │ │ ├── bootstrap-scrollspy.js │ │ ├── bootstrap-collapse.js │ │ ├── bootstrap-carousel.js │ │ ├── bootstrap-modal.js │ │ ├── bootstrap-typeahead.js │ │ └── bootstrap-tooltip.js ├── templates │ ├── csv.mak │ ├── login.mak │ ├── accept.mak │ └── submissions.mak ├── models.py └── __init__.py ├── .gitignore ├── MANIFEST.in ├── openhw2012.wsgi ├── setup.cfg ├── README.rst ├── compress ├── setup.py └── development.ini /fedorasummerofhardware/scripts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | *.db 4 | data 5 | sstore 6 | *.egg-info 7 | *.swp 8 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/img/logo.png -------------------------------------------------------------------------------- /fedorasummerofhardware/static/img/fedora.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/img/fedora.png -------------------------------------------------------------------------------- /fedorasummerofhardware/static/img/logo-olpc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/img/logo-olpc.png -------------------------------------------------------------------------------- /fedorasummerofhardware/static/img/starburst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/img/starburst.png -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt *.ini *.cfg *.rst 2 | recursive-include fedorasummerofhardware *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml 3 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/img/logo-raspi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/img/logo-raspi.png -------------------------------------------------------------------------------- /fedorasummerofhardware/static/img/photo-olpc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/img/photo-olpc.png -------------------------------------------------------------------------------- /fedorasummerofhardware/static/img/photo-raspi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/img/photo-raspi.png -------------------------------------------------------------------------------- /fedorasummerofhardware/static/img/photo-arduino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/img/photo-arduino.png -------------------------------------------------------------------------------- /fedorasummerofhardware/static/fonts/chewy-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/fonts/chewy-webfont.woff -------------------------------------------------------------------------------- /fedorasummerofhardware/static/fonts/chewy-webfont.woff.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/fonts/chewy-webfont.woff.1 -------------------------------------------------------------------------------- /fedorasummerofhardware/static/fonts/Comfortaa_Regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/fonts/Comfortaa_Regular-webfont.ttf -------------------------------------------------------------------------------- /fedorasummerofhardware/static/fonts/Comfortaa_Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedora-infra/fedora-openhw2012/master/fedorasummerofhardware/static/fonts/Comfortaa_Regular-webfont.woff -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/grid.less: -------------------------------------------------------------------------------- 1 | // Fixed (940px) 2 | #grid > .core(@gridColumnWidth, @gridGutterWidth); 3 | 4 | // Fluid (940px) 5 | #grid > .fluid(@fluidGridColumnWidth, @fluidGridGutterWidth); -------------------------------------------------------------------------------- /fedorasummerofhardware/templates/csv.mak: -------------------------------------------------------------------------------- 1 | ## -*- coding: utf-8 -*- 2 | % for app in applications: 3 | ${app.date},${app.username},${app.realname.decode('utf-8')},${app.country},${app.hardware},${app.shield},${app.text.decode('utf-8')}
4 | % endfor 5 | -------------------------------------------------------------------------------- /openhw2012.wsgi: -------------------------------------------------------------------------------- 1 | import site 2 | site.addsitedir('/srv/web/openhw2012/openhw2012/lib/python2.6/site-packages/') 3 | 4 | from pyramid.paster import get_app, setup_logging 5 | application = get_app('/srv/web/openhw2012/development.ini', 'main') 6 | setup_logging('/srv/web/openhw2012/development.ini') 7 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/utilities.less: -------------------------------------------------------------------------------- 1 | // UTILITY CLASSES 2 | // --------------- 3 | 4 | // Quick floats 5 | .pull-right { 6 | float: right; 7 | } 8 | .pull-left { 9 | float: left; 10 | } 11 | 12 | // Toggling content 13 | .hide { 14 | display: none; 15 | } 16 | .show { 17 | display: block; 18 | } 19 | 20 | // Visibility 21 | .invisible { 22 | visibility: hidden; 23 | } 24 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // COMPONENT ANIMATIONS 2 | // -------------------- 3 | 4 | .fade { 5 | opacity: 0; 6 | .transition(opacity .15s linear); 7 | &.in { 8 | opacity: 1; 9 | } 10 | } 11 | 12 | .collapse { 13 | position: relative; 14 | height: 0; 15 | overflow: hidden; 16 | .transition(height .35s ease); 17 | &.in { 18 | height: auto; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/js/bootstrap-transition.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a(function(){a.support.transition=(function(){var b=(function(){var e=document.createElement("bootstrap"),d={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},c;for(c in d){if(e.style[c]!==undefined){return d[c]}}}());return b&&{end:b}})()})}(window.jQuery); -------------------------------------------------------------------------------- /fedorasummerofhardware/templates/login.mak: -------------------------------------------------------------------------------- 1 | ## -*- coding: utf-8 -*- 2 | <% flash = '. '.join(request.session.pop_flash()) %> 3 |
${flash}
4 | 5 |
6 | Fedora Username:
7 | Password:

8 | 9 |
10 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/layouts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Layouts 3 | // Fixed-width and fluid (with sidebar) layouts 4 | // -------------------------------------------- 5 | 6 | 7 | // Container (centered, fixed-width layouts) 8 | .container { 9 | .container-fixed(); 10 | } 11 | 12 | // Fluid layouts (left aligned, with sidebar, min- & max-width content) 13 | .container-fluid { 14 | padding-right: @gridGutterWidth; 15 | padding-left: @gridGutterWidth; 16 | .clearfix(); 17 | } -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/hero-unit.less: -------------------------------------------------------------------------------- 1 | // HERO UNIT 2 | // --------- 3 | 4 | .hero-unit { 5 | padding: 60px; 6 | margin-bottom: 30px; 7 | background-color: @heroUnitBackground; 8 | .border-radius(6px); 9 | h1 { 10 | margin-bottom: 0; 11 | font-size: 60px; 12 | line-height: 1; 13 | color: @heroUnitHeadingColor; 14 | letter-spacing: -1px; 15 | } 16 | p { 17 | font-size: 18px; 18 | font-weight: 200; 19 | line-height: @baseLineHeight * 1.5; 20 | color: @heroUnitLeadColor; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // BREADCRUMBS 2 | // ----------- 3 | 4 | .breadcrumb { 5 | padding: 7px 14px; 6 | margin: 0 0 @baseLineHeight; 7 | list-style: none; 8 | #gradient > .vertical(@white, #f5f5f5); 9 | border: 1px solid #ddd; 10 | .border-radius(3px); 11 | .box-shadow(inset 0 1px 0 @white); 12 | li { 13 | display: inline-block; 14 | .ie7-inline-block(); 15 | text-shadow: 0 1px 0 @white; 16 | } 17 | .divider { 18 | padding: 0 5px; 19 | color: @grayLight; 20 | } 21 | .active a { 22 | color: @grayDark; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/wells.less: -------------------------------------------------------------------------------- 1 | // WELLS 2 | // ----- 3 | 4 | .well { 5 | min-height: 20px; 6 | padding: 19px; 7 | margin-bottom: 20px; 8 | background-color: #f5f5f5; 9 | border: 1px solid #eee; 10 | border: 1px solid rgba(0,0,0,.05); 11 | .border-radius(4px); 12 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 13 | blockquote { 14 | border-color: #ddd; 15 | border-color: rgba(0,0,0,.15); 16 | } 17 | } 18 | 19 | // Sizes 20 | .well-large { 21 | padding: 24px; 22 | .border-radius(6px); 23 | } 24 | .well-small { 25 | padding: 9px; 26 | .border-radius(3px); 27 | } 28 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [nosetests] 2 | match=^test 3 | nocapture=1 4 | cover-package=pyramidapp 5 | with-coverage=1 6 | cover-erase=1 7 | 8 | [compile_catalog] 9 | directory = pyramidapp/locale 10 | domain = pyramidapp 11 | statistics = true 12 | 13 | [extract_messages] 14 | add_comments = TRANSLATORS: 15 | output_file = pyramidapp/locale/pyramidapp.pot 16 | width = 80 17 | 18 | [init_catalog] 19 | domain = pyramidapp 20 | input_file = pyramidapp/locale/pyramidapp.pot 21 | output_dir = pyramidapp/locale 22 | 23 | [update_catalog] 24 | domain = pyramidapp 25 | input_file = pyramidapp/locale/pyramidapp.pot 26 | output_dir = pyramidapp/locale 27 | previous = true 28 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/js/charCount.min.js: -------------------------------------------------------------------------------- 1 | (function(a){a.fn.charCount=function(b){var d={allowed:140,warning:25,css:"counter",counterElement:"span",cssWarning:"warning",cssExceeded:"exceeded",counterText:""};var b=a.extend(d,b);function c(g){var e=a(g).val().length;var f=b.allowed-e;if(f<=b.warning&&f>=0){a(g).next().addClass(b.cssWarning)}else{a(g).next().removeClass(b.cssWarning)}if(f<0){a(g).next().addClass(b.cssExceeded)}else{a(g).next().removeClass(b.cssExceeded)}a(g).next().html(b.counterText+f)}this.each(function(){a(this).after("<"+b.counterElement+' class="'+b.css+'">'+b.counterText+"");c(this);a(this).keyup(function(){c(this)});a(this).change(function(){c(this)})})}})(jQuery); -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Fedora Summer of Open Hardware 2012 2 | =================================== 3 | 4 | .. image:: http://lewk.org/img/openhw2012.png 5 | 6 | Authors 7 | ------- 8 | 9 | * `Máirín Duffy `_ 10 | * `Luke Macken `_ 11 | 12 | Setting up a local instance 13 | --------------------------- 14 | 15 | :: 16 | 17 | yum install -y python-virtualenv git libcurl-devel 18 | git clone git://github.com/lmacken/fedora-openhw2012.git 19 | cd fedora-openhw2012 20 | virtualenv env 21 | source env/bin/activate 22 | pip install kitchen pycurl 23 | python setup.py develop 24 | initialize_FedoraSummerOfHardware_db development.ini 25 | pserve development.ini 26 | -------------------------------------------------------------------------------- /compress: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | STATIC=fedorasummerofhardware/static 4 | 5 | rm -f $STATIC/js/bootstrap*.min.js $STATIC/css/compressed.css 6 | 7 | # Compile our Bootstrap JavaScript with the YUI compressor 8 | java -jar ~/code/github.com/yuicompressor/build/yuicompressor-2.4.8pre.jar -o '.js$:.min.js' $STATIC/js/bootstrap*.js $STATIC/js/charCount.js 9 | 10 | # Compile our CSS with lessc 11 | ~/.npm/less/1.3.0/package/bin/lessc $STATIC/less/bootstrap.less > $STATIC/css/uncompressed.css 12 | 13 | # Use the YUI compressor on our compiled less css 14 | java -jar ~/code/github.com/yuicompressor/build/yuicompressor-2.4.8pre.jar $STATIC/css/uncompressed.css > $STATIC/css/compressed.css 15 | ls -lh $STATIC/css/compressed.css 16 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/scaffolding.less: -------------------------------------------------------------------------------- 1 | // Scaffolding 2 | // Basic and global styles for generating a grid system, structural layout, and page templates 3 | // ------------------------------------------------------------------------------------------- 4 | 5 | 6 | // Body reset 7 | // ---------- 8 | 9 | body { 10 | margin: 0; 11 | font-family: @baseFontFamily; 12 | font-size: @baseFontSize; 13 | line-height: @baseLineHeight; 14 | color: @textColor; 15 | background-color: @bodyBackground; 16 | } 17 | 18 | 19 | // Links 20 | // ----- 21 | 22 | a { 23 | color: @linkColor; 24 | text-decoration: none; 25 | } 26 | a:hover { 27 | color: @linkColorHover; 28 | text-decoration: underline; 29 | } 30 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/close.less: -------------------------------------------------------------------------------- 1 | // CLOSE ICONS 2 | // ----------- 3 | 4 | .close { 5 | float: right; 6 | font-size: 20px; 7 | font-weight: bold; 8 | line-height: @baseLineHeight; 9 | color: @black; 10 | text-shadow: 0 1px 0 rgba(255,255,255,1); 11 | .opacity(20); 12 | &:hover { 13 | color: @black; 14 | text-decoration: none; 15 | cursor: pointer; 16 | .opacity(40); 17 | } 18 | } 19 | 20 | // Additional properties for button version 21 | // iOS requires the button element instead of an anchor tag. 22 | // If you want the anchor version, it requires `href="#"`. 23 | button.close { 24 | padding: 0; 25 | cursor: pointer; 26 | background: transparent; 27 | border: 0; 28 | -webkit-appearance: none; 29 | } -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/pager.less: -------------------------------------------------------------------------------- 1 | // PAGER 2 | // ----- 3 | 4 | .pager { 5 | margin-left: 0; 6 | margin-bottom: @baseLineHeight; 7 | list-style: none; 8 | text-align: center; 9 | .clearfix(); 10 | } 11 | .pager li { 12 | display: inline; 13 | } 14 | .pager a { 15 | display: inline-block; 16 | padding: 5px 14px; 17 | background-color: #fff; 18 | border: 1px solid #ddd; 19 | .border-radius(15px); 20 | } 21 | .pager a:hover { 22 | text-decoration: none; 23 | background-color: #f5f5f5; 24 | } 25 | .pager .next a { 26 | float: right; 27 | } 28 | .pager .previous a { 29 | float: left; 30 | } 31 | .pager .disabled a, 32 | .pager .disabled a:hover { 33 | color: @grayLight; 34 | background-color: #fff; 35 | cursor: default; 36 | } -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/accordion.less: -------------------------------------------------------------------------------- 1 | // ACCORDION 2 | // --------- 3 | 4 | 5 | // Parent container 6 | .accordion { 7 | margin-bottom: @baseLineHeight; 8 | } 9 | 10 | // Group == heading + body 11 | .accordion-group { 12 | margin-bottom: 2px; 13 | border: 1px solid #e5e5e5; 14 | .border-radius(4px); 15 | } 16 | .accordion-heading { 17 | border-bottom: 0; 18 | } 19 | .accordion-heading .accordion-toggle { 20 | display: block; 21 | padding: 8px 15px; 22 | } 23 | 24 | // General toggle styles 25 | .accordion-toggle { 26 | cursor: pointer; 27 | } 28 | 29 | // Inner needs the styles because you can't animate properly with any styles on the element 30 | .accordion-inner { 31 | padding: 9px 15px; 32 | border-top: 1px solid #e5e5e5; 33 | } 34 | -------------------------------------------------------------------------------- /fedorasummerofhardware/scripts/initializedb.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | from sqlalchemy import engine_from_config 5 | from pyramid.paster import get_appsettings, setup_logging 6 | 7 | from ..models import DBSession, Application, Base 8 | 9 | def usage(argv): 10 | cmd = os.path.basename(argv[0]) 11 | print('usage: %s \n' 12 | '(example: "%s development.ini")' % (cmd, cmd)) 13 | sys.exit(1) 14 | 15 | def main(argv=sys.argv): 16 | if len(argv) != 2: 17 | usage(argv) 18 | config_uri = argv[1] 19 | setup_logging(config_uri) 20 | settings = get_appsettings(config_uri) 21 | engine = engine_from_config(settings, 'sqlalchemy.') 22 | DBSession.configure(bind=engine) 23 | Base.metadata.create_all(engine) 24 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/js/bootstrap-alert.min.js: -------------------------------------------------------------------------------- 1 | !function(c){var b='[data-dismiss="alert"]',a=function(d){c(d).on("click",b,this.close)};a.prototype.close=function(i){var h=c(this),f=h.attr("data-target"),g;if(!f){f=h.attr("href");f=f&&f.replace(/.*(?=#[^\s]*$)/,"")}g=c(f);i&&i.preventDefault();g.length||(g=h.hasClass("alert")?h:h.parent());g.trigger(i=c.Event("close"));if(i.isDefaultPrevented()){return}g.removeClass("in");function d(){g.trigger("closed").remove()}c.support.transition&&g.hasClass("fade")?g.on(c.support.transition.end,d):d()};c.fn.alert=function(d){return this.each(function(){var f=c(this),e=f.data("alert");if(!e){f.data("alert",(e=new a(this)))}if(typeof d=="string"){e[d].call(f)}})};c.fn.alert.Constructor=a;c(function(){c("body").on("click.alert.data-api",b,a.prototype.close)})}(window.jQuery); -------------------------------------------------------------------------------- /fedorasummerofhardware/static/js/bootstrap-dropdown.min.js: -------------------------------------------------------------------------------- 1 | !function(d){var b='[data-toggle="dropdown"]',a=function(f){var e=d(f).on("click.dropdown.data-api",this.toggle);d("html").on("click.dropdown.data-api",function(){e.parent().removeClass("open")})};a.prototype={constructor:a,toggle:function(j){var i=d(this),h,f,g;if(i.is(".disabled, :disabled")){return}f=i.attr("data-target");if(!f){f=i.attr("href");f=f&&f.replace(/.*(?=#[^\s]*$)/,"")}h=d(f);h.length||(h=i.parent());g=h.hasClass("open");c();if(!g){h.toggleClass("open")}return false}};function c(){d(b).parent().removeClass("open")}d.fn.dropdown=function(e){return this.each(function(){var g=d(this),f=g.data("dropdown");if(!f){g.data("dropdown",(f=new a(this)))}if(typeof e=="string"){f[e].call(g)}})};d.fn.dropdown.Constructor=a;d(function(){d("html").on("click.dropdown.data-api",c);d("body").on("click.dropdown",".dropdown form",function(f){f.stopPropagation()}).on("click.dropdown.data-api",b,a.prototype.toggle)})}(window.jQuery); -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/tooltip.less: -------------------------------------------------------------------------------- 1 | // TOOLTIP 2 | // ------= 3 | 4 | .tooltip { 5 | position: absolute; 6 | z-index: @zindexTooltip; 7 | display: block; 8 | visibility: visible; 9 | padding: 5px; 10 | font-size: 11px; 11 | .opacity(0); 12 | &.in { .opacity(80); } 13 | &.top { margin-top: -2px; } 14 | &.right { margin-left: 2px; } 15 | &.bottom { margin-top: 2px; } 16 | &.left { margin-left: -2px; } 17 | &.top .tooltip-arrow { #popoverArrow > .top(); } 18 | &.left .tooltip-arrow { #popoverArrow > .left(); } 19 | &.bottom .tooltip-arrow { #popoverArrow > .bottom(); } 20 | &.right .tooltip-arrow { #popoverArrow > .right(); } 21 | } 22 | .tooltip-inner { 23 | max-width: 200px; 24 | padding: 3px 8px; 25 | color: @white; 26 | text-align: center; 27 | text-decoration: none; 28 | background-color: @black; 29 | .border-radius(4px); 30 | } 31 | .tooltip-arrow { 32 | position: absolute; 33 | width: 0; 34 | height: 0; 35 | } 36 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/js/bootstrap-button.min.js: -------------------------------------------------------------------------------- 1 | !function(b){var a=function(d,c){this.$element=b(d);this.options=b.extend({},b.fn.button.defaults,c)};a.prototype.setState=function(f){var h="disabled",c=this.$element,e=c.data(),g=c.is("input")?"val":"html";f=f+"Text";e.resetText||c.data("resetText",c[g]());c[g](e[f]||this.options[f]);setTimeout(function(){f=="loadingText"?c.addClass(h).attr(h,h):c.removeClass(h).removeAttr(h)},0)};a.prototype.toggle=function(){var c=this.$element.parent('[data-toggle="buttons-radio"]');c&&c.find(".active").removeClass("active");this.$element.toggleClass("active")};b.fn.button=function(c){return this.each(function(){var f=b(this),e=f.data("button"),d=typeof c=="object"&&c;if(!e){f.data("button",(e=new a(this,d)))}if(c=="toggle"){e.toggle()}else{if(c){e.setState(c)}}})};b.fn.button.defaults={loadingText:"loading..."};b.fn.button.Constructor=a;b(function(){b("body").on("click.button.data-api","[data-toggle^=button]",function(d){var c=b(d.target);if(!c.hasClass("btn")){c=c.closest(".btn")}c.button("toggle")})})}(window.jQuery); -------------------------------------------------------------------------------- /fedorasummerofhardware/static/js/bootstrap-popover.min.js: -------------------------------------------------------------------------------- 1 | !function(b){var a=function(d,c){this.init("popover",d,c)};a.prototype=b.extend({},b.fn.tooltip.Constructor.prototype,{constructor:a,setContent:function(){var e=this.tip(),d=this.getTitle(),c=this.getContent();e.find(".popover-title")[this.isHTML(d)?"html":"text"](d);e.find(".popover-content > *")[this.isHTML(c)?"html":"text"](c);e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var d,c=this.$element,e=this.options;d=c.attr("data-content")||(typeof e.content=="function"?e.content.call(c[0]):e.content);return d},tip:function(){if(!this.$tip){this.$tip=b(this.options.template)}return this.$tip}});b.fn.popover=function(c){return this.each(function(){var f=b(this),e=f.data("popover"),d=typeof c=="object"&&c;if(!e){f.data("popover",(e=new a(this,d)))}if(typeof c=="string"){e[c]()}})};b.fn.popover.Constructor=a;b.fn.popover.defaults=b.extend({},b.fn.tooltip.defaults,{placement:"right",content:"",template:'

'})}(window.jQuery); -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // THUMBNAILS 2 | // ---------- 3 | // Note: `.thumbnails` and `.thumbnails > li` are overriden in responsive files 4 | 5 | // Make wrapper ul behave like the grid 6 | .thumbnails { 7 | margin-left: -@gridGutterWidth; 8 | list-style: none; 9 | .clearfix(); 10 | } 11 | // Fluid rows have no left margin 12 | .row-fluid .thumbnails { 13 | margin-left: 0; 14 | } 15 | 16 | // Float li to make thumbnails appear in a row 17 | .thumbnails > li { 18 | float: left; // Explicity set the float since we don't require .span* classes 19 | margin-bottom: @baseLineHeight; 20 | margin-left: @gridGutterWidth; 21 | } 22 | 23 | // The actual thumbnail (can be `a` or `div`) 24 | .thumbnail { 25 | display: block; 26 | padding: 4px; 27 | line-height: 1; 28 | border: 1px solid #ddd; 29 | .border-radius(4px); 30 | .box-shadow(0 1px 1px rgba(0,0,0,.075)); 31 | } 32 | // Add a hover state for linked versions only 33 | a.thumbnail:hover { 34 | border-color: @linkColor; 35 | .box-shadow(0 1px 4px rgba(0,105,214,.25)); 36 | } 37 | 38 | // Images and captions 39 | .thumbnail > img { 40 | display: block; 41 | max-width: 100%; 42 | margin-left: auto; 43 | margin-right: auto; 44 | } 45 | .thumbnail .caption { 46 | padding: 9px; 47 | } 48 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/js/bootstrap-tab.min.js: -------------------------------------------------------------------------------- 1 | !function(b){var a=function(c){this.element=b(c)};a.prototype={constructor:a,show:function(){var i=this.element,f=i.closest("ul:not(.dropdown-menu)"),d=i.attr("data-target"),g,c,h;if(!d){d=i.attr("href");d=d&&d.replace(/.*(?=#[^\s]*$)/,"")}if(i.parent("li").hasClass("active")){return}g=f.find(".active a").last()[0];h=b.Event("show",{relatedTarget:g});i.trigger(h);if(h.isDefaultPrevented()){return}c=b(d);this.activate(i.parent("li"),f);this.activate(c,c.parent(),function(){i.trigger({type:"shown",relatedTarget:g})})},activate:function(e,d,h){var c=d.find("> .active"),g=h&&b.support.transition&&c.hasClass("fade");function f(){c.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");e.addClass("active");if(g){e[0].offsetWidth;e.addClass("in")}else{e.removeClass("fade")}if(e.parent(".dropdown-menu")){e.closest("li.dropdown").addClass("active")}h&&h()}g?c.one(b.support.transition.end,f):f();c.removeClass("in")}};b.fn.tab=function(c){return this.each(function(){var e=b(this),d=e.data("tab");if(!d){e.data("tab",(d=new a(this)))}if(typeof c=="string"){d[c]()}})};b.fn.tab.Constructor=a;b(function(){b("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(c){c.preventDefault();b(this).tab("show")})})}(window.jQuery); -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/pagination.less: -------------------------------------------------------------------------------- 1 | // PAGINATION 2 | // ---------- 3 | 4 | .pagination { 5 | height: @baseLineHeight * 2; 6 | margin: @baseLineHeight 0; 7 | } 8 | .pagination ul { 9 | display: inline-block; 10 | .ie7-inline-block(); 11 | margin-left: 0; 12 | margin-bottom: 0; 13 | .border-radius(3px); 14 | .box-shadow(0 1px 2px rgba(0,0,0,.05)); 15 | } 16 | .pagination li { 17 | display: inline; 18 | } 19 | .pagination a { 20 | float: left; 21 | padding: 0 14px; 22 | line-height: (@baseLineHeight * 2) - 2; 23 | text-decoration: none; 24 | border: 1px solid #ddd; 25 | border-left-width: 0; 26 | } 27 | .pagination a:hover, 28 | .pagination .active a { 29 | background-color: #f5f5f5; 30 | } 31 | .pagination .active a { 32 | color: @grayLight; 33 | cursor: default; 34 | } 35 | .pagination .disabled span, 36 | .pagination .disabled a, 37 | .pagination .disabled a:hover { 38 | color: @grayLight; 39 | background-color: transparent; 40 | cursor: default; 41 | } 42 | .pagination li:first-child a { 43 | border-left-width: 1px; 44 | .border-radius(3px 0 0 3px); 45 | } 46 | .pagination li:last-child a { 47 | .border-radius(0 3px 3px 0); 48 | } 49 | 50 | // Centered 51 | .pagination-centered { 52 | text-align: center; 53 | } 54 | .pagination-right { 55 | text-align: right; 56 | } 57 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/alerts.less: -------------------------------------------------------------------------------- 1 | // ALERT STYLES 2 | // ------------ 3 | 4 | // Base alert styles 5 | .alert { 6 | padding: 8px 35px 8px 14px; 7 | margin-bottom: @baseLineHeight; 8 | text-shadow: 0 1px 0 rgba(255,255,255,.5); 9 | background-color: @warningBackground; 10 | border: 1px solid @warningBorder; 11 | .border-radius(4px); 12 | color: @warningText; 13 | } 14 | .alert-heading { 15 | color: inherit; 16 | } 17 | 18 | // Adjust close link position 19 | .alert .close { 20 | position: relative; 21 | top: -2px; 22 | right: -21px; 23 | line-height: 18px; 24 | } 25 | 26 | // Alternate styles 27 | // ---------------- 28 | 29 | .alert-success { 30 | background-color: @successBackground; 31 | border-color: @successBorder; 32 | color: @successText; 33 | } 34 | .alert-danger, 35 | .alert-error { 36 | background-color: @errorBackground; 37 | border-color: @errorBorder; 38 | color: @errorText; 39 | } 40 | .alert-info { 41 | background-color: @infoBackground; 42 | border-color: @infoBorder; 43 | color: @infoText; 44 | } 45 | 46 | // Block alerts 47 | // ------------------------ 48 | .alert-block { 49 | padding-top: 14px; 50 | padding-bottom: 14px; 51 | } 52 | .alert-block > p, 53 | .alert-block > ul { 54 | margin-bottom: 0; 55 | } 56 | .alert-block p + p { 57 | margin-top: 5px; 58 | } 59 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/popovers.less: -------------------------------------------------------------------------------- 1 | // POPOVERS 2 | // -------- 3 | 4 | .popover { 5 | position: absolute; 6 | top: 0; 7 | left: 0; 8 | z-index: @zindexPopover; 9 | display: none; 10 | padding: 5px; 11 | &.top { margin-top: -5px; } 12 | &.right { margin-left: 5px; } 13 | &.bottom { margin-top: 5px; } 14 | &.left { margin-left: -5px; } 15 | &.top .arrow { #popoverArrow > .top(); } 16 | &.right .arrow { #popoverArrow > .right(); } 17 | &.bottom .arrow { #popoverArrow > .bottom(); } 18 | &.left .arrow { #popoverArrow > .left(); } 19 | .arrow { 20 | position: absolute; 21 | width: 0; 22 | height: 0; 23 | } 24 | } 25 | .popover-inner { 26 | padding: 3px; 27 | width: 280px; 28 | overflow: hidden; 29 | background: @black; // has to be full background declaration for IE fallback 30 | background: rgba(0,0,0,.8); 31 | .border-radius(6px); 32 | .box-shadow(0 3px 7px rgba(0,0,0,0.3)); 33 | } 34 | .popover-title { 35 | padding: 9px 15px; 36 | line-height: 1; 37 | background-color: #f5f5f5; 38 | border-bottom:1px solid #eee; 39 | .border-radius(3px 3px 0 0); 40 | } 41 | .popover-content { 42 | padding: 14px; 43 | background-color: @white; 44 | .border-radius(0 0 3px 3px); 45 | .background-clip(padding-box); 46 | p, ul, ol { 47 | margin-bottom: 0; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v2.0.4 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | 11 | // CSS Reset 12 | @import "reset.less"; 13 | 14 | // Core variables and mixins 15 | @import "variables.less"; // Modify this for custom colors, font-sizes, etc 16 | @import "mixins.less"; 17 | 18 | // Grid system and page structure 19 | @import "scaffolding.less"; 20 | @import "grid.less"; 21 | @import "layouts.less"; 22 | 23 | // Base CSS 24 | @import "type.less"; 25 | @import "forms.less"; 26 | @import "tables.less"; 27 | 28 | // Components: common 29 | @import "sprites.less"; 30 | @import "wells.less"; 31 | @import "component-animations.less"; 32 | @import "close.less"; 33 | 34 | // Components: Buttons & Alerts 35 | @import "buttons.less"; 36 | @import "button-groups.less"; 37 | @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less 38 | 39 | // Components: Misc 40 | @import "labels-badges.less"; 41 | @import "hero-unit.less"; 42 | @import "modals.less"; 43 | 44 | 45 | // Utility classes 46 | @import "utilities.less"; // Has to be last to override when necessary 47 | 48 | // Fedora Components 49 | @import "fedora-variables.less"; 50 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import setup, find_packages 4 | 5 | here = os.path.abspath(os.path.dirname(__file__)) 6 | README = open(os.path.join(here, 'README.rst')).read() 7 | 8 | requires = [ 9 | 'pyramid', 10 | 'SQLAlchemy', 11 | 'transaction', 12 | 'pyramid_debugtoolbar', 13 | 'waitress', 14 | 'kitchen', 15 | 'python-fedora', 16 | 'bunch', 17 | 'pyramid_mailer', 18 | 'pyramid_beaker', 19 | 'webhelpers', 20 | ] 21 | 22 | setup(name='FedoraSummerOfHardware', 23 | version='0.0', 24 | description='FedoraSummerOfHardware', 25 | long_description=README + '\n\n', 26 | classifiers=[ 27 | "Programming Language :: Python", 28 | "Framework :: Pylons", 29 | "Topic :: Internet :: WWW/HTTP", 30 | "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", 31 | ], 32 | author='', 33 | author_email='', 34 | license='AGPLv3', 35 | url='', 36 | keywords='web wsgi bfg pylons pyramid', 37 | packages=find_packages(), 38 | include_package_data=True, 39 | zip_safe=False, 40 | test_suite='fedorasummerofhardware', 41 | install_requires=requires, 42 | entry_points="""\ 43 | [paste.app_factory] 44 | main = fedorasummerofhardware:main 45 | [console_scripts] 46 | initialize_FedoraSummerOfHardware_db = fedorasummerofhardware.scripts.initializedb:main 47 | """, 48 | ) 49 | -------------------------------------------------------------------------------- /fedorasummerofhardware/static/less/code.less: -------------------------------------------------------------------------------- 1 | // Code.less 2 | // Code typography styles for the and
 elements
 3 | // --------------------------------------------------------
 4 | 
 5 | // Inline and block code styles
 6 | code,
 7 | pre {
 8 |   padding: 0 3px 2px;
 9 |   #font > #family > .monospace;
10 |   font-size: @baseFontSize - 1;
11 |   color: @grayDark;
12 |   .border-radius(3px);
13 | }
14 | 
15 | // Inline code
16 | code {
17 |   padding: 2px 4px;
18 |   color: #d14;
19 |   background-color: #f7f7f9;
20 |   border: 1px solid #e1e1e8;
21 | }
22 | 
23 | // Blocks of code
24 | pre {
25 |   display: block;
26 |   padding: (@baseLineHeight - 1) / 2;
27 |   margin: 0 0 @baseLineHeight / 2;
28 |   font-size: @baseFontSize * .925; // 13px to 12px
29 |   line-height: @baseLineHeight;
30 |   word-break: break-all;
31 |   word-wrap: break-word;
32 |   white-space: pre;
33 |   white-space: pre-wrap;
34 |   background-color: #f5f5f5;
35 |   border: 1px solid #ccc; // fallback for IE7-8
36 |   border: 1px solid rgba(0,0,0,.15);
37 |   .border-radius(4px);
38 | 
39 |   // Make prettyprint styles more spaced out for readability
40 |   &.prettyprint {
41 |     margin-bottom: @baseLineHeight;
42 |   }
43 | 
44 |   // Account for some code outputs that place code tags in pre tags
45 |   code {
46 |     padding: 0;
47 |     color: inherit;
48 |     background-color: transparent;
49 |     border: 0;
50 |   }
51 | }
52 | 
53 | // Enable scrollable blocks of code
54 | .pre-scrollable {
55 |   max-height: 340px;
56 |   overflow-y: scroll;
57 | }


--------------------------------------------------------------------------------
/fedorasummerofhardware/models.py:
--------------------------------------------------------------------------------
 1 | # Copyright (C) 2012 Red Hat, Inc.
 2 | #
 3 | # This program is free software: you can redistribute it and/or modify
 4 | # it under the terms of the GNU Affero General Public License as
 5 | # published by the Free Software Foundation, either version 3 of the
 6 | # License, or (at your option) any later version.
 7 | #
 8 | # This program is distributed in the hope that it will be useful,
 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 | # GNU Affero General Public License for more details.
12 | #
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program.  If not, see .
15 | 
16 | from datetime import datetime
17 | from sqlalchemy import Column, DateTime, Integer, Text, Boolean, Date
18 | from sqlalchemy.ext.declarative import declarative_base
19 | from sqlalchemy.orm import scoped_session, sessionmaker
20 | 
21 | DBSession = scoped_session(sessionmaker())
22 | Base = declarative_base()
23 | 
24 | class Application(Base):
25 |     __tablename__ = 'applications'
26 |     id = Column(Integer, primary_key=True)
27 |     realname = Column(Text)
28 |     username = Column(Text, unique=True)
29 |     country = Column(Text)
30 |     state = Column(Text)
31 |     hardware = Column(Text)
32 |     shield = Column(Text)
33 |     date = Column(DateTime, default=datetime.now)
34 |     text = Column(Text)
35 |     approved = Column(Boolean, default=False)
36 |     address = Column(Text)
37 |     phone = Column(Text)
38 | 
39 |     def __repr__(self):
40 |         return "" % (self.username, self.hardware)
41 | 


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/less/labels-badges.less:
--------------------------------------------------------------------------------
 1 | // LABELS & BADGES
 2 | // ---------------
 3 | 
 4 | // Base classes
 5 | .label,
 6 | .badge {
 7 |   font-size: @baseFontSize * .846;
 8 |   font-weight: bold;
 9 |   line-height: 14px; // ensure proper line-height if floated
10 |   color: @white;
11 |   vertical-align: baseline;
12 |   white-space: nowrap;
13 |   text-shadow: 0 -1px 0 rgba(0,0,0,.25);
14 |   background-color: @grayLight;
15 | }
16 | // Set unique padding and border-radii
17 | .label {
18 |   padding: 1px 4px 2px;
19 |   .border-radius(3px);
20 | }
21 | .badge {
22 |   padding: 1px 9px 2px;
23 |   .border-radius(9px);
24 | }
25 | 
26 | // Hover state, but only for links
27 | a {
28 |   &.label:hover,
29 |   &.badge:hover {
30 |     color: @white;
31 |     text-decoration: none;
32 |     cursor: pointer;
33 |   }
34 | }
35 | 
36 | // Colors
37 | // Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute)
38 | .label,
39 | .badge {
40 |   // Important (red)
41 |   &-important         { background-color: @errorText; }
42 |   &-important[href]   { background-color: darken(@errorText, 10%); }
43 |   // Warnings (orange)
44 |   &-warning           { background-color: @orange; }
45 |   &-warning[href]     { background-color: darken(@orange, 10%); }
46 |   // Success (green)
47 |   &-success           { background-color: @successText; }
48 |   &-success[href]     { background-color: darken(@successText, 10%); }
49 |   // Info (turquoise)
50 |   &-info              { background-color: @infoText; }
51 |   &-info[href]        { background-color: darken(@infoText, 10%); }
52 |   // Inverse (black)
53 |   &-inverse           { background-color: @grayDark; }
54 |   &-inverse[href]     { background-color: darken(@grayDark, 10%); }
55 | }
56 | 


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/js/bootstrap-scrollspy.min.js:
--------------------------------------------------------------------------------
1 | !function(b){function a(f,e){var g=b.proxy(this.process,this),c=b(f).is("body")?b(window):b(f),d;this.options=b.extend({},b.fn.scrollspy.defaults,e);this.$scrollElement=c.on("scroll.scroll.data-api",g);this.selector=(this.options.target||((d=b(f).attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""))||"")+" .nav li > a";this.$body=b("body");this.refresh();this.process()}a.prototype={constructor:a,refresh:function(){var c=this,d;this.offsets=b([]);this.targets=b([]);d=this.$body.find(this.selector).map(function(){var f=b(this),e=f.data("target")||f.attr("href"),g=/^#\w/.test(e)&&b(e);return(g&&e.length&&[[g.position().top,e]])||null}).sort(function(f,e){return f[0]-e[0]}).each(function(){c.offsets.push(this[0]);c.targets.push(this[1])})},process:function(){var h=this.$scrollElement.scrollTop()+this.options.offset,e=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,g=e-this.$scrollElement.height(),f=this.offsets,c=this.targets,j=this.activeTarget,d;if(h>=g){return j!=(d=c.last()[0])&&this.activate(d)}for(d=f.length;d--;){j!=c[d]&&h>=f[d]&&(!f[d+1]||h<=f[d+1])&&this.activate(c[d])}},activate:function(e){var d,c;this.activeTarget=e;b(this.selector).parent(".active").removeClass("active");c=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]';d=b(c).parent("li").addClass("active");if(d.parent(".dropdown-menu")){d=d.closest("li.dropdown").addClass("active")}d.trigger("activate")}};b.fn.scrollspy=function(c){return this.each(function(){var f=b(this),e=f.data("scrollspy"),d=typeof c=="object"&&c;if(!e){f.data("scrollspy",(e=new a(this,d)))}if(typeof c=="string"){e[c]()}})};b.fn.scrollspy.Constructor=a;b.fn.scrollspy.defaults={offset:10};b(function(){b('[data-spy="scroll"]').each(function(){var c=b(this);c.scrollspy(c.data())})})}(window.jQuery);


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/js/charCount.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * 	Character Count Plugin - jQuery plugin
 3 |  * 	Dynamic character count for text areas and input fields
 4 |  *	written by Alen Grakalic	
 5 |  *	http://cssglobe.com/post/7161/jquery-plugin-simplest-twitterlike-dynamic-character-count-for-textareas
 6 |  *
 7 |  *	Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
 8 |  *	Dual licensed under the MIT (MIT-LICENSE.txt)
 9 |  *	and GPL (GPL-LICENSE.txt) licenses.
10 |  *
11 |  *	Built for jQuery library
12 |  *	http://jquery.com
13 |  *
14 |  */
15 |  
16 | (function($) {
17 | 
18 | 	$.fn.charCount = function(options){
19 | 	  
20 | 		// default configuration properties
21 | 		var defaults = {	
22 | 			allowed: 140,		
23 | 			warning: 25,
24 | 			css: 'counter',
25 | 			counterElement: 'span',
26 | 			cssWarning: 'warning',
27 | 			cssExceeded: 'exceeded',
28 | 			counterText: ''
29 | 		}; 
30 | 			
31 | 		var options = $.extend(defaults, options); 
32 | 		
33 | 		function calculate(obj){
34 | 			var count = $(obj).val().length;
35 | 			var available = options.allowed - count;
36 | 			if(available <= options.warning && available >= 0){
37 | 				$(obj).next().addClass(options.cssWarning);
38 | 			} else {
39 | 				$(obj).next().removeClass(options.cssWarning);
40 | 			}
41 | 			if(available < 0){
42 | 				$(obj).next().addClass(options.cssExceeded);
43 | 			} else {
44 | 				$(obj).next().removeClass(options.cssExceeded);
45 | 			}
46 | 			$(obj).next().html(options.counterText + available);
47 | 		};
48 | 				
49 | 		this.each(function() {  			
50 | 			$(this).after('<'+ options.counterElement +' class="' + options.css + '">'+ options.counterText +'');
51 | 			calculate(this);
52 | 			$(this).keyup(function(){calculate(this)});
53 | 			$(this).change(function(){calculate(this)});
54 | 		});
55 | 	  
56 | 	};
57 | 
58 | })(jQuery);
59 | 


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/js/bootstrap-collapse.min.js:
--------------------------------------------------------------------------------
1 | !function(a){var b=function(d,c){this.$element=a(d);this.options=a.extend({},a.fn.collapse.defaults,c);if(this.options.parent){this.$parent=a(this.options.parent)}this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var c=this.$element.hasClass("width");return c?"width":"height"},show:function(){var f,c,e,d;if(this.transitioning){return}f=this.dimension();c=a.camelCase(["scroll",f].join("-"));e=this.$parent&&this.$parent.find("> .accordion-group > .in");if(e&&e.length){d=e.data("collapse");if(d&&d.transitioning){return}e.collapse("hide");d||e.data("collapse",null)}this.$element[f](0);this.transition("addClass",a.Event("show"),"shown");this.$element[f](this.$element[0][c])},hide:function(){var c;if(this.transitioning){return}c=this.dimension();this.reset(this.$element[c]());this.transition("removeClass",a.Event("hide"),"hidden");this.$element[c](0)},reset:function(c){var d=this.dimension();this.$element.removeClass("collapse")[d](c||"auto")[0].offsetWidth;this.$element[c!==null?"addClass":"removeClass"]("collapse");return this},transition:function(g,d,e){var f=this,c=function(){if(d.type=="show"){f.reset()}f.transitioning=0;f.$element.trigger(e)};this.$element.trigger(d);if(d.isDefaultPrevented()){return}this.transitioning=1;this.$element[g]("in");a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,c):c()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};a.fn.collapse=function(c){return this.each(function(){var f=a(this),e=f.data("collapse"),d=typeof c=="object"&&c;if(!e){f.data("collapse",(e=new b(this,d)))}if(typeof c=="string"){e[c]()}})};a.fn.collapse.defaults={toggle:true};a.fn.collapse.Constructor=b;a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(h){var g=a(this),c,f=g.attr("data-target")||h.preventDefault()||(c=g.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),d=a(f).data("collapse")?"toggle":g.data();a(f).collapse(d)})})}(window.jQuery);


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/js/bootstrap-transition.js:
--------------------------------------------------------------------------------
 1 | /* ===================================================
 2 |  * bootstrap-transition.js v2.0.4
 3 |  * http://twitter.github.com/bootstrap/javascript.html#transitions
 4 |  * ===================================================
 5 |  * Copyright 2012 Twitter, Inc.
 6 |  *
 7 |  * Licensed under the Apache License, Version 2.0 (the "License");
 8 |  * you may not use this file except in compliance with the License.
 9 |  * You may obtain a copy of the License at
10 |  *
11 |  * http://www.apache.org/licenses/LICENSE-2.0
12 |  *
13 |  * Unless required by applicable law or agreed to in writing, software
14 |  * distributed under the License is distributed on an "AS IS" BASIS,
15 |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 |  * See the License for the specific language governing permissions and
17 |  * limitations under the License.
18 |  * ========================================================== */
19 | 
20 | 
21 | !function ($) {
22 | 
23 |   $(function () {
24 | 
25 |     "use strict"; // jshint ;_;
26 | 
27 | 
28 |     /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29 |      * ======================================================= */
30 | 
31 |     $.support.transition = (function () {
32 | 
33 |       var transitionEnd = (function () {
34 | 
35 |         var el = document.createElement('bootstrap')
36 |           , transEndEventNames = {
37 |                'WebkitTransition' : 'webkitTransitionEnd'
38 |             ,  'MozTransition'    : 'transitionend'
39 |             ,  'OTransition'      : 'oTransitionEnd'
40 |             ,  'msTransition'     : 'MSTransitionEnd'
41 |             ,  'transition'       : 'transitionend'
42 |             }
43 |           , name
44 | 
45 |         for (name in transEndEventNames){
46 |           if (el.style[name] !== undefined) {
47 |             return transEndEventNames[name]
48 |           }
49 |         }
50 | 
51 |       }())
52 | 
53 |       return transitionEnd && {
54 |         end: transitionEnd
55 |       }
56 | 
57 |     })()
58 | 
59 |   })
60 | 
61 | }(window.jQuery);


--------------------------------------------------------------------------------
/development.ini:
--------------------------------------------------------------------------------
 1 | [app:main]
 2 | use = egg:FedoraSummerOfHardware
 3 | 
 4 | pyramid.reload_templates = true
 5 | pyramid.debug_authorization = false
 6 | pyramid.debug_notfound = false
 7 | pyramid.debug_routematch = false
 8 | pyramid.default_locale_name = en
 9 | pyramid.includes =
10 |     pyramid_debugtoolbar
11 | 
12 | sqlalchemy.url = sqlite:///%(here)s/FedoraSummerOfHardware.db
13 | 
14 | accept_applications = False
15 | start_date = 2012-07-25
16 | stop_date = 2012-08-16
17 | 
18 | admin_usernames = lmacken spot duffy
19 | admin_email = lmacken@redhat.com
20 | email_from = openhw2012-members@fedoraproject.org
21 | email_subject = Your Fedora Summer of Open Hardware 2012 Application
22 | email_body = Congratulations, your Fedora Summer of Open Hardware application has been tentatively accepted. Please go to the following URL and enter your mailing address so we can send you your hardware: %sAs long as your mailing address isn't outside of the list of regions eligible for this drawing (%s), you should be receiving your hardware within the next %s weeks. We'll let you know if any issues crop up with your application when we do a final check on it.
23 | 
24 | est_shipping = 6-10
25 | 
26 | exclude_states = NY FL
27 | prohibited_users = redhat.com
28 | 
29 | hardware = raspberrypi arduino olpc
30 | num_raspberrypi = 150
31 | num_olpc = 50
32 | num_arduino = 20
33 | 
34 | authtkt.secret = CHANGEMEINPRODUCTION!!!1
35 | 
36 | [server:main]
37 | use = egg:waitress#main
38 | host = 0.0.0.0
39 | port = 6543
40 | 
41 | # Begin logging configuration
42 | 
43 | [loggers]
44 | keys = root, fedorasummerofhardware, sqlalchemy
45 | 
46 | [handlers]
47 | keys = console
48 | 
49 | [formatters]
50 | keys = generic
51 | 
52 | [logger_root]
53 | level = INFO
54 | handlers = console
55 | 
56 | [logger_fedorasummerofhardware]
57 | level = DEBUG
58 | handlers =
59 | qualname = fedorasummerofhardware
60 | 
61 | [logger_sqlalchemy]
62 | level = INFO
63 | handlers =
64 | qualname = sqlalchemy.engine
65 | # "level = INFO" logs SQL queries.
66 | # "level = DEBUG" logs SQL queries and results.
67 | # "level = WARN" logs neither.  (Recommended for production systems.)
68 | 
69 | [handler_console]
70 | class = StreamHandler
71 | args = (sys.stderr,)
72 | level = NOTSET
73 | formatter = generic
74 | 
75 | [formatter_generic]
76 | format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
77 | 
78 | # End logging configuration
79 | 


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/less/modals.less:
--------------------------------------------------------------------------------
 1 | // MODALS
 2 | // ------
 3 | 
 4 | // Recalculate z-index where appropriate
 5 | .modal-open {
 6 |   .dropdown-menu {  z-index: @zindexDropdown + @zindexModal; }
 7 |   .dropdown.open { *z-index: @zindexDropdown + @zindexModal; }
 8 |   .popover       {  z-index: @zindexPopover  + @zindexModal; }
 9 |   .tooltip       {  z-index: @zindexTooltip  + @zindexModal; }
10 | }
11 | 
12 | // Background
13 | .modal-backdrop {
14 |   position: fixed;
15 |   top: 0;
16 |   right: 0;
17 |   bottom: 0;
18 |   left: 0;
19 |   z-index: @zindexModalBackdrop;
20 |   background-color: @black;
21 |   // Fade for backdrop
22 |   &.fade { opacity: 0; }
23 | }
24 | 
25 | .modal-backdrop,
26 | .modal-backdrop.fade.in {
27 |   .opacity(80);
28 | }
29 | 
30 | // Base modal
31 | .modal {
32 |   position: fixed;
33 |   top: 50%;
34 |   left: 50%;
35 |   z-index: @zindexModal;
36 |   overflow: auto;
37 |   width: 560px;
38 |   margin: -250px 0 0 -280px;
39 |   background-color: @white;
40 |   border: 1px solid #999;
41 |   border: 1px solid rgba(0,0,0,.3);
42 |   *border: 1px solid #999; /* IE6-7 */
43 |   .border-radius(6px);
44 |   .box-shadow(0 3px 7px rgba(0,0,0,0.3));
45 |   .background-clip(padding-box);
46 |   &.fade {
47 |     .transition(e('opacity .3s linear, top .3s ease-out'));
48 |     top: -25%;
49 |   }
50 |   &.fade.in { top: 50%; }
51 | }
52 | .modal-header {
53 |   padding: 9px 15px;
54 |   border-bottom: 1px solid #eee;
55 |   // Close icon
56 |   .close { margin-top: 2px; }
57 | }
58 | 
59 | // Body (where all modal content resides)
60 | .modal-body {
61 |   overflow-y: auto;
62 |   max-height: 400px;
63 |   padding: 15px;
64 | }
65 | // Remove bottom margin if need be
66 | .modal-form {
67 |   margin-bottom: 0;
68 | }
69 | 
70 | // Footer (for actions)
71 | .modal-footer {
72 |   padding: 14px 15px 15px;
73 |   margin-bottom: 0;
74 |   text-align: right; // right align buttons
75 |   background-color: #f5f5f5;
76 |   border-top: 1px solid #ddd;
77 |   .border-radius(0 0 6px 6px);
78 |   .box-shadow(inset 0 1px 0 @white);
79 |   .clearfix(); // clear it in case folks use .pull-* classes on buttons
80 | 
81 |   // Properly space out buttons
82 |   .btn + .btn {
83 |     margin-left: 5px;
84 |     margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
85 |   }
86 |   // but override that for button groups
87 |   .btn-group .btn + .btn {
88 |     margin-left: -1px;
89 |   }
90 | }
91 | 


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/js/bootstrap-carousel.min.js:
--------------------------------------------------------------------------------
1 | !function(a){var b=function(d,c){this.$element=a(d);this.options=c;this.options.slide&&this.slide(this.options.slide);this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(c){if(!c){this.paused=false}this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval));return this},to:function(g){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(g>(d.length-1)||g<0){return}if(this.sliding){return this.$element.one("slid",function(){f.to(g)})}if(e==g){return this.pause().cycle()}return this.slide(g>e?"next":"prev",a(d[g]))},pause:function(c){if(!c){this.paused=true}clearInterval(this.interval);this.interval=null;return this},next:function(){if(this.sliding){return}return this.slide("next")},prev:function(){if(this.sliding){return}return this.slide("prev")},slide:function(j,d){var l=this.$element.find(".active"),c=d||l[j](),i=this.interval,k=j=="next"?"left":"right",f=j=="next"?"first":"last",g=this,h=a.Event("slide");this.sliding=true;i&&this.pause();c=c.length?c:this.$element.find(".item")[f]();if(c.hasClass("active")){return}if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(h);if(h.isDefaultPrevented()){return}c.addClass(j);c[0].offsetWidth;l.addClass(k);c.addClass(k);this.$element.one(a.support.transition.end,function(){c.removeClass([j,k].join(" ")).addClass("active");l.removeClass(["active",k].join(" "));g.sliding=false;setTimeout(function(){g.$element.trigger("slid")},0)})}else{this.$element.trigger(h);if(h.isDefaultPrevented()){return}l.removeClass("active");c.addClass("active");this.sliding=false;this.$element.trigger("slid")}i&&this.cycle();return this}};a.fn.carousel=function(c){return this.each(function(){var f=a(this),e=f.data("carousel"),d=a.extend({},a.fn.carousel.defaults,typeof c=="object"&&c);if(!e){f.data("carousel",(e=new b(this,d)))}if(typeof c=="number"){e.to(c)}else{if(typeof c=="string"||(c=d.slide)){e[c]()}else{if(d.interval){e.cycle()}}}})};a.fn.carousel.defaults={interval:5000,pause:"hover"};a.fn.carousel.Constructor=b;a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(h){var g=a(this),d,c=a(g.attr("data-target")||(d=g.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!c.data("modal")&&a.extend({},c.data(),g.data());c.carousel(f);h.preventDefault()})})}(window.jQuery);


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/less/carousel.less:
--------------------------------------------------------------------------------
  1 | // CAROUSEL
  2 | // --------
  3 | 
  4 | .carousel {
  5 |   position: relative;
  6 |   margin-bottom: @baseLineHeight;
  7 |   line-height: 1;
  8 | }
  9 | 
 10 | .carousel-inner {
 11 |   overflow: hidden;
 12 |   width: 100%;
 13 |   position: relative;
 14 | }
 15 | 
 16 | .carousel {
 17 | 
 18 |   .item {
 19 |     display: none;
 20 |     position: relative;
 21 |     .transition(.6s ease-in-out left);
 22 |   }
 23 | 
 24 |   // Account for jankitude on images
 25 |   .item > img {
 26 |     display: block;
 27 |     line-height: 1;
 28 |   }
 29 | 
 30 |   .active,
 31 |   .next,
 32 |   .prev { display: block; }
 33 | 
 34 |   .active {
 35 |     left: 0;
 36 |   }
 37 | 
 38 |   .next,
 39 |   .prev {
 40 |     position: absolute;
 41 |     top: 0;
 42 |     width: 100%;
 43 |   }
 44 | 
 45 |   .next {
 46 |     left: 100%;
 47 |   }
 48 |   .prev {
 49 |     left: -100%;
 50 |   }
 51 |   .next.left,
 52 |   .prev.right {
 53 |     left: 0;
 54 |   }
 55 | 
 56 |   .active.left {
 57 |     left: -100%;
 58 |   }
 59 |   .active.right {
 60 |     left: 100%;
 61 |   }
 62 | 
 63 | }
 64 | 
 65 | // Left/right controls for nav
 66 | // ---------------------------
 67 | 
 68 | .carousel-control {
 69 |   position: absolute;
 70 |   top: 40%;
 71 |   left: 15px;
 72 |   width: 40px;
 73 |   height: 40px;
 74 |   margin-top: -20px;
 75 |   font-size: 60px;
 76 |   font-weight: 100;
 77 |   line-height: 30px;
 78 |   color: @white;
 79 |   text-align: center;
 80 |   background: @grayDarker;
 81 |   border: 3px solid @white;
 82 |   .border-radius(23px);
 83 |   .opacity(50);
 84 | 
 85 |   // we can't have this transition here
 86 |   // because webkit cancels the carousel
 87 |   // animation if you trip this while
 88 |   // in the middle of another animation
 89 |   // ;_;
 90 |   // .transition(opacity .2s linear);
 91 | 
 92 |   // Reposition the right one
 93 |   &.right {
 94 |     left: auto;
 95 |     right: 15px;
 96 |   }
 97 | 
 98 |   // Hover state
 99 |   &:hover {
100 |     color: @white;
101 |     text-decoration: none;
102 |     .opacity(90);
103 |   }
104 | }
105 | 
106 | // Caption for text below images
107 | // -----------------------------
108 | 
109 | .carousel-caption {
110 |   position: absolute;
111 |   left: 0;
112 |   right: 0;
113 |   bottom: 0;
114 |   padding: 10px 15px 5px;
115 |   background: @grayDark;
116 |   background: rgba(0,0,0,.75);
117 | }
118 | .carousel-caption h4,
119 | .carousel-caption p {
120 |   color: @white;
121 | }
122 | 


--------------------------------------------------------------------------------
/fedorasummerofhardware/__init__.py:
--------------------------------------------------------------------------------
 1 | # Copyright (C) 2012 Red Hat, Inc.
 2 | #
 3 | # This program is free software: you can redistribute it and/or modify
 4 | # it under the terms of the GNU Affero General Public License as
 5 | # published by the Free Software Foundation, either version 3 of the
 6 | # License, or (at your option) any later version.
 7 | #
 8 | # This program is distributed in the hope that it will be useful,
 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 | # GNU Affero General Public License for more details.
12 | #
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program.  If not, see .
15 | 
16 | from pyramid.authentication import AuthTktAuthenticationPolicy
17 | from pyramid.authorization import ACLAuthorizationPolicy
18 | from pyramid.exceptions import Forbidden
19 | from pyramid.config import Configurator
20 | from pyramid_beaker import session_factory_from_settings
21 | from pyramid_beaker import set_cache_regions_from_settings
22 | from sqlalchemy import engine_from_config
23 | 
24 | from .models import DBSession
25 | 
26 | def main(global_config, **settings):
27 |     """ This function returns a Pyramid WSGI application. """
28 |     engine = engine_from_config(settings, 'sqlalchemy.')
29 |     DBSession.configure(bind=engine)
30 |     session_factory = session_factory_from_settings(settings)
31 |     set_cache_regions_from_settings(settings)
32 |     config = Configurator(settings=settings, session_factory=session_factory)
33 |     config.set_authentication_policy(AuthTktAuthenticationPolicy(
34 |             settings['authtkt.secret']))
35 |     config.set_authorization_policy(ACLAuthorizationPolicy())
36 |     config.add_static_view('static', 'static', cache_max_age=3600)
37 |     config.add_route('home', '/')
38 |     config.add_route('submit', '/submit')
39 |     config.add_route('details', '/details')
40 |     config.add_route('admin', '/admin')
41 |     config.add_route('csv', '/csv')
42 |     config.add_route('approve', '/approve')
43 |     config.add_route('accept', '/accept')
44 |     config.add_route('save_address', '/save_address')
45 |     config.include('pyramid_mailer')
46 |     config.add_route('login', '/login')
47 |     config.add_route('logout', '/logout')
48 |     config.add_view('fedorasummerofhardware.views.login_view',
49 |                     renderer='fedorasummerofhardware:templates/login.mak',
50 |                     context=Forbidden)
51 |     config.scan()
52 |     return config.make_wsgi_app()
53 | 


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/js/bootstrap-alert.js:
--------------------------------------------------------------------------------
 1 | /* ==========================================================
 2 |  * bootstrap-alert.js v2.0.4
 3 |  * http://twitter.github.com/bootstrap/javascript.html#alerts
 4 |  * ==========================================================
 5 |  * Copyright 2012 Twitter, Inc.
 6 |  *
 7 |  * Licensed under the Apache License, Version 2.0 (the "License");
 8 |  * you may not use this file except in compliance with the License.
 9 |  * You may obtain a copy of the License at
10 |  *
11 |  * http://www.apache.org/licenses/LICENSE-2.0
12 |  *
13 |  * Unless required by applicable law or agreed to in writing, software
14 |  * distributed under the License is distributed on an "AS IS" BASIS,
15 |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 |  * See the License for the specific language governing permissions and
17 |  * limitations under the License.
18 |  * ========================================================== */
19 | 
20 | 
21 | !function ($) {
22 | 
23 |   "use strict"; // jshint ;_;
24 | 
25 | 
26 |  /* ALERT CLASS DEFINITION
27 |   * ====================== */
28 | 
29 |   var dismiss = '[data-dismiss="alert"]'
30 |     , Alert = function (el) {
31 |         $(el).on('click', dismiss, this.close)
32 |       }
33 | 
34 |   Alert.prototype.close = function (e) {
35 |     var $this = $(this)
36 |       , selector = $this.attr('data-target')
37 |       , $parent
38 | 
39 |     if (!selector) {
40 |       selector = $this.attr('href')
41 |       selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
42 |     }
43 | 
44 |     $parent = $(selector)
45 | 
46 |     e && e.preventDefault()
47 | 
48 |     $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
49 | 
50 |     $parent.trigger(e = $.Event('close'))
51 | 
52 |     if (e.isDefaultPrevented()) return
53 | 
54 |     $parent.removeClass('in')
55 | 
56 |     function removeElement() {
57 |       $parent
58 |         .trigger('closed')
59 |         .remove()
60 |     }
61 | 
62 |     $.support.transition && $parent.hasClass('fade') ?
63 |       $parent.on($.support.transition.end, removeElement) :
64 |       removeElement()
65 |   }
66 | 
67 | 
68 |  /* ALERT PLUGIN DEFINITION
69 |   * ======================= */
70 | 
71 |   $.fn.alert = function (option) {
72 |     return this.each(function () {
73 |       var $this = $(this)
74 |         , data = $this.data('alert')
75 |       if (!data) $this.data('alert', (data = new Alert(this)))
76 |       if (typeof option == 'string') data[option].call($this)
77 |     })
78 |   }
79 | 
80 |   $.fn.alert.Constructor = Alert
81 | 
82 | 
83 |  /* ALERT DATA-API
84 |   * ============== */
85 | 
86 |   $(function () {
87 |     $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
88 |   })
89 | 
90 | }(window.jQuery);


--------------------------------------------------------------------------------
/fedorasummerofhardware/static/js/bootstrap-modal.min.js:
--------------------------------------------------------------------------------
1 | !function(e){var a=function(i,h){this.options=h;this.$element=e(i).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this))};a.prototype={constructor:a,toggle:function(){return this[!this.isShown?"show":"hide"]()},show:function(){var h=this,i=e.Event("show");this.$element.trigger(i);if(this.isShown||i.isDefaultPrevented()){return}e("body").addClass("modal-open");this.isShown=true;d.call(this);c.call(this,function(){var j=e.support.transition&&h.$element.hasClass("fade");if(!h.$element.parent().length){h.$element.appendTo(document.body)}h.$element.show();if(j){h.$element[0].offsetWidth}h.$element.addClass("in");j?h.$element.one(e.support.transition.end,function(){h.$element.trigger("shown")}):h.$element.trigger("shown")})},hide:function(i){i&&i.preventDefault();var h=this;i=e.Event("hide");this.$element.trigger(i);if(!this.isShown||i.isDefaultPrevented()){return}this.isShown=false;e("body").removeClass("modal-open");d.call(this);this.$element.removeClass("in");e.support.transition&&this.$element.hasClass("fade")?g.call(this):f.call(this)}};function g(){var h=this,i=setTimeout(function(){h.$element.off(e.support.transition.end);f.call(h)},500);this.$element.one(e.support.transition.end,function(){clearTimeout(i);f.call(h)})}function f(h){this.$element.hide().trigger("hidden");c.call(this)}function c(k){var j=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var h=e.support.transition&&i;this.$backdrop=e('