├── .gitignore ├── README.md ├── assets ├── css │ └── bootstrap.min.css └── js │ └── bootstrap.min.js ├── config ├── config.go ├── config.yaml ├── config_remote_version.go └── viper.go ├── data.sql ├── go.mod ├── handler ├── ServeAssetsHandler.go ├── display_form_data.go ├── display_headers.go ├── display_url_params.go ├── index.go ├── index_template_view.go ├── order │ └── order.go ├── parse_json_request.go ├── password_hashing.go ├── read_cookie.go ├── remote_viper_config.go ├── user.go ├── user │ ├── init.go │ ├── login.go │ ├── logout.go │ └── secret.go ├── write_json_response.go └── ws │ ├── echo.go │ └── echo_display.go ├── logic ├── order.go ├── users.go └── users_test.go ├── main ├── main.go ├── middleware.go ├── middleware ├── access_log.go ├── http_method.go └── log.go ├── model └── dao │ ├── init.go │ ├── order.go │ ├── order_goods.go │ ├── order_test.go │ ├── table │ ├── base.go │ ├── order.go │ ├── order_goods.go │ └── user.go │ ├── user.go │ ├── user_mock_test.go │ └── user_test.go ├── router └── router.go ├── tmp └── log │ └── .gitignore ├── utils ├── vlog │ └── vlog.go └── zlog │ └── log.go └── views ├── content.gohtml ├── layout.gohtml ├── nav.gohtml └── websockets.html /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | go.sum 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Go Web 编程入门 2 | 3 | 这是我在公众号上更新的,《Go Web编程》系列教程文章的存档。教程对新手非常友好,从零开始用Go语言构建一个Web程序。我们通过用Go语言创建一个简易的Web框架来讲解Go语言在Web编程中经常涉及的功能及其实现,源码已经按照章节打成tag, 通过参考章节对应版本的源码一定会让你的学习过程更轻松,读者朋友们可以自己动手创建项目来练习这里教授的功能 4 | 源码,这样效果更好,如果自己的项目遇到卡壳儿的地方再去参考我提供的源码。 5 | 6 | 比如你想看第二章节节的代码,那么就可以在项目里使用 7 | ``` 8 | git checkout v0.2.0 9 | ``` 10 | 切换到这个章节对应的源码版本了。 11 | 12 | 13 | 学习中如果遇到了问题,欢迎在我的公众号文章中留言,这样能帮助到更多读者。 14 | 15 | 16 | 17 | ## 目录 18 | - [学习用Go语言自己实现Web服务器](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484112&idx=1&sn=79d0d3167d0d962fe41ec00cdafffbb0&chksm=fa80d347cdf75a51183182f14622af766538ca0c5335012e5e1cc50b100e78f2954fa3943770&token=708416499&lang=zh_CN#rd) 19 | - [五分钟用Docker快速搭建Go开发环境](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484127&idx=1&sn=f5286405728b2d4f657e16cfdb6f07cc&chksm=fa80d348cdf75a5e1f95fdfb3a0d703cee59d6560e5b377f3a0bfe6770ca7bf236eadb0a7e44&token=708416499&lang=zh_CN#rd) 20 | - [gorilla/mux 路由](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484172&idx=1&sn=6dc988c86c3572a8092bdc79feb8d4e8&chksm=fa80d29bcdf75b8d06fc56366352671131c06e1c299a4929a56d7f5ab7137d1e1aec213c5e40&token=1670923354&lang=zh_CN#rd) 21 | - [十分钟学会用Go编写Web中间件](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484180&idx=1&sn=b66497c5428c25577068f18132b2d59d&chksm=fa80d283cdf75b95cc49d08c56d0fa9b00c47d0457c894be3ca3ea02bd3c404cfb5312fa1d93&token=730660954&lang=zh_CN#rd) 22 | - [应用数据库](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484200&idx=1&sn=a6d41c6aa4b3e22eac313966fb7eac57&scene=19#wechat_redirect) 23 | - [应用ORM](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484212&idx=1&sn=fc64a905c8f32acab908cc7d3d848680&chksm=fa80d2a3cdf75bb5f47244145b965e9be3ee002270154f53a1c16802a375001cd7822490986d&token=386954690&lang=zh_CN#rd) 24 | - [深入学习如何解析HTTP请求](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484246&idx=1&sn=6de3644dcb1877a3e205745aaf9fed71&chksm=fa80d2c1cdf75bd78fbedbfc28931b213986bc861c757c8d0a1ad3efa088726a7e176bde2f61&token=1075978729&lang=zh_CN#rd) 25 | - [超详细的Go语言模板库应用指南](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484271&idx=1&sn=6dfef42f172b6a177fd372e619796991&chksm=fa80d2f8cdf75bee931b7516f41e0aa4ba48b38d41ecce1fec055c255aaa51a5a828f7450f4e&token=1975536642&lang=zh_CN#rd) 26 | - [使用Go语言创建静态文件服务器](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484278&idx=1&sn=488a0c0304237e15c53c74ebd7a8296a&chksm=fa80d2e1cdf75bf70efcf95f708bc54cf9564f1f22340754abef14ee0baf2a181d48230723c5&token=44329373&lang=zh_CN#rd) 27 | - [使用 SecureCookie确保Cookie的安全传输](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484287&idx=1&sn=54baf9ab1739b2001a2e1aec6d6a2d66&chksm=fa80d2e8cdf75bfe8110856f8719be79db94a7de96fe771b9d38ea1d9a93957e7122c5fce780&token=975323517&lang=zh_CN#rd) 28 | - [SecureCookie实现客户端Session管理](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484297&idx=1&sn=a1d647f0f3f2996a3dc1d06b9cfaaa9b&chksm=fa80d21ecdf75b089e0dc1d4a914688ef1e9c416366fd4562f7bff961c5ecdf6c4a5dfc71880&token=1228657490&lang=zh_CN#rd) 29 | - [使用Go语言创建WebSocket服务 30 | ](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484313&idx=1&sn=a5c096466a5dbf4ec83eab2ba5992d7f&chksm=fa80d20ecdf75b18476a010bde5c5707e2bd3915f4c3e4e4ad4159baa541bb921c571d1f898b&token=1667524815&lang=zh_CN#rd) 31 | 32 | - [关于如何收集,标准化和集中化处理Golang日志的一些建议 33 | ](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484320&idx=1&sn=d6c4b46c7e106ca14368c0772b8c803a&chksm=fa80d237cdf75b2194539edf548abad7aaba64b998d3abab6d441b15fdbbaf1eddd258c0c30e&token=1940467894&lang=zh_CN#rd) 34 | 35 | - [给自己写的服务器添加错误和访问日志](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484332&idx=1&sn=99a3af12669240b721312d935854d1e4&chksm=fa80d23bcdf75b2d722e0b6274a73a9e8533ce92da9a3b24aabbc1f0d8c45bddcf435ccc565a&token=618719182&lang=zh_CN#rd) 36 | 37 | - [Go Web编程--解析JSON请求和生成JSON响应](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484342&idx=1&sn=f2a66a72b8147009c50ade2ef8b7f054&chksm=fa80d221cdf75b3739932a357843d8b6cc44a3096c326fab9dc1e84bb59e61696911842ab444&token=916082054&lang=zh_CN#rd) 38 | 39 | - [应该使用哪种哈希算法保护用户密码](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484347&idx=1&sn=37cdaff84347e59586ced60f9c17b026&chksm=fa80d22ccdf75b3a21f38483bc611a318b0d4ab04011fc2dcbaa388965da3533872a3ab45c55&token=726137373&lang=zh_CN#rd) 40 | 41 | - [使用bcrpyt哈希用户密码](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247484352&idx=1&sn=30a070ec4aa61b98bcf4739348c6f111&chksm=fa80d257cdf75b41e51faa7f95712f6a2751659678ae487cd9868ad4de8f6b526011f0034529&token=923225651&lang=zh_CN#rd) 42 | - [整合 Zap 作为项目业务日志 Logger 组件](https://mp.weixin.qq.com/s?__biz=MzUzNTY5MzU2MA==&mid=2247493846&idx=1&sn=de3eee6b0d1a02bcd966ea07b7401c99&chksm=fa833941cdf4b057d45b7cbf2748abb1c1e79d0572b55705f868f35581c8d9ed3d9812f8e27e&token=471555695&lang=zh_CN#rd_) 43 | 44 | ## 公众号 45 | 46 | ![微信公众号:网管叨bi叨](https://github.com/kevinyan815/Learning_Laravel_Kernel/blob/master/images/WX20200119-143845%402x.png) 47 | -------------------------------------------------------------------------------- /assets/css/bootstrap.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} 6 | /*# sourceMappingURL=bootstrap.min.css.map */ -------------------------------------------------------------------------------- /assets/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/spf13/viper" 5 | "path" 6 | "runtime" 7 | "time" 8 | ) 9 | 10 | type databaseConfig struct { 11 | Type string `mapstructure:"type"` 12 | DSN string `mapstructure:"dsn"` 13 | MaxOpenConn int `mapstructure:"maxopen""` 14 | MaxIdleConn int `mapstructure:"maxidle"` 15 | MaxLifeTime time.Duration `mapstructure:"maxlifetime"` 16 | } 17 | 18 | type RedisConfig struct { 19 | Address string `mapstructure:"address"` 20 | Password string `mapstructure:"password"` 21 | DbNumber int `mapstructure:"dbnumber"` 22 | MaxActive int `mapstructure:"maxactive"` 23 | MaxIdle int `mapstructure:"maxidle"` 24 | } 25 | 26 | var Database *databaseConfig 27 | var Redis *RedisConfig 28 | 29 | func init() { 30 | // 获取当前文件的路径 31 | _, filename, _, _ := runtime.Caller(0) 32 | // 配置文件目录的路径 33 | configBaseDir := path.Dir(filename) 34 | vp := viper.New() 35 | vp.AddConfigPath(configBaseDir) 36 | // 产品级项目,可以设置成根据环境环境加载配置目录 37 | // env := os.Getenv("ENV") 38 | // vp.AddConfigPath(configBaseDir + env) 39 | // 不设置配置名的时候,则读取目录下的所有文件 40 | // vp.SetConfigName("config") 41 | // 指定只读取 yaml 型的配置文件 42 | vp.SetConfigType("yaml") 43 | err := vp.ReadInConfig() 44 | if err != nil { 45 | panic(err) 46 | } 47 | vp.UnmarshalKey("database", &Database) 48 | Database.MaxLifeTime *= time.Second 49 | // 此配置没有值,计划使用远程配置中心配置 50 | // 请看远程配置中心版本 config_remote_version.go 的代码 51 | vp.UnmarshalKey("redis", &Redis) 52 | } 53 | -------------------------------------------------------------------------------- /config/config.yaml: -------------------------------------------------------------------------------- 1 | database: 2 | type: mysql 3 | dsn: "root:superpass@tcp(localhost:30306)/go_web?charset=utf8&parseTime=True&loc=Local" 4 | maxopen: 100 5 | maxidle: 10 6 | maxlifetime: 300 7 | -------------------------------------------------------------------------------- /config/config_remote_version.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | /** 4 | * 如果使用远程配置中心,请用此源文件替换config.go 5 | * 注意:需要有ETCD 环境才可以使用 6 | */ 7 | 8 | //import ( 9 | // "example.com/http_demo/utils/zlog" 10 | // "github.com/spf13/viper" 11 | // _ "github.com/spf13/viper/remote" 12 | // "go.uber.org/zap" 13 | // "path" 14 | // "runtime" 15 | // "time" 16 | //) 17 | // 18 | //type databaseConfig struct { 19 | // Type string `mapstructure:"type"` 20 | // DSN string `mapstructure:"dsn"` 21 | // MaxOpenConn int `mapstructure:"maxopen""` 22 | // MaxIdleConn int `mapstructure:"maxidle"` 23 | // MaxLifeTime time.Duration `mapstructure:"maxlifetime"` 24 | //} 25 | // 26 | //type RedisConfig struct { 27 | // Address string `mapstructure:"address"` 28 | // Password string `mapstructure:"password"` 29 | // DbNumber int `mapstructure:"dbnumber"` 30 | // MaxActive int `mapstructure:"maxactive"` 31 | // MaxIdle int `mapstructure:"maxidle"` 32 | //} 33 | // 34 | //var Database *databaseConfig 35 | //var Redis *RedisConfig 36 | // 37 | //func init() { 38 | // // 获取当前文件的路径 39 | // _, filename, _, _ := runtime.Caller(0) 40 | // // 配置文件目录的路径 41 | // configBaseDir := path.Dir(filename) 42 | // vp := viper.New() 43 | // vp.AddConfigPath(configBaseDir) 44 | // // 本地配置文件可以和远程配置中心一起使用 45 | // viper.RemoteConfig = &RemoteConfig{} 46 | // err := vp.AddRemoteProvider("etcd", "http://127.0.0.1:32379", "root/config/viper-test/config") 47 | // if err != nil { 48 | // panic(err) 49 | // } 50 | // // 产品级项目,可以设置成根据环境环境加载配置目录 51 | // // env := os.Getenv("ENV") 52 | // // vp.AddConfigPath("config/" + env) 53 | // // 不设置配置名的时候,则读取目录下的所有文件 54 | // // vp.SetConfigName("config") 55 | // // 指定只读取 yaml 型的配置文件 56 | // vp.SetConfigType("yaml") 57 | // err = vp.ReadInConfig() 58 | // if err != nil { 59 | // panic(err) 60 | // } 61 | // err = vp.ReadRemoteConfig() 62 | // if err != nil { 63 | // panic(err) 64 | // } 65 | // vp.UnmarshalKey("database", &Database) 66 | // Database.MaxLifeTime *= time.Second 67 | // vp.UnmarshalKey("redis", &Redis) 68 | // 69 | // go watchRemoteConfig(vp) 70 | //} 71 | // 72 | //func watchRemoteConfig(vp *viper.Viper) { 73 | // for { 74 | // time.Sleep(5 * time.Second) 75 | // err := vp.WatchRemoteConfigOnChannel() 76 | // if err != nil { 77 | // zlog.Error("Read Config Server Error", zap.Error(err)) 78 | // return 79 | // } 80 | // // 监控远程配置的变更 81 | // vp.UnmarshalKey("redis", &Redis) 82 | // } 83 | //} 84 | -------------------------------------------------------------------------------- /config/viper.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "example.com/http_demo/utils/zlog" 7 | "github.com/spf13/viper" 8 | "go.etcd.io/etcd/client/v3" 9 | "go.uber.org/zap" 10 | "io" 11 | "time" 12 | ) 13 | 14 | type RemoteConfig struct { 15 | viper.RemoteProvider 16 | 17 | Username string 18 | Password string 19 | } 20 | 21 | func (c *RemoteConfig) Get(rp viper.RemoteProvider) (io.Reader, error) { 22 | c.RemoteProvider = rp 23 | 24 | return c.get() 25 | } 26 | 27 | func (c *RemoteConfig) Watch(rp viper.RemoteProvider) (io.Reader, error) { 28 | c.RemoteProvider = rp 29 | 30 | return c.get() 31 | } 32 | 33 | func (c *RemoteConfig) WatchChannel(rp viper.RemoteProvider) (<-chan *viper.RemoteResponse, chan bool) { 34 | c.RemoteProvider = rp 35 | rr := make(chan *viper.RemoteResponse) 36 | stop := make(chan bool) 37 | 38 | go func() { 39 | client, err := c.newClient() 40 | if err != nil { 41 | zlog.Error("Etcd Client Error", zap.Error(err)) 42 | return 43 | } 44 | defer client.Close() 45 | 46 | for { 47 | ch := client.Watch(context.Background(), c.RemoteProvider.Path()) 48 | select { 49 | case <-stop: 50 | return 51 | case res := <-ch: 52 | for _, event := range res.Events { 53 | rr <- &viper.RemoteResponse{ 54 | Value: event.Kv.Value, 55 | } 56 | } 57 | } 58 | } 59 | }() 60 | 61 | return rr, stop 62 | } 63 | 64 | func (c *RemoteConfig) newClient() (*clientv3.Client, error) { 65 | client, err := clientv3.New(clientv3.Config{ 66 | Endpoints: []string{c.Endpoint()}, 67 | Username: c.Username, 68 | Password: c.Password, 69 | AutoSyncInterval: time.Hour, 70 | DialTimeout: time.Second * 5, 71 | DialKeepAliveTime: time.Second * 15, 72 | DialKeepAliveTimeout: time.Second * 5, 73 | }) 74 | 75 | if err != nil { 76 | return nil, err 77 | } 78 | 79 | return client, nil 80 | } 81 | 82 | func (c *RemoteConfig) get() (io.Reader, error) { 83 | client, err := c.newClient() 84 | 85 | if err != nil { 86 | return nil, err 87 | } 88 | 89 | defer client.Close() 90 | 91 | ctx, cancel := context.WithTimeout(context.Background(), time.Second) 92 | resp, err := client.Get(ctx, c.Path()) 93 | cancel() 94 | 95 | if err != nil { 96 | return nil, err 97 | } 98 | 99 | return bytes.NewReader(resp.Kvs[0].Value), nil 100 | } 101 | -------------------------------------------------------------------------------- /data.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `orders` ( 2 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID', 3 | `user_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', 4 | `bill_money` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '订单金额(分)', 5 | `order_no` varchar(32) NOT NULL DEFAULT '' COMMENT '业务支付订单号', 6 | `platform_order_no` varchar(32) NOT NULL DEFAULT '' COMMENT '支付中心订单号', 7 | `order_goods_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '订单对应的商品ID', 8 | `state` tinyint(2) unsigned NOT NULL DEFAULT '1' COMMENT '1-待支付,2-支付成功,3-支付失败', 9 | `paid_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 10 | `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', 11 | `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 12 | PRIMARY KEY (`id`), 13 | KEY `idx_created_at` (`created_at`), 14 | KEY `idx_updated_at` (`updated_at`) 15 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单表'; 16 | 17 | INSERT INTO `orders` (`id`, `user_id`, `bill_money`, `order_no`, `platform_order_no`, `state`, `paid_at`, `created_at`, `updated_at`) 18 | VALUES 19 | (19,534321467,126000,'20230704000000001365252146','qa202307040001899329431467_o_00',1,'0000-00-00 00:00:00','2023-07-04 15:27:57','2023-07-04 15:27:57'), 20 | (20,534321467,126000,'20230704000000001365272146','qa202307040001899329451467_o_00',1,'0000-00-00 00:00:00','2023-07-04 15:28:55','2023-07-04 15:28:55'), 21 | (21,534321467,126000,'20230704000000001365292146','qa202307040001899329471467_o_00',1,'0000-00-00 00:00:00','2023-07-04 15:29:28','2023-07-04 15:29:28'), 22 | (22,534321467,100,'20230704000000001365482146','qa202307040001899329651467_o_00',1,'0000-00-00 00:00:00','2023-07-04 15:56:50','2023-07-04 15:56:50'), 23 | (23,534321467,126000,'20230704000000001365642146','qa202307040001899329701467_o_00',1,'0000-00-00 00:00:00','2023-07-04 16:13:19','2023-07-04 16:13:19'), 24 | (24,534321467,126000,'20230704000000001365792146','qa202307040001899329731467_o_00',1,'0000-00-00 00:00:00','2023-07-04 16:15:47','2023-07-04 16:15:47'), 25 | (25,534321467,126000,'20230704000000001365982146','qa202307040001899329801467_o_00',1,'0000-00-00 00:00:00','2023-07-04 16:28:00','2023-07-04 16:28:00'), 26 | (26,534321467,126000,'20230704000000001366262146','qa202307040001899330231467_o_00',1,'0000-00-00 00:00:00','2023-07-04 17:27:08','2023-07-04 17:27:08'), 27 | (27,534321467,126000,'20230704000000001366342146','qa202307040001899330251467_o_00',1,'0000-00-00 00:00:00','2023-07-04 17:27:48','2023-07-04 17:27:48'), 28 | (28,534321467,126000,'20230704000000001366352146','qa202307040001899330261467_o_00',1,'0000-00-00 00:00:00','2023-07-04 17:29:42','2023-07-04 17:29:42'), 29 | (29,534321467,126000,'20230704000000001366362146','qa202307040001899330271467_o_00',1,'0000-00-00 00:00:00','2023-07-04 17:30:51','2023-07-04 17:30:51'), 30 | (30,534321467,126000,'20230704000000001366372146','qa202307040001899330281467_o_00',1,'0000-00-00 00:00:00','2023-07-04 17:32:30','2023-07-04 17:32:30'), 31 | (31,534321467,126000,'20230704000000001366382146','qa202307040001899330291467_o_00',1,'0000-00-00 00:00:00','2023-07-04 17:33:21','2023-07-04 17:33:21'), 32 | (32,534321467,126000,'20230704000000001366972146','qa202307040001899336241467_o_00',1,'0000-00-00 00:00:00','2023-07-04 19:41:42','2023-07-04 19:41:42'), 33 | (33,534321467,126000,'20230705000000001375612146','qa202307050001899338491467_o_00',1,'0000-00-00 00:00:00','2023-07-05 09:33:35','2023-07-05 09:33:35'); -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module example.com/http_demo 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/BurntSushi/toml v1.1.0 // indirect 7 | github.com/DATA-DOG/go-sqlmock v1.5.0 8 | github.com/go-sql-driver/mysql v1.5.0 9 | github.com/gorilla/mux v1.7.3 10 | github.com/gorilla/sessions v1.2.0 11 | github.com/gorilla/websocket v1.4.2 12 | github.com/jinzhu/gorm v1.9.12 13 | github.com/kelseyhightower/confd v0.16.0 14 | github.com/sirupsen/logrus v1.8.1 15 | github.com/spf13/viper v1.12.0 16 | github.com/stretchr/testify v1.7.1 17 | go.etcd.io/etcd/client/v3 v3.5.4 18 | go.uber.org/zap v1.21.0 19 | golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 20 | gopkg.in/natefinch/lumberjack.v2 v2.0.0 21 | ) 22 | -------------------------------------------------------------------------------- /handler/ServeAssetsHandler.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import "net/http" 4 | 5 | func ServeAssets (w http.ResponseWriter, r *http.Request) { 6 | 7 | } -------------------------------------------------------------------------------- /handler/display_form_data.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func DisplayFormDataHandler(w http.ResponseWriter, r *http.Request) { 9 | if err := r.ParseForm(); err != nil { 10 | panic(err) 11 | } 12 | 13 | for key, values := range r.Form { 14 | fmt.Fprintf(w, "Form field %q, Values %q\n", key, values) 15 | 16 | fmt.Fprintf(w, "Form field %q, Value %q\n", key, r.FormValue(key)) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /handler/display_headers.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func DisplayHeadersHandler(w http.ResponseWriter, r *http.Request) { 9 | fmt.Fprintf(w, "Method: %s URL: %s Protocol: %s \n", r.Method, r.URL, r.Proto) 10 | // 遍历所有请求头 11 | for k, v := range r.Header { 12 | fmt.Fprintf(w, "Header field %q, Value %q\n", k, v) 13 | } 14 | 15 | fmt.Fprintf(w, "Host = %q\n", r.Host) 16 | fmt.Fprintf(w, "RemoteAddr= %q\n", r.RemoteAddr) 17 | // 通过 Key 获取指定请求头的值 18 | fmt.Fprintf(w, "\n\nFinding value of \"Accept\" %q", r.Header["Accept"]) 19 | } -------------------------------------------------------------------------------- /handler/display_url_params.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func DisplayUrlParamsHandler(w http.ResponseWriter, r *http.Request) { 9 | for k, v := range r.URL.Query() { 10 | fmt.Fprintf(w, "ParamName %q, Value %q\n", k, v) 11 | fmt.Fprintf(w, "ParamName %q, Get Value %q\n", k, r.URL.Query().Get(k)) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /handler/index.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type HelloHandler struct{} 9 | 10 | func (*HelloHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 11 | //ints := []int{0, 1, 2} 12 | //fmt.Fprintf(w, "%v", ints[0:5]) 13 | fmt.Fprintf(w, "Hello World1") 14 | } -------------------------------------------------------------------------------- /handler/index_template_view.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "html/template" 6 | "net/http" 7 | ) 8 | 9 | type Teacher struct { 10 | Name string 11 | Subject string 12 | } 13 | type Student struct { 14 | Id int 15 | Name string 16 | Country string 17 | } 18 | 19 | type Rooster struct { 20 | Teacher Teacher 21 | Students []Student 22 | } 23 | func ShowIndexView(response http.ResponseWriter, request *http.Request) { 24 | 25 | teacher := Teacher{ 26 | Name: "Alex", 27 | Subject: "Physics", 28 | } 29 | students := []Student{ 30 | {Id: 1001, Name: "Peter", Country: "China"}, 31 | {Id: 1002, Name: "Jeniffer", Country: "Sweden"}, 32 | } 33 | rooster := Rooster{ 34 | Teacher: teacher, 35 | Students: students, 36 | } 37 | 38 | tmpl, err := template.ParseFiles("./views/layout.gohtml", "./views/nav.gohtml", "./views/content.gohtml") 39 | if err != nil { 40 | fmt.Println("Error " + err.Error()) 41 | } 42 | tmpl.Execute(response, rooster) 43 | } 44 | -------------------------------------------------------------------------------- /handler/order/order.go: -------------------------------------------------------------------------------- 1 | package order 2 | 3 | import ( 4 | "example.com/http_demo/logic" 5 | "example.com/http_demo/model/dao" 6 | "fmt" 7 | "net/http" 8 | ) 9 | 10 | func GoodsInit(w http.ResponseWriter, r *http.Request) { 11 | 12 | err := logic.InitOrderGoodsData() 13 | if err != nil { 14 | fmt.Fprintln(w, "初始化OrderGoods失败!", "原因:"+err.Error()) 15 | } else { 16 | fmt.Fprintln(w, "初始化OrderGoods成功!") 17 | } 18 | return 19 | } 20 | 21 | func SingeTableQuery(w http.ResponseWriter, r *http.Request) { 22 | // 根据主键查询第一条记录 23 | data, _ := dao.GetFirstOrderInTable() 24 | fmt.Fprintln(w, "Order表的第一行记录", data) 25 | // 根据主键查询最后一条记录 26 | data, _ = dao.GetLastOrderInTable() 27 | fmt.Fprintln(w, "Order表的最后一条记录", data) 28 | // 使用查询用户的所有订单 29 | orders, _ := dao.GetUserOrders(534321467) 30 | fmt.Fprintln(w, "查询用户的订单, 条件 WHERE user_id = ?, 结果: ", orders) 31 | for _, order := range orders { 32 | fmt.Fprintln(w, "--", order.OrderNo) 33 | } 34 | 35 | userOrders, orderTotal, _ := logic.QueryUserOrdersInPage(534321467, 1, "2023-07-04", "") 36 | fmt.Fprintln(w, "分页查询用户的订单, 条件 WHERE user_id = ? AND created_at >= ? created, 返回结果: ", userOrders, "符合条件的总数: ", orderTotal) 37 | for _, order := range userOrders { 38 | fmt.Fprintln(w, "--", order.OrderNo, "创建时间", order.CreatedAt) 39 | } 40 | serialInfo, err := dao.GetOrderSerialInfo("20230704000000001366262146") 41 | fmt.Fprintln(w, "使用SELECT 指定查询返回的字段, 返回结果: ", serialInfo, "Error: ", err) 42 | serialInfoList, err := dao.GetOrdersSerial([]string{"20230704000000001366262146", "20230704000000001366372146"}) 43 | fmt.Fprintln(w, "使用SELECT 指定查询返回的字段, 查询多条数据返回结果: ", serialInfoList, "Error: ", err) 44 | for _, serial := range serialInfoList { 45 | fmt.Fprintln(w, "--platform_order_no:", serial.OutOrderNo) 46 | } 47 | orderStat, _ := dao.GetOrderStat() 48 | //orderStat, _ := dao.GetOrderStatMap() 49 | fmt.Fprintln(w, "使用GROUP, 每日订单金额统计:", orderStat) 50 | for _, stat := range orderStat { 51 | fmt.Fprintln(w, "--Date:", stat.Date, "--Money:", stat.DayMoneyAmount) 52 | } 53 | 54 | } 55 | 56 | func SetOrderState(w http.ResponseWriter, r *http.Request) { 57 | err := dao.SetOrderStatePaySuccess("20230704000000001366262146") 58 | if err != nil { 59 | fmt.Fprintln(w, "更新失败!") 60 | return 61 | } 62 | fmt.Fprintln(w, "更新成功!") 63 | return 64 | } 65 | 66 | func MultipleTableQuery(w http.ResponseWriter, r *http.Request) { 67 | goodsList, err := dao.GetUserOrderGoods(534321467) 68 | if err != nil { 69 | fmt.Fprintln(w, "JOIN 查询", "Error: ", err) 70 | return 71 | } 72 | fmt.Fprintln(w, "JOIN 查询成功") 73 | for _, item := range goodsList { 74 | fmt.Fprintln(w, "--OrderNo:", item.OrderNo, "--GoodsName:", item.GoodsName, "---GoodsId:", item.GoodsId) 75 | } 76 | 77 | goodsMap, err := dao.GetUserOrderGoodsMap(534321467) 78 | fmt.Fprintln(w, "JOIN 查询", "Error: ", err) 79 | for key, item := range goodsMap { 80 | fmt.Fprintln(w, "--GoodsId:", key, "--GoodsName:", item) 81 | } 82 | return 83 | } 84 | 85 | func SetOrderPaySuccess(w http.ResponseWriter, r *http.Request) { 86 | err := logic.SetOrderSuccessAndCreateGoods(534321467, "20230704000000001366352146") 87 | if err != nil { 88 | fmt.Fprintln(w, "更新失败!") 89 | return 90 | } 91 | 92 | fmt.Fprintln(w, "更新成功!") 93 | return 94 | } 95 | -------------------------------------------------------------------------------- /handler/parse_json_request.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | type Person struct { 10 | Name string 11 | Age int 12 | } 13 | 14 | func ParseJsonRequestHandler(w http.ResponseWriter, r *http.Request) { 15 | var p Person 16 | 17 | // 将请求体中的 JSON 数据解析到结构体中 18 | // 发生错误,返回400 错误码 19 | err := json.NewDecoder(r.Body).Decode(&p) 20 | if err != nil { 21 | http.Error(w, err.Error(), http.StatusBadRequest) 22 | return 23 | } 24 | 25 | fmt.Fprintf(w, "Person: %+v", p) 26 | } 27 | -------------------------------------------------------------------------------- /handler/password_hashing.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "golang.org/x/crypto/bcrypt" 6 | "net/http" 7 | ) 8 | 9 | 10 | func HashPassword(password string) (string, error) { 11 | bytes, err := bcrypt.GenerateFromPassword([]byte(password), 14) 12 | return string(bytes), err 13 | } 14 | 15 | func CheckPasswordHash(password, hash string) bool { 16 | err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) 17 | return err == nil 18 | } 19 | 20 | func GetHashingCost(hashedPassword []byte) int { 21 | cost, _ := bcrypt.Cost(hashedPassword) 22 | return cost 23 | } 24 | 25 | func PassWordHashingHandler(w http.ResponseWriter, r *http.Request) { 26 | password := "secret" 27 | hash, _ := HashPassword(password) // ignore error for the sake of simplicity 28 | 29 | fmt.Fprintln(w,"Password:", password) 30 | fmt.Fprintln(w, "Hash: ", hash) 31 | 32 | match := CheckPasswordHash(password, hash) 33 | fmt.Fprintln(w,"Match: ", match) 34 | 35 | cost := GetHashingCost([]byte(hash)) 36 | fmt.Fprintln(w,"Cost: ", cost) 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /handler/read_cookie.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func ReadCookieHandler(w http.ResponseWriter, r *http.Request) { 9 | for _, cookie := range r.Cookies() { 10 | fmt.Fprintf(w, "Cookie field %q, Value %q\n", cookie.Name, cookie.Value) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /handler/remote_viper_config.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "example.com/http_demo/config" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | func RemoteViperConfig(w http.ResponseWriter, r *http.Request) { 10 | // 此例子,需要启用远程配置中心后才能使用 11 | fmt.Fprintf(w, "Redis field %s, Value %s\n", "address", config.Redis.Address) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /handler/user.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gorilla/mux" 6 | "net/http" 7 | ) 8 | 9 | func ShowVisitorInfo(writer http.ResponseWriter, request *http.Request) { 10 | vars := mux.Vars(request) 11 | name := vars["name"] 12 | country := vars["country"] 13 | fmt.Fprintf(writer, "This guy named %s, was coming from %s .", name, country) 14 | } -------------------------------------------------------------------------------- /handler/user/init.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import "github.com/gorilla/sessions" 4 | 5 | const ( 6 | //64位 7 | cookieStoreAuthKey = "r_y52DdjxDD$Oi8wj@7zyv0gYUDpl7eDJi5fKv2mrHN6s79XhIg3sh1muyy#8vnm" 8 | //AES encrypt key必须是16或者32位 9 | cookieStoreEncryptKey = "M*40ScmijZnCjEf4il1alwAVzn39cQH3" 10 | ) 11 | 12 | var sessionStore *sessions.CookieStore 13 | 14 | func init () { 15 | sessionStore = sessions.NewCookieStore( 16 | []byte(cookieStoreAuthKey), 17 | []byte(cookieStoreEncryptKey), 18 | ) 19 | 20 | sessionStore.Options = &sessions.Options{ 21 | HttpOnly: true, 22 | MaxAge: 60 * 15, 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /handler/user/login.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "example.com/http_demo/logic" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | var sessionCookieName = "user-session" 10 | func Login(w http.ResponseWriter, r *http.Request) { 11 | session, err := sessionStore.Get(r, sessionCookieName) 12 | if err != nil { 13 | http.Error(w, err.Error(), http.StatusInternalServerError) 14 | return 15 | } 16 | // 登录验证 17 | name := r.FormValue("name") 18 | pass := r.FormValue("password") 19 | _, err = logic.AuthenticateUser(name, pass) 20 | if err != nil { 21 | http.Error(w, err.Error(), http.StatusUnauthorized) 22 | return 23 | } 24 | // 在session中标记用户已经通过登录验证 25 | session.Values["authenticated"] = true 26 | err = session.Save(r, w) 27 | 28 | fmt.Fprintln(w, "登录成功!", err) 29 | } -------------------------------------------------------------------------------- /handler/user/logout.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func Logout(w http.ResponseWriter, r *http.Request) { 8 | session, _ := sessionStore.Get(r, sessionCookieName) 9 | 10 | session.Values["authenticated"] = false 11 | session.Save(r, w) 12 | } 13 | -------------------------------------------------------------------------------- /handler/user/secret.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func Secret(w http.ResponseWriter, r *http.Request) { 9 | session, _ := sessionStore.Get(r, sessionCookieName) 10 | 11 | if auth, ok := session.Values["authenticated"].(bool); !ok || !auth { 12 | http.Error(w, "Forbidden", http.StatusForbidden) 13 | return 14 | } 15 | 16 | fmt.Fprintln(w, "这里还是空空如也!") 17 | } -------------------------------------------------------------------------------- /handler/write_json_response.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | ) 7 | 8 | type User struct { 9 | FirstName string `json:"firstname"` 10 | LastName string `json:"lastname"` 11 | Age int `json:"age"` 12 | } 13 | 14 | func WriteJsonResponseHandler(w http.ResponseWriter, r *http.Request) { 15 | p := User{ 16 | FirstName: "John", 17 | LastName: "Doe", 18 | Age: 25, 19 | } 20 | // Set response header 21 | w.Header().Set("Content-Type", "application/json") 22 | err := json.NewEncoder(w).Encode(&p) 23 | if err != nil { 24 | //... handle error 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /handler/ws/echo.go: -------------------------------------------------------------------------------- 1 | package ws 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gorilla/websocket" 6 | "net/http" 7 | ) 8 | 9 | 10 | 11 | 12 | var upgrader = websocket.Upgrader{ 13 | ReadBufferSize: 1024, 14 | WriteBufferSize: 1024, 15 | } 16 | 17 | func EchoMessage(w http.ResponseWriter, r *http.Request) { 18 | conn, _ := upgrader.Upgrade(w, r, nil) // error ignored for sake of simplicity 19 | 20 | for { 21 | // 读取客户端的消息 22 | msgType, msg, err := conn.ReadMessage() 23 | if err != nil { 24 | return 25 | } 26 | 27 | // 把消息打印到标准输出 28 | fmt.Printf("%s sent: %s\n", conn.RemoteAddr(), string(msg)) 29 | 30 | // 把消息写回客户端,完成回音 31 | if err = conn.WriteMessage(msgType, msg); err != nil { 32 | return 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /handler/ws/echo_display.go: -------------------------------------------------------------------------------- 1 | package ws 2 | 3 | import "net/http" 4 | 5 | func DisplayEcho(w http.ResponseWriter, r *http.Request) { 6 | http.ServeFile(w, r, "views/websockets.html") 7 | } 8 | -------------------------------------------------------------------------------- /logic/order.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "errors" 5 | "example.com/http_demo/model/dao" 6 | "example.com/http_demo/model/dao/table" 7 | "example.com/http_demo/utils/zlog" 8 | "github.com/jinzhu/gorm" 9 | "go.uber.org/zap" 10 | ) 11 | 12 | func InitOrderGoodsData() error { 13 | if err := CheckOrdersInitialization(); err != nil { 14 | return err 15 | } 16 | err := dao.InitOrderGoodsFromOrder() 17 | if err != nil { 18 | zlog.Error("order_init_error", zap.Error(err)) 19 | } 20 | return err 21 | } 22 | 23 | func CheckOrdersInitialization() error { 24 | orderGoodsList, err := dao.GetAllOrderGoods() 25 | if err != nil { 26 | return err 27 | } 28 | 29 | if len(orderGoodsList) > 0 { 30 | err = errors.New("OrderGoods 已初始化, 请勿重复操作") 31 | return err 32 | } 33 | return nil 34 | } 35 | 36 | func QueryUserOrdersInPage(userId int64, page int, startDate, endDate string) (orders []*table.Order, orderTotal int, err error) { 37 | dataSize := 10 38 | dataFrom := (page - 1) * dataSize 39 | orders, orderTotal, err = dao.QueryOrderListForUser(userId, dataFrom, dataSize, startDate, endDate) 40 | if err != nil { 41 | zlog.Error("QueryUserOrdersError", zap.Error(err)) 42 | return nil, 0, err 43 | } 44 | return 45 | } 46 | 47 | func SetOrderSuccessAndCreateGoods(userId int64, orderNo string) (err error) { 48 | 49 | // 开启事务并自动提交 50 | err = dao.DB().Transaction(func(tx *gorm.DB) error { 51 | // 在事务中执行一些 db 操作(从这里开始,您应该使用 'tx' 而不是 'db') 52 | order, err := dao.GetOrderByNoInTx(tx, orderNo) 53 | if err != nil || order.UserId != userId { 54 | zlog.Error("error_detail", zap.Error(err), zap.Any("userId", userId), zap.Any("orderNo", orderNo)) 55 | // 返回任何错误都会回滚事务 56 | return errors.New("未找到对应的订单") 57 | } 58 | 59 | err = dao.SetOrderStatePaySuccessInTx(tx, orderNo) 60 | if err != nil { 61 | return err 62 | } 63 | 64 | err = dao.CreateOrderGoodsInTx(tx, userId, order.Id, "商品名InTx") 65 | 66 | return err 67 | }) 68 | 69 | return 70 | } 71 | 72 | // SetOrderSuccessAndCreateGoodsInHandTx 与 SetOrderSuccessAndCreateGoods 功能相同, 区别是使用的手动管理事务的方式 73 | // SetOrderSuccessAndCreateGoods 使用的是db.Transaction 自动管理的事务 74 | func SetOrderSuccessAndCreateGoodsInHandTx(userId int64, orderNo string) (err error) { 75 | // 手动开启事务 76 | tx := dao.DB().Begin() 77 | panicked := true 78 | defer func() { // 控制事务的提交和回滚, 保证事务的完整性 79 | // db.Transaction 内部其实就是这么实现的 80 | if err != nil || panicked { 81 | tx.Rollback() 82 | } else { 83 | tx.Commit() 84 | } 85 | }() 86 | 87 | order, err := dao.GetOrderByNoInTx(tx, orderNo) 88 | if err != nil || order.UserId != userId { 89 | zlog.Error("error_detail", zap.Error(err), zap.Any("userId", userId), zap.Any("orderNo", orderNo)) 90 | // 返回任何错误都会回滚事务 91 | return errors.New("未找到对应的订单") 92 | } 93 | 94 | err = dao.SetOrderStatePaySuccessInTx(tx, orderNo) 95 | if err != nil { 96 | return err 97 | } 98 | 99 | err = dao.CreateOrderGoodsInTx(tx, userId, order.Id, "商品名InTx") 100 | if err != nil { 101 | return err 102 | } 103 | // 没有错误把panicked设置为false, 代表着程序正常执行完毕, 事务提交 104 | panicked = false 105 | return 106 | } 107 | -------------------------------------------------------------------------------- /logic/users.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "example.com/http_demo/model/dao" 5 | "example.com/http_demo/model/dao/table" 6 | ) 7 | 8 | func GetAllUsers() (users []*table.User, err error) { 9 | users, err = dao.GetAllUsers() 10 | 11 | return 12 | } 13 | 14 | func AuthenticateUser(name, password string) (user *table.User, err error) { 15 | user, err = dao.GetUserByNameAndPassword(name, password) 16 | return 17 | } -------------------------------------------------------------------------------- /logic/users_test.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "github.com/kelseyhightower/confd/log" 5 | "testing" 6 | ) 7 | 8 | func TestGetAllUsers(t *testing.T) { 9 | tests := []struct { 10 | name string 11 | wantErr bool 12 | }{ 13 | { 14 | name: "test", 15 | wantErr: false, 16 | }, 17 | } 18 | for _, tt := range tests { 19 | t.Run(tt.name, func(t *testing.T) { 20 | gotUsers, err := GetAllUsers() 21 | if (err != nil) != tt.wantErr { 22 | t.Errorf("GetAllUsers() error = %v, wantErr %v", err, tt.wantErr) 23 | return 24 | } 25 | for _, user := range gotUsers{ 26 | log.Info("user: %v", user) 27 | } 28 | }) 29 | } 30 | } -------------------------------------------------------------------------------- /main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-study-lab/go-http-server/b6f366c73db5f757c634129a67334506297a9117/main -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "example.com/http_demo/router" 6 | "example.com/http_demo/utils/vlog" 7 | "log" 8 | "net/http" 9 | "os" 10 | "os/signal" 11 | "syscall" 12 | 13 | "github.com/gorilla/mux" 14 | ) 15 | 16 | func main() { 17 | //mux := http.NewServeMux() 18 | //mux.Handle("/", &helloHandler{}) 19 | muxRouter := mux.NewRouter() 20 | 21 | // register route handlers 22 | router.RegisterRoutes(muxRouter) 23 | 24 | // set error log writer 25 | errorWriter := vlog.ErrorLog.Writer() 26 | defer errorWriter.Close() 27 | 28 | server := &http.Server{ 29 | Addr: ":8080", 30 | Handler: muxRouter, 31 | ErrorLog: log.New(vlog.ErrorLog.Writer(), "", 0), 32 | } 33 | 34 | // 创建系统信号接收器 35 | done := make(chan os.Signal) 36 | signal.Notify(done, os.Interrupt, syscall.SIGINT, syscall.SIGTERM) 37 | go func() { 38 | <-done 39 | 40 | if err := server.Shutdown(context.Background()); err != nil { 41 | log.Fatal("Shutdown server:", err) 42 | } 43 | }() 44 | 45 | log.Println("Starting HTTP server...") 46 | err := server.ListenAndServe() 47 | if err != nil { 48 | if err == http.ErrServerClosed { 49 | log.Print("Server closed under request") 50 | } else { 51 | log.Fatal("Server closed unexpected") 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /middleware.go: -------------------------------------------------------------------------------- 1 | // This is just a demo code displaying how to write middleware 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "log" 7 | "net/http" 8 | "time" 9 | ) 10 | 11 | type Middleware func(http.HandlerFunc) http.HandlerFunc 12 | 13 | // 记录每个URL请求的执行时长 14 | func Logging() Middleware { 15 | 16 | // 创建中间件 17 | return func(f http.HandlerFunc) http.HandlerFunc { 18 | 19 | // 创建一个新的handler包装http.HandlerFunc 20 | return func(w http.ResponseWriter, r *http.Request) { 21 | 22 | // 中间件的处理逻辑 23 | start := time.Now() 24 | defer func() { log.Println(r.URL.Path, time.Since(start)) }() 25 | 26 | // 调用下一个中间件或者最终的handler处理程序 27 | f(w, r) 28 | } 29 | } 30 | } 31 | 32 | // 验证请求用的是否是指定的HTTP Method,不是则返回 400 Bad Request 33 | func Method(m string) Middleware { 34 | 35 | return func(f http.HandlerFunc) http.HandlerFunc { 36 | 37 | return func(w http.ResponseWriter, r *http.Request) { 38 | 39 | if r.Method != m { 40 | http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest) 41 | return 42 | } 43 | 44 | f(w, r) 45 | } 46 | } 47 | } 48 | 49 | // 把应用到http.HandlerFunc处理器的中间件 50 | // 按照先后顺序和处理器本身链起来供http.HandleFunc调用 51 | func Chain(f http.HandlerFunc, middlewares ...Middleware) http.HandlerFunc { 52 | for _, m := range middlewares { 53 | f = m(f) 54 | } 55 | return f 56 | } 57 | 58 | // 最终的处理请求的http.HandlerFunc 59 | func Hello(w http.ResponseWriter, r *http.Request) { 60 | fmt.Fprintln(w, "Hello World") 61 | } 62 | 63 | //func main() { 64 | // http.HandleFunc("/", Chain(Hello, Method("GET"), Logging())) 65 | // http.ListenAndServe(":8080", nil) 66 | //} -------------------------------------------------------------------------------- /middleware/access_log.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "bytes" 5 | "example.com/http_demo/utils/vlog" 6 | "github.com/sirupsen/logrus" 7 | "io" 8 | "net/http" 9 | ) 10 | 11 | type ResponseWithRecorder struct { 12 | http.ResponseWriter 13 | statusCode int 14 | body bytes.Buffer 15 | } 16 | 17 | func (rec *ResponseWithRecorder) WriteHeader(statusCode int) { 18 | rec.ResponseWriter.WriteHeader(statusCode) 19 | rec.statusCode = statusCode 20 | } 21 | 22 | func (rec *ResponseWithRecorder) Write(d []byte) (n int, err error) { 23 | n, err = rec.ResponseWriter.Write(d) 24 | if err != nil { 25 | return 26 | } 27 | rec.body.Write(d) 28 | 29 | return 30 | } 31 | 32 | // 创建中间件 33 | 34 | func AccessLogging(f http.Handler) http.Handler { 35 | 36 | // 创建一个新的handler包装http.HandlerFunc 37 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 38 | buf := new(bytes.Buffer) 39 | buf.ReadFrom(r.Body) 40 | r.Body.Close() 41 | r.Body = io.NopCloser(buf) 42 | logEntry := vlog.AccessLog.WithFields(logrus.Fields{ 43 | "ip": r.RemoteAddr, 44 | "method": r.Method, 45 | "path": r.RequestURI, 46 | "query": r.URL.RawQuery, 47 | "request_body": buf.String(), 48 | }) 49 | 50 | wc := &ResponseWithRecorder{ 51 | ResponseWriter: w, 52 | statusCode: http.StatusOK, 53 | body: bytes.Buffer{}, 54 | } 55 | 56 | // 调用下一个中间件或者最终的handler处理程序 57 | f.ServeHTTP(wc, r) 58 | 59 | defer logEntry.WithFields(logrus.Fields{ 60 | "status": wc.statusCode, 61 | "response_body": wc.body.String(), 62 | }).Info() 63 | 64 | }) 65 | } 66 | -------------------------------------------------------------------------------- /middleware/http_method.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "github.com/gorilla/mux" 5 | "net/http" 6 | ) 7 | 8 | // 验证请求用的是否是指定的HTTP Method,不是则返回 400 Bad Request 9 | func Method(m string) mux.MiddlewareFunc { 10 | 11 | return func(f http.Handler) http.Handler { 12 | 13 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 14 | 15 | if r.Method != m { 16 | http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest) 17 | return 18 | } 19 | 20 | f.ServeHTTP(w, r) 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /middleware/log.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "github.com/gorilla/mux" 5 | "log" 6 | "net/http" 7 | "time" 8 | ) 9 | 10 | // 记录每个URL请求的执行时长 11 | func Logging() mux.MiddlewareFunc { 12 | 13 | // 创建中间件 14 | return func(f http.Handler) http.Handler { 15 | 16 | // 创建一个新的handler包装http.HandlerFunc 17 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 18 | 19 | // 中间件的处理逻辑 20 | start := time.Now() 21 | defer func() { log.Println(r.URL.Path, time.Since(start)) }() 22 | 23 | // 调用下一个中间件或者最终的handler处理程序 24 | f.ServeHTTP(w, r) 25 | }) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /model/dao/init.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "example.com/http_demo/config" 5 | _ "github.com/go-sql-driver/mysql" 6 | "github.com/jinzhu/gorm" 7 | ) 8 | 9 | var _DB *gorm.DB 10 | 11 | func DB() *gorm.DB { 12 | return _DB 13 | } 14 | 15 | func init() { 16 | _DB = initDB() 17 | } 18 | 19 | func initDB() *gorm.DB { 20 | // In our docker dev environment use 21 | //db, err := gorm.Open("mysql", "root:superpass@tcp(database:3306)/go_web?charset=utf8&parseTime=True&loc=Local") 22 | // Out of docker use 23 | db, err := gorm.Open(config.Database.Type, config.Database.DSN) 24 | if err != nil { 25 | panic(err) 26 | } 27 | db.DB().SetMaxOpenConns(config.Database.MaxOpenConn) 28 | db.DB().SetMaxIdleConns(config.Database.MaxIdleConn) 29 | db.DB().SetConnMaxLifetime(config.Database.MaxLifeTime) 30 | if err = db.DB().Ping(); err != nil { 31 | panic(err) 32 | } 33 | return db 34 | } 35 | -------------------------------------------------------------------------------- /model/dao/order.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "example.com/http_demo/model/dao/table" 5 | "example.com/http_demo/utils/zlog" 6 | "github.com/jinzhu/gorm" 7 | "go.uber.org/zap" 8 | "time" 9 | ) 10 | 11 | //-------- 单表查询开始 -----------// 12 | 13 | func GetAllOrders() (orders []*table.Order, err error) { 14 | orders = make([]*table.Order, 0) 15 | err = DB().Find(&orders).Error 16 | if err != nil && err != gorm.ErrRecordNotFound { 17 | return nil, err 18 | } 19 | return 20 | } 21 | 22 | func GetFirstOrderInTable() (order *table.Order, err error) { 23 | // 指针变量要先初始化, 直接传给Gorm的查询方法会空指针报错 24 | order = new(table.Order) 25 | //.First(&order) 传指针类型变量order的指针也行, 效果一样不用纠结 26 | err = DB().First(order).Error 27 | if err != nil && err != gorm.ErrRecordNotFound { 28 | return nil, err 29 | } 30 | return 31 | } 32 | 33 | func GetLastOrderInTable() (order *table.Order, err error) { 34 | order = new(table.Order) 35 | err = DB().Last(order).Error 36 | if err != nil && err != gorm.ErrRecordNotFound { 37 | return nil, err 38 | } 39 | return 40 | } 41 | 42 | func GetUserOrders(userId int64) (orders []*table.Order, err error) { 43 | orders = make([]*table.Order, 0) 44 | err = DB().Where("user_id = ?", userId).Find(&orders).Error 45 | if err != nil && err != gorm.ErrRecordNotFound { 46 | return nil, err 47 | } 48 | return 49 | } 50 | 51 | func GetUserPaidOrders(userId int64) (orders []*table.Order, err error) { 52 | orders = make([]*table.Order, 0) 53 | err = DB().Where("user_id = ?", userId). 54 | Where("state = ?", table.ORDER_STATE_PAY_SUCCESS). 55 | // 这两个Where调用等价于 .Where("user_id = ? AND state = ?", userId, 2) 56 | // 等价于用Map查询 57 | // .Where(map[stirng]interface{} { // 不建议使用, 只能进行相等匹配, 且不能做参数类型限制 58 | // user_id: userId, 59 | // state: 2 60 | // }) 61 | Find(&orders).Error 62 | if err != nil && err != gorm.ErrRecordNotFound { 63 | return nil, err 64 | } 65 | return 66 | } 67 | 68 | func GetUserUnPaidOrders(userId int64) (orders []*table.Order, err error) { 69 | orders = make([]*table.Order, 0) 70 | err = DB().Where("user_id = ?", userId). 71 | Where("state IN (?)", []int{table.ORDER_STATE_UNPAID, table.ORDER_STATE_PAY_FAILD}). 72 | Find(&orders).Error 73 | if err != nil && err != gorm.ErrRecordNotFound { 74 | return nil, err 75 | } 76 | return 77 | } 78 | 79 | func GetUserNotPaidOrders(userId int64) (orders []*table.Order, err error) { 80 | orders = make([]*table.Order, 0) 81 | err = DB().Where("user_id = ?", userId). 82 | Not("state", table.ORDER_STATE_PAY_SUCCESS). 83 | Find(&orders).Error 84 | // SELECT * FROM orders WHERE user_id = {userId} AND state != 2 85 | if err != nil && err != gorm.ErrRecordNotFound { 86 | return nil, err 87 | } 88 | return 89 | } 90 | 91 | func GetUserNotFailedOrders(userId int64) (orders []*table.Order, err error) { 92 | orders = make([]*table.Order, 0) 93 | err = DB().Where("user_id = ?", userId). 94 | Not("state", []int{table.ORDER_STATE_UNPAID, table.ORDER_STATE_PAY_FAILD}). 95 | Find(&orders).Error 96 | // SELECT * FROM orders WHERE user_id = {userId} AND state NOT IN (1, 3) 97 | if err != nil && err != gorm.ErrRecordNotFound { 98 | return nil, err 99 | } 100 | return 101 | } 102 | 103 | // OR 条件 104 | func GetOrderUnPaidOrPayFailed() (orders []*table.Order, err error) { 105 | orders = make([]*table.Order, 0) 106 | err = DB().Where("state = ?", table.ORDER_STATE_UNPAID). 107 | Or("state = ?", table.ORDER_STATE_PAY_FAILD). 108 | Find(&orders).Error 109 | // SELECT * FROM orders WHERE user_id = {userId} AND state NOT IN (1, 3) 110 | if err != nil && err != gorm.ErrRecordNotFound { 111 | return nil, err 112 | } 113 | return 114 | } 115 | 116 | func QueryOrderListForUser(userId int64, dataFrom, dataSize int, startDate, endDate string) (orders []*table.Order, orderTotal int, err error) { 117 | orders = make([]*table.Order, 0) 118 | 119 | db := DB().Where("user_id = ?", userId) 120 | // 根据参数值生成响应的SQL 121 | if startDate != "" { 122 | db = db.Where("created_at >= ?", startDate) 123 | } 124 | if endDate != "" { 125 | db = db.Where("created_at <= ?", endDate) 126 | } 127 | 128 | err = db.Debug().Order("id DESC"). 129 | Offset(dataFrom). 130 | Limit(dataSize). 131 | Find(&orders).Count(&orderTotal).Error 132 | // 一般分页会要求返回当页数据和总条数, 这种写法会减少代码重复量, 就不需要再写下面的 QueryOrderCountForUser 函数了 133 | // SELECT * FROM orders WHERE ... ORDER BY id DESC LIMIT 10, OFFSET 0 134 | // SELECT COUNT(*) FROM orders WHERE ... ORDER BY id DESC LIMIT 10, OFFSET 0 135 | // (ORDER BY, LIMIT 对COUNT不起作用, 会正确返回WHERE条件对应的行数) 136 | zlog.Info("result debug", zap.Any("list", orders), zap.Any("total", orderTotal)) 137 | if err != nil && err != gorm.ErrRecordNotFound { 138 | return nil, 0, err 139 | } 140 | 141 | return 142 | } 143 | 144 | func QueryOrderCountForUser(userId int64, startDate, endDate string) (orderCount int, err error) { 145 | db := DB().Model(table.Order{}). 146 | Where("user_id = ?", userId) 147 | if startDate != "" { 148 | db = db.Where("created_at >= ?", startDate) 149 | } 150 | if endDate != "" { 151 | db = db.Where("created_at <= ?", startDate) 152 | } 153 | 154 | err = db.Count(&orderCount).Error 155 | return 156 | } 157 | 158 | type OrderSerialInfo struct { 159 | OrderNo string // 对应Scan扫描的结果集里的order_no 字段 160 | // 如果Scan扫描的结果字段与结构体字段不同, 需要使用tag进行标注 161 | OutOrderNo string `gorm:"column:platform_order_no"` 162 | } 163 | 164 | func GetOrderSerialInfo(orderNo string) (orderSerialInfo *OrderSerialInfo, err error) { 165 | 166 | orderSerialInfo = new(OrderSerialInfo) 167 | // Debug() 用于调试时打印出执行的SQL 168 | // Scan操作时使用.Model() 会告诉GORM要在哪个Model对象上执行操作, GORM会自动找到对应的表名 169 | err = DB().Debug().Model(table.Order{}). 170 | // DB().Model(table.Order{}) 也可以写成 DB().Table(table.Order{}.TableName()) 171 | //.Table()是更底层的写法,直接指定SQL的表名, 一般在关联查询里使用这种写法 172 | Select("order_no, platform_order_no"). 173 | Where("order_no = ?", orderNo). 174 | Scan(&orderSerialInfo).Error 175 | // Scan 用于将查询结果集扫描进结构体或者结构体列表中去 176 | // 没查到数据会返回 gorm.ErrRecordNotFound 错误 177 | // Scan 可以用在SELECT 和 GROUP、JOIN 等指定返回字段的查询中, 用于获取结果--把查询结果集扫描到实参变量中存储 178 | if err != nil && err != gorm.ErrRecordNotFound { 179 | return nil, err 180 | } 181 | zlog.Info("GetOrderSerialInfo", zap.Any("orderSerialInfo", orderSerialInfo)) 182 | 183 | return 184 | } 185 | 186 | //db.Model() 和 db.Table()的区别 187 | //https://stackoverflow.com/questions/67550966/go-gorm-difference-between-db-model-and-db-table-query 188 | 189 | func GetOrdersSerial(orderNo []string) (serialInfoList []*OrderSerialInfo, err error) { 190 | serialInfoList = make([]*OrderSerialInfo, 0) 191 | err = DB().Debug().Model(table.Order{}). 192 | Select("order_no, platform_order_no"). 193 | Where("order_no IN (?)", orderNo). 194 | Scan(&serialInfoList).Error 195 | if err != nil && err != gorm.ErrRecordNotFound { 196 | return nil, err 197 | } 198 | 199 | return 200 | } 201 | 202 | type OrderStat struct { 203 | Date string 204 | DayMoneyAmount int64 `gorm:"column:amount"` 205 | } 206 | 207 | func GetOrderStat() (stats []*OrderStat, err error) { 208 | stats = make([]*OrderStat, 0) 209 | err = DB().Debug().Model(table.Order{}). 210 | Select("SUM(bill_money) AS amount, DATE(created_at) AS date"). 211 | Group("DATE(created_at)"). 212 | Having("amount > 0").Scan(&stats).Error // 把Group结果扫描进实现定义好的结构体列表 213 | if err != nil && err != gorm.ErrRecordNotFound { 214 | return nil, err 215 | } 216 | 217 | return 218 | } 219 | 220 | func GetOrderStatMap() (statMap map[string]*OrderStat, err error) { 221 | // 使用Rows()返回结果集, 遍历结果集返回更定制化的结果 222 | rows, err := DB().Table(table.Order{}.TableName()). 223 | Select("SUM(bill_money) AS amount, DATE(created_at) AS date"). 224 | Group("DATE(created_at)"). 225 | Having("amount > 0").Rows() 226 | 227 | if err != nil && err != gorm.ErrRecordNotFound { 228 | return nil, err 229 | } 230 | 231 | var amount int64 232 | var date string 233 | statMap = map[string]*OrderStat{} 234 | defer rows.Close() 235 | for rows.Next() { 236 | err = rows.Scan(&amount, &date) 237 | 238 | if err != nil { 239 | return nil, err 240 | } 241 | 242 | statMap[date] = &OrderStat{ 243 | Date: date, 244 | DayMoneyAmount: amount, 245 | } 246 | } 247 | 248 | return statMap, err 249 | } 250 | 251 | //-------- 单表查询结束 -----------// 252 | 253 | //-------- Update操作 -----------// 254 | 255 | // GORM 的时间跟踪 256 | // GORM 会对模型中的三个时间字段进行跟踪, 分别是CreatedAt, UpdatedAt, DeletedAt 257 | // 如果模型有CreatedAt, UpdatedAt 创建记录时都会被赋予当时的时间, 更新记录时GORM会总动更新UpdatedAt的时间 258 | // 如果模型有DeletedAt字段, 调用Delete删除该记录时,将会设置DeletedAt字段为当前时间,而不是直接将记录从数据库中删除。 259 | 260 | func SetOrderStatePaySuccess(orderNo string) error { 261 | updates := map[string]interface{}{ 262 | "state": table.ORDER_STATE_PAY_SUCCESS, 263 | "paid_at": time.Now(), 264 | } 265 | // 执行SQL UPDATE orders SET state = 2, paid_at = '当前时间(yyyy-mm-dd hh:ii:ss)', updated_at = '当前时间' WHERE order_no = {orderNo} 266 | // 使用 map 更新多个属性,只会更新其中有变化的属性 267 | err := DB().Model(table.Order{}). 268 | Where("order_no = ?", orderNo). 269 | Update(updates).Error 270 | // Update方法里也可以使用结构体 Update(&table.Order{State: 2, PaidAt: time.Now()}) 271 | // 使用 struct 更新多个属性,只会更新其中有变化且为非零值的字段 272 | // 另外可以通过Update(updates).RowsAffected 获取更新的记录数 273 | return err 274 | } 275 | 276 | //-------- Update操作结束 -----------// 277 | 278 | //-------- Join 查询 -----------// 279 | 280 | type UserGoods struct { 281 | UserId int64 282 | OrderNo string 283 | GoodsId int64 284 | GoodsName string 285 | OrderState int `gorm:"column:state"` 286 | } 287 | 288 | func GetUserOrderGoods(userId int64) (goodsList []*UserGoods, err error) { 289 | tableOrder := table.Order{}.TableName() 290 | tableGoods := table.OrderGoods{}.TableName() 291 | 292 | goodsList = make([]*UserGoods, 0) 293 | 294 | err = DB().Debug().Table(tableOrder+" AS o"). 295 | Joins("INNER JOIN "+tableGoods+" AS og ON o.id = og.order_id"). 296 | Select("o.user_id, o.order_no, o.state, og.id as goods_id, og.goods_name"). 297 | Where("o.user_id = ?", userId).Scan(&goodsList).Error 298 | // Scan, Find方法的参数是Slice类型时, 必须传递Slice的指针, 否则在其中填充数据后因为底层数组变更,导致内外部Slice指向的底层数组不一致 299 | zlog.Info("debug data", zap.Any("data", goodsList)) 300 | 301 | return 302 | } 303 | 304 | // GetUserOrderGoodsMap 返回以GoodsId为Key, GoodsName为值的Map 305 | // 主要是为了演示对JOIN查询结果集的逐行Scan操作 306 | func GetUserOrderGoodsMap(userId int64) (userOrderGoodsMap map[int64]string, err error) { 307 | tableOrder := table.Order{}.TableName() 308 | tableGoods := table.OrderGoods{}.TableName() 309 | 310 | rows, err := DB().Table(tableOrder+" AS o"). 311 | Joins("INNER JOIN "+tableGoods+" AS og ON o.id = og.order_id"). 312 | Select("og.id as goods_id, og.goods_name"). 313 | Where("o.user_id = ?", userId).Rows() 314 | if err != nil && err != gorm.ErrRecordNotFound { 315 | return nil, err 316 | } 317 | 318 | defer rows.Close() 319 | userOrderGoodsMap = make(map[int64]string) 320 | var ( 321 | GoodsId int64 322 | GoodsName string 323 | ) 324 | for rows.Next() { 325 | //err := rows.Scan(&result) 326 | // 遍历结果集的记录时Scan只能往多个基础类型变量里扫描列对应的数据 327 | // 有几列就对应几个变量, 不能往结构体里扫描, 否则会报错 328 | // 比如本例中如果把连表查询的结果逐行Scan到一个结构体变量, 会有如下错误 329 | // sql: expected 2 destination arguments in Scan, not 1 330 | // 综合起来更推荐上一种把整个结果集Scan进结构体列表的方式拿到连表查询的结果集. 331 | err := rows.Scan(&GoodsId, &GoodsName) 332 | if err != nil { 333 | return nil, err 334 | } 335 | 336 | userOrderGoodsMap[GoodsId] = GoodsName 337 | } 338 | 339 | return 340 | } 341 | 342 | // 事务内操作 343 | 344 | func GetOrderByNoInTx(tx *gorm.DB, orderNo string) (order *table.Order, err error) { 345 | order = new(table.Order) 346 | err = tx.Set("gorm:query_option", "FOR UPDATE").Where("order_no = ?", orderNo).First(&order).Error 347 | // SELECT * FROM orders WHERE order_no = ? FOR UPDATE 348 | return 349 | } 350 | 351 | // SetOrderStatePaySuccessInTx 在事务中修改订单状态 352 | func SetOrderStatePaySuccessInTx(tx *gorm.DB, orderNo string) error { 353 | updates := map[string]interface{}{ 354 | "state": table.ORDER_STATE_PAY_SUCCESS, 355 | "paid_at": time.Now(), 356 | } 357 | err := tx.Model(table.Order{}). 358 | Where("order_no = ?", orderNo). 359 | Update(updates).Error 360 | 361 | return err 362 | } 363 | -------------------------------------------------------------------------------- /model/dao/order_goods.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "example.com/http_demo/model/dao/table" 5 | "fmt" 6 | "github.com/jinzhu/gorm" 7 | "strconv" 8 | "strings" 9 | ) 10 | 11 | func GetAllOrderGoods() (orderGoodsList []*table.OrderGoods, err error) { 12 | orderGoodsList = make([]*table.OrderGoods, 0) // List 类型的参数必须先初始化, 直接.Find(&orderGoodsList)会空指针报错 13 | err = DB().Debug().Find(&orderGoodsList).Error 14 | if err != nil && err != gorm.ErrRecordNotFound { 15 | return nil, err 16 | } 17 | return 18 | } 19 | 20 | func InitOrderGoodsFromOrder() error { 21 | orders, err := GetAllOrders() 22 | if err != nil { 23 | return err 24 | } 25 | orderGoodsList := make([]*table.OrderGoods, 0) 26 | for index, order := range orders { 27 | orderGoods := &table.OrderGoods{ 28 | UserId: order.UserId, 29 | GoodsName: "商品" + strconv.Itoa(index+1), 30 | OrderId: order.Id, 31 | } 32 | orderGoodsList = append(orderGoodsList, orderGoods) 33 | //DB().Create(&orderGoods).Error //创建单个orderGoods 34 | } 35 | // 批量创建orderGoods 36 | // v1 版本不支持用Create 进行批量插入, v2 已支持 37 | // err = DB().Create(&orderGoodsList).Error 38 | BulkInsertOrderGoods(orderGoodsList) 39 | return err 40 | } 41 | 42 | // BulkInsertOrderGoods 43 | // 目前 gorm v1 并不支持批量插入这一功能, v2版本支持 44 | // 在 v1.x 的情况下,如果硬要使用 gorm 做批量插入,需要使用db.Exec方法 45 | // 可参见以下方式: 46 | // https://stackoverflow.com/questions/12486436/how-do-i-batch-sql-statements-with-package-database-sql 47 | func BulkInsertOrderGoods(unsavedRows []*table.OrderGoods) error { 48 | valueStrings := make([]string, 0, len(unsavedRows)) 49 | valueArgs := make([]interface{}, 0, len(unsavedRows)*3) 50 | for _, row := range unsavedRows { 51 | valueStrings = append(valueStrings, "(?, ?, ?)") 52 | valueArgs = append(valueArgs, row.UserId) 53 | valueArgs = append(valueArgs, row.GoodsName) 54 | valueArgs = append(valueArgs, row.OrderId) 55 | } 56 | statement := fmt.Sprintf("INSERT INTO "+table.OrderGoods{}.TableName()+" (user_id, goods_name, order_id) VALUES %s", 57 | strings.Join(valueStrings, ",")) 58 | 59 | err := DB().Exec(statement, valueArgs...).Error 60 | return err 61 | } 62 | 63 | func CreateOrderGoodsInTx(tx *gorm.DB, userId, orderId int64, goodsName string) error { 64 | orderGoods := &table.OrderGoods{ 65 | UserId: userId, 66 | GoodsName: goodsName, 67 | OrderId: orderId, 68 | } 69 | err := tx.Create(orderGoods).Error 70 | return err 71 | } 72 | -------------------------------------------------------------------------------- /model/dao/order_test.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "example.com/http_demo/model/dao/table" 5 | "example.com/http_demo/utils/zlog" 6 | "github.com/stretchr/testify/assert" 7 | "go.uber.org/zap" 8 | "testing" 9 | ) 10 | 11 | func TestGetAllOrders(t *testing.T) { 12 | tests := []struct { 13 | name string 14 | wantOrders []*table.Order 15 | wantErr assert.ErrorAssertionFunc 16 | }{ 17 | { 18 | name: "test1", 19 | wantErr: nil, 20 | }, 21 | } 22 | for _, tt := range tests { 23 | t.Run(tt.name, func(t *testing.T) { 24 | gotOrders, err := GetAllOrders() 25 | //if !tt.wantErr(t, err, fmt.Sprintf("GetAllOrders()")) { 26 | // return 27 | //} 28 | zlog.Info("orders data log", zap.Any("data", gotOrders), zap.Any("err", err)) 29 | }) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /model/dao/table/base.go: -------------------------------------------------------------------------------- 1 | package table 2 | 3 | import "time" 4 | 5 | type BaseFields struct { 6 | Id int64 `gorm:"column:id;primary_key" json:"id"` //自增ID 7 | CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` //创建时间 8 | UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` //更新时间 9 | } 10 | -------------------------------------------------------------------------------- /model/dao/table/order.go: -------------------------------------------------------------------------------- 1 | package table 2 | 3 | import "time" 4 | 5 | // 订单表 6 | type Order struct { 7 | BaseFields 8 | UserId int64 `gorm:"column:user_id" json:"user_id"` //用户ID 9 | BillMoney int64 `gorm:"column:bill_money" json:"bill_money"` //订单金额(分) 10 | OrderNo string `gorm:"column:order_no;type:varchar(32)" json:"order_no"` //业务支付订单号 11 | PlatformOrderNo string `gorm:"column:platform_order_no;type:varchar(32)" json:"platform_order_no"` //支付中心订单号 12 | OrderGoodsId int64 `gorm:"column:order_goods_id" json:"order_goods_id"` //订单对应的商品ID 13 | State int8 `gorm:"column:state;default:1" json:"state"` //1-待支付,2-支付成功,3-支付失败 14 | PaidAt time.Time `gorm:"column:paid_at" json:"paid_at"` 15 | } 16 | 17 | const ( 18 | ORDER_STATE_UNPAID = 1 19 | ORDER_STATE_PAY_SUCCESS = 2 20 | ORDER_STATE_PAY_FAILD = 3 21 | ) 22 | 23 | func (Order) TableName() string { 24 | return "orders" 25 | } 26 | -------------------------------------------------------------------------------- /model/dao/table/order_goods.go: -------------------------------------------------------------------------------- 1 | package table 2 | 3 | // 订单商品表 4 | type OrderGoods struct { 5 | BaseFields 6 | UserId int64 `gorm:"column:user_id" json:"user_id"` //用户ID 7 | GoodsName string `gorm:"column:goods_name" json:"goods_name"` //商品名 8 | OrderId int64 `gorm:"column:order_id" json:"order_id"` //商品的订单ID 9 | } 10 | 11 | func (OrderGoods) TableName() string { 12 | return "order_goods" 13 | } 14 | -------------------------------------------------------------------------------- /model/dao/table/user.go: -------------------------------------------------------------------------------- 1 | package table 2 | 3 | import "time" 4 | 5 | type User struct { 6 | Id int64 `gorm:"column:id;primary_key"` 7 | UserName string `gorm:"column:username"` 8 | Secret string `gorm:"column:secret;type:varchar(1000)"` 9 | CreatedAt time.Time `gorm:"column:created_at"` 10 | UpdatedAt time.Time `gorm:"column:updated_at"` 11 | } 12 | 13 | // TableName sets the insert table name for this struct type 14 | func (m *User) TableName() string { 15 | return "users" 16 | } -------------------------------------------------------------------------------- /model/dao/user.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "example.com/http_demo/model/dao/table" 5 | ) 6 | 7 | func CreateUser(user *table.User) (err error) { 8 | // 打印出要执行的SQL语句 err = DB().Debug().Create(user).Error 9 | err = DB().Create(user).Error 10 | 11 | return 12 | } 13 | 14 | func GetUserById(userId int64) (user *table.User, err error) { 15 | user = new(table.User) 16 | err = DB().Where("id = ?", userId).First(user).Error 17 | 18 | return 19 | } 20 | 21 | func GetAllUsers() (users []*table.User, err error) { 22 | err = DB().Find(&users).Error 23 | return 24 | } 25 | 26 | func GetUserByNameAndPassword(name, password string) (user *table.User, err error) { 27 | user = new(table.User) 28 | err = DB().Where("username = ? AND secret = ?", name, password). 29 | First(&user).Error 30 | 31 | return 32 | } 33 | 34 | func UpdateUserNameById(userName string, userId int64) (err error) { 35 | user := new(table.User) 36 | updated := map[string]interface{}{ 37 | "username": userName, 38 | } 39 | err = DB().Model(user).Where("id = ?", userId).Updates(updated).Error 40 | return 41 | } 42 | 43 | func DeleteUserById(userId int64) (err error) { 44 | user := new(table.User) 45 | err = DB().Where("id = ?", userId).First(user).Error 46 | if err != nil { 47 | return 48 | } 49 | err = DB().Delete(user).Error 50 | 51 | return 52 | } 53 | -------------------------------------------------------------------------------- /model/dao/user_mock_test.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "database/sql" 5 | "database/sql/driver" 6 | "example.com/http_demo/model/dao/table" 7 | "example.com/http_demo/utils/zlog" 8 | "github.com/DATA-DOG/go-sqlmock" 9 | "github.com/jinzhu/gorm" 10 | "github.com/stretchr/testify/assert" 11 | "go.uber.org/zap" 12 | "os" 13 | "testing" 14 | "time" 15 | ) 16 | 17 | var ( 18 | mock sqlmock.Sqlmock 19 | err error 20 | db *sql.DB 21 | ) 22 | 23 | // TestMain是在当前package下,最先运行的一个函数,常用于初始化 24 | func TestMain(m *testing.M) { 25 | // 创建一个 sqlmock 的数据库连接 和 mock对象,mock对象管理 db 预期要执行的SQL 26 | 27 | // sqlmock 默认使用 sqlmock.QueryMatcherRegex 作为默认的SQL匹配器 28 | // 该匹配器使用mock.ExpectQuery 和 mock.ExpectExec 的参数作为正则表达式而不是SQL语句字符串 29 | // 所以指定预期要执行的SQL语句时,会遇到下面的错误 30 | // ExecQuery: error parsing regexp: invalid or unsupported Perl syntax 31 | // 有两种办法解决这个问题: 32 | // 1. 使用regexp.QuoteMeta 把SQL转义成正则表达式 => mock.ExpectQuery(regexp.QuoteMeta(`SELECT ....`)) 33 | // 2. 让sqlmock 使用 QueryMatcherEqual 匹配器,该匹配器把mock.ExpectQuery 和 mock.ExpectExec 的参数作为 34 | // 预期要执行的SQL语句跟要执行的SQL进行相等比较 35 | 36 | // 这里 让sqlmock 使用 sqlmock.QueryMatcherEqual 作为匹配器匹配器,该匹配器把mock.ExpectQuery 37 | // 和 mock.ExpectExec 的参数作为 预期要执行的SQL语句跟真正要执行的SQL进行相等比较 38 | db, mock, err = sqlmock.New(sqlmock.QueryMatcherOption(sqlmock.QueryMatcherEqual)) 39 | if err != nil { 40 | 41 | panic(err) 42 | } 43 | _DB, err = gorm.Open("mysql", db) 44 | 45 | // m.Run 是调用包下面各个Test函数的入口 46 | os.Exit(m.Run()) 47 | } 48 | 49 | func TestCreateUserMock(t *testing.T) { 50 | user := &table.User{ 51 | UserName: "Kevin", 52 | Secret: "123456", 53 | CreatedAt: time.Now(), 54 | UpdatedAt: time.Now(), 55 | } 56 | mock.ExpectBegin() 57 | // 因为 sqlmock 使用的是 QueryMatcherEqual 匹配器 58 | // 所以,下面的sql语句必须精确匹配要执行的SQL(包括符号和空格) 59 | mock.ExpectExec("INSERT INTO `users` (`username`,`secret`,`created_at`,`updated_at`) VALUES (?,?,?,?)"). 60 | WithArgs(user.UserName, user.Secret, user.CreatedAt, user.UpdatedAt). 61 | WillReturnResult(sqlmock.NewResult(1, 1)) 62 | mock.ExpectCommit() 63 | err := CreateUser(user) 64 | assert.Nil(t, err) 65 | 66 | } 67 | 68 | func TestGetUserByNameAndPasswordMock(t *testing.T) { 69 | user := &table.User{ 70 | Id: 1, 71 | UserName: "Kevin", 72 | Secret: "123456", 73 | CreatedAt: time.Now(), 74 | UpdatedAt: time.Now(), 75 | } 76 | 77 | mock.ExpectQuery("SELECT * FROM `users` WHERE (username = ? AND secret = ?) "+ 78 | "ORDER BY `users`.`id` ASC LIMIT 1"). 79 | WithArgs(user.UserName, user.Secret). 80 | WillReturnRows( 81 | // 这里要跟结果集包含的列匹配,因为查询是 SELECT * 所以表的字段都要列出来 82 | sqlmock.NewRows([]string{"id", "username", "secret", "created_at", "updated_at"}). 83 | AddRow(1, user.UserName, user.Secret, user.CreatedAt, user.UpdatedAt)) 84 | res, err := GetUserByNameAndPassword(user.UserName, user.Secret) 85 | zlog.Info("MockTestResult", zap.Any("res", res), zap.Any("err", err)) 86 | assert.Nil(t, err) 87 | assert.Equal(t, user, res) 88 | } 89 | 90 | func TestUpdateUserNameByIdMock(t *testing.T) { 91 | newName := "Kev" 92 | var userId int64 = 1 93 | 94 | // GORM 在UPDATE 的时候会自动更新updated_at 字段为当前时间,与这里withArgs传递的 time.Now() 参数不一致, 95 | // 目前没有办法Mock测试GORM的UPDATE方法,除非用Exec直接执行更新SQL,不过那就失去使用ORM的意义了 96 | // 这个先跳过 97 | // 2022.5.16 目前已找到解决方案: 98 | // https://github.com/DATA-DOG/go-sqlmock/issues/ 99 | // sqlmock.AnyArg() match any kind of arguments seful for time.Time or similar kinds of arguments. 100 | // 如果考虑代码可读性,还有一种方案,可以自定定义一个 sqlmock.Argument 实现,请看下面的 AnyTime 类型 101 | mock.ExpectBegin() 102 | mock.ExpectExec("UPDATE `users` SET `updated_at` = ?, `username` = ? WHERE (id = ?)"). 103 | //WithArgs(sqlmock.AnyArg(), newName, userId). 104 | WithArgs(AnyTime{}, newName, userId). 105 | WillReturnResult(sqlmock.NewResult(1, 1)) 106 | mock.ExpectCommit() 107 | 108 | err := UpdateUserNameById(newName, userId) 109 | assert.Nil(t, err) 110 | } 111 | 112 | // 定义一个AnyTime 类型,实现 sqlmock.Argument接口 113 | // 参考自:https://qiita.com/isao_e_dev/items/c9da34c6d1f99a112207 114 | type AnyTime struct{} 115 | 116 | func (a AnyTime) Match(v driver.Value) bool { 117 | // Match 方法中:判断字段值只要是time.Time 类型,就能验证通过 118 | // 这种方式比使用 sqlmock.AnyArg() 限制性更强一些,代码可读性也会更好 119 | _, ok := v.(time.Time) 120 | return ok 121 | } 122 | -------------------------------------------------------------------------------- /model/dao/user_test.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "example.com/http_demo/model/dao/table" 5 | "github.com/kelseyhightower/confd/log" 6 | "testing" 7 | ) 8 | 9 | func TestCreateUser(t *testing.T) { 10 | type args struct { 11 | user *table.User 12 | } 13 | tests := []struct { 14 | name string 15 | args args 16 | wantErr bool 17 | }{ 18 | { 19 | name: "test", 20 | args: args{user: &table.User{UserName: "Kevin", Secret: "123456"}}, 21 | wantErr: false, 22 | }, 23 | } 24 | for _, tt := range tests { 25 | t.Run(tt.name, func(t *testing.T) { 26 | if err := CreateUser(tt.args.user); (err != nil) != tt.wantErr { 27 | t.Errorf("CreateUser() error = %v, wantErr %v", err, tt.wantErr) 28 | } 29 | }) 30 | } 31 | } 32 | 33 | func TestGetAllUsers(t *testing.T) { 34 | tests := []struct { 35 | name string 36 | wantErr bool 37 | }{ 38 | { 39 | name: "test", 40 | wantErr: false, 41 | }, 42 | } 43 | for _, tt := range tests { 44 | t.Run(tt.name, func(t *testing.T) { 45 | gotUsers, err := GetAllUsers() 46 | if (err != nil) != tt.wantErr { 47 | t.Errorf("GetAllUser() error = %v, wantErr %v", err, tt.wantErr) 48 | return 49 | } 50 | for _, user := range gotUsers { 51 | log.Info("user: %v", user) 52 | } 53 | 54 | }) 55 | } 56 | } 57 | 58 | func TestUpdateUserNameById(t *testing.T) { 59 | type args struct { 60 | userName string 61 | userId int64 62 | } 63 | tests := []struct { 64 | name string 65 | args args 66 | wantErr bool 67 | }{ 68 | { 69 | name: "test", 70 | args: args{ 71 | userName: "Klein", 72 | userId: 1, 73 | }, 74 | wantErr: false, 75 | }, 76 | } 77 | for _, tt := range tests { 78 | t.Run(tt.name, func(t *testing.T) { 79 | if err := UpdateUserNameById(tt.args.userName, tt.args.userId); (err != nil) != tt.wantErr { 80 | t.Errorf("UpdateUserNameById() error = %v, wantErr %v", err, tt.wantErr) 81 | } 82 | }) 83 | } 84 | } 85 | 86 | func TestGetUserByNameAndPassword(t *testing.T) { 87 | type args struct { 88 | name string 89 | password string 90 | } 91 | tests := []struct { 92 | name string 93 | args args 94 | wantErr bool 95 | }{ 96 | { 97 | name: "test", 98 | args: args{ 99 | name: "Klein", 100 | password: "123", 101 | }, 102 | wantErr: false, 103 | }, 104 | } 105 | for _, tt := range tests { 106 | t.Run(tt.name, func(t *testing.T) { 107 | gotUser, err := GetUserByNameAndPassword(tt.args.name, tt.args.password) 108 | if (err != nil) != tt.wantErr { 109 | t.Errorf("GetUserByNameAndPassword() error = %v, wantErr %v", err, tt.wantErr) 110 | return 111 | } 112 | log.Info("user %v", gotUser) 113 | }) 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /router/router.go: -------------------------------------------------------------------------------- 1 | package router 2 | 3 | import ( 4 | "example.com/http_demo/handler/order" 5 | "example.com/http_demo/handler/user" 6 | "example.com/http_demo/handler/ws" 7 | "example.com/http_demo/middleware" 8 | "github.com/gorilla/mux" 9 | "net/http" 10 | 11 | "example.com/http_demo/handler" 12 | ) 13 | 14 | func RegisterRoutes(r *mux.Router) { 15 | // serve static file request 16 | fs := http.FileServer(http.Dir("assets/")) 17 | serveFileHandler := http.StripPrefix("/static/", fs) 18 | r.PathPrefix("/static/").Handler(serveFileHandler) 19 | 20 | // apply Logging middleware 21 | r.Use(middleware.Logging(), middleware.AccessLogging) 22 | 23 | indexRouter := r.PathPrefix("/index").Subrouter() 24 | indexRouter.HandleFunc("/viper_test", handler.RemoteViperConfig) 25 | indexRouter.HandleFunc("/password_hashing", handler.PassWordHashingHandler) 26 | indexRouter.HandleFunc("/display_headers", handler.DisplayHeadersHandler) 27 | indexRouter.HandleFunc("/display_url_params", handler.DisplayUrlParamsHandler) 28 | indexRouter.HandleFunc("/display_form_data", handler.DisplayFormDataHandler).Methods("POST") 29 | indexRouter.HandleFunc("/read_cookie", handler.ReadCookieHandler) 30 | indexRouter.HandleFunc("/parse_json_request", handler.ParseJsonRequestHandler) 31 | indexRouter.HandleFunc("/get_json_response", handler.WriteJsonResponseHandler) 32 | 33 | userRouter := r.PathPrefix("/user").Subrouter() 34 | userRouter.HandleFunc("/names/{name}/countries/{country}", handler.ShowVisitorInfo) 35 | //userRouter.Use(middleware.Method("GET")) 36 | userRouter.HandleFunc("/login", user.Login).Methods("POST") 37 | userRouter.HandleFunc("/secret", user.Secret) 38 | userRouter.HandleFunc("/logout", user.Logout) 39 | 40 | viewRouter := r.PathPrefix("/view").Subrouter() 41 | viewRouter.HandleFunc("/index", handler.ShowIndexView) 42 | 43 | wsRouter := r.PathPrefix("/ws").Subrouter() 44 | wsRouter.HandleFunc("/echo", ws.EchoMessage) 45 | wsRouter.HandleFunc("/echo_display", ws.DisplayEcho) 46 | 47 | orderRouter := r.PathPrefix("/order").Subrouter() 48 | orderRouter.HandleFunc("/order_goods/init", order.GoodsInit).Methods("POST") 49 | orderRouter.HandleFunc("/single_table/query_demo", order.SingeTableQuery) 50 | orderRouter.HandleFunc("/set_state", order.SetOrderState).Methods("POST") 51 | orderRouter.HandleFunc("/multiple_table/query_demo", order.MultipleTableQuery).Methods("GET") 52 | orderRouter.HandleFunc("/order_goods/tx_demo", order.SetOrderPaySuccess).Methods("POST") 53 | } 54 | -------------------------------------------------------------------------------- /tmp/log/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /utils/vlog/vlog.go: -------------------------------------------------------------------------------- 1 | package vlog 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | "os" 6 | ) 7 | 8 | var ErrorLog *logrus.Logger 9 | var AccessLog *logrus.Logger 10 | var errorLogFile = "./tmp/log/error.log" 11 | var accessLogFile = "./tmp/log/access.log" 12 | func init () { 13 | initErrorLog() 14 | initAccessLog() 15 | } 16 | 17 | func initErrorLog() { 18 | ErrorLog = logrus.New() 19 | ErrorLog.SetFormatter(&logrus.JSONFormatter{}) 20 | file , err := os.OpenFile(errorLogFile, os.O_RDWR | os.O_CREATE | os.O_APPEND, 0755) 21 | if err != nil { 22 | panic(err) 23 | } 24 | ErrorLog.SetOutput(file) 25 | } 26 | 27 | func initAccessLog() { 28 | AccessLog = logrus.New() 29 | AccessLog.SetFormatter(&logrus.JSONFormatter{}) 30 | file , err := os.OpenFile(accessLogFile, os.O_RDWR | os.O_CREATE | os.O_APPEND, 0755) 31 | if err != nil { 32 | panic(err) 33 | } 34 | AccessLog.SetOutput(file) 35 | } -------------------------------------------------------------------------------- /utils/zlog/log.go: -------------------------------------------------------------------------------- 1 | package zlog 2 | 3 | import ( 4 | "go.uber.org/zap" 5 | "go.uber.org/zap/zapcore" 6 | "gopkg.in/natefinch/lumberjack.v2" 7 | "os" 8 | "path" 9 | "runtime" 10 | ) 11 | 12 | // 简单封装一下对 zap 日志库的使用 13 | // 使用方式: 14 | // zlog.Debug("hello", zap.String("name", "Kevin"), zap.Any("arbitraryObj", dummyObject)) 15 | // zlog.Info("hello", zap.String("name", "Kevin"), zap.Any("arbitraryObj", dummyObject)) 16 | // zlog.Warn("hello", zap.String("name", "Kevin"), zap.Any("arbitraryObj", dummyObject)) 17 | var logger *zap.Logger 18 | 19 | func init() { 20 | encoderConfig := zap.NewProductionEncoderConfig() 21 | encoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder 22 | encoder := zapcore.NewJSONEncoder(encoderConfig) 23 | 24 | //file, _ := os.OpenFile("/tmp/test.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 644) 25 | //fileWriteSyncer = zapcore.AddSync(file) 26 | fileWriteSyncer := getFileLogWriter() 27 | 28 | core := zapcore.NewTee( 29 | // 同时向控制台和文件写日志, 生产环境记得把控制台写入去掉 30 | zapcore.NewCore(encoder, zapcore.AddSync(os.Stdout), zapcore.DebugLevel), 31 | zapcore.NewCore(encoder, fileWriteSyncer, zapcore.DebugLevel), 32 | ) 33 | logger = zap.New(core) 34 | } 35 | 36 | func getFileLogWriter() (writeSyncer zapcore.WriteSyncer) { 37 | // 使用 lumberjack 实现 log rotate 38 | lumberJackLogger := &lumberjack.Logger{ 39 | Filename: "/tmp/test.log", 40 | MaxSize: 100, 41 | MaxBackups: 60, 42 | MaxAge: 1, 43 | Compress: false, 44 | } 45 | 46 | return zapcore.AddSync(lumberJackLogger) 47 | } 48 | 49 | func Info(message string, fields ...zap.Field) { 50 | callerFields := getCallerInfoForLog() 51 | fields = append(fields, callerFields...) 52 | logger.Info(message, fields...) 53 | } 54 | 55 | func Debug(message string, fields ...zap.Field) { 56 | callerFields := getCallerInfoForLog() 57 | fields = append(fields, callerFields...) 58 | logger.Debug(message, fields...) 59 | } 60 | 61 | func Error(message string, fields ...zap.Field) { 62 | callerFields := getCallerInfoForLog() 63 | fields = append(fields, callerFields...) 64 | logger.Error(message, fields...) 65 | } 66 | 67 | func Warn(message string, fields ...zap.Field) { 68 | callerFields := getCallerInfoForLog() 69 | fields = append(fields, callerFields...) 70 | logger.Warn(message, fields...) 71 | } 72 | 73 | func getCallerInfoForLog() (callerFields []zap.Field) { 74 | 75 | pc, file, line, ok := runtime.Caller(2) // 回溯两层,拿到写日志的业务函数的信息 76 | if !ok { 77 | return 78 | } 79 | funcName := runtime.FuncForPC(pc).Name() 80 | funcName = path.Base(funcName) //Base函数返回路径的最后一个元素,只保留函数名 81 | 82 | callerFields = append(callerFields, zap.String("func", funcName), zap.String("file", file), zap.Int("line", line)) 83 | return 84 | } 85 | -------------------------------------------------------------------------------- /views/content.gohtml: -------------------------------------------------------------------------------- 1 | {{define "content"}} 2 | {{range .Students}} 3 |
4 |
5 |

Name

6 |

Name has the value of : {{.Name}}

7 |

More »

8 |
9 |
10 |

Id

11 |

Id has the value of : {{.Id}}

12 |

More »

13 |
14 |
15 |

Country

16 |

Country has the value of : {{.Country}}

17 |

More »

18 |
19 |
20 | {{end}} 21 | {{end}} -------------------------------------------------------------------------------- /views/layout.gohtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Bootstrap Template Page for Go Web Programming 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | {{ template "nav" .}} 18 | 19 |
20 | {{template "content" .}} 21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /views/nav.gohtml: -------------------------------------------------------------------------------- 1 | {{define "nav"}} 2 | 9 | 10 |
11 |
12 |

Hello, Professor {{.Teacher.Name}}

13 |
    14 |
  • Name : {{.Teacher.Name}}

    15 |

  • Subject : {{.Teacher.Subject}} 16 |
17 |

More »

18 |
19 |
20 | {{end}} -------------------------------------------------------------------------------- /views/websockets.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |
9 | 10 | 11 |

12 |     
13 | 14 | 32 | 33 | --------------------------------------------------------------------------------