├── .gitignore
├── .pryrc
├── .ruby-version
├── CONTRIBUTING.md
├── Gemfile
├── Gemfile.lock
├── Guardfile
├── LICENSE
├── Procfile
├── README.md
├── Rakefile
├── app-css
├── _mixins.css.sass
├── components
│ ├── .gitkeep
│ ├── detail-panel.css.sass
│ ├── flash-message.css.sass
│ ├── index.css.sass
│ ├── list-subscriber-form.css.sass
│ ├── loader.css.scss
│ └── user-profile.css.sass
└── pages
│ ├── content-page.css.sass
│ ├── index.css.sass
│ └── user-page.css.sass
├── app-js
├── components
│ ├── .gitkeep
│ ├── about.js.es6
│ ├── bucket-scroll.js.es6
│ ├── feedback.js.es6
│ ├── flash-message.js.es6
│ ├── index.js.es6
│ ├── list-subscriber-form.js.es6
│ ├── new-project.js.es6
│ ├── project-list.js.es6
│ ├── tooltips.js.es6
│ └── votes.js.es6
└── vendor
│ ├── js.cookie-2.0.4.min.js
│ └── lodash-inflection.js
├── app
├── assets
│ ├── images
│ │ ├── .keep
│ │ ├── jacques.png
│ │ ├── marc.jpg
│ │ └── mark.jpg
│ ├── javascripts
│ │ ├── application.js
│ │ └── dependencies.js
│ └── stylesheets
│ │ ├── _bootstrap-override-variables.scss
│ │ ├── _responsive.sass
│ │ ├── application.sass
│ │ └── dependencies.sass
├── controllers
│ ├── application_controller.rb
│ ├── audit_logs_controller.rb
│ ├── concerns
│ │ └── .keep
│ ├── help_controller.rb
│ ├── list_subscribers_controller.rb
│ ├── pages_controller.rb
│ ├── projects_controller.rb
│ ├── sessions_controller.rb
│ └── users_controller.rb
├── forms
│ └── project_form.rb
├── helpers
│ └── application_helper.rb
├── interactors
│ ├── auth_user.rb
│ ├── base_interactor.rb
│ ├── post_auth.rb
│ ├── pre_auth.rb
│ └── update_project.rb
├── mailers
│ └── .keep
├── models
│ ├── .keep
│ ├── audit_log.rb
│ ├── concerns
│ │ └── .keep
│ ├── feedback.rb
│ ├── list_subscriber.rb
│ ├── project.rb
│ ├── user.rb
│ └── vote.rb
├── serializers
│ ├── feedback_serializer.rb
│ └── project_serializer.rb
└── views
│ ├── audit_logs
│ ├── edit.html.haml
│ └── index.html.haml
│ ├── help
│ ├── about.haml
│ ├── contact.haml
│ ├── faqs.haml
│ ├── guidelines.haml
│ └── team.haml
│ ├── layouts
│ ├── _analytics.html.erb
│ ├── _detail_panel.html.haml
│ ├── _flash_messages.html.haml
│ ├── _help.html.haml
│ ├── _navbar.html.haml
│ ├── _rollbar.html.erb
│ └── application.html.haml
│ ├── list_subscribers
│ ├── _subscribe_form.html.erb
│ ├── confirm.html.erb
│ ├── edit.html.haml
│ └── success.html.haml
│ ├── pages
│ ├── about.html.erb
│ └── devauth.html.haml
│ ├── projects
│ ├── _detail.html.haml
│ ├── _end_of_buckets.html.haml
│ ├── _project.atom.jbuilder
│ ├── _project.rss.jbuilder
│ ├── _project_listings.html.haml
│ ├── _projects_for_bucket.html.haml
│ ├── already_submitted.html.haml
│ ├── bucket.html.haml
│ ├── edit.html.haml
│ ├── index.atom.builder
│ ├── index.html.haml
│ ├── index.rss.builder
│ ├── new.html.haml
│ ├── recent.atom.builder
│ ├── recent.rss.builder
│ └── vote_confirm.html.erb
│ ├── sessions
│ ├── auth_failure.html.haml
│ └── logout.html.haml
│ └── users
│ ├── edit.html.haml
│ └── show.html.haml
├── bin
├── bundle
├── rails
├── rake
├── rspec
├── setup
└── spring
├── config.ru
├── config
├── application.rb
├── boot.rb
├── database.yml
├── environment.rb
├── environments
│ ├── development.rb
│ ├── production.rb
│ └── test.rb
├── initializers
│ ├── assets.rb
│ ├── backtrace_silencers.rb
│ ├── check_for_twitter_keys.rb
│ ├── config.rb
│ ├── cookies_serializer.rb
│ ├── filter_parameter_logging.rb
│ ├── inflections.rb
│ ├── mime_types.rb
│ ├── omniauth.rb
│ ├── rollbar.rb
│ ├── session_store.rb
│ └── wrap_parameters.rb
├── locales
│ └── en.yml
├── puma.rb
├── routes.rb
├── secrets.yml
├── settings.local.yml.example
├── settings.yml
└── settings
│ ├── development.yml
│ ├── production.yml
│ └── test.yml
├── db
├── migrate
│ ├── 20151216045210_create_users.rb
│ ├── 20151216045228_create_votes.rb
│ ├── 20151216045237_create_projects.rb
│ ├── 20151216052011_create_list_subscribers.rb
│ ├── 20151217054927_create_feedbacks.rb
│ ├── 20151217093858_create_audit_logs.rb
│ ├── 20151217110511_create_ranking_pg_functions.rb
│ ├── 20151220212736_add_note_to_audit_logs.rb
│ ├── 20151221073236_update_feedback_session_column.rb
│ ├── 20151221081710_add_fields_to_list_subscriber.rb
│ └── 20151221232302_add_format_to_list_subscribers.rb
├── schema.rb
└── seeds.rb
├── lib
├── assets
│ └── .keep
├── ext
│ ├── date_ext.rb
│ └── serialize_ext.rb
└── tasks
│ ├── .keep
│ ├── auto_annotate_models.rake
│ └── new_project.rake
├── log
└── .keep
├── public
├── 404.html
├── 422.html
├── 500.html
├── apple-touch-icon-precomposed.png
├── favicon.ico
├── favicon.png
├── fonts
│ └── bootstrap
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
└── robots.txt
├── spec
├── factories.rb
├── factories
│ ├── project_factory.rb
│ └── user_factory.rb
├── features
│ └── edit_project_spec.rb
├── forms
│ └── project_form_spec.rb
├── interactors
│ └── update_project_spec.rb
├── models
│ ├── audit_log_spec.rb
│ ├── list_subscriber_spec.rb
│ ├── project_spec.rb
│ ├── user_spec.rb
│ └── vote_spec.rb
├── rails_helper.rb
├── requests
│ ├── .gitkeep
│ ├── audit_logs_spec.rb
│ ├── projects_spec.rb
│ └── users_spec.rb
├── spec_helper.rb
└── support
│ └── factory_girl.rb
└── vendor
└── assets
├── javascripts
└── .keep
└── stylesheets
├── .keep
└── bootstrap
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── Gemfile
├── LICENSE
├── README.md
├── Rakefile
├── assets
├── fonts
│ └── bootstrap
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
├── images
│ └── .keep
├── javascripts
│ ├── bootstrap-sprockets.js
│ ├── bootstrap.js
│ ├── bootstrap.min.js
│ └── bootstrap
│ │ ├── affix.js
│ │ ├── alert.js
│ │ ├── button.js
│ │ ├── carousel.js
│ │ ├── collapse.js
│ │ ├── dropdown.js
│ │ ├── modal.js
│ │ ├── popover.js
│ │ ├── scrollspy.js
│ │ ├── tab.js
│ │ ├── tooltip.js
│ │ └── transition.js
└── stylesheets
│ ├── _bootstrap-compass.scss
│ ├── _bootstrap-mincer.scss
│ ├── _bootstrap-sprockets.scss
│ ├── _bootstrap.scss
│ └── bootstrap
│ ├── _alerts.scss
│ ├── _badges.scss
│ ├── _breadcrumbs.scss
│ ├── _button-groups.scss
│ ├── _buttons.scss
│ ├── _carousel.scss
│ ├── _close.scss
│ ├── _code.scss
│ ├── _component-animations.scss
│ ├── _dropdowns.scss
│ ├── _forms.scss
│ ├── _glyphicons.scss
│ ├── _grid.scss
│ ├── _input-groups.scss
│ ├── _jumbotron.scss
│ ├── _labels.scss
│ ├── _list-group.scss
│ ├── _media.scss
│ ├── _mixins.scss
│ ├── _modals.scss
│ ├── _navbar.scss
│ ├── _navs.scss
│ ├── _normalize.scss
│ ├── _pager.scss
│ ├── _pagination.scss
│ ├── _panels.scss
│ ├── _popovers.scss
│ ├── _print.scss
│ ├── _progress-bars.scss
│ ├── _responsive-embed.scss
│ ├── _responsive-utilities.scss
│ ├── _scaffolding.scss
│ ├── _tables.scss
│ ├── _theme.scss
│ ├── _thumbnails.scss
│ ├── _tooltip.scss
│ ├── _type.scss
│ ├── _utilities.scss
│ ├── _variables.scss
│ ├── _wells.scss
│ └── mixins
│ ├── _alerts.scss
│ ├── _background-variant.scss
│ ├── _border-radius.scss
│ ├── _buttons.scss
│ ├── _center-block.scss
│ ├── _clearfix.scss
│ ├── _forms.scss
│ ├── _gradients.scss
│ ├── _grid-framework.scss
│ ├── _grid.scss
│ ├── _hide-text.scss
│ ├── _image.scss
│ ├── _labels.scss
│ ├── _list-group.scss
│ ├── _nav-divider.scss
│ ├── _nav-vertical-align.scss
│ ├── _opacity.scss
│ ├── _pagination.scss
│ ├── _panels.scss
│ ├── _progress-bar.scss
│ ├── _reset-filter.scss
│ ├── _reset-text.scss
│ ├── _resize.scss
│ ├── _responsive-visibility.scss
│ ├── _size.scss
│ ├── _tab-focus.scss
│ ├── _table-row.scss
│ ├── _text-emphasis.scss
│ ├── _text-overflow.scss
│ └── _vendor-prefixes.scss
├── bootstrap-sass.gemspec
├── bower.json
├── composer.json
├── lib
├── bootstrap-sass.rb
└── bootstrap-sass
│ ├── engine.rb
│ └── version.rb
├── package.json
├── sache.json
├── tasks
├── bower.rake
├── converter.rb
└── converter
│ ├── char_string_scanner.rb
│ ├── fonts_conversion.rb
│ ├── js_conversion.rb
│ ├── less_conversion.rb
│ ├── logger.rb
│ └── network.rb
└── templates
└── project
├── _bootstrap-variables.sass
├── manifest.rb
└── styles.sass
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore the default SQLite database.
11 | /db/*.sqlite3
12 | /db/*.sqlite3-journal
13 |
14 | # Ignore all logfiles and tempfiles.
15 | /log/*
16 | !/log/.keep
17 | /tmp
18 | .rspec
19 | config/settings.local.yml
20 | config/settings/*.local.yml
21 | config/environments/*.local.yml
22 | .byebug_history
23 | config/settings/local.yml
24 | public/assets
25 | db/restore_from_heroku.sh
26 | Termfile
27 |
--------------------------------------------------------------------------------
/.pryrc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/.pryrc
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.1.4
2 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to OpenHunt
2 |
3 | OpenHunt was designed from the ground up to be community driven and open to everyone.
4 |
5 | This makes it a great platform to contribute to whether it be submitting bug reports and feature requests to contributing code.
6 |
7 | We love our community and encourage contributions but being so open felt it was right to establish some guidance and rules to keep everyone happy and on the same page.
8 |
9 | ## Submitting issues
10 |
11 | If you have found a bug or would like to request a feature, you can do so by creating an issue [here](https://github.com/OpenHunting/openhunt/issues). This helps us keep everything organised and to discuss the request.
12 |
13 | - Try and be as descriptive as possible.
14 | - If you are submitting an issue, explain the steps to recreate the issue.
15 | - Be respectful to others in the community.
16 |
17 | ## Pull requests
18 |
19 | You can also help us tackle feature and issue requests by contributing code to the project.
20 |
21 | If you need help on getting started, please consult the [readme](https://github.com/OpenHunting/openhunt/blob/master/README.md) before submitting issues as it might be able to answer some questions you might have.
22 |
23 | - Fork the project [here](https://github.com/OpenHunting/openhunt/fork).
24 | - Respect the code conventions used in the project to keep everything uniform.
25 | - If your work is significant, create a feature branch.
26 | - Explain the changes in your commit message for us to review.
27 | - If you are working from an existing issue, tag the issue in your commit message `#issue-id`.
28 |
29 | > Thanks again for your continued support and above all, let's have some fun creating the best platform possible.
30 |
31 | **OpenHunt Team**
32 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | ruby "2.1.4"
3 |
4 | # Core
5 | gem 'rails', '4.2.5'
6 | gem 'pg'
7 | gem 'puma'
8 |
9 | gem 'rails_12factor', group: :production
10 |
11 | # Assets
12 | gem 'sass-rails', '~> 5.0'
13 | gem 'sprockets', '>= 3.0.0'
14 | gem 'sprockets-es6'
15 | gem 'bourbon', '= 3.2.4' # old bourbon, will work with libsass
16 | gem 'uglifier', '>= 1.3.0'
17 | gem 'jquery-rails'
18 | # gem 'therubyracer', platforms: :ruby
19 |
20 | source 'https://rails-assets.org' do
21 | gem 'rails-assets-bootstrap'
22 | gem 'rails-assets-lodash'
23 | gem 'rails-assets-es5-shim'
24 | end
25 |
26 | gem 'omniauth'
27 | gem 'omniauth-twitter'
28 | gem 'twitter', '5.11.0'
29 |
30 | # Views
31 | gem 'haml-rails'
32 | gem 'jbuilder', '~> 2.0'
33 | gem 'active_model_serializers', '~> 0.9.3'
34 |
35 | # React
36 | gem 'react-rails', '~> 1.5.0'
37 |
38 | # Validation
39 | gem 'validate_url'
40 | gem 'validate_email'
41 |
42 | # Configuration
43 | gem 'config'
44 |
45 | # Error reporting
46 | gem 'rollbar', '~> 2.4.0'
47 |
48 | # Docs
49 | gem 'sdoc', '~> 0.4.0', group: :doc
50 |
51 | gem 'interactor-rails'
52 | gem 'active_attr'
53 |
54 | group :development, :test do
55 | gem 'byebug'
56 | gem 'pry-rails'
57 |
58 | gem 'capybara'
59 | gem 'poltergeist'
60 |
61 | gem 'rspec-rails', '~> 3.0'
62 | gem 'factory_girl'
63 | gem 'factory_girl_rails'
64 | gem 'database_cleaner'
65 | gem 'timecop'
66 | gem 'faker'
67 |
68 | gem 'annotate'
69 |
70 | gem 'quiet_assets'
71 | end
72 |
73 | group :development do
74 | gem 'web-console', '~> 2.0'
75 |
76 | gem 'guard-rspec', require: false
77 | gem 'guard-livereload', '>= 0.4.0'
78 | # gem 'spring'
79 | end
80 |
--------------------------------------------------------------------------------
/Guardfile:
--------------------------------------------------------------------------------
1 | guard :rspec, cmd: 'bundle exec rspec' do
2 | watch('spec/spec_helper.rb') { "spec" }
3 | watch('config/routes.rb') { "spec/routing" }
4 | watch('app/controllers/application_controller.rb') { "spec/controllers" }
5 | watch(%r{^spec/.+_spec\.rb$})
6 | watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
7 | watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
8 | watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
9 | watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
10 | end
11 |
12 |
13 |
14 | # Reload the browser as asset files change
15 | # install the Chrome plugin here: http://bit.ly/UNR8rC
16 | guard :livereload, :apply_js_live => false do
17 | watch(%r{^app/.+\.(erb|haml|slim)$})
18 |
19 | watch(%r{^app/helpers/.+\.rb$})
20 | watch(%r{^(public/|app/assets).+\.(css|js|html)$})
21 | watch(%r{^(app/assets/.+\.css)\.s[ac]ss$}) { |m| m[1] }
22 | watch(%r{^(app/assets/.+\.js)\.coffee$}) { |m| m[1] }
23 |
24 | watch(%r{^(app-css/.+\.css)\.s[ac]ss$}) { |m| m[1] }
25 |
26 | watch(%r{^(app-js/.+)\.hbs$}) { |m| m[1] }
27 | watch(%r{^(app-js/.+)\.emblem$}) { |m| m[1] }
28 | end
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Open Hunt
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: bundle exec puma -C config/puma.rb
2 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/app-css/_mixins.css.sass:
--------------------------------------------------------------------------------
1 | @import "bourbon"
2 | @import "responsive"
3 | @import "_bootstrap-override-variables.scss"
4 | @import "bootstrap/assets/stylesheets/_bootstrap.scss"
5 |
--------------------------------------------------------------------------------
/app-css/components/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/app-css/components/.gitkeep
--------------------------------------------------------------------------------
/app-css/components/detail-panel.css.sass:
--------------------------------------------------------------------------------
1 | @import "mixins"
2 |
3 | #detail-panel
4 | position: fixed
5 | top: 0
6 | right: 0
7 | bottom: 0
8 | background: #fff
9 | z-index: 1000
10 | padding-top: 52px
11 | width: 400px
12 | box-shadow: 0 0 5px rgba(#000, 0.4)
13 | // color: #fff
14 | font-size: 12px
15 | display: none
16 | color: #777
17 | overflow: auto
18 | +xs
19 | left: 0
20 | width: auto
21 | // a
22 | // color: #fff
23 | strong
24 | color: #000
25 | font-weight: normal
26 | .btn-default
27 | color: #333
28 | text-shadow: none
29 | padding: 3px 8px
30 |
31 | .project-info
32 | font-size: 14px
33 |
34 | .project-feedback
35 | padding: 0px 20px
36 | position: relative
37 | .close-feedback-button
38 | position: absolute
39 | top: -10px
40 | right: 3px
41 | z-index: 100000
42 | padding: 10px
43 | h3
44 | margin-bottom: 5px
45 |
46 | .feedback-listing
47 | h4
48 | font-size: 18px
49 |
50 | .feedback-form
51 | textarea
52 | min-height: 100px
53 | margin-bottom: 10px
54 | border: 1px solid #ccc
55 | box-shadow: none
56 | .actions
57 | text-align: right
58 |
59 | label
60 | text-shadow: none
61 | font-weight: 300
62 | .btn-primary
63 | border: 1px solid #337AB7
64 | color: #337AB7
65 | background: #fff
66 | text-transform: uppercase
67 | text-shadow: none
68 | &:hover
69 | background: #E6E6E6
70 | color: #000
71 |
72 | .project-loading
73 | font-size: 30px
74 | padding: 30px 50px
75 | text-align: center
76 | color: rgba(#fff, 0.5)
77 | display: none
78 |
79 | &.loading
80 | .project-loading
81 | display: block
82 | .project-feedback
83 | display: none
84 |
--------------------------------------------------------------------------------
/app-css/components/flash-message.css.sass:
--------------------------------------------------------------------------------
1 | @import "mixins"
2 |
3 | .flash-message
4 | height: 57px
5 | line-height: 41px
6 | background: white
7 | position: fixed
8 | left: 0
9 | right: 0
10 | bottom: 0
11 | z-index: 100001
12 | box-shadow: 0 0 3px rgba(0,0,0,0.5)
13 | p
14 | padding: 8px
15 | font-size: 18px
16 | font-weight: bold
17 | text-align: center
18 | text-shadow: 0px 1px 0 rgba(255, 255, 255, .5)
19 | overflow: hidden
20 | text-overflow: ellipsis
21 | white-space: nowrap
22 |
23 | a
24 | color: #333
25 | font-weight: normal
26 | margin-left: 10px
27 | text-decoration: underline
28 | font-size: 14px
29 | text-shadow: none
30 | &.flash-alert
31 | border-top: 1px solid #999
32 | color: #333
33 | // +linear-gradient(top, #FFF797, #F2DB56)
34 | &.flash-notice
35 | color: #333
36 | // +linear-gradient(top, #FFF797, #F2DB56)
37 |
--------------------------------------------------------------------------------
/app-css/components/index.css.sass:
--------------------------------------------------------------------------------
1 | //= require_tree ./
2 |
--------------------------------------------------------------------------------
/app-css/components/list-subscriber-form.css.sass:
--------------------------------------------------------------------------------
1 | @import "mixins"
2 |
3 | .list-subscriber-form
4 | padding: 8px 0
5 | margin-top: -5px
6 | text-align: center
7 | position: fixed
8 | bottom: 0
9 | left: 0
10 | right: 0
11 | z-index: 10000
12 |
13 | // background: rgba(#5693E7, 0.2)
14 | background: #5693E7
15 | color: #fff
16 | text-shadow: 0 0 3px rgba(#000, 0.5)
17 |
18 | .close-subscribe-form
19 | position: absolute
20 | right: 10px
21 | top: 18px
22 | cursor: pointer
23 | z-index: 100
24 | opacity: 0.3
25 | i
26 | font-size: 20px
27 |
28 | label, .form-control
29 | display: inline-block
30 | margin-top: 3px
31 | margin-bottom: 3px
32 | .form-control
33 | border-color: #efefef
34 | box-shadow: none
35 | width: auto
36 | margin-left: 10px
37 | .subscribe-fields
38 | white-space: nowrap
39 |
--------------------------------------------------------------------------------
/app-css/components/loader.css.scss:
--------------------------------------------------------------------------------
1 | .loader,
2 | .loader:before,
3 | .loader:after {
4 | background: #508FE6;
5 | -webkit-animation: load1 1s infinite ease-in-out;
6 | animation: load1 1s infinite ease-in-out;
7 | width: 1em;
8 | height: 4em;
9 | }
10 | .loader:before,
11 | .loader:after {
12 | position: absolute;
13 | top: 0;
14 | content: '';
15 | }
16 | .loader:before {
17 | left: -1.5em;
18 | -webkit-animation-delay: -0.32s;
19 | animation-delay: -0.32s;
20 | }
21 | .loader {
22 | text-indent: -9999em;
23 | margin: auto;
24 | position: relative;
25 | font-size: 11px;
26 | -webkit-transform: translateZ(0);
27 | -ms-transform: translateZ(0);
28 | transform: translateZ(0);
29 | -webkit-animation-delay: -0.16s;
30 | animation-delay: -0.16s;
31 | }
32 | .loader:after {
33 | left: 1.5em;
34 | }
35 | @-webkit-keyframes load1 {
36 | 0%,
37 | 80%,
38 | 100% {
39 | box-shadow: 0 0 #508FE6;
40 | height: 4em;
41 | }
42 | 40% {
43 | box-shadow: 0 -2em #508FE6;
44 | height: 5em;
45 | }
46 | }
47 | @keyframes load1 {
48 | 0%,
49 | 80%,
50 | 100% {
51 | box-shadow: 0 0 #508FE6;
52 | height: 4em;
53 | }
54 | 40% {
55 | box-shadow: 0 -2em #508FE6;
56 | height: 5em;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app-css/components/user-profile.css.sass:
--------------------------------------------------------------------------------
1 | @import "mixins"
2 |
3 | .user-profile
4 | margin-bottom: 30px
5 | margin-top: 15px
6 | padding-left: 80px
7 | position: relative
8 | font-size: 18px
9 |
10 | .user-avatar
11 | position: absolute
12 | left: 0
13 | top: 0
14 | width: 60px
15 | height: 60px
16 | border-radius: 60px
17 | background-repeat: no-repeat
18 | background-size: cover
19 | background-position: center center
20 | border: 1px solid #ddd
21 |
22 | .user-name
23 | font-size: 24px
24 | margin-bottom: 0px
25 |
26 | .user-location
27 | color: #999
28 |
29 | .user-actions
30 | margin-top: 5px
31 |
--------------------------------------------------------------------------------
/app-css/pages/content-page.css.sass:
--------------------------------------------------------------------------------
1 | @import "mixins"
2 |
3 | .content-page
4 | h2
5 | font-size: 18px
6 | p
7 | font-size: 14px
8 | color: #aaa
9 |
10 | .about-people
11 | margin-top: 30px
12 | .about-person
13 | margin-left: 10px
14 | margin-right: 10px
15 | border-radius: 10px
16 | text-align: center
17 | margin-bottom: 20px
18 | +xs
19 | border-bottom: 1px solid #efefef
20 | padding-bottom: 20px
21 |
22 | h3
23 | margin-top: 0
24 | font-size: 18px
25 | margin-bottom: 3px
26 | .about-link
27 | display: block
28 | margin-bottom: 5px
29 |
30 | .avatar
31 | width: 100px
32 | height: 100px
33 | background-size: cover
34 | background-position: center
35 | background-repeat: no-repeat
36 | display: inline-block
37 | border-radius: 100px
38 | margin-bottom: 5px
39 |
40 | ul
41 | margin-bottom: 0
42 | font-size: 12px
43 | li
44 | background: #fafafa
45 | border-radius: 5px
46 | padding: 5px
47 | max-width: 300px
48 | margin: auto
49 | margin-bottom: 5px
50 |
51 | &.left
52 | margin-left: 0
53 | &.right
54 | margin-right: 0
55 |
56 | .faq-item
57 | max-width: 750px
58 | h3
59 | font-size: 16px
60 | p
61 | line-height: 1.6
62 |
63 | .content-nav
64 | margin: auto
65 | margin-top: 30px
66 | max-width: 850px
67 | // &.wide
68 | // max-width: 850px
69 |
70 | .content-inner
71 | max-width: 850px
72 | margin: auto
73 | padding: 30px
74 | border: 1px solid #aaa
75 | box-shadow: 0 1px 2px rgba(#000, 0.3)
76 | border-radius: 3px
77 | margin-top: 10px
78 | // &.wide
79 | // max-width: 850px
80 | h2
81 | margin-top: -5px
82 | font-size: 20px
83 |
84 |
85 | .feature
86 | margin-left: -30px
87 | margin-right: -30px
88 | padding-left: 30px
89 | padding-right: 30px
90 | background: #F7FAFE
91 | margin-bottom: 15px
92 | padding-top: 15px
93 | padding-bottom: 15px
94 | margin-top: 15px
95 | h3
96 | margin-top: 0
97 | font-size: 16px
98 | a
99 | color: #333
100 | p
101 | color: #888
102 | p:last-of-type
103 | margin-bottom: 0
104 |
105 | .governance, .contributors
106 | h3
107 | font-size: 16px
108 | a
109 | color: #333
110 |
111 | ul
112 | padding-top: 10px
113 | padding-left: 15px
114 | li
115 | margin-bottom: 10px
116 |
--------------------------------------------------------------------------------
/app-css/pages/index.css.sass:
--------------------------------------------------------------------------------
1 | //= require_tree ./
2 |
--------------------------------------------------------------------------------
/app-css/pages/user-page.css.sass:
--------------------------------------------------------------------------------
1 | @import "mixins"
2 |
3 | .user-page
4 | padding-top: 20px
5 |
6 | .user-form
7 | +clearfix
8 |
9 | margin-top: 15px
10 |
11 | font-size: 14px
12 | max-width: 350px
13 |
14 | label
15 | display: block
16 | .form-control
17 | border: 1px solid #ccc
18 |
19 | .project-list
20 | width: auto
21 |
--------------------------------------------------------------------------------
/app-js/components/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/app-js/components/.gitkeep
--------------------------------------------------------------------------------
/app-js/components/about.js.es6:
--------------------------------------------------------------------------------
1 | (() => {
2 | $(document).ready(() => {
3 | var aboutScreen = $("#about-screen")
4 | var body = $("body");
5 | var navbarAbout = $(".navbar-about");
6 |
7 | var openAbout = () => {
8 | if(aboutScreen.is(".about-static")){ return; }
9 |
10 | aboutScreen.fadeIn("normal", () => {
11 | aboutScreen.scrollTop(0);
12 | });
13 |
14 | body.addClass("about-screen-opened");
15 | navbarAbout.addClass("active");
16 | };
17 | var closeAbout = () => {
18 | if(aboutScreen.is(".about-static")){ return; }
19 |
20 | aboutScreen.fadeOut("fast");
21 | body.removeClass("about-screen-opened");
22 | navbarAbout.removeClass("active");
23 | };
24 |
25 | $(document).on("click touchstart", ".close-about", (e) => {
26 | e.preventDefault();
27 | closeAbout();
28 | });
29 |
30 | $(document).on("click touchstart", "#about-screen", (e) => {
31 | if($(e.target).closest(".about-inner").length > 0) {
32 | return;
33 | }
34 | closeAbout();
35 | });
36 |
37 | $(document).on("click touchstart", ".open-about", (e) => {
38 | e.preventDefault();
39 | openAbout();
40 | });
41 |
42 | $(document).on("click touchstart", ".toggle-about", (e) => {
43 | e.preventDefault();
44 |
45 | if(aboutScreen.is(":visible")) {
46 | closeAbout();
47 | }
48 | else {
49 | openAbout();
50 | }
51 | });
52 |
53 | // show about page on first visit
54 | if($("body").is(".show-intro")) {
55 | openAbout();
56 | }
57 |
58 | });
59 | })();
60 |
--------------------------------------------------------------------------------
/app-js/components/bucket-scroll.js.es6:
--------------------------------------------------------------------------------
1 | (() => {
2 | $(document).ready(() => {
3 |
4 | // only run script on body.bucket-scroll
5 | var body = $("body");
6 | if(!body.is(".bucket-scroll")){ return; }
7 |
8 | var loading = false;
9 |
10 | var loadBucket = (bucket) => {
11 | loading = true;
12 | console.log("loading bucket...", bucket);
13 |
14 | $(".buckets").append `
15 |
16 |
Loading more
17 |
Loading...
18 |
19 |
20 | `
21 |
22 | $.ajax({
23 | type: "GET",
24 | url: `/date/${bucket}`,
25 | dataType: "html",
26 | data: {
27 | partial: true
28 | },
29 | success: (html) => {
30 | var projectList = $(html);
31 | $(".buckets").find(".loading-bucket").replaceWith(projectList);
32 |
33 | if(projectList.is(".end-of-buckets")) {
34 | console.log("Reached the end.");
35 | body.removeClass(".bucket-scroll");
36 | }
37 |
38 | loading = false;
39 |
40 | $(document).trigger("initalizeTooltips")
41 |
42 | },
43 | error: (xhr) => {
44 | console.error(xhr);
45 | },
46 | complete: (json) => {}
47 | });
48 | };
49 |
50 | var triggerScroll = () => {
51 | if(loading) { return; }
52 |
53 | var prevBucket = $(".project-list").last().data("prev-bucket")
54 | if(!prevBucket) {
55 | console.log("End of buckets.")
56 | return;
57 | }
58 |
59 | loadBucket(prevBucket);
60 | };
61 |
62 | // setup infinite scroll
63 | $(window).scroll((e) => {
64 |
65 | if(!((window.innerHeight + window.scrollY) >= document.body.offsetHeight)) {
66 | return;
67 | }
68 |
69 | triggerScroll();
70 | });
71 |
72 |
73 | // ghetto fix for homepage
74 | setTimeout(() => {
75 | triggerScroll();
76 | }, 500);
77 | setTimeout(() => {
78 | triggerScroll();
79 | }, 1000);
80 | setTimeout(() => {
81 | triggerScroll();
82 | }, 1500);
83 | setTimeout(() => {
84 | triggerScroll();
85 | }, 2000);
86 |
87 | });
88 | })();
89 |
--------------------------------------------------------------------------------
/app-js/components/flash-message.js.es6:
--------------------------------------------------------------------------------
1 | (() => {
2 | var $ = jQuery;
3 |
4 | var hideFlash = (flashElement) => {
5 | $(flashElement).slideUp()
6 | };
7 |
8 |
9 | $(document).on("click touchstart", ".flash-hide-btn", (e) => {
10 | e.preventDefault();
11 |
12 | var flashElement = $(e.target).closest(".flash-message");
13 | hideFlash(flashElement);
14 | });
15 |
16 | $(document).ready(() => {
17 | $(".flash-message").each((i, el) => {
18 | setTimeout(() => {
19 | hideFlash(el)
20 | }, 5000);
21 | });
22 | });
23 |
24 | })();
25 |
--------------------------------------------------------------------------------
/app-js/components/index.js.es6:
--------------------------------------------------------------------------------
1 | //= require_tree ./
2 |
--------------------------------------------------------------------------------
/app-js/components/list-subscriber-form.js.es6:
--------------------------------------------------------------------------------
1 | (() => {
2 |
3 | $(document).on("click", ".close-subscribe-form", (e) => {
4 | e.preventDefault();
5 | Cookies.set('hide_subscribe', true, { expires: 90 });
6 | $(e.target).closest(".list-subscriber-form").slideUp("fast")
7 | });
8 |
9 | })();
10 |
--------------------------------------------------------------------------------
/app-js/components/new-project.js.es6:
--------------------------------------------------------------------------------
1 | (() => {
2 | $(document).ready(() => {
3 | $("#new-product input[type=text]" ).on('focus', function(e) {
4 | $(e.target).prev().css({'color':'rgb(80, 143, 230)'});
5 | });
6 |
7 | $("#new-product input[type=text]" ).on('blur', function(e) {
8 | $(e.target).val() === '' ? $(e.target).prev().css({'color':'#000'}) : null
9 | })
10 |
11 | if ($('#new-product .form-group').hasClass('has-error')) {
12 | $( "input[type=text]" ).on('focus', function(e) {
13 | $(e.target).next('p.help-block').fadeOut();
14 | });
15 | }
16 | });
17 | })();
18 |
--------------------------------------------------------------------------------
/app-js/components/project-list.js.es6:
--------------------------------------------------------------------------------
1 | (() => {
2 |
3 | $(document).on("click touchstart", ".more-projects-btn", (e) => {
4 | e.preventDefault();
5 |
6 | $(e.target).closest(".project-list").addClass("expanded");
7 | });
8 |
9 | })();
10 |
--------------------------------------------------------------------------------
/app-js/components/tooltips.js.es6:
--------------------------------------------------------------------------------
1 | (() => {
2 | $(document).on("initalizeTooltips", () => {
3 | $('[data-toggle="tooltip"]').tooltip({
4 | 'animation': false,
5 | 'delay': 0,
6 | 'placement': 'left'
7 | });
8 | });
9 |
10 | $(document).ready(() => {
11 | $(document).trigger("initalizeTooltips");
12 | });
13 |
14 | })();
15 |
--------------------------------------------------------------------------------
/app-js/components/votes.js.es6:
--------------------------------------------------------------------------------
1 | (() => {
2 | $(document).ready(() => {
3 |
4 | $(document).on("click touchstart", ".item-vote.ajax", (e) => {
5 | e.preventDefault();
6 |
7 | var voteElement = $(e.target).closest(".item-vote");
8 | var type = voteElement.is(".on") ? "DELETE" : "POST"
9 | voteElement.toggleClass("on")
10 |
11 | $.ajax({
12 | type: type,
13 | url: voteElement.attr("href"),
14 | dataType: "json",
15 | success: (json) => {
16 | console.log("Success:", json)
17 | voteElement.find(".counter").text(json.project.votes_count)
18 | },
19 | error: (xhr) => {
20 | var json = xhr.responseJSON;
21 | if(json){
22 | console.error(json);
23 | }
24 | },
25 | complete: (json) => {
26 |
27 | }
28 | });
29 |
30 | });
31 |
32 | });
33 | })();
34 |
--------------------------------------------------------------------------------
/app-js/vendor/js.cookie-2.0.4.min.js:
--------------------------------------------------------------------------------
1 | /*! js-cookie v2.0.4 | MIT */
2 | /* https://github.com/js-cookie/js-cookie/tree/v2.0.4#readme */
3 | !function(a){if("function"==typeof define&&define.amd)define(a);else if("object"==typeof exports)module.exports=a();else{var b=window.Cookies,c=window.Cookies=a();c.noConflict=function(){return window.Cookies=b,c}}}(function(){function a(){for(var a=0,b={};a1){if(f=a({path:"/"},d.defaults,f),"number"==typeof f.expires){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}try{g=JSON.stringify(e),/^[\{\[]/.test(g)&&(e=g)}catch(i){}return e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)),b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),b=b.replace(/[\(\)]/g,escape),document.cookie=[b,"=",e,f.expires&&"; expires="+f.expires.toUTCString(),f.path&&"; path="+f.path,f.domain&&"; domain="+f.domain,f.secure?"; secure":""].join("")}b||(g={});for(var j=document.cookie?document.cookie.split("; "):[],k=/(%[0-9A-Z]{2})+/g,l=0;l :desc).limit(100)
6 | # TODO: paginate
7 | end
8 |
9 | def edit
10 | load_log
11 | end
12 |
13 | def update
14 |
15 | load_log
16 |
17 | @log.note = params[:note]
18 |
19 | if @log.save!
20 | redirect_to(params[:redirect_url] || '/audit')
21 | else
22 | @errors = @log.errors
23 | render :edit
24 | end
25 | end
26 |
27 | protected
28 | def load_log
29 | @log = AuditLog.where(id: params[:id]).first
30 | end
31 |
32 | def require_moderator
33 | unless current_user.try(:moderator?)
34 | flash[:alert] = "Only moderators can access this page."
35 | redirect_to "/"
36 | end
37 | end
38 |
39 | end
40 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/app/controllers/help_controller.rb:
--------------------------------------------------------------------------------
1 | class HelpController < ApplicationController
2 |
3 | def about
4 | end
5 |
6 | def team
7 | end
8 |
9 | def guidelines
10 | end
11 |
12 | def faqs
13 | end
14 |
15 | def contact
16 | end
17 |
18 | end
--------------------------------------------------------------------------------
/app/controllers/list_subscribers_controller.rb:
--------------------------------------------------------------------------------
1 | class ListSubscribersController < ApplicationController
2 | before_filter :load_list_subscriber
3 |
4 | def edit
5 | end
6 |
7 | def update
8 | @list_subscriber ||= ListSubscriber.new(email: params[:email])
9 | @list_subscriber.email = params[:email]
10 | @list_subscriber.email_format = params[:email_format]
11 | @list_subscriber.subscribed = (params[:subscribed] == "true")
12 |
13 | if @list_subscriber.save
14 | set_subscriber(@list_subscriber)
15 |
16 | if params[:redirect_url]
17 | flash[:notice] = "Subscription settings saved."
18 | redirect_to params[:redirect_url]
19 | else
20 | redirect_to "/subscribe/success"
21 | end
22 | else
23 | render :edit
24 | end
25 | end
26 |
27 | def success
28 | if current_subscriber.blank?
29 | redirect_to "/subscribe"
30 | end
31 | end
32 |
33 | def confirm
34 | # TODO: confirm subscription
35 | end
36 |
37 | protected
38 | def load_list_subscriber
39 | @list_subscriber = current_subscriber
40 | end
41 |
42 |
43 | end
44 |
--------------------------------------------------------------------------------
/app/controllers/pages_controller.rb:
--------------------------------------------------------------------------------
1 | class PagesController < ApplicationController
2 | def about
3 |
4 | end
5 |
6 | def people
7 | end
8 |
9 | def faq
10 | end
11 |
12 | def differences
13 | end
14 |
15 | def governance
16 | end
17 |
18 | if Rails.env.development?
19 | def test_flash
20 | type = (params[:type] || "alert").to_sym
21 | msg = params[:message].presence || "Some test flash"
22 | flash[type] = msg
23 | redirect_to "/"
24 | end
25 |
26 | def devauth
27 | if params[:screen_name].present?
28 | user = User.where(screen_name: params[:screen_name]).first
29 | if user.present?
30 | session[:user_id] = user.id
31 | redirect_to "/"
32 | return
33 | end
34 | end
35 |
36 | # TODO: paginate
37 | @users = User.all.order(:created_at => :asc).limit(200)
38 | end
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/app/controllers/sessions_controller.rb:
--------------------------------------------------------------------------------
1 | class SessionsController < ApplicationController
2 | def auth_start
3 | PreAuth.call(params: params, session: session)
4 | redirect_to "/auth/twitter"
5 | end
6 |
7 | def auth_callback
8 | result = AuthUser.call(auth: auth_hash)
9 |
10 | set_user(result.user)
11 |
12 | post_auth = PostAuth.call(user: current_user, session: session)
13 |
14 | redirect_to "/"
15 | end
16 |
17 | def auth_failure
18 | @login_type = params[:strategy].to_s.capitalize.presence
19 |
20 | case params[:message]
21 | when "invalid_credentials"
22 | @login_error = "Invalid credentials. Please try logging in again."
23 | else
24 | @login_error = "Our app is broken."
25 | end
26 |
27 | end
28 |
29 | def logout
30 | if current_user.blank?
31 | redirect_to "/"
32 | return
33 | end
34 | end
35 |
36 | def logout_complete
37 | clear_user
38 | clear_subscriber
39 |
40 | flash[:message] = "You are now logged out."
41 | redirect_to "/"
42 | end
43 |
44 | protected
45 |
46 | def auth_hash
47 | request.env['omniauth.auth']
48 | end
49 |
50 | def get_twitter_auth(oauth_token, oauth_secret)
51 | client = Twitter::REST::Client.new do |config|
52 | config.consumer_key = Settings.twitter_key
53 | config.consumer_secret = Settings.twitter_secret
54 | config.access_token = oauth_token
55 | config.access_token_secret = oauth_secret
56 | end
57 |
58 | client.user.to_hash
59 | end
60 | end
61 |
--------------------------------------------------------------------------------
/app/controllers/users_controller.rb:
--------------------------------------------------------------------------------
1 | class UsersController < ApplicationController
2 | before_filter :require_user, only: [:ban, :unban, :make_moderator, :remove_moderator, :edit, :update]
3 |
4 | def show
5 | load_user
6 | if @user.blank?
7 | redirect_to "/"
8 | return
9 | end
10 |
11 | load_voted_projects
12 | load_submitted_projects
13 |
14 | if current_user.present?
15 | @vote_ids = current_user.match_votes((@voted_projects+@submitted_projects).map(&:id))
16 | end
17 | end
18 |
19 | def edit
20 | @user = current_user
21 |
22 | end
23 |
24 | def update
25 | @user = current_user
26 |
27 | end
28 |
29 | def ban
30 | load_user
31 |
32 | result = current_user.ban_user(@user)
33 | redirect_url = "/@#{@user.screen_name}"
34 | redirect_to "/audit/#{result.id}/edit?redirect_url=#{redirect_url}"
35 | end
36 |
37 | def unban
38 | load_user
39 |
40 | result = current_user.unban_user(@user)
41 | redirect_url = "/@#{@user.screen_name}"
42 | redirect_to "/audit/#{result.id}/edit?redirect_url=#{redirect_url}"
43 | end
44 |
45 | def make_moderator
46 | load_user
47 |
48 | result = current_user.make_moderator(@user)
49 | redirect_url = "/@#{@user.screen_name}"
50 | redirect_to "/audit/#{result.id}/edit?redirect_url=#{redirect_url}"
51 | end
52 |
53 | def remove_moderator
54 | load_user
55 |
56 | result = current_user.remove_moderator(@user)
57 | redirect_url = "/@#{@user.screen_name}"
58 | redirect_to "/audit/#{result.id}/edit?redirect_url=#{redirect_url}"
59 | end
60 |
61 | protected
62 | def load_user
63 | @user = User.where("lower(screen_name) =?", params[:screen_name]).first
64 | end
65 |
66 | def load_voted_projects
67 | @voted_projects = @user.voted_projects.order(:votes_count => :desc)
68 | end
69 |
70 | def load_submitted_projects
71 | @submitted_projects = @user.submitted_projects.order(:votes_count => :desc)
72 | end
73 | end
74 |
--------------------------------------------------------------------------------
/app/forms/project_form.rb:
--------------------------------------------------------------------------------
1 | class ProjectForm
2 | include ActiveAttr::Model
3 |
4 | attribute :name
5 | validates_presence_of :name
6 | validates_length_of :name, maximum: 80, allow_blank: true
7 |
8 | attribute :url
9 | validates_presence_of :url
10 | validates_url :url, :allow_blank => true, :message => "Oops! Looks like the URL isn't valid. Try checking if the site actually exists first."
11 | # may need to validate if domain actually exists, since the URI parser Addressable::URI used in validates_url gem is very lenient
12 | validate :check_unique_url
13 |
14 | attr_accessor :current_project_id
15 |
16 | def check_unique_url
17 | return if url.blank?
18 |
19 | normalized_url = Project.normalize_url(url)
20 | dupe_project = Project.get_duplicate_by_url(normalized_url)
21 |
22 | if dupe_project.present? and dupe_project.id != current_project_id
23 | errors.add(:url, "has already been submitted")
24 | end
25 | end
26 |
27 | def ensure_http_on_url
28 | unless self.url[/\Ahttp:\/\//] || self.url[/\Ahttps:\/\//]
29 | self.url = "http://#{self.url}"
30 | end
31 | end
32 |
33 | attribute :description
34 | validates_presence_of :description
35 | validates_length_of :description, maximum: 80, allow_blank: true
36 |
37 | def self.for_update(params, project)
38 | params = params.with_indifferent_access
39 | form = ProjectForm.new
40 | form.current_project_id = project.id
41 | form.name = params[:name] || project.name
42 | form.url = params[:url] || project.url
43 | form.description = params[:description] || project.description
44 | form
45 | end
46 | end
47 |
--------------------------------------------------------------------------------
/app/interactors/auth_user.rb:
--------------------------------------------------------------------------------
1 | class AuthUser < BaseInteractor
2 |
3 | def call
4 | require_context(:auth)
5 |
6 | auth = context.auth
7 |
8 | # TODO: make this support other providers
9 |
10 | user = User.find_or_initialize_by({
11 | twitter_id: auth.uid
12 | })
13 |
14 | # set data from twitter auth
15 | user.screen_name = auth.info.nickname
16 | user.name = auth.info.name
17 | user.profile_image_url = auth.info.image
18 | user.twitter_id = auth.uid
19 | user.location = auth.info.location
20 | user.save!
21 |
22 | context.user = user
23 | end
24 |
25 | end
26 |
--------------------------------------------------------------------------------
/app/interactors/base_interactor.rb:
--------------------------------------------------------------------------------
1 | class BaseInteractor
2 | include Interactor
3 |
4 | # checks if a field is in context, raises exception if not
5 | def require_context(field_name)
6 | if context.send(field_name).present?
7 | return true
8 | else
9 | raise "No #{field_name} param provided for #{self.class}"
10 | return false
11 | end
12 | end
13 |
14 | # checks if a field is in context, fail if not
15 | def validate_context(field_name, msg = nil)
16 | if context.send(field_name).present?
17 | return true
18 | else
19 | context.fail!({
20 | message: msg.presence || "#{field_name} param is required"
21 | })
22 | end
23 | end
24 |
25 | def params
26 | if context.params.blank?
27 | context.params = Util.indifferent({})
28 | end
29 | context.params
30 | end
31 |
32 | end
33 |
--------------------------------------------------------------------------------
/app/interactors/post_auth.rb:
--------------------------------------------------------------------------------
1 | # go through session items post login and perform actions (such as vote, etc)
2 | class PostAuth < BaseInteractor
3 |
4 | def call
5 | require_context(:session)
6 | require_context(:user)
7 |
8 | # find project the user was voting on, and vote it up automatically
9 | vote_project_slug = session[:vote_project_slug]
10 | session[:vote_project_slug] = nil
11 |
12 | if vote_project_slug.present?
13 | project = Project.where(slug: vote_project_slug).first
14 | context.user.vote(project)
15 | end
16 |
17 | # set redirect_to
18 | context.redirect_to = session[:redirect_to].presence
19 | end
20 |
21 | def session
22 | context.session
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/app/interactors/pre_auth.rb:
--------------------------------------------------------------------------------
1 | # store param variables into session before login (so we can act on them after login)
2 | class PreAuth < BaseInteractor
3 | def call
4 | require_context(:params)
5 |
6 | # go through session items and store actons for later (such as vote, etc)
7 | context.session[:vote_project_slug] = context.params[:vote]
8 |
9 | # save redirect_to
10 | context.session[:redirect_to] = context.params[:redirect_to]
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/interactors/update_project.rb:
--------------------------------------------------------------------------------
1 | class UpdateProject < BaseInteractor
2 |
3 | def call
4 | require_context :project
5 | require_context :user
6 |
7 | context.form = ProjectForm.for_update(params, context.project)
8 |
9 | # TODO: store slug history in case we change name (so old slugs still go project)
10 | # ie: /asdf_old redirects to /asdf_new
11 |
12 | context.fail!(errors: "You are not allowed to do this") unless user_is_allowed?
13 |
14 | if context.form.valid?
15 | audit_action if context.user.moderator?
16 | context.project.update_attributes!(params)
17 | else
18 | context.fail! errors: context.form.errors
19 | end
20 | end
21 |
22 | def user_is_allowed?
23 | return true if context.user.moderator?
24 | return true if context.user.is_submitter?(context.project)
25 | # TODO: check that submitter is within the allowed time period
26 | return false
27 | end
28 |
29 | def audit_action
30 | context.audit_log = AuditLog.create!({
31 | item_type: "update_project",
32 | moderator_id: context.user.id,
33 | target_id: context.project.id,
34 | target_type: "Project",
35 | target_display: context.form.name,
36 | target_url: "/detail/#{context.project.reload.slug}"
37 | })
38 | end
39 | end
40 |
--------------------------------------------------------------------------------
/app/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/app/mailers/.keep
--------------------------------------------------------------------------------
/app/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/app/models/.keep
--------------------------------------------------------------------------------
/app/models/audit_log.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: audit_logs
4 | #
5 | # id :integer not null, primary key
6 | # moderator_id :integer
7 | # item_type :string
8 | # target_id :integer
9 | # target_type :string
10 | # target_display :string
11 | # target_url :string
12 | # created_at :datetime not null
13 | # updated_at :datetime not null
14 | # note :string
15 | #
16 |
17 | class AuditLog < ActiveRecord::Base
18 | belongs_to :moderator, class_name: "User"
19 | belongs_to :project
20 |
21 |
22 | end
23 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/app/models/concerns/.keep
--------------------------------------------------------------------------------
/app/models/feedback.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: feedbacks
4 | #
5 | # id :integer not null, primary key
6 | # body :text not null
7 | # anonymous :boolean default(FALSE)
8 | # project_id :integer not null
9 | # user_id :integer
10 | # anon_user_hash :string
11 | # created_at :datetime not null
12 | # updated_at :datetime not null
13 | #
14 |
15 | class Feedback < ActiveRecord::Base
16 | belongs_to :project, counter_cache: true
17 | belongs_to :user
18 |
19 | validates_presence_of :body, :message => "can't be blank"
20 | end
21 |
--------------------------------------------------------------------------------
/app/models/list_subscriber.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: list_subscribers
4 | #
5 | # id :integer not null, primary key
6 | # email :string not null
7 | # subscribed :boolean default(TRUE)
8 | # user_id :integer
9 | # created_at :datetime not null
10 | # updated_at :datetime not null
11 | # confirmed :boolean default(FALSE)
12 | # confirm_code :string
13 | # email_format :string
14 | #
15 |
16 | class ListSubscriber < ActiveRecord::Base
17 |
18 | # optional user_id
19 | belongs_to :user
20 |
21 | validates_presence_of :email
22 | validates_email :email, :allow_blank => true
23 | validates_uniqueness_of :email, :on => :create, :message => "is already taken"
24 |
25 | end
26 |
--------------------------------------------------------------------------------
/app/models/vote.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: votes
4 | #
5 | # id :integer not null, primary key
6 | # user_id :integer not null
7 | # project_id :integer not null
8 | # created_at :datetime not null
9 | # updated_at :datetime not null
10 | #
11 |
12 | class Vote < ActiveRecord::Base
13 | belongs_to :user
14 | belongs_to :project, counter_cache: true
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/app/serializers/feedback_serializer.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: feedbacks
4 | #
5 | # id :integer not null, primary key
6 | # body :text not null
7 | # anonymous :boolean default(FALSE)
8 | # project_id :integer not null
9 | # user_id :integer
10 | # anon_user_hash :string
11 | # created_at :datetime not null
12 | # updated_at :datetime not null
13 | #
14 |
15 | class FeedbackSerializer < ActiveModel::Serializer
16 | attributes :id, :user_id, :project_id, :body, :anonymous, :created_at, :updated_at
17 |
18 | end
19 |
--------------------------------------------------------------------------------
/app/serializers/project_serializer.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: projects
4 | #
5 | # id :integer not null, primary key
6 | # name :string not null
7 | # description :string not null
8 | # url :string not null
9 | # normalized_url :string not null
10 | # bucket :string not null
11 | # slug :string not null
12 | # user_id :integer not null
13 | # hidden :boolean default(FALSE)
14 | # votes_count :integer default(0)
15 | # feedbacks_count :integer default(0)
16 | # created_at :datetime not null
17 | # updated_at :datetime not null
18 | #
19 | # Indexes
20 | #
21 | # index_projects_on_bucket (bucket)
22 | # index_projects_on_slug (slug)
23 | #
24 |
25 | class ProjectSerializer < ActiveModel::Serializer
26 | attributes :id, :slug, :name, :description, :url, :votes_count, :feedbacks_count, :created_at, :user_id
27 |
28 | # TODO: user
29 | end
30 |
--------------------------------------------------------------------------------
/app/views/audit_logs/edit.html.haml:
--------------------------------------------------------------------------------
1 | %div#new-product.row
2 | %div.new-product-wrapper.col-md-6.col-sm-12.col-xs-12.col-md-offset-3
3 | %h2 Add a Note
4 | %p.text-center Explain why you just did what you did
5 | = form_tag "/audit/#{@log.id}", method: :patch do
6 | %div{:class => "form-group #{error_class(:note)}"}
7 | %label{:for => "note"} Note
8 | = text_field_tag "note", @log.note, class: "form-control", placeholder: "Why did you do this?"
9 | = field_errors(:note)
10 | .form-actions.text-center
11 | %button.btn.btn-primary.btn-super{:type => "submit"} Add Note
12 |
--------------------------------------------------------------------------------
/app/views/audit_logs/index.html.haml:
--------------------------------------------------------------------------------
1 | %h2 Audit Trail
2 | %p
3 | List of all actions that Open Hunt moderators have taken on the site.
4 |
5 | - if not @audit_logs.blank?
6 | %table.table.table-striped
7 | %thead
8 | %tr
9 | %td Date
10 | %td Moderator
11 | %td Log
12 | %td Reason
13 | %tbody
14 | - @audit_logs.each do |log|
15 | - moderator = log.moderator
16 | %tr
17 | %td
18 | = log.created_at.strftime("%a %b %d, %Y at %I:%M%p")
19 | %td
20 | %a{:href => '/@' + moderator.screen_name}
21 | = moderator.screen_name
22 | %td
23 | = audit_description(log)
24 | %td
25 | - if log.note
26 | = log.note
27 | - else
28 | %p No logs are available at this time.
--------------------------------------------------------------------------------
/app/views/help/about.haml:
--------------------------------------------------------------------------------
1 | .help-container
2 | .row
3 | = render 'layouts/help'
4 | .col-md-10
5 | %h1 About
6 | %p
7 | Open Hunt is a brand new community for fans and builders of
8 | early stage technology products. We aim to be completely open
9 | and transparent, without insiders or gatekeepers who control
10 | who gets listed and who gets left out.
11 | %p
12 | This list may be overwhelming initially, but we're actively working on tools to let the community surface the best products to the top.
13 | %p
14 | You can get involved: file an issue
15 | or submit a pull request. With your support, we can create an
16 | alternative product enthusiast community that lasts.
17 | %p Thank you!
18 | %p
19 | %strong The Open Hunt team
--------------------------------------------------------------------------------
/app/views/help/contact.haml:
--------------------------------------------------------------------------------
1 | .help-container
2 | .row
3 | = render 'layouts/help'
4 | .col-md-10
5 | %h1 Contact
6 | If you would like to get in touch with the team, you can do so via email.
--------------------------------------------------------------------------------
/app/views/help/guidelines.haml:
--------------------------------------------------------------------------------
1 | .help-container
2 | .row
3 | = render 'layouts/help'
4 | .col-md-10
5 | %h1 Guidelines
6 | %p
7 | Open Hunt top goal is to be run by and for the community.
8 | To accomplish this, key decisions will be made by the Council
9 | elected by the community. The elected chief has the same vote as other members,
10 | but can also veto proposals.
11 | %p
12 | All council meetings will be conducted via Slack and publically posted.
13 | Proposals will be tracked and discussed via GitHub issues.
14 | %p
15 | Voting will be held a couple months after launch. The initial council consists of
16 | contributors to the initial site launch.
17 | %h3 Current Council
18 | %ul
19 | %li
20 | %a(href="http://github.com/jacquescrocker")
21 | Jacques Crocker (chief)
22 | %li
23 | %a(href="http://github.com/mhurwi")
24 | Mark Hurwitz
25 | %li
26 | %a(href="http://github.com/marccantwell")
27 | Marc Cantwell
28 | %li
29 | %a(href="http://github.com/mbajur")
30 | Michał Bajur
31 | %li
32 | %a(href="http://github.com/jrbapna")
33 | Jason Bapna
--------------------------------------------------------------------------------
/app/views/help/team.haml:
--------------------------------------------------------------------------------
1 | .help-container
2 | .row
3 | = render 'layouts/help'
4 | .col-md-10
5 | %h1 Team
6 | %p
7 | Open Hunt was cobbled together by a small group of independent developers. Please help! Join us on GitHub.
8 |
9 | %h3 Contributors
10 | .row
11 | %ul
12 | %li
13 | %a(href="http://github.com/jacquescrocker") Jacques Crocker
14 | %li
15 | %a(href="http://twitter.com/mhurwi") Mark Hurwitz
16 | %li
17 | %a(href="https://twitter.com/marccantwell") Marc Cantwell
18 | %li
19 | %a(href="http://github.com/mbajur") Michał Bajur
20 | %li
21 | %a(href="http://github.com/jrbapna") Jason Bapna
22 | %li
23 | %a(href="http://github.com/nblackburn") Nathaniel Blackburn
24 | %li
25 | %a(href="http://github.com/wonderbread") Rob McFadzean
26 | %li
27 | %a(href="http://github.com/kiriappeee") Adnan Issadeen
28 | %li
29 | %a(href="http://github.com/rjsamson") Robert J Samson
30 | %li
31 | %a(href="http://github.com/brendannee") Brendan Nee
32 | %li
33 | %a(href="http://github.com/skx") Steve Kemp
34 | %li
35 | %a(href="http://github.com/openhunting/openhunt") You (we hope!)
36 |
--------------------------------------------------------------------------------
/app/views/layouts/_analytics.html.erb:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/views/layouts/_detail_panel.html.haml:
--------------------------------------------------------------------------------
1 | #detail-panel{class: ("loading" unless @show_detail_panel)}
2 |
3 | .project-loading
4 | Loading...
5 |
6 | - if @show_detail_panel
7 | = render partial: "projects/detail", project: @project, feedback: @feedback
8 | - else
9 | .project-feedback
10 |
--------------------------------------------------------------------------------
/app/views/layouts/_flash_messages.html.haml:
--------------------------------------------------------------------------------
1 | - if notice.present?
2 | .flash-message.flash-notice
3 | %p
4 | = notice
5 | = link_to "Hide this message", "#", :class => "flash-hide-btn"
6 | - elsif alert.present?
7 | .flash-message.flash-alert
8 | %p
9 | = alert
10 | = link_to "Hide this message", "#", :class => "flash-hide-btn"
11 |
--------------------------------------------------------------------------------
/app/views/layouts/_help.html.haml:
--------------------------------------------------------------------------------
1 | .col-md-2
2 | .list-group
3 | %a.list-group-item{:href => '/about', :class => ('active' if current_page?(action: 'about', controller: 'help'))} About
4 | %a.list-group-item{:href => '/team', :class => ('active' if current_page?(action: 'team', controller: 'help'))} Team
5 | %a.list-group-item{:href => '/guidelines', :class => ('active' if current_page?(action: 'guidelines', controller: 'help'))} Guidelines
6 | %a.list-group-item{:href => '/faqs', :class => ('active' if current_page?(action: 'faqs', controller: 'help'))} FAQ's
7 | %a.list-group-item{:href => '/contact', :class => ('active' if current_page?(action: 'contact', controller: 'help'))} Contact
8 |
--------------------------------------------------------------------------------
/app/views/layouts/_navbar.html.haml:
--------------------------------------------------------------------------------
1 | %nav.navbar.navbar-default.navbar-fixed-top
2 | .container
3 | .navbar-header
4 | %a.navbar-brand{href: '/'} Open Hunt
5 | %ul.nav.navbar-nav.navbar-right
6 | %li{class: ('active' if current_page?(action: 'new', controller: 'projects'))}
7 | %a{:href => '/new'} + Post
8 | %li
9 | %a{:class => 'dropdown-toggle', :href => '#', 'data-toggle' => 'dropdown'}
10 | Help
11 | %span{:class => 'caret'}
12 | %ul{:class => 'dropdown-menu'}
13 | %li{:class => ('active' if current_page?(action: 'about', controller: 'help'))}
14 | %a{:href => '/about'} About
15 | %li{:class => ('active' if current_page?(action: 'team', controller: 'help'))}
16 | %a{:href => '/team'} Team
17 | %li{:class => ('active' if current_page?(action: 'guidelines', controller: 'help'))}
18 | %a{:href => '/guidelines'} Guidelines
19 | %li{:class => ('active' if current_page?(action: 'faqs', controller: 'help'))}
20 | %a{:href => '/faqs'} FAQ's
21 | %li{:class => ('active' if current_page?(action: 'contact', controller: 'help'))}
22 | %a{:href => '/contact'} Contact
23 |
24 | - if current_user.present?
25 | %li.profile-nav
26 | %a{:class => 'dropdown-toggle', :href => '#', 'data-toggle' => 'dropdown'}
27 | .user-avatar(style="background-image:url('#{current_user.profile_image_url}');")
28 | %span{:class => 'caret'}
29 | %ul{:class => 'dropdown-menu'}
30 | %li{:class => 'dropdown-header'}
31 | = current_user.screen_name
32 | %li{class: ('active' if current_page?(action: 'show', controller: 'users', screen_name: current_user.screen_name))}
33 | %a{:href => "/@#{current_user.screen_name}"} Profile
34 | %li{class: ('active' if current_page?(action: 'edit', controller: 'users'))}
35 | %a{:href => "/settings"} Settings
36 | - if current_user.moderator?
37 | %li{class: ("active" if current_page?(action: "index", controller: "audit_logs"))}
38 | %a{:href => "/audit"} Audit Trail
39 | %li
40 | %a{:href => '/logout', 'data-method' => 'POST'} Logout
41 | - else
42 | %li
43 | %a{:href => '/login'} Login
44 |
--------------------------------------------------------------------------------
/app/views/layouts/application.html.haml:
--------------------------------------------------------------------------------
1 | !!!
2 | %html(lang="en")
3 | %head
4 | %title Open Hunt - discover new products, give feedback, help each other
5 | %meta{"name" => "viewport", "content" => "width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"}/
6 | %meta{"content" => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
7 | %meta{"charset" => "utf-8"}/
8 |
9 | = stylesheet_link_tag "dependencies", "application", media: 'all'
10 | = stylesheet_link_tag "https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"
11 | = csrf_meta_tags
12 |
13 | = content_for(:head)
14 |
15 | %body(class="#{body_css} #{'show-intro' if show_intro?}")
16 |
17 | - if @skip_header
18 | - flash.keep
19 | - else
20 | = render "layouts/navbar"
21 | = render "layouts/flash_messages"
22 |
23 | = content_for(:after_header)
24 |
25 | .container
26 | = yield
27 |
28 | = render "layouts/detail_panel"
29 |
30 | - if Settings.include_analytics
31 | = render "layouts/analytics"
32 | = javascript_include_tag "dependencies", "application"
33 | = render "layouts/rollbar"
34 |
--------------------------------------------------------------------------------
/app/views/list_subscribers/_subscribe_form.html.erb:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/app/views/list_subscribers/confirm.html.erb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/app/views/list_subscribers/confirm.html.erb
--------------------------------------------------------------------------------
/app/views/list_subscribers/edit.html.haml:
--------------------------------------------------------------------------------
1 | - skip_header
2 |
3 | .splash-box
4 | %h2
5 | Subscribe to Open Hunt
6 |
7 | -# TODO
8 |
--------------------------------------------------------------------------------
/app/views/list_subscribers/success.html.haml:
--------------------------------------------------------------------------------
1 | -# - skip_header
2 |
3 | .splash-box
4 | %h2
5 | Awesome, you are now subscribed.
6 |
7 | %p
8 | Check your inbox to confirm.
9 |
10 | %p.actions
11 | %a.btn.btn-primary.btn-super{:href => "/"}
12 | Back to Homepage
13 |
--------------------------------------------------------------------------------
/app/views/pages/about.html.erb:
--------------------------------------------------------------------------------
1 | <%= render "pages/about_screen", static: true %>
2 |
--------------------------------------------------------------------------------
/app/views/pages/devauth.html.haml:
--------------------------------------------------------------------------------
1 | - skip_header
2 |
3 | .splash-box
4 | %h2
5 | Pick a user to login as:
6 |
7 | %ul.list-unstyled
8 | - @users.each do |user|
9 | %li
10 | %a(href="/devauth/#{user.screen_name}")
11 | == @#{user.screen_name}
12 |
--------------------------------------------------------------------------------
/app/views/projects/_end_of_buckets.html.haml:
--------------------------------------------------------------------------------
1 | .project-list.end-of-buckets
2 | %p You reached the beginning!
3 | %p Open Hunt launched on #{Settings.site_launch}
4 |
--------------------------------------------------------------------------------
/app/views/projects/_project.atom.jbuilder:
--------------------------------------------------------------------------------
1 | feed.entry(project, url: project.url) do |entry|
2 | entry.title(project.name)
3 | entry.content(project.description)
4 |
5 | entry.author do |author|
6 | author.name(project.user.screen_name)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/projects/_project.rss.jbuilder:
--------------------------------------------------------------------------------
1 | xml.item do
2 | xml.title project.name
3 | xml.description project.description
4 | xml.pubDate project.created_at.to_s(:rfc822)
5 | xml.link project.url
6 | xml.guid root_url(anchor: "open=#{project.slug}")
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/projects/_project_listings.html.haml:
--------------------------------------------------------------------------------
1 | - projects.each do |project|
2 | .project-listing.item.row{"data-project-slug" => project.slug, class: ("marked-as-spam" if project.hidden?)}
3 | .item-details.col-md-9.col-sm-9.col-xs-10
4 | %a.item-vote{project_vote_attributes(project)}
5 | .box
6 | .arrow
7 | %span.triangle{"aria-hidden" => "true"}
8 | ▲
9 | .counter
10 | = project.votes_count
11 |
12 | %a.title{href: project.url, target: "_blank"}
13 | = project.name
14 | .description
15 | = project.description
16 | .item-comments.col-md-3.col-sm-3.col-xs-2
17 | .item-comments-inner
18 | - user = project.user
19 | - if user
20 | %span.posted-by.hidden-xs Posted by
21 | %a.user-avatar(href="/@#{user.screen_name}")
22 | %img{src: user.profile_image_url, class: 'img-circle', 'data-toggle'=>"tooltip", :title=>"@#{user.screen_name} #{user.location}"}
23 |
24 | -# .comments-gif
25 | -# %span.glyphicon.glyphicon-comment{"aria-hidden" => "true"}
26 |
27 | - if projects.blank?
28 | .empty-projects
29 | %p= local_assigns[:empty_msg] || "No products found."
30 |
--------------------------------------------------------------------------------
/app/views/projects/_projects_for_bucket.html.haml:
--------------------------------------------------------------------------------
1 | - next_bucket = Project.next_bucket(time)
2 | - prev_bucket = Project.prev_bucket(time)
3 |
4 | .project-list.row{"data-next-bucket" => next_bucket, "data-prev-bucket" => prev_bucket, class: ("expanded" if Project.is_bucket_today?(time))}
5 | .head.col-md-12.col-sm-12.col-xs-12
6 | -# - if local_assigns[:add_nav]
7 | -# .project-nav.pull-right
8 | -# - if next_bucket
9 | -# %a.btn.btn-xs.btn-default(href="/date/#{next_bucket}" title="View next day") <
10 | -# - if prev_bucket
11 | -# %a.btn.btn-xs.btn-default(href="/date/#{prev_bucket}" title="View previous day") >
12 |
13 | .today
14 | = date_display(time)
15 |
16 | %a.date(href="/date/#{Project.bucket(time)}" title="Permalink for date: #{time.strftime('%B %d, %Y')}")
17 | - if time.weekend?
18 | = (time - 1.day).strftime('%B %d')
19 | = " - "
20 | = time.strftime('%d')
21 | - else
22 | = time.strftime('%B %d')
23 | .clearfix
24 |
25 | - top_items = projects[0...Settings.products_to_show]
26 | - more_items = projects[Settings.products_to_show..-1]
27 |
28 | - if Project.is_bucket_today?(time)
29 | - empty_msg = "Good morning! Interested in posting a product today?".html_safe
30 | - else
31 | - empty_msg = "No products were submitted on #{time.strftime("%A, %B %d")}"
32 |
33 | = render "projects/project_listings", projects: top_items, empty_msg: empty_msg
34 |
35 | - if more_items.present?
36 | .more-projects-btn
37 | ▿ show #{more_items.count} more...
38 |
39 | .expanded-projects
40 | = render "projects/project_listings", projects: more_items
41 |
--------------------------------------------------------------------------------
/app/views/projects/already_submitted.html.haml:
--------------------------------------------------------------------------------
1 | %div#new-product.row
2 | %div.new-product-wrapper.col-md-6.col-sm-12.col-xs-12.col-md-offset-3
3 | %h2 Post a new product
4 | %p.text-center Sorry, just 1 product can be posted per day. Please come back tomorrow!
5 | .form-actions.text-center
6 | %br
7 | %a.btn.btn-primary.btn-super{href: "/"} Return to Homepage
8 |
--------------------------------------------------------------------------------
/app/views/projects/bucket.html.haml:
--------------------------------------------------------------------------------
1 | = render "projects/projects_for_bucket", time: Project.parse_bucket(@bucket), projects: @projects, add_nav: true
2 |
--------------------------------------------------------------------------------
/app/views/projects/edit.html.haml:
--------------------------------------------------------------------------------
1 | %div#new-product.row
2 | %div.new-product-wrapper.col-md-6.col-sm-12.col-xs-12.col-md-offset-3
3 | -# %h2 Post a new product
4 | -# %p.text-center Discover a killer new product? Post it!
5 | = form_tag "/update/#{@project.slug}", method: :patch do
6 | %div{:class => "form-group #{error_class(:name)}"}
7 | %label{:for => "name"} Name
8 | = text_field_tag "name", @project.name, class: "form-control", placeholder: "Enter the product's name"
9 | = field_errors(:name)
10 | %div{:class => "form-group #{error_class(:url)}"}
11 | %label{:for => "url"} Link
12 | = text_field_tag "url", @project.url, class: "form-control", placeholder: "http://www..."
13 | = field_errors(:url)
14 | %div{:class => "form-group #{error_class(:description)}"}
15 | %label{:for => "description"} Tagline
16 | = text_field_tag "description", @project.description, class: "form-control", placeholder: "Describe the product in a few words"
17 | = field_errors(:description)
18 | .form-actions.text-center
19 | %button.btn.btn-primary.btn-super{:type => "submit"} Update Project
20 |
--------------------------------------------------------------------------------
/app/views/projects/index.atom.builder:
--------------------------------------------------------------------------------
1 | atom_feed do |feed|
2 | feed.title('Open Hunt - Most popular projects today')
3 | feed.updated(@feed_updated_at) if @projects.length > 0
4 |
5 | render @projects, feed: feed
6 | end
7 |
--------------------------------------------------------------------------------
/app/views/projects/index.html.haml:
--------------------------------------------------------------------------------
1 | - body_css "bucket-scroll"
2 |
3 | - content_for :head do
4 | = auto_discovery_link_tag(:rss, format: :rss)
5 | = auto_discovery_link_tag(:rss, format: :rss, controller: :projects, action: :recent)
6 | = auto_discovery_link_tag(:atom, format: :atom)
7 | = auto_discovery_link_tag(:atom, format: :atom, controller: :projects, action: :recent)
8 |
9 |
10 | - if show_subcribe_form?
11 | - content_for :after_header do
12 | = render "list_subscribers/subscribe_form"
13 |
14 | .buckets
15 | = render "projects/projects_for_bucket", time: current_now, projects: @projects
16 |
--------------------------------------------------------------------------------
/app/views/projects/index.rss.builder:
--------------------------------------------------------------------------------
1 | xml.instruct! :xml, version: "1.0"
2 | xml.rss version: "2.0" do
3 | xml.channel do
4 | xml.title 'Open Hunt - Most popular projects today'
5 | xml.description 'Discover new products, give feedback, help each other'
6 | xml.link root_url
7 |
8 | render @projects, xml: xml
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/projects/new.html.haml:
--------------------------------------------------------------------------------
1 | %div#new-product.row
2 | %div.new-product-wrapper.col-md-6.col-sm-12.col-xs-12.col-md-offset-3
3 | -# %h2 Post a new product
4 | -# %p.text-center Discover a killer new product? Post it!
5 | = form_tag "/new" do
6 | %div{:class => "form-group #{error_class(:name)}"}
7 | %label{:for => "name"} Name
8 | = text_field_tag "name", params[:name], class: "form-control", placeholder: "Enter the product's name"
9 | = field_errors(:name)
10 | %div{:class => "form-group #{error_class(:url)}"}
11 | %label{:for => "url"} Link
12 | = text_field_tag "url", params[:url], class: "form-control", placeholder: "http://www..."
13 | = field_errors(:url)
14 | %div{:class => "form-group #{error_class(:description)}"}
15 | %label{:for => "description"} Tagline
16 | = text_field_tag "description", params[:description], class: "form-control", placeholder: "Describe the product in a few words"
17 | = field_errors(:description)
18 | .form-actions.text-center
19 | %button.btn.btn-primary.btn-super{:type => "submit"} Submit Product
20 |
--------------------------------------------------------------------------------
/app/views/projects/recent.atom.builder:
--------------------------------------------------------------------------------
1 | atom_feed do |feed|
2 | feed.title('Open Hunt - Recently added projects')
3 | feed.updated(@projects[0].created_at) if @projects.length > 0
4 |
5 | render @projects, feed: feed
6 | end
7 |
--------------------------------------------------------------------------------
/app/views/projects/recent.rss.builder:
--------------------------------------------------------------------------------
1 | xml.instruct! :xml, version: "1.0"
2 | xml.rss version: "2.0" do
3 | xml.channel do
4 | xml.title 'Open Hunt - Recently added projects'
5 | xml.description 'Discover new products, give feedback, help each other'
6 | xml.link root_url
7 |
8 | render @projects, xml: xml
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/projects/vote_confirm.html.erb:
--------------------------------------------------------------------------------
1 | <% skip_header %>
2 |
3 |
4 |
Confirm vote for: <%= @project.name %>
5 |
Vote
6 |
7 |
--------------------------------------------------------------------------------
/app/views/sessions/auth_failure.html.haml:
--------------------------------------------------------------------------------
1 | - skip_header
2 |
3 | .splash-box
4 | %h2
5 | Sorry, we were unable to login#{" with #{@login_type}" if @login_type.present?}.
6 |
7 | - if @login_error
8 | %p
9 | %strong Reason:
10 | = @login_error
11 | %p.actions
12 | %a.btn.btn-primary.btn-super{:href => "/login"}
13 | Login Again
14 |
15 | = mail_to "all@openhunt.co", subject: "unable to login", body: "reason: #{params[:message]}", class: "btn btn-primary btn-super" do
16 | Email Us
17 | %a.btn.btn-primary.btn-super{:href => "/"}
18 | Go Back
19 |
--------------------------------------------------------------------------------
/app/views/sessions/logout.html.haml:
--------------------------------------------------------------------------------
1 | .splash-box
2 | %h2
3 | Ready to go?
4 |
5 | %a(href="/logout" data-method="POST" class="btn btn-primary btn-super")
6 | Log Out
7 |
--------------------------------------------------------------------------------
/app/views/users/edit.html.haml:
--------------------------------------------------------------------------------
1 | .user-page
2 | %h2 Settings
3 | .user-form
4 | = form_tag "/subscribe?redirect_url=/", method: :post do
5 | .form-group
6 | %label(for="email") Email Address
7 | = email_field_tag :email, @user.list_subscriber.try(:email), class: "form-control"
8 | .form-group
9 | %label(for="email_format") Format
10 | = select_tag :email_format, options_for_select({"HTML" => "html", "Text" => "text"}, @user.list_subscriber.try(:email_format)), class: "form-control"
11 | .form-group.pull-left
12 | %label.checkbox-wrapper
13 | = check_box_tag :subscribed, "true", @user.list_subscriber.try(:subscribed?)
14 | Subscribe to Daily Newsletter
15 |
16 | .pull-right
17 | %button.btn.btn-default(type="submit") Save
18 |
--------------------------------------------------------------------------------
/app/views/users/show.html.haml:
--------------------------------------------------------------------------------
1 | .user-page
2 | .row
3 | .col-sm-6
4 | .user-profile
5 | .user-avatar(style="background-image:url('#{@user.profile_image_url}');")
6 | .user-name= @user.name.presence || "Anonymous"
7 | .user-twitter= link_to "@#{@user.screen_name}", "https://twitter.com/#{@user.screen_name}"
8 | .user-location= @user.location
9 |
10 | .user-actions
11 | - if moderator?
12 | - if @user.banned?
13 | %a.btn.btn-xs.btn-default(data-method="post" href="/unban/@#{@user.screen_name}") Unban User
14 | - else
15 | - if current_user != @user
16 | %a.btn.btn-xs.btn-default(data-method="post" href="/ban/@#{@user.screen_name}") Ban User
17 |
18 | - unless @user.moderator?
19 | %a.btn.btn-xs.btn-default(data-method="post" href="/make_moderator/@#{@user.screen_name}") Add Moderator
20 |
21 |
22 | .col-sm-6
23 | .project-list.row
24 | .head.col-md-12.col-sm-12.col-xs-12
25 | .today
26 | Favorited
27 | .date (#{@voted_projects.count})
28 | .clearfix
29 | = render "projects/project_listings", projects: @voted_projects, empty_msg: "No products have been favorited."
30 |
31 | .project-list.row
32 | .head.col-md-12.col-sm-12.col-xs-12
33 | .today
34 | Submitted
35 | .date (#{@submitted_projects.count})
36 | .clearfix
37 | = render "projects/project_listings", projects: @submitted_projects, empty_msg: "No products have been submitted."
38 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | APP_PATH = File.expand_path('../../config/application', __FILE__)
8 | require_relative '../config/boot'
9 | require 'rails/commands'
10 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | require_relative '../config/boot'
8 | require 'rake'
9 | Rake.application.run
10 |
--------------------------------------------------------------------------------
/bin/rspec:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'rspec' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('rspec-core', 'rspec')
17 |
--------------------------------------------------------------------------------
/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'pathname'
3 |
4 | # path to your application root.
5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6 |
7 | Dir.chdir APP_ROOT do
8 | # This script is a starting point to setup your application.
9 | # Add necessary setup steps to this file:
10 |
11 | puts "== Installing dependencies =="
12 | system "gem install bundler --conservative"
13 | system "bundle check || bundle install"
14 |
15 | # puts "\n== Copying sample files =="
16 | # unless File.exist?("config/database.yml")
17 | # system "cp config/database.yml.sample config/database.yml"
18 | # end
19 |
20 | puts "\n== Preparing database =="
21 | system "bin/rake db:setup"
22 |
23 | puts "\n== Removing old logs and tempfiles =="
24 | system "rm -f log/*"
25 | system "rm -rf tmp/cache"
26 |
27 | puts "\n== Restarting application server =="
28 | system "touch tmp/restart.txt"
29 | end
30 |
--------------------------------------------------------------------------------
/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads spring without using Bundler, in order to be fast.
4 | # It gets overwritten when you run the `spring binstub` command.
5 |
6 | unless defined?(Spring)
7 | require 'rubygems'
8 | require 'bundler'
9 |
10 | if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
11 | Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq }
12 | gem 'spring', match[1]
13 | require 'spring/binstub'
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module Openhunt
10 | class Application < Rails::Application
11 |
12 | require "ext/serialize_ext"
13 | require "ext/date_ext"
14 |
15 | # Settings in config/environments/* take precedence over those specified here.
16 | # Application configuration should go into files in config/initializers
17 | # -- all .rb files in that directory are automatically loaded.
18 |
19 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
20 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
21 | # config.time_zone = 'Central Time (US & Canada)'
22 |
23 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
24 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
25 | # config.i18n.default_locale = :de
26 |
27 | config.autoload_paths << "#{Rails.root}/lib"
28 | config.autoload_paths << "#{Rails.root}/app/forms"
29 | config.autoload_paths << "#{Rails.root}/app/workers"
30 |
31 | config.assets.paths << Rails.root.join("app-js")
32 | config.assets.paths << Rails.root.join("app-css")
33 |
34 | config.assets.paths << Rails.root.join("vendor", "assets", "fonts")
35 | config.assets.paths << Rails.root.join("app", "assets", "fonts")
36 |
37 | config.assets.precompile += %w( application.css application.js )
38 | config.assets.precompile += %w( dependencies.css dependencies.js )
39 | config.assets.precompile += %w( .svg .eot .woff .ttf)
40 |
41 | # Do not swallow errors in after_commit/after_rollback callbacks.
42 | config.active_record.raise_in_transactional_callbacks = true
43 |
44 | # default to production react mode
45 | config.react.variant = :production
46 |
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 |
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | default: &default
2 | adapter: postgresql
3 | encoding: unicode
4 | pool: 5
5 | timeout: 5000
6 |
7 | development:
8 | <<: *default
9 | database: openhunt_development
10 |
11 | test:
12 | <<: *default
13 | database: openhunt_test
14 |
15 | production:
16 | <<: *default
17 | database: openhunt_production
18 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = false
11 |
12 | # Show full error reports and disable caching.
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send.
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger.
20 | config.active_support.deprecation = :log
21 |
22 | # Raise an error on page load if there are pending migrations.
23 | config.active_record.migration_error = :page_load
24 |
25 | # Debug mode disables concatenation and preprocessing of assets.
26 | # This option may cause significant delays in view rendering with a large
27 | # number of complex assets.
28 | config.assets.debug = true
29 |
30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31 | # yet still be able to expire them through the digest params.
32 | config.assets.digest = true
33 |
34 | # Adds additional error checking when serving assets at runtime.
35 | # Checks for improperly declared sprockets dependencies.
36 | # Raises helpful error messages.
37 | config.assets.raise_runtime_errors = true
38 |
39 | config.react.addons = true # defaults to false
40 |
41 | config.react.variant = :development
42 |
43 | # Settings for the pool of renderers:
44 | config.react.server_renderer_pool_size ||= 1 # ExecJS doesn't allow more than one on MRI
45 | config.react.server_renderer_timeout ||= 20 # seconds
46 | config.react.server_renderer = React::ServerRendering::SprocketsRenderer
47 | config.react.server_renderer_options = {
48 | files: ["react-server.js", "components.js"], # files to load for prerendering
49 | replay_console: true, # if true, console.* will be replayed client-side
50 | }
51 |
52 | # Raises error for missing translations
53 | # config.action_view.raise_on_missing_translations = true
54 | end
55 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure static file server for tests with Cache-Control for performance.
16 | config.serve_static_files = true
17 | config.static_cache_control = 'public, max-age=3600'
18 |
19 | # Show full error reports and disable caching.
20 | config.consider_all_requests_local = true
21 | config.action_controller.perform_caching = false
22 |
23 | # Raise exceptions instead of rendering exception templates.
24 | config.action_dispatch.show_exceptions = false
25 |
26 | # Disable request forgery protection in test environment.
27 | config.action_controller.allow_forgery_protection = false
28 |
29 | # Tell Action Mailer not to deliver emails to the real world.
30 | # The :test delivery method accumulates sent emails in the
31 | # ActionMailer::Base.deliveries array.
32 | config.action_mailer.delivery_method = :test
33 |
34 | # Randomize the order test cases are executed.
35 | config.active_support.test_order = :random
36 |
37 | # Print deprecation notices to the stderr.
38 | config.active_support.deprecation = :stderr
39 |
40 | # Raises error for missing translations
41 | # config.action_view.raise_on_missing_translations = true
42 | end
43 |
--------------------------------------------------------------------------------
/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = '1.0'
5 |
6 | # Add additional assets to the asset load path
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | # Precompile additional assets.
10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11 | # Rails.application.config.assets.precompile += %w( search.js )
12 |
--------------------------------------------------------------------------------
/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/config/initializers/check_for_twitter_keys.rb:
--------------------------------------------------------------------------------
1 | is_precompile = ARGV.any?{|i| i.to_s.include?("assets:")}
2 |
3 | unless is_precompile
4 | # Warn user if theres no twitter_key or twitter_secret configured
5 | if Settings.twitter_key.blank? or Settings.twitter_secret.blank?
6 | puts "MISSING: `Settings.twitter_key` and/or `Settings.twitter_secret`"
7 | if Rails.env.production?
8 | puts("SET IT WITH: ENV['Settings.twitter_key'] and ENV['Settings.twitter_secret']")
9 | else
10 | puts("ADD A FILE: config/settings.local.yml (see config/settings.local.yml.example)")
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/config/initializers/config.rb:
--------------------------------------------------------------------------------
1 | Config.setup do |config|
2 | config.const_name = "Settings"
3 | config.use_env = true
4 | end
5 |
--------------------------------------------------------------------------------
/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.action_dispatch.cookies_serializer = :json
4 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/config/initializers/omniauth.rb:
--------------------------------------------------------------------------------
1 | Rails.application.config.middleware.use OmniAuth::Builder do
2 | provider :twitter, Settings.twitter_key, Settings.twitter_secret, {
3 | secure_image_url: true,
4 | image_size: 'bigger',
5 | }
6 |
7 | end
8 |
9 | OmniAuth.config.on_failure = Proc.new do |env|
10 | OmniAuth::FailureEndpoint.new(env).redirect_to_failure
11 | end
12 |
--------------------------------------------------------------------------------
/config/initializers/rollbar.rb:
--------------------------------------------------------------------------------
1 | if Settings.rollbar_access_token
2 | Rollbar.configure do |config|
3 | # Without configuration, Rollbar is enabled in all environments.
4 | # To disable in specific environments, set config.enabled=false.
5 |
6 | config.access_token = Settings.rollbar_access_token
7 |
8 | # Here we'll disable in 'test':
9 | if Rails.env.test?
10 | config.enabled = false
11 | end
12 |
13 | # By default, Rollbar will try to call the `current_user` controller method
14 | # to fetch the logged-in user object, and then call that object's `id`,
15 | # `username`, and `email` methods to fetch those properties. To customize:
16 | # config.person_method = "my_current_user"
17 | # config.person_id_method = "my_id"
18 | # config.person_username_method = "my_username"
19 | # config.person_email_method = "my_email"
20 |
21 | # If you want to attach custom data to all exception and message reports,
22 | # provide a lambda like the following. It should return a hash.
23 | # config.custom_data_method = lambda { {:some_key => "some_value" } }
24 |
25 | # Add exception class names to the exception_level_filters hash to
26 | # change the level that exception is reported at. Note that if an exception
27 | # has already been reported and logged the level will need to be changed
28 | # via the rollbar interface.
29 | # Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore'
30 | # 'ignore' will cause the exception to not be reported at all.
31 | # config.exception_level_filters.merge!('MyCriticalException' => 'critical')
32 | #
33 | # You can also specify a callable, which will be called with the exception instance.
34 | # config.exception_level_filters.merge!('MyCriticalException' => lambda { |e| 'critical' })
35 |
36 | # Enable asynchronous reporting (uses girl_friday or Threading if girl_friday
37 | # is not installed)
38 | # config.use_async = true
39 | # Supply your own async handler:
40 | # config.async_handler = Proc.new { |payload|
41 | # Thread.new { Rollbar.process_from_async_handler(payload) }
42 | # }
43 |
44 | # Enable asynchronous reporting (using sucker_punch)
45 | # config.use_sucker_punch
46 |
47 | # Enable delayed reporting (using Sidekiq)
48 | # config.use_sidekiq
49 | # You can supply custom Sidekiq options:
50 | # config.use_sidekiq 'queue' => 'default'
51 | end
52 | end
53 |
--------------------------------------------------------------------------------
/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.session_store :cookie_store, {
4 | key: '_openhunt_session',
5 | expire_after: 60.days,
6 | }
7 |
--------------------------------------------------------------------------------
/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | hello: "Hello world"
24 |
--------------------------------------------------------------------------------
/config/puma.rb:
--------------------------------------------------------------------------------
1 | workers Integer(ENV['WEB_CONCURRENCY'] || 2)
2 | threads_count = Integer(ENV['MAX_THREADS'] || 5)
3 | threads threads_count, threads_count
4 |
5 | preload_app!
6 |
7 | rackup DefaultRackup
8 | port ENV['PORT'] || 3000
9 | environment ENV['RACK_ENV'] || 'development'
10 |
11 | on_worker_boot do
12 | # Worker specific setup for Rails 4.1+
13 | # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
14 | ActiveRecord::Base.establish_connection
15 | end
16 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 |
3 | # Projects
4 | get '/new' => 'projects#new'
5 | post '/new' => 'projects#create'
6 | get '/validate' => 'projects#validate_project'
7 | get '/date/:bucket' => 'projects#bucket'
8 | get '/edit/:slug' => 'projects#edit'
9 | patch '/update/:slug' => 'projects#update'
10 | get '/detail/:slug' => 'projects#detail'
11 | post '/feedback/:slug' => 'projects#set_feedback'
12 | post '/hide/:slug' => 'projects#hide'
13 | post '/unhide/:slug' => 'projects#unhide'
14 | get '/vote/:slug' => 'projects#vote_confirm'
15 | post '/vote/:slug' => 'projects#vote'
16 | delete '/vote/:slug' => 'projects#unvote'
17 |
18 | # Subscribe
19 | get '/subscribe' => 'list_subscribers#edit'
20 | get '/subscribe/success' => 'list_subscribers#success'
21 | post '/subscribe' => 'list_subscribers#update'
22 | get '/subscribe/confirm/:code' => 'list_subscribers#confirm'
23 |
24 | # Audit
25 | get '/audit' => 'audit_logs#index'
26 | get '/audit/:id/edit' => 'audit_logs#edit'
27 | patch '/audit/:id' => 'audit_logs#update'
28 |
29 | # Help
30 | get '/about' => 'help#about'
31 | get '/team' => 'help#team'
32 | get '/guidelines' => 'help#guidelines'
33 | get '/faqs' => 'help#faqs'
34 | get '/contact' => 'help#contact'
35 |
36 | # User
37 | get '/@:screen_name' => 'users#show'
38 | get '/settings' => 'users#edit'
39 | post '/settings' => 'users#update'
40 | post '/ban/@:screen_name' => 'users#ban'
41 | post '/unban/@:screen_name' => 'users#unban'
42 | post '/make_moderator/@:screen_name' => 'users#make_moderator'
43 | post '/remove_moderator/@:screen_name' => 'users#remove_moderator'
44 |
45 | # Session
46 | get '/logout' => 'sessions#logout'
47 | post '/logout' => 'sessions#logout_complete'
48 | delete '/logout' => 'sessions#logout_complete'
49 | get '/login' => 'sessions#auth_start', as: :auth_start
50 | get '/auth/:service/callback' => 'sessions#auth_callback', as: :auth_callback
51 | get '/auth/failure' => 'sessions#auth_failure'
52 |
53 | # Feeds
54 | get '/recent' => 'projects#recent', format: [:atom, :rss]
55 | get '/popular' => 'projects#index', format: [:atom, :rss]
56 |
57 | # Legacy
58 | get '/feedback/:slug' => 'projects#detail'
59 |
60 | if Rails.env.development?
61 | get '/test_flash' => 'pages#test_flash'
62 | get '/devauth(/:screen_name)' => 'pages#devauth'
63 | end
64 |
65 | root 'projects#index'
66 |
67 | end
68 |
--------------------------------------------------------------------------------
/config/secrets.yml:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rake secret` to generate a secure secret key.
9 |
10 | # Make sure the secrets in this file are kept private
11 | # if you're sharing your code publicly.
12 |
13 | development:
14 | secret_key_base: fd5b65740ab17029f74e4aef9f3f4f81d8688335ca2f68643be448626f3d9877123da52bc8672ba98e186fbd13d2845178d1c243e0578b38fa9358db2c02a7a3
15 |
16 | test:
17 | secret_key_base: 663e15fc203df51b6d67d5d1d82fc42893a47e70cbeb4d5da0f30bb6c8edcde7704466122667238ea2951ecb02ba00d5a9a0ee1bbcec6ea524e3fdd9c4dad811
18 |
19 | # Do not keep production secrets in the repository,
20 | # instead read values from the environment.
21 | production:
22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23 |
--------------------------------------------------------------------------------
/config/settings.local.yml.example:
--------------------------------------------------------------------------------
1 | # MOVE THIS FILE TO config/settings.local.yml and replace the twitter_key and twitter_secret
2 | # https://apps.twitter.com/, click on your app, then click on "Keys and Access Tokens"
3 |
4 | # pull the value for "Consumer Key (API Key)"
5 | twitter_key: "PASTE_REAL_KEY_HERE"
6 |
7 | # pull the value for "Consumer Secret (API Secret)"
8 | twitter_secret: "PASTE_REAL_SECRET_HERE"
9 |
--------------------------------------------------------------------------------
/config/settings.yml:
--------------------------------------------------------------------------------
1 | some_config: "Hello"
2 |
3 | featured_per_page: 10
4 |
5 | base_timezone: "Pacific Time (US & Canada)"
6 |
7 | include_analytics: false
8 |
9 | site_launch: "Dec 18, 2015"
10 |
11 | products_to_show: 20
12 |
13 |
14 | # in minutes
15 | project_edit_window: 20
16 |
--------------------------------------------------------------------------------
/config/settings/development.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/config/settings/development.yml
--------------------------------------------------------------------------------
/config/settings/production.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/config/settings/production.yml
--------------------------------------------------------------------------------
/config/settings/test.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/config/settings/test.yml
--------------------------------------------------------------------------------
/db/migrate/20151216045210_create_users.rb:
--------------------------------------------------------------------------------
1 | class CreateUsers < ActiveRecord::Migration
2 | def change
3 | create_table :users do |t|
4 | t.string :screen_name, null: false
5 | t.string :name
6 | t.string :profile_image_url
7 | t.string :twitter_id
8 | t.string :location
9 |
10 | t.boolean :moderator, default: false
11 | t.boolean :banned, default: false
12 | t.timestamps null: false
13 | end
14 |
15 | add_index :users, :screen_name
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/db/migrate/20151216045228_create_votes.rb:
--------------------------------------------------------------------------------
1 | class CreateVotes < ActiveRecord::Migration
2 | def change
3 | create_table :votes do |t|
4 |
5 | t.integer :user_id, null: false
6 | t.integer :project_id, null: false
7 |
8 | t.timestamps null: false
9 | end
10 |
11 | # TODO: need some indexes here
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/db/migrate/20151216045237_create_projects.rb:
--------------------------------------------------------------------------------
1 | class CreateProjects < ActiveRecord::Migration
2 | def change
3 | create_table :projects do |t|
4 | t.string :name, null: false
5 | t.string :description, null: false
6 | t.string :url, null: false
7 | t.string :normalized_url, null: false
8 |
9 | t.string :bucket, null: false
10 | t.string :slug, null: false
11 |
12 | t.integer :user_id, null: false
13 |
14 | t.boolean :hidden, default: false
15 | t.integer :votes_count, default: 0
16 | t.integer :feedbacks_count, default: 0
17 |
18 | t.timestamps null: false
19 | end
20 |
21 | add_index :projects, :bucket
22 | add_index :projects, :slug
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/db/migrate/20151216052011_create_list_subscribers.rb:
--------------------------------------------------------------------------------
1 | class CreateListSubscribers < ActiveRecord::Migration
2 | def change
3 | create_table :list_subscribers do |t|
4 |
5 | t.string :email, null: false
6 | t.boolean :subscribed, default: true
7 |
8 | t.integer :user_id, null: true
9 |
10 |
11 | t.timestamps null: false
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/db/migrate/20151217054927_create_feedbacks.rb:
--------------------------------------------------------------------------------
1 | class CreateFeedbacks < ActiveRecord::Migration
2 | def change
3 | create_table :feedbacks do |t|
4 | t.text :body, null: false
5 |
6 | t.boolean :anonymous, default: false
7 | t.integer :project_id, null: false
8 |
9 | # identify the user with one of these
10 | t.integer :user_id
11 | t.string :session_id
12 |
13 | t.timestamps null: false
14 | end
15 |
16 | # TODO: need some indexes here
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/db/migrate/20151217093858_create_audit_logs.rb:
--------------------------------------------------------------------------------
1 | class CreateAuditLogs < ActiveRecord::Migration
2 | def change
3 | create_table :audit_logs do |t|
4 | t.integer :moderator_id
5 | t.string :item_type
6 | t.integer :target_id
7 | t.string :target_type
8 | t.string :target_display
9 | t.string :target_url
10 |
11 | t.timestamps null: false
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/db/migrate/20151217110511_create_ranking_pg_functions.rb:
--------------------------------------------------------------------------------
1 | class CreateRankingPgFunctions < ActiveRecord::Migration
2 | def up
3 | execute <<-SPROC
4 | CREATE OR REPLACE FUNCTION popularity(count integer, weight integer default 3) RETURNS integer AS $$
5 | SELECT count * weight
6 | $$ LANGUAGE SQL IMMUTABLE;
7 |
8 | CREATE OR REPLACE FUNCTION ranking(id integer, counts integer, weight integer default 3) RETURNS integer AS $$
9 | SELECT id + popularity(counts, weight)
10 | $$ LANGUAGE SQL IMMUTABLE;
11 |
12 | CREATE INDEX index_projects_on_ranking
13 | ON projects (ranking(id, votes_count, 3) DESC);
14 | SPROC
15 | end
16 |
17 | def down
18 | execute <<-SPROC
19 | DROP INDEX index_projects_on_ranking;
20 | DROP FUNCTION IF EXISTS popularity(integer, integer);
21 | DROP FUNCTION IF EXISTS ranking(integer, integer, integer);
22 | SPROC
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/db/migrate/20151220212736_add_note_to_audit_logs.rb:
--------------------------------------------------------------------------------
1 | class AddNoteToAuditLogs < ActiveRecord::Migration
2 | def change
3 | add_column :audit_logs, :note, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20151221073236_update_feedback_session_column.rb:
--------------------------------------------------------------------------------
1 | class UpdateFeedbackSessionColumn < ActiveRecord::Migration
2 | def change
3 | rename_column :feedbacks, :session_id, :anon_user_hash
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20151221081710_add_fields_to_list_subscriber.rb:
--------------------------------------------------------------------------------
1 | class AddFieldsToListSubscriber < ActiveRecord::Migration
2 | def change
3 | add_column :list_subscribers, :confirmed, :boolean, default: false
4 | add_column :list_subscribers, :confirm_code, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20151221232302_add_format_to_list_subscribers.rb:
--------------------------------------------------------------------------------
1 | class AddFormatToListSubscribers < ActiveRecord::Migration
2 | def change
3 | add_column :list_subscribers, :email_format, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # before running, you could reset your db:
2 | # rake db:drop db:create db:migrate db:seed
3 |
4 | 200.times do
5 | User.create(
6 | screen_name: Faker::Hipster.word,
7 | name: Faker::Name.name,
8 | profile_image_url: Faker::Avatar.image,
9 | twitter_id: Faker::Hipster.word,
10 | location: "#{Faker::Address.city}, #{Faker::Address.state}"
11 | )
12 | end
13 |
14 | (0..10).each do |i|
15 | puts
16 | puts
17 | puts
18 | puts "creating projects for day #{i}"
19 | puts
20 | puts
21 | puts
22 |
23 | day = Time.find_zone!(Settings.base_timezone).now.beginning_of_day - i.days
24 |
25 | User.take(50).each do |user|
26 | created_time = day + rand(23).hours + rand(59).minutes + rand(59).seconds
27 | print "."
28 | $stdout.flush
29 | project = Project.new(
30 | name: Faker::Name.name,
31 | description: Faker::Hipster.sentences(1).first.truncate(80),
32 | url: Faker::Internet.url
33 | )
34 | project.user = user
35 | project.save!
36 | project.update_attributes(bucket: Project.bucket(created_time))
37 | user.vote(project)
38 | User.offset(rand(160)).take(rand(40)).each do |other_user|
39 | other_user.vote(project)
40 | end
41 | end
42 | end
43 |
44 | puts "DONE"
45 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/lib/assets/.keep
--------------------------------------------------------------------------------
/lib/ext/date_ext.rb:
--------------------------------------------------------------------------------
1 | module DateAndTime::Calculations
2 | def weekend?
3 | wday == 0 or wday == 6
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/lib/ext/serialize_ext.rb:
--------------------------------------------------------------------------------
1 | # extension to allow using `.serialize` on all object, arrays, and active record relations
2 | class ActiveRecord::Base
3 |
4 | # ActiveModelSerializers can bite my ass
5 | def self.serialize(obj)
6 | if obj.is_a?(Hash)
7 | new_obj = obj.dup
8 | new_obj.keys.each do |key|
9 | new_object[key] = new_object[key].serialize
10 | end
11 | new_object.as_json
12 | elsif obj.respond_to?(:map)
13 | obj.map{|i| serialize(i)}
14 | else
15 | "#{self.to_s}Serializer".constantize.new(obj).serializable_hash.as_json
16 | end
17 | rescue NameError => e
18 | Rails.logger.warn("No ActiveModelSerializer found for #{self.to_s}")
19 | obj.as_json
20 | end
21 |
22 | def serialize
23 | self.class.serialize(self)
24 | end
25 |
26 | end
27 |
28 | module Enumerable
29 | def serialize
30 | obj = self
31 | if obj.is_a?(Hash)
32 | new_obj = obj.dup
33 | new_obj.keys.each do |key|
34 | new_obj[key] = new_obj[key].serialize
35 | end
36 | new_obj.as_json
37 | else
38 | self.map{|i| i.serialize}
39 | end
40 | end
41 | end
42 |
43 | class ActiveRecord::Relation
44 | def serialize
45 | self.map{|i| i.serialize }
46 | end
47 | end
48 |
49 | class Object
50 | def serialize
51 | as_json
52 | end
53 | end
54 |
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/lib/tasks/.keep
--------------------------------------------------------------------------------
/lib/tasks/auto_annotate_models.rake:
--------------------------------------------------------------------------------
1 | # NOTE: only doing this in development as some production environments (Heroku)
2 | # NOTE: are sensitive to local FS writes, and besides -- it's just not proper
3 | # NOTE: to have a dev-mode tool do its thing in production.
4 | if Rails.env.development?
5 | task :set_annotation_options do
6 | # You can override any of these by setting an environment variable of the
7 | # same name.
8 | Annotate.set_defaults({
9 | 'position_in_routes' => "before",
10 | 'position_in_class' => "before",
11 | 'position_in_test' => "before",
12 | 'position_in_fixture' => "before",
13 | 'position_in_factory' => "before",
14 | 'position_in_serializer' => "before",
15 | 'show_foreign_keys' => "true",
16 | 'show_indexes' => "true",
17 | 'simple_indexes' => "false",
18 | 'model_dir' => "app/models",
19 | 'include_version' => "false",
20 | 'require' => "",
21 | 'exclude_tests' => "false",
22 | 'exclude_fixtures' => "false",
23 | 'exclude_factories' => "false",
24 | 'exclude_serializers' => "false",
25 | 'ignore_model_sub_dir' => "false",
26 | 'skip_on_db_migrate' => "false",
27 | 'format_bare' => "true",
28 | 'format_rdoc' => "false",
29 | 'format_markdown' => "false",
30 | 'sort' => "false",
31 | 'force' => "false",
32 | 'trace' => "false",
33 | })
34 | end
35 |
36 | Annotate.load_tasks
37 | end
38 |
--------------------------------------------------------------------------------
/lib/tasks/new_project.rake:
--------------------------------------------------------------------------------
1 | namespace :new_project do
2 | def file_string_replace(file_path, old_string, new_string)
3 | text = File.read(file_path)
4 | File.open(file_path, "w") {|file| file.puts text.gsub(old_string, new_string) }
5 | end
6 |
7 | desc "Renames Rails app name to the Camel Cased name of the folder"
8 | task :rename => :environment do
9 | project_name = File.basename(Rails.root)
10 |
11 | camelized = project_name.camelize
12 |
13 | # replace references in application.rb and session_store
14 | file_string_replace(Rails.root.join("config", "application.rb").to_s, "NewProject", camelized)
15 | file_string_replace(Rails.root.join("config", "initializers", "session_store.rb").to_s, "new_project", project_name)
16 |
17 | # replace layout title
18 | file_string_replace(Rails.root.join("app", "views", "layouts", "application.html.erb").to_s, "NewProject", camelized.underscore.titleize)
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/log/.keep
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/public/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/public/favicon.ico
--------------------------------------------------------------------------------
/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/public/favicon.png
--------------------------------------------------------------------------------
/public/fonts/bootstrap/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/public/fonts/bootstrap/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/public/fonts/bootstrap/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/public/fonts/bootstrap/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/public/fonts/bootstrap/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/public/fonts/bootstrap/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/public/fonts/bootstrap/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/public/fonts/bootstrap/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | # User-agent: *
5 | # Disallow: /
6 |
--------------------------------------------------------------------------------
/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # TODO: define some factories
2 | # http://www.rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md#Defining_factories
3 |
4 | # factories can also go in spec/factories/*.rb
5 |
--------------------------------------------------------------------------------
/spec/factories/project_factory.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: projects
4 | #
5 | # id :integer not null, primary key
6 | # name :string not null
7 | # description :string not null
8 | # url :string not null
9 | # normalized_url :string not null
10 | # bucket :string not null
11 | # slug :string not null
12 | # user_id :integer not null
13 | # hidden :boolean default(FALSE)
14 | # votes_count :integer default(0)
15 | # feedbacks_count :integer default(0)
16 | # created_at :datetime not null
17 | # updated_at :datetime not null
18 | #
19 | # Indexes
20 | #
21 | # index_projects_on_bucket (bucket)
22 | # index_projects_on_slug (slug)
23 | #
24 |
25 | FactoryGirl.define do
26 | factory :project do
27 | name "asdf"
28 | description "asdfasdf"
29 | url "http://www.asdf.com"
30 | # association :user, factory: :user
31 | end
32 | end
33 |
--------------------------------------------------------------------------------
/spec/factories/user_factory.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: users
4 | #
5 | # id :integer not null, primary key
6 | # screen_name :string not null
7 | # name :string
8 | # profile_image_url :string
9 | # twitter_id :string
10 | # location :string
11 | # moderator :boolean default(FALSE)
12 | # banned :boolean default(FALSE)
13 | # created_at :datetime not null
14 | # updated_at :datetime not null
15 | #
16 | # Indexes
17 | #
18 | # index_users_on_screen_name (screen_name)
19 | #
20 |
21 | FactoryGirl.define do
22 | factory :user do
23 | sequence :screen_name do |n|
24 | "asdf#{n}"
25 | end
26 | name "asdf"
27 | profile_image_url "asdf"
28 | twitter_id "asdf"
29 | location "asdf"
30 | end
31 | end
32 |
--------------------------------------------------------------------------------
/spec/features/edit_project_spec.rb:
--------------------------------------------------------------------------------
1 | # these specs are tricky. javascript and such.
2 | # redirect urls are barfing
3 | #
4 | # require "rails_helper"
5 | #
6 | # RSpec.feature "Edit Project", js: true, type: :feature do
7 | # let(:submitter) { FactoryGirl.create(:user) }
8 | # let(:project) { submitter.projects.create(FactoryGirl.attributes_for(:project)) }
9 | # before :each do
10 | # DatabaseCleaner.clean
11 | # ApplicationController.any_instance.stub(:current_user).and_return(submitter)
12 | # end
13 | #
14 | # scenario "User can edit a project" do
15 | # visit "/edit/#{project.slug}"
16 | # fill_in("Name", with: "changed banana")
17 | # click_button("Update Project") # <= brittle selector
18 | # expect(page).to have_content("changed banana")
19 | # end
20 | # end
21 |
--------------------------------------------------------------------------------
/spec/forms/project_form_spec.rb:
--------------------------------------------------------------------------------
1 |
2 | require 'rails_helper'
3 |
4 | RSpec.describe ProjectForm do
5 | let(:submitter) { FactoryGirl.create(:user) }
6 | let(:project) { submitter.projects.create(FactoryGirl.attributes_for(:project)) }
7 | before :each do
8 | DatabaseCleaner.clean
9 | end
10 |
11 | context "for update" do
12 | it "validates with just name" do
13 | params = { name: "banana" }
14 | form = ProjectForm.for_update(params, project)
15 | expect(form.valid?).to eql true
16 | expect(form.name).to eql "banana"
17 | end
18 | it "validates with just description" do
19 | params = { description: "banana" }
20 | form = ProjectForm.for_update(params, project)
21 | expect(form.valid?).to eql true
22 | expect(form.description).to eql "banana"
23 | end
24 | it "allows trivial change to url" do
25 | params = { url: "http://asdf.com" }
26 | form = ProjectForm.for_update(params, project)
27 | expect(form.valid?).to eql true
28 | expect(form.url).to eql "http://asdf.com"
29 | end
30 | end
31 |
32 | end
33 |
--------------------------------------------------------------------------------
/spec/interactors/update_project_spec.rb:
--------------------------------------------------------------------------------
1 |
2 | require 'rails_helper'
3 |
4 | RSpec.describe UpdateProject do
5 | let(:submitter) { FactoryGirl.create(:user) }
6 | let(:project) { submitter.projects.create(FactoryGirl.attributes_for(:project)) }
7 | before :each do
8 | DatabaseCleaner.clean
9 | end
10 | it "updates trivial url change" do
11 | params = { url: "http://asdf.com" }
12 | UpdateProject.call(params: params, project: project, user: submitter)
13 | expect(project.reload.url).to eql "http://asdf.com"
14 | end
15 | it "updates the name" do
16 | params = { name: "banana" }
17 | UpdateProject.call(params: params, project: project, user: submitter)
18 | expect(project.reload.name).to eql "banana"
19 | end
20 | it "updates the description" do
21 | params = { description: "banana" }
22 | UpdateProject.call(params: params, project: project, user: submitter)
23 | expect(project.reload.description).to eql "banana"
24 | end
25 | it "leaves an audit log" do
26 | submitter.update_attributes(moderator: true)
27 | params = { description: "banana" }
28 | UpdateProject.call(params: params, project: project, user: submitter)
29 | expect(AuditLog.first.item_type).to eql "update_project"
30 | expect(AuditLog.first.target_url).to eql "/detail/asdf"
31 | end
32 |
33 | context "protections" do
34 | it "only allows owner or moderator" do
35 | bad_user = FactoryGirl.create(:user)
36 | params = { name: "pwn u!" }
37 | result = UpdateProject.call(params: params, project: project, user: bad_user)
38 | expect(result.success?).to eql false
39 | end
40 | it "doesn't update to use another project's url" do
41 | project
42 | other_project = submitter.projects.create(FactoryGirl.attributes_for(:project, url: "http://this_url_ok.com"))
43 | params = { url: "http://asdf.com"}
44 | result = UpdateProject.call(params: params, project: other_project, user: submitter)
45 | expect(result.success?).to eql false
46 | end
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/spec/models/audit_log_spec.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: audit_logs
4 | #
5 | # id :integer not null, primary key
6 | # moderator_id :integer
7 | # item_type :string
8 | # target_id :integer
9 | # target_type :string
10 | # target_display :string
11 | # target_url :string
12 | # created_at :datetime not null
13 | # updated_at :datetime not null
14 | # note :string
15 | #
16 |
17 | require 'rails_helper'
18 |
19 | RSpec.describe AuditLog, type: :model do
20 | # pending "add some examples to (or delete) #{__FILE__}"
21 | end
22 |
--------------------------------------------------------------------------------
/spec/models/list_subscriber_spec.rb:
--------------------------------------------------------------------------------
1 |
2 | # == Schema Information
3 | #
4 | # Table name: list_subscribers
5 | #
6 | # id :integer not null, primary key
7 | # email :string not null
8 | # subscribed :boolean default(TRUE)
9 | # user_id :integer
10 | # created_at :datetime not null
11 | # updated_at :datetime not null
12 | # confirmed :boolean default(FALSE)
13 | # confirm_code :string
14 | # email_format :string
15 | #
16 |
--------------------------------------------------------------------------------
/spec/models/user_spec.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: users
4 | #
5 | # id :integer not null, primary key
6 | # screen_name :string not null
7 | # name :string
8 | # profile_image_url :string
9 | # twitter_id :string
10 | # location :string
11 | # moderator :boolean default(FALSE)
12 | # banned :boolean default(FALSE)
13 | # created_at :datetime not null
14 | # updated_at :datetime not null
15 | #
16 | # Indexes
17 | #
18 | # index_users_on_screen_name (screen_name)
19 | #
20 |
21 | require 'rails_helper'
22 |
23 | RSpec.describe User, type: :model do
24 |
25 | let(:submitter) { FactoryGirl.create(:user) }
26 | let(:other_user) { FactoryGirl.create(:user) }
27 | let(:project) { submitter.projects.create(FactoryGirl.attributes_for(:project)) }
28 |
29 | before :each do
30 | DatabaseCleaner.clean
31 | end
32 |
33 | context "voting" do
34 | it "cannot vote twice for same project" do
35 | user = FactoryGirl.create(:user)
36 | user.vote(project)
37 | user.vote(project)
38 | expect(user.votes.count).to eql 1
39 | end
40 | end
41 |
42 | context "moderator" do
43 | it "make_moderator" do
44 | submitter.update_attributes!(moderator: true)
45 | submitter.make_moderator(other_user)
46 | expect(other_user.moderator).to eql true
47 | end
48 | it "remove_moderator" do
49 | submitter.update_attributes!(moderator: true)
50 | other_user.update_attributes!(moderator: false)
51 | submitter.remove_moderator(other_user)
52 | expect(other_user.moderator).to eql false
53 | end
54 | end
55 |
56 | it "checks is user is submitter" do
57 | expect(submitter.is_submitter?(project)).to eql true
58 | expect(other_user.is_submitter?(project)).to eql false
59 | end
60 |
61 | it "can update a project" do
62 | params = { name: "banana"}
63 | submitter.update_project(project, params)
64 | expect(project.reload.name).to eql "banana"
65 | end
66 |
67 | it "knows that submitter can update a project" do
68 | expect(submitter.can_update?(project)).to eql true
69 | expect(other_user.can_update?(project)).to eql false
70 | end
71 |
72 | it "knows that moderator can update a project" do
73 | other_user.update_attributes(moderator: true)
74 | expect(other_user.can_update?(project)).to eql true
75 | end
76 | end
77 |
--------------------------------------------------------------------------------
/spec/models/vote_spec.rb:
--------------------------------------------------------------------------------
1 | # == Schema Information
2 | #
3 | # Table name: votes
4 | #
5 | # id :integer not null, primary key
6 | # user_id :integer not null
7 | # project_id :integer not null
8 | # created_at :datetime not null
9 | # updated_at :datetime not null
10 | #
11 |
12 | require 'rails_helper'
13 |
14 | # RSpec.describe Vote, type: :model do
15 | # pending "add some examples to (or delete) #{__FILE__}"
16 | # end
17 |
--------------------------------------------------------------------------------
/spec/requests/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/spec/requests/.gitkeep
--------------------------------------------------------------------------------
/spec/requests/audit_logs_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 |
3 | RSpec.describe "Projects", :type => :request do
4 | let(:user) { FactoryGirl.create(:user, moderator: true) }
5 | let(:project) { user.projects.create(FactoryGirl.attributes_for(:project))}
6 | let(:log) { AuditLog.create(
7 | moderator_id: user.id,
8 | item_type: "update_project",
9 | target_id: project.id,
10 | target_type: "Project",
11 | target_display: project.name,
12 | target_url: "/detail/#{project.slug}"
13 | ) }
14 |
15 | before :each do
16 | DatabaseCleaner.clean
17 | ApplicationController.any_instance.stub(:current_user).and_return(user)
18 | end
19 |
20 | context "edit" do
21 | it "loads form" do
22 | get "/audit/#{log.id}/edit"
23 | expect(response.body).to include "Note"
24 | end
25 | end
26 |
27 | context "update" do
28 | it "updates the log with the note" do
29 | patch "/audit/#{log.id}", note: "testtesttest"
30 | follow_redirect!
31 | expect(response.body).to include "testtesttest"
32 | byebug
33 | expect(AuditLog.first.note).to eql "testtesttest"
34 | end
35 | end
36 | end
37 |
--------------------------------------------------------------------------------
/spec/requests/projects_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 | #
3 | RSpec.describe "Projects", :type => :request do
4 | context "projects index" do
5 | before do
6 | # headers = {
7 | # "ACCEPT" => "application/json", # This is what Rails 4 accepts
8 | # }
9 | get("/", {}, headers)
10 | end
11 |
12 | it "should return with proper http" do
13 | expect(response).to have_http_status(200)
14 | end
15 | end
16 |
17 | context "create" do
18 | let(:user) { FactoryGirl.create(:user) }
19 | let(:params) { {
20 | name: 'asdf',
21 | url: 'http://www.asdf.com',
22 | description: 'asdf'
23 | } }
24 | before :each do
25 | DatabaseCleaner.clean
26 | ApplicationController.any_instance.stub(:current_user).and_return(user)
27 | end
28 | it "creates a new project" do
29 | post("/new", params)
30 | expect(Project.first.name).to eql 'asdf'
31 | expect(Project.first.votes_count).to eql 1
32 | expect(Project.first.votes.first.user_id).to eql user.id
33 | end
34 | it "detects a duplicate submission by 'www'" do
35 | post("/new", params)
36 | user2 = FactoryGirl.create(:user)
37 | ApplicationController.any_instance.stub(:current_user).and_return(user2)
38 | params[:name] = 'asdf banana'
39 | params[:url] = 'http://asdf.com'
40 | post("/new", params)
41 | expect(Project.count).to eql 1
42 | end
43 | end
44 |
45 | context "update" do
46 | let(:user) { FactoryGirl.create(:user) }
47 | let(:project) { user.projects.create(FactoryGirl.attributes_for(:project))}
48 | before :each do
49 | DatabaseCleaner.clean
50 | ApplicationController.any_instance.stub(:current_user).and_return(user)
51 | end
52 | it "updates the project name" do
53 | patch "/update/#{project.slug}", name: "banana"
54 | expect(project.reload.name).to eql "banana"
55 | end
56 | it "redirects moderator to audit note" do
57 | user.update_attributes(moderator: true)
58 | patch "/update/#{project.slug}", name: "banana"
59 | follow_redirect!
60 | log = AuditLog.first
61 | expect(path).to eql "/audit/1/edit"
62 | end
63 | end
64 | end
65 |
--------------------------------------------------------------------------------
/spec/requests/users_spec.rb:
--------------------------------------------------------------------------------
1 | require "rails_helper"
2 | #
3 | RSpec.describe "Users", :type => :request do
4 |
5 | context "add moderator" do
6 | let(:user) { FactoryGirl.create(:user, moderator: true) }
7 | let(:user2) { FactoryGirl.create(:user) }
8 | before :each do
9 | DatabaseCleaner.clean
10 | ApplicationController.any_instance.stub(:current_user).and_return(user)
11 | end
12 | it "make_moderator" do
13 | post("/make_moderator/@#{user2.screen_name}")
14 | expect(user2.reload.moderator).to eql true
15 | end
16 |
17 | it "remove_moderator" do
18 | user2.update_attributes!(moderator: true)
19 | post("/remove_moderator/@#{user2.screen_name}")
20 | expect(user2.reload.moderator).to eql false
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/spec/support/factory_girl.rb:
--------------------------------------------------------------------------------
1 | RSpec.configure do |config|
2 | config.include FactoryGirl::Syntax::Methods
3 |
4 | config.use_transactional_fixtures = false
5 |
6 | config.before(:suite) do
7 | DatabaseCleaner.clean_with(:truncation)
8 | FactoryGirl.lint
9 | end
10 |
11 | config.before(:each) do |example|
12 | DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction
13 | DatabaseCleaner.start
14 | end
15 |
16 | config.after(:each) do
17 | DatabaseCleaner.clean
18 | end
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/vendor/assets/javascripts/.keep
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/vendor/assets/stylesheets/.keep
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/.gitignore:
--------------------------------------------------------------------------------
1 | *.gem
2 | .sass-cache
3 | bootstrap.css
4 | bootstrap-responsive.css
5 | Gemfile.lock
6 | *.gemfile.lock
7 | .rvmrc
8 | .rbenv-version
9 |
10 | # Ignore bundler config
11 | /.bundle
12 | /vendor/cache
13 | /vendor/bundle
14 | tmp/
15 | test/screenshots/
16 | test/dummy_rails/log/*.log
17 | test/dummy_rails/public/assets/
18 | .DS_Store
19 | node_modules
20 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/.travis.yml:
--------------------------------------------------------------------------------
1 | language: ruby
2 | cache: bundler
3 | bundler_args: --path ../../vendor/bundle --without debug
4 | rvm:
5 | - 2.2.3
6 | gemfile:
7 | - test/gemfiles/rails_head.gemfile
8 | - test/gemfiles/sass_3_3.gemfile
9 | - test/gemfiles/sass_3_4.gemfile
10 | - test/gemfiles/sass_head.gemfile
11 | before_install:
12 | - "nvm install stable"
13 | - "npm install"
14 | matrix:
15 | allow_failures:
16 | - gemfile: test/gemfiles/rails_head.gemfile
17 | - gemfile: test/gemfiles/sass_head.gemfile
18 | notifications:
19 | slack: heybb:3n88HHilXn76ji9vV4gL819Y
20 | env:
21 | global:
22 | - VERBOSE=1
23 | script:
24 | bundle exec rake && sh test/*.sh
25 | sudo: false
26 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | gemspec
4 |
5 | # Compass for the dummy app
6 | gem 'compass', require: false
7 |
8 | group :development do
9 | gem 'byebug', platforms: [:mri_21, :mri_22], require: false
10 | end
11 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013-2015 Twitter, Inc
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/vendor/assets/stylesheets/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/vendor/assets/stylesheets/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/vendor/assets/stylesheets/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/vendor/assets/stylesheets/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHunting/openhunt/bee950dabc68507b5aec3ae396f9315ad137a053/vendor/assets/stylesheets/bootstrap/assets/images/.keep
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/javascripts/bootstrap-sprockets.js:
--------------------------------------------------------------------------------
1 | //= require ./bootstrap/affix
2 | //= require ./bootstrap/alert
3 | //= require ./bootstrap/button
4 | //= require ./bootstrap/carousel
5 | //= require ./bootstrap/collapse
6 | //= require ./bootstrap/dropdown
7 | //= require ./bootstrap/modal
8 | //= require ./bootstrap/scrollspy
9 | //= require ./bootstrap/tab
10 | //= require ./bootstrap/transition
11 | //= require ./bootstrap/tooltip
12 | //= require ./bootstrap/popover
13 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/javascripts/bootstrap/alert.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: alert.js v3.3.6
3 | * http://getbootstrap.com/javascript/#alerts
4 | * ========================================================================
5 | * Copyright 2011-2015 Twitter, Inc.
6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7 | * ======================================================================== */
8 |
9 |
10 | +function ($) {
11 | 'use strict';
12 |
13 | // ALERT CLASS DEFINITION
14 | // ======================
15 |
16 | var dismiss = '[data-dismiss="alert"]'
17 | var Alert = function (el) {
18 | $(el).on('click', dismiss, this.close)
19 | }
20 |
21 | Alert.VERSION = '3.3.6'
22 |
23 | Alert.TRANSITION_DURATION = 150
24 |
25 | Alert.prototype.close = function (e) {
26 | var $this = $(this)
27 | var selector = $this.attr('data-target')
28 |
29 | if (!selector) {
30 | selector = $this.attr('href')
31 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
32 | }
33 |
34 | var $parent = $(selector)
35 |
36 | if (e) e.preventDefault()
37 |
38 | if (!$parent.length) {
39 | $parent = $this.closest('.alert')
40 | }
41 |
42 | $parent.trigger(e = $.Event('close.bs.alert'))
43 |
44 | if (e.isDefaultPrevented()) return
45 |
46 | $parent.removeClass('in')
47 |
48 | function removeElement() {
49 | // detach from parent, fire event then clean up data
50 | $parent.detach().trigger('closed.bs.alert').remove()
51 | }
52 |
53 | $.support.transition && $parent.hasClass('fade') ?
54 | $parent
55 | .one('bsTransitionEnd', removeElement)
56 | .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
57 | removeElement()
58 | }
59 |
60 |
61 | // ALERT PLUGIN DEFINITION
62 | // =======================
63 |
64 | function Plugin(option) {
65 | return this.each(function () {
66 | var $this = $(this)
67 | var data = $this.data('bs.alert')
68 |
69 | if (!data) $this.data('bs.alert', (data = new Alert(this)))
70 | if (typeof option == 'string') data[option].call($this)
71 | })
72 | }
73 |
74 | var old = $.fn.alert
75 |
76 | $.fn.alert = Plugin
77 | $.fn.alert.Constructor = Alert
78 |
79 |
80 | // ALERT NO CONFLICT
81 | // =================
82 |
83 | $.fn.alert.noConflict = function () {
84 | $.fn.alert = old
85 | return this
86 | }
87 |
88 |
89 | // ALERT DATA-API
90 | // ==============
91 |
92 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
93 |
94 | }(jQuery);
95 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/javascripts/bootstrap/transition.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: transition.js v3.3.6
3 | * http://getbootstrap.com/javascript/#transitions
4 | * ========================================================================
5 | * Copyright 2011-2015 Twitter, Inc.
6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7 | * ======================================================================== */
8 |
9 |
10 | +function ($) {
11 | 'use strict';
12 |
13 | // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
14 | // ============================================================
15 |
16 | function transitionEnd() {
17 | var el = document.createElement('bootstrap')
18 |
19 | var transEndEventNames = {
20 | WebkitTransition : 'webkitTransitionEnd',
21 | MozTransition : 'transitionend',
22 | OTransition : 'oTransitionEnd otransitionend',
23 | transition : 'transitionend'
24 | }
25 |
26 | for (var name in transEndEventNames) {
27 | if (el.style[name] !== undefined) {
28 | return { end: transEndEventNames[name] }
29 | }
30 | }
31 |
32 | return false // explicit for ie8 ( ._.)
33 | }
34 |
35 | // http://blog.alexmaccaw.com/css-transitions
36 | $.fn.emulateTransitionEnd = function (duration) {
37 | var called = false
38 | var $el = this
39 | $(this).one('bsTransitionEnd', function () { called = true })
40 | var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
41 | setTimeout(callback, duration)
42 | return this
43 | }
44 |
45 | $(function () {
46 | $.support.transition = transitionEnd()
47 |
48 | if (!$.support.transition) return
49 |
50 | $.event.special.bsTransitionEnd = {
51 | bindType: $.support.transition.end,
52 | delegateType: $.support.transition.end,
53 | handle: function (e) {
54 | if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
55 | }
56 | }
57 | })
58 |
59 | }(jQuery);
60 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/_bootstrap-compass.scss:
--------------------------------------------------------------------------------
1 | @function twbs-font-path($path) {
2 | @return font-url($path, true);
3 | }
4 |
5 | @function twbs-image-path($path) {
6 | @return image-url($path, true);
7 | }
8 |
9 | $bootstrap-sass-asset-helper: true;
10 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/_bootstrap-mincer.scss:
--------------------------------------------------------------------------------
1 | // Mincer asset helper functions
2 | //
3 | // This must be imported into a .css.ejs.scss file.
4 | // Then, <% %>-interpolations will be parsed as strings by Sass, and evaluated by EJS after Sass compilation.
5 |
6 |
7 | @function twbs-font-path($path) {
8 | // do something like following
9 | // from "path/to/font.ext#suffix" to "<%- asset_path(path/to/font.ext)) + #suffix %>"
10 | // from "path/to/font.ext?#suffix" to "<%- asset_path(path/to/font.ext)) + ?#suffix %>"
11 | // or from "path/to/font.ext" just "<%- asset_path(path/to/font.ext)) %>"
12 | @return "<%- asset_path("#{$path}".replace(/[#?].*$/, '')) + "#{$path}".replace(/(^[^#?]*)([#?]?.*$)/, '$2') %>";
13 | }
14 |
15 | @function twbs-image-path($file) {
16 | @return "<%- asset_path("#{$file}") %>";
17 | }
18 |
19 | $bootstrap-sass-asset-helper: true;
20 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/_bootstrap-sprockets.scss:
--------------------------------------------------------------------------------
1 | @function twbs-font-path($path) {
2 | @return font-path($path);
3 | }
4 |
5 | @function twbs-image-path($path) {
6 | @return image-path($path);
7 | }
8 |
9 | $bootstrap-sass-asset-helper: true;
10 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/_bootstrap.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.3.6 (http://getbootstrap.com)
3 | * Copyright 2011-2015 Twitter, Inc.
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 | */
6 |
7 | // Core variables and mixins
8 | @import "bootstrap/variables";
9 | @import "bootstrap/mixins";
10 |
11 | // Reset and dependencies
12 | @import "bootstrap/normalize";
13 | @import "bootstrap/print";
14 | @import "bootstrap/glyphicons";
15 |
16 | // Core CSS
17 | @import "bootstrap/scaffolding";
18 | @import "bootstrap/type";
19 | @import "bootstrap/code";
20 | @import "bootstrap/grid";
21 | @import "bootstrap/tables";
22 | @import "bootstrap/forms";
23 | @import "bootstrap/buttons";
24 |
25 | // Components
26 | @import "bootstrap/component-animations";
27 | @import "bootstrap/dropdowns";
28 | @import "bootstrap/button-groups";
29 | @import "bootstrap/input-groups";
30 | @import "bootstrap/navs";
31 | @import "bootstrap/navbar";
32 | @import "bootstrap/breadcrumbs";
33 | @import "bootstrap/pagination";
34 | @import "bootstrap/pager";
35 | @import "bootstrap/labels";
36 | @import "bootstrap/badges";
37 | @import "bootstrap/jumbotron";
38 | @import "bootstrap/thumbnails";
39 | @import "bootstrap/alerts";
40 | @import "bootstrap/progress-bars";
41 | @import "bootstrap/media";
42 | @import "bootstrap/list-group";
43 | @import "bootstrap/panels";
44 | @import "bootstrap/responsive-embed";
45 | @import "bootstrap/wells";
46 | @import "bootstrap/close";
47 |
48 | // Components w/ JavaScript
49 | @import "bootstrap/modals";
50 | @import "bootstrap/tooltip";
51 | @import "bootstrap/popovers";
52 | @import "bootstrap/carousel";
53 |
54 | // Utility classes
55 | @import "bootstrap/utilities";
56 | @import "bootstrap/responsive-utilities";
57 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_alerts.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Alerts
3 | // --------------------------------------------------
4 |
5 |
6 | // Base styles
7 | // -------------------------
8 |
9 | .alert {
10 | padding: $alert-padding;
11 | margin-bottom: $line-height-computed;
12 | border: 1px solid transparent;
13 | border-radius: $alert-border-radius;
14 |
15 | // Headings for larger alerts
16 | h4 {
17 | margin-top: 0;
18 | // Specified for the h4 to prevent conflicts of changing $headings-color
19 | color: inherit;
20 | }
21 |
22 | // Provide class for links that match alerts
23 | .alert-link {
24 | font-weight: $alert-link-font-weight;
25 | }
26 |
27 | // Improve alignment and spacing of inner content
28 | > p,
29 | > ul {
30 | margin-bottom: 0;
31 | }
32 |
33 | > p + p {
34 | margin-top: 5px;
35 | }
36 | }
37 |
38 | // Dismissible alerts
39 | //
40 | // Expand the right padding and account for the close button's positioning.
41 |
42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.
43 | .alert-dismissible {
44 | padding-right: ($alert-padding + 20);
45 |
46 | // Adjust close link position
47 | .close {
48 | position: relative;
49 | top: -2px;
50 | right: -21px;
51 | color: inherit;
52 | }
53 | }
54 |
55 | // Alternate styles
56 | //
57 | // Generate contextual modifier classes for colorizing the alert.
58 |
59 | .alert-success {
60 | @include alert-variant($alert-success-bg, $alert-success-border, $alert-success-text);
61 | }
62 |
63 | .alert-info {
64 | @include alert-variant($alert-info-bg, $alert-info-border, $alert-info-text);
65 | }
66 |
67 | .alert-warning {
68 | @include alert-variant($alert-warning-bg, $alert-warning-border, $alert-warning-text);
69 | }
70 |
71 | .alert-danger {
72 | @include alert-variant($alert-danger-bg, $alert-danger-border, $alert-danger-text);
73 | }
74 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_badges.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Badges
3 | // --------------------------------------------------
4 |
5 |
6 | // Base class
7 | .badge {
8 | display: inline-block;
9 | min-width: 10px;
10 | padding: 3px 7px;
11 | font-size: $font-size-small;
12 | font-weight: $badge-font-weight;
13 | color: $badge-color;
14 | line-height: $badge-line-height;
15 | vertical-align: middle;
16 | white-space: nowrap;
17 | text-align: center;
18 | background-color: $badge-bg;
19 | border-radius: $badge-border-radius;
20 |
21 | // Empty badges collapse automatically (not available in IE8)
22 | &:empty {
23 | display: none;
24 | }
25 |
26 | // Quick fix for badges in buttons
27 | .btn & {
28 | position: relative;
29 | top: -1px;
30 | }
31 |
32 | .btn-xs &,
33 | .btn-group-xs > .btn & {
34 | top: 0;
35 | padding: 1px 5px;
36 | }
37 |
38 | // [converter] extracted a& to a.badge
39 |
40 | // Account for badges in navs
41 | .list-group-item.active > &,
42 | .nav-pills > .active > a > & {
43 | color: $badge-active-color;
44 | background-color: $badge-active-bg;
45 | }
46 |
47 | .list-group-item > & {
48 | float: right;
49 | }
50 |
51 | .list-group-item > & + & {
52 | margin-right: 5px;
53 | }
54 |
55 | .nav-pills > li > a > & {
56 | margin-left: 3px;
57 | }
58 | }
59 |
60 | // Hover state, but only for links
61 | a.badge {
62 | &:hover,
63 | &:focus {
64 | color: $badge-link-hover-color;
65 | text-decoration: none;
66 | cursor: pointer;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_breadcrumbs.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Breadcrumbs
3 | // --------------------------------------------------
4 |
5 |
6 | .breadcrumb {
7 | padding: $breadcrumb-padding-vertical $breadcrumb-padding-horizontal;
8 | margin-bottom: $line-height-computed;
9 | list-style: none;
10 | background-color: $breadcrumb-bg;
11 | border-radius: $border-radius-base;
12 |
13 | > li {
14 | display: inline-block;
15 |
16 | + li:before {
17 | // [converter] Workaround for https://github.com/sass/libsass/issues/1115
18 | $nbsp: "\00a0";
19 | content: "#{$breadcrumb-separator}#{$nbsp}"; // Unicode space added since inline-block means non-collapsing white-space
20 | padding: 0 5px;
21 | color: $breadcrumb-color;
22 | }
23 | }
24 |
25 | > .active {
26 | color: $breadcrumb-active-color;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_close.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Close icons
3 | // --------------------------------------------------
4 |
5 |
6 | .close {
7 | float: right;
8 | font-size: ($font-size-base * 1.5);
9 | font-weight: $close-font-weight;
10 | line-height: 1;
11 | color: $close-color;
12 | text-shadow: $close-text-shadow;
13 | @include opacity(.2);
14 |
15 | &:hover,
16 | &:focus {
17 | color: $close-color;
18 | text-decoration: none;
19 | cursor: pointer;
20 | @include opacity(.5);
21 | }
22 |
23 | // [converter] extracted button& to button.close
24 | }
25 |
26 | // Additional properties for button version
27 | // iOS requires the button element instead of an anchor tag.
28 | // If you want the anchor version, it requires `href="#"`.
29 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
30 | button.close {
31 | padding: 0;
32 | cursor: pointer;
33 | background: transparent;
34 | border: 0;
35 | -webkit-appearance: none;
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_code.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Code (inline and block)
3 | // --------------------------------------------------
4 |
5 |
6 | // Inline and block code styles
7 | code,
8 | kbd,
9 | pre,
10 | samp {
11 | font-family: $font-family-monospace;
12 | }
13 |
14 | // Inline code
15 | code {
16 | padding: 2px 4px;
17 | font-size: 90%;
18 | color: $code-color;
19 | background-color: $code-bg;
20 | border-radius: $border-radius-base;
21 | }
22 |
23 | // User input typically entered via keyboard
24 | kbd {
25 | padding: 2px 4px;
26 | font-size: 90%;
27 | color: $kbd-color;
28 | background-color: $kbd-bg;
29 | border-radius: $border-radius-small;
30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
31 |
32 | kbd {
33 | padding: 0;
34 | font-size: 100%;
35 | font-weight: bold;
36 | box-shadow: none;
37 | }
38 | }
39 |
40 | // Blocks of code
41 | pre {
42 | display: block;
43 | padding: (($line-height-computed - 1) / 2);
44 | margin: 0 0 ($line-height-computed / 2);
45 | font-size: ($font-size-base - 1); // 14px to 13px
46 | line-height: $line-height-base;
47 | word-break: break-all;
48 | word-wrap: break-word;
49 | color: $pre-color;
50 | background-color: $pre-bg;
51 | border: 1px solid $pre-border-color;
52 | border-radius: $border-radius-base;
53 |
54 | // Account for some code outputs that place code tags in pre tags
55 | code {
56 | padding: 0;
57 | font-size: inherit;
58 | color: inherit;
59 | white-space: pre-wrap;
60 | background-color: transparent;
61 | border-radius: 0;
62 | }
63 | }
64 |
65 | // Enable scrollable blocks of code
66 | .pre-scrollable {
67 | max-height: $pre-scrollable-max-height;
68 | overflow-y: scroll;
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_component-animations.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Component animations
3 | // --------------------------------------------------
4 |
5 | // Heads up!
6 | //
7 | // We don't use the `.opacity()` mixin here since it causes a bug with text
8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552.
9 |
10 | .fade {
11 | opacity: 0;
12 | @include transition(opacity .15s linear);
13 | &.in {
14 | opacity: 1;
15 | }
16 | }
17 |
18 | .collapse {
19 | display: none;
20 |
21 | &.in { display: block; }
22 | // [converter] extracted tr&.in to tr.collapse.in
23 | // [converter] extracted tbody&.in to tbody.collapse.in
24 | }
25 |
26 | tr.collapse.in { display: table-row; }
27 |
28 | tbody.collapse.in { display: table-row-group; }
29 |
30 | .collapsing {
31 | position: relative;
32 | height: 0;
33 | overflow: hidden;
34 | @include transition-property(height, visibility);
35 | @include transition-duration(.35s);
36 | @include transition-timing-function(ease);
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_grid.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Grid system
3 | // --------------------------------------------------
4 |
5 |
6 | // Container widths
7 | //
8 | // Set the container width, and override it for fixed navbars in media queries.
9 |
10 | .container {
11 | @include container-fixed;
12 |
13 | @media (min-width: $screen-sm-min) {
14 | width: $container-sm;
15 | }
16 | @media (min-width: $screen-md-min) {
17 | width: $container-md;
18 | }
19 | @media (min-width: $screen-lg-min) {
20 | width: $container-lg;
21 | }
22 | }
23 |
24 |
25 | // Fluid container
26 | //
27 | // Utilizes the mixin meant for fixed width containers, but without any defined
28 | // width for fluid, full width layouts.
29 |
30 | .container-fluid {
31 | @include container-fixed;
32 | }
33 |
34 |
35 | // Row
36 | //
37 | // Rows contain and clear the floats of your columns.
38 |
39 | .row {
40 | @include make-row;
41 | }
42 |
43 |
44 | // Columns
45 | //
46 | // Common styles for small and large grid columns
47 |
48 | @include make-grid-columns;
49 |
50 |
51 | // Extra small grid
52 | //
53 | // Columns, offsets, pushes, and pulls for extra small devices like
54 | // smartphones.
55 |
56 | @include make-grid(xs);
57 |
58 |
59 | // Small grid
60 | //
61 | // Columns, offsets, pushes, and pulls for the small device range, from phones
62 | // to tablets.
63 |
64 | @media (min-width: $screen-sm-min) {
65 | @include make-grid(sm);
66 | }
67 |
68 |
69 | // Medium grid
70 | //
71 | // Columns, offsets, pushes, and pulls for the desktop device range.
72 |
73 | @media (min-width: $screen-md-min) {
74 | @include make-grid(md);
75 | }
76 |
77 |
78 | // Large grid
79 | //
80 | // Columns, offsets, pushes, and pulls for the large desktop device range.
81 |
82 | @media (min-width: $screen-lg-min) {
83 | @include make-grid(lg);
84 | }
85 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_jumbotron.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Jumbotron
3 | // --------------------------------------------------
4 |
5 |
6 | .jumbotron {
7 | padding-top: $jumbotron-padding;
8 | padding-bottom: $jumbotron-padding;
9 | margin-bottom: $jumbotron-padding;
10 | color: $jumbotron-color;
11 | background-color: $jumbotron-bg;
12 |
13 | h1,
14 | .h1 {
15 | color: $jumbotron-heading-color;
16 | }
17 |
18 | p {
19 | margin-bottom: ($jumbotron-padding / 2);
20 | font-size: $jumbotron-font-size;
21 | font-weight: 200;
22 | }
23 |
24 | > hr {
25 | border-top-color: darken($jumbotron-bg, 10%);
26 | }
27 |
28 | .container &,
29 | .container-fluid & {
30 | border-radius: $border-radius-large; // Only round corners at higher resolutions if contained in a container
31 | padding-left: ($grid-gutter-width / 2);
32 | padding-right: ($grid-gutter-width / 2);
33 | }
34 |
35 | .container {
36 | max-width: 100%;
37 | }
38 |
39 | @media screen and (min-width: $screen-sm-min) {
40 | padding-top: ($jumbotron-padding * 1.6);
41 | padding-bottom: ($jumbotron-padding * 1.6);
42 |
43 | .container &,
44 | .container-fluid & {
45 | padding-left: ($jumbotron-padding * 2);
46 | padding-right: ($jumbotron-padding * 2);
47 | }
48 |
49 | h1,
50 | .h1 {
51 | font-size: $jumbotron-heading-font-size;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_labels.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Labels
3 | // --------------------------------------------------
4 |
5 | .label {
6 | display: inline;
7 | padding: .2em .6em .3em;
8 | font-size: 75%;
9 | font-weight: bold;
10 | line-height: 1;
11 | color: $label-color;
12 | text-align: center;
13 | white-space: nowrap;
14 | vertical-align: baseline;
15 | border-radius: .25em;
16 |
17 | // [converter] extracted a& to a.label
18 |
19 | // Empty labels collapse automatically (not available in IE8)
20 | &:empty {
21 | display: none;
22 | }
23 |
24 | // Quick fix for labels in buttons
25 | .btn & {
26 | position: relative;
27 | top: -1px;
28 | }
29 | }
30 |
31 | // Add hover effects, but only for links
32 | a.label {
33 | &:hover,
34 | &:focus {
35 | color: $label-link-hover-color;
36 | text-decoration: none;
37 | cursor: pointer;
38 | }
39 | }
40 |
41 | // Colors
42 | // Contextual variations (linked labels get darker on :hover)
43 |
44 | .label-default {
45 | @include label-variant($label-default-bg);
46 | }
47 |
48 | .label-primary {
49 | @include label-variant($label-primary-bg);
50 | }
51 |
52 | .label-success {
53 | @include label-variant($label-success-bg);
54 | }
55 |
56 | .label-info {
57 | @include label-variant($label-info-bg);
58 | }
59 |
60 | .label-warning {
61 | @include label-variant($label-warning-bg);
62 | }
63 |
64 | .label-danger {
65 | @include label-variant($label-danger-bg);
66 | }
67 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_media.scss:
--------------------------------------------------------------------------------
1 | .media {
2 | // Proper spacing between instances of .media
3 | margin-top: 15px;
4 |
5 | &:first-child {
6 | margin-top: 0;
7 | }
8 | }
9 |
10 | .media,
11 | .media-body {
12 | zoom: 1;
13 | overflow: hidden;
14 | }
15 |
16 | .media-body {
17 | width: 10000px;
18 | }
19 |
20 | .media-object {
21 | display: block;
22 |
23 | // Fix collapse in webkit from max-width: 100% and display: table-cell.
24 | &.img-thumbnail {
25 | max-width: none;
26 | }
27 | }
28 |
29 | .media-right,
30 | .media > .pull-right {
31 | padding-left: 10px;
32 | }
33 |
34 | .media-left,
35 | .media > .pull-left {
36 | padding-right: 10px;
37 | }
38 |
39 | .media-left,
40 | .media-right,
41 | .media-body {
42 | display: table-cell;
43 | vertical-align: top;
44 | }
45 |
46 | .media-middle {
47 | vertical-align: middle;
48 | }
49 |
50 | .media-bottom {
51 | vertical-align: bottom;
52 | }
53 |
54 | // Reset margins on headings for tighter default spacing
55 | .media-heading {
56 | margin-top: 0;
57 | margin-bottom: 5px;
58 | }
59 |
60 | // Media list variation
61 | //
62 | // Undo default ul/ol styles
63 | .media-list {
64 | padding-left: 0;
65 | list-style: none;
66 | }
67 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_mixins.scss:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------------------------------
3 |
4 | // Utilities
5 | @import "mixins/hide-text";
6 | @import "mixins/opacity";
7 | @import "mixins/image";
8 | @import "mixins/labels";
9 | @import "mixins/reset-filter";
10 | @import "mixins/resize";
11 | @import "mixins/responsive-visibility";
12 | @import "mixins/size";
13 | @import "mixins/tab-focus";
14 | @import "mixins/reset-text";
15 | @import "mixins/text-emphasis";
16 | @import "mixins/text-overflow";
17 | @import "mixins/vendor-prefixes";
18 |
19 | // Components
20 | @import "mixins/alerts";
21 | @import "mixins/buttons";
22 | @import "mixins/panels";
23 | @import "mixins/pagination";
24 | @import "mixins/list-group";
25 | @import "mixins/nav-divider";
26 | @import "mixins/forms";
27 | @import "mixins/progress-bar";
28 | @import "mixins/table-row";
29 |
30 | // Skins
31 | @import "mixins/background-variant";
32 | @import "mixins/border-radius";
33 | @import "mixins/gradients";
34 |
35 | // Layout
36 | @import "mixins/clearfix";
37 | @import "mixins/center-block";
38 | @import "mixins/nav-vertical-align";
39 | @import "mixins/grid-framework";
40 | @import "mixins/grid";
41 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_pager.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Pager pagination
3 | // --------------------------------------------------
4 |
5 |
6 | .pager {
7 | padding-left: 0;
8 | margin: $line-height-computed 0;
9 | list-style: none;
10 | text-align: center;
11 | @include clearfix;
12 | li {
13 | display: inline;
14 | > a,
15 | > span {
16 | display: inline-block;
17 | padding: 5px 14px;
18 | background-color: $pager-bg;
19 | border: 1px solid $pager-border;
20 | border-radius: $pager-border-radius;
21 | }
22 |
23 | > a:hover,
24 | > a:focus {
25 | text-decoration: none;
26 | background-color: $pager-hover-bg;
27 | }
28 | }
29 |
30 | .next {
31 | > a,
32 | > span {
33 | float: right;
34 | }
35 | }
36 |
37 | .previous {
38 | > a,
39 | > span {
40 | float: left;
41 | }
42 | }
43 |
44 | .disabled {
45 | > a,
46 | > a:hover,
47 | > a:focus,
48 | > span {
49 | color: $pager-disabled-color;
50 | background-color: $pager-bg;
51 | cursor: $cursor-disabled;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_pagination.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Pagination (multiple pages)
3 | // --------------------------------------------------
4 | .pagination {
5 | display: inline-block;
6 | padding-left: 0;
7 | margin: $line-height-computed 0;
8 | border-radius: $border-radius-base;
9 |
10 | > li {
11 | display: inline; // Remove list-style and block-level defaults
12 | > a,
13 | > span {
14 | position: relative;
15 | float: left; // Collapse white-space
16 | padding: $padding-base-vertical $padding-base-horizontal;
17 | line-height: $line-height-base;
18 | text-decoration: none;
19 | color: $pagination-color;
20 | background-color: $pagination-bg;
21 | border: 1px solid $pagination-border;
22 | margin-left: -1px;
23 | }
24 | &:first-child {
25 | > a,
26 | > span {
27 | margin-left: 0;
28 | @include border-left-radius($border-radius-base);
29 | }
30 | }
31 | &:last-child {
32 | > a,
33 | > span {
34 | @include border-right-radius($border-radius-base);
35 | }
36 | }
37 | }
38 |
39 | > li > a,
40 | > li > span {
41 | &:hover,
42 | &:focus {
43 | z-index: 2;
44 | color: $pagination-hover-color;
45 | background-color: $pagination-hover-bg;
46 | border-color: $pagination-hover-border;
47 | }
48 | }
49 |
50 | > .active > a,
51 | > .active > span {
52 | &,
53 | &:hover,
54 | &:focus {
55 | z-index: 3;
56 | color: $pagination-active-color;
57 | background-color: $pagination-active-bg;
58 | border-color: $pagination-active-border;
59 | cursor: default;
60 | }
61 | }
62 |
63 | > .disabled {
64 | > span,
65 | > span:hover,
66 | > span:focus,
67 | > a,
68 | > a:hover,
69 | > a:focus {
70 | color: $pagination-disabled-color;
71 | background-color: $pagination-disabled-bg;
72 | border-color: $pagination-disabled-border;
73 | cursor: $cursor-disabled;
74 | }
75 | }
76 | }
77 |
78 | // Sizing
79 | // --------------------------------------------------
80 |
81 | // Large
82 | .pagination-lg {
83 | @include pagination-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $border-radius-large);
84 | }
85 |
86 | // Small
87 | .pagination-sm {
88 | @include pagination-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $border-radius-small);
89 | }
90 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_print.scss:
--------------------------------------------------------------------------------
1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
2 |
3 | // ==========================================================================
4 | // Print styles.
5 | // Inlined to avoid the additional HTTP request: h5bp.com/r
6 | // ==========================================================================
7 |
8 | @media print {
9 | *,
10 | *:before,
11 | *:after {
12 | background: transparent !important;
13 | color: #000 !important; // Black prints faster: h5bp.com/s
14 | box-shadow: none !important;
15 | text-shadow: none !important;
16 | }
17 |
18 | a,
19 | a:visited {
20 | text-decoration: underline;
21 | }
22 |
23 | a[href]:after {
24 | content: " (" attr(href) ")";
25 | }
26 |
27 | abbr[title]:after {
28 | content: " (" attr(title) ")";
29 | }
30 |
31 | // Don't show links that are fragment identifiers,
32 | // or use the `javascript:` pseudo protocol
33 | a[href^="#"]:after,
34 | a[href^="javascript:"]:after {
35 | content: "";
36 | }
37 |
38 | pre,
39 | blockquote {
40 | border: 1px solid #999;
41 | page-break-inside: avoid;
42 | }
43 |
44 | thead {
45 | display: table-header-group; // h5bp.com/t
46 | }
47 |
48 | tr,
49 | img {
50 | page-break-inside: avoid;
51 | }
52 |
53 | img {
54 | max-width: 100% !important;
55 | }
56 |
57 | p,
58 | h2,
59 | h3 {
60 | orphans: 3;
61 | widows: 3;
62 | }
63 |
64 | h2,
65 | h3 {
66 | page-break-after: avoid;
67 | }
68 |
69 | // Bootstrap specific changes start
70 |
71 | // Bootstrap components
72 | .navbar {
73 | display: none;
74 | }
75 | .btn,
76 | .dropup > .btn {
77 | > .caret {
78 | border-top-color: #000 !important;
79 | }
80 | }
81 | .label {
82 | border: 1px solid #000;
83 | }
84 |
85 | .table {
86 | border-collapse: collapse !important;
87 |
88 | td,
89 | th {
90 | background-color: #fff !important;
91 | }
92 | }
93 | .table-bordered {
94 | th,
95 | td {
96 | border: 1px solid #ddd !important;
97 | }
98 | }
99 |
100 | // Bootstrap specific changes end
101 | }
102 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_progress-bars.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Progress bars
3 | // --------------------------------------------------
4 |
5 |
6 | // Bar animations
7 | // -------------------------
8 |
9 | // WebKit
10 | @-webkit-keyframes progress-bar-stripes {
11 | from { background-position: 40px 0; }
12 | to { background-position: 0 0; }
13 | }
14 |
15 | // Spec and IE10+
16 | @keyframes progress-bar-stripes {
17 | from { background-position: 40px 0; }
18 | to { background-position: 0 0; }
19 | }
20 |
21 |
22 | // Bar itself
23 | // -------------------------
24 |
25 | // Outer container
26 | .progress {
27 | overflow: hidden;
28 | height: $line-height-computed;
29 | margin-bottom: $line-height-computed;
30 | background-color: $progress-bg;
31 | border-radius: $progress-border-radius;
32 | @include box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
33 | }
34 |
35 | // Bar of progress
36 | .progress-bar {
37 | float: left;
38 | width: 0%;
39 | height: 100%;
40 | font-size: $font-size-small;
41 | line-height: $line-height-computed;
42 | color: $progress-bar-color;
43 | text-align: center;
44 | background-color: $progress-bar-bg;
45 | @include box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));
46 | @include transition(width .6s ease);
47 | }
48 |
49 | // Striped bars
50 | //
51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the
52 | // `.progress-bar-striped` class, which you just add to an existing
53 | // `.progress-bar`.
54 | .progress-striped .progress-bar,
55 | .progress-bar-striped {
56 | @include gradient-striped;
57 | background-size: 40px 40px;
58 | }
59 |
60 | // Call animation for the active one
61 | //
62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the
63 | // `.progress-bar.active` approach.
64 | .progress.active .progress-bar,
65 | .progress-bar.active {
66 | @include animation(progress-bar-stripes 2s linear infinite);
67 | }
68 |
69 |
70 | // Variations
71 | // -------------------------
72 |
73 | .progress-bar-success {
74 | @include progress-bar-variant($progress-bar-success-bg);
75 | }
76 |
77 | .progress-bar-info {
78 | @include progress-bar-variant($progress-bar-info-bg);
79 | }
80 |
81 | .progress-bar-warning {
82 | @include progress-bar-variant($progress-bar-warning-bg);
83 | }
84 |
85 | .progress-bar-danger {
86 | @include progress-bar-variant($progress-bar-danger-bg);
87 | }
88 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_responsive-embed.scss:
--------------------------------------------------------------------------------
1 | // Embeds responsive
2 | //
3 | // Credit: Nicolas Gallagher and SUIT CSS.
4 |
5 | .embed-responsive {
6 | position: relative;
7 | display: block;
8 | height: 0;
9 | padding: 0;
10 | overflow: hidden;
11 |
12 | .embed-responsive-item,
13 | iframe,
14 | embed,
15 | object,
16 | video {
17 | position: absolute;
18 | top: 0;
19 | left: 0;
20 | bottom: 0;
21 | height: 100%;
22 | width: 100%;
23 | border: 0;
24 | }
25 | }
26 |
27 | // Modifier class for 16:9 aspect ratio
28 | .embed-responsive-16by9 {
29 | padding-bottom: 56.25%;
30 | }
31 |
32 | // Modifier class for 4:3 aspect ratio
33 | .embed-responsive-4by3 {
34 | padding-bottom: 75%;
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_thumbnails.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Thumbnails
3 | // --------------------------------------------------
4 |
5 |
6 | // Mixin and adjust the regular image class
7 | .thumbnail {
8 | display: block;
9 | padding: $thumbnail-padding;
10 | margin-bottom: $line-height-computed;
11 | line-height: $line-height-base;
12 | background-color: $thumbnail-bg;
13 | border: 1px solid $thumbnail-border;
14 | border-radius: $thumbnail-border-radius;
15 | @include transition(border .2s ease-in-out);
16 |
17 | > img,
18 | a > img {
19 | @include img-responsive;
20 | margin-left: auto;
21 | margin-right: auto;
22 | }
23 |
24 | // [converter] extracted a&:hover, a&:focus, a&.active to a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active
25 |
26 | // Image captions
27 | .caption {
28 | padding: $thumbnail-caption-padding;
29 | color: $thumbnail-caption-color;
30 | }
31 | }
32 |
33 | // Add a hover state for linked versions only
34 | a.thumbnail:hover,
35 | a.thumbnail:focus,
36 | a.thumbnail.active {
37 | border-color: $link-color;
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_utilities.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Utility classes
3 | // --------------------------------------------------
4 |
5 |
6 | // Floats
7 | // -------------------------
8 |
9 | .clearfix {
10 | @include clearfix;
11 | }
12 | .center-block {
13 | @include center-block;
14 | }
15 | .pull-right {
16 | float: right !important;
17 | }
18 | .pull-left {
19 | float: left !important;
20 | }
21 |
22 |
23 | // Toggling content
24 | // -------------------------
25 |
26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1
27 | .hide {
28 | display: none !important;
29 | }
30 | .show {
31 | display: block !important;
32 | }
33 | .invisible {
34 | visibility: hidden;
35 | }
36 | .text-hide {
37 | @include text-hide;
38 | }
39 |
40 |
41 | // Hide from screenreaders and browsers
42 | //
43 | // Credit: HTML5 Boilerplate
44 |
45 | .hidden {
46 | display: none !important;
47 | }
48 |
49 |
50 | // For Affix plugin
51 | // -------------------------
52 |
53 | .affix {
54 | position: fixed;
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/_wells.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Wells
3 | // --------------------------------------------------
4 |
5 |
6 | // Base class
7 | .well {
8 | min-height: 20px;
9 | padding: 19px;
10 | margin-bottom: 20px;
11 | background-color: $well-bg;
12 | border: 1px solid $well-border;
13 | border-radius: $border-radius-base;
14 | @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
15 | blockquote {
16 | border-color: #ddd;
17 | border-color: rgba(0,0,0,.15);
18 | }
19 | }
20 |
21 | // Sizes
22 | .well-lg {
23 | padding: 24px;
24 | border-radius: $border-radius-large;
25 | }
26 | .well-sm {
27 | padding: 9px;
28 | border-radius: $border-radius-small;
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_alerts.scss:
--------------------------------------------------------------------------------
1 | // Alerts
2 |
3 | @mixin alert-variant($background, $border, $text-color) {
4 | background-color: $background;
5 | border-color: $border;
6 | color: $text-color;
7 |
8 | hr {
9 | border-top-color: darken($border, 5%);
10 | }
11 | .alert-link {
12 | color: darken($text-color, 10%);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_background-variant.scss:
--------------------------------------------------------------------------------
1 | // Contextual backgrounds
2 |
3 | // [converter] $parent hack
4 | @mixin bg-variant($parent, $color) {
5 | #{$parent} {
6 | background-color: $color;
7 | }
8 | a#{$parent}:hover,
9 | a#{$parent}:focus {
10 | background-color: darken($color, 10%);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_border-radius.scss:
--------------------------------------------------------------------------------
1 | // Single side border-radius
2 |
3 | @mixin border-top-radius($radius) {
4 | border-top-right-radius: $radius;
5 | border-top-left-radius: $radius;
6 | }
7 | @mixin border-right-radius($radius) {
8 | border-bottom-right-radius: $radius;
9 | border-top-right-radius: $radius;
10 | }
11 | @mixin border-bottom-radius($radius) {
12 | border-bottom-right-radius: $radius;
13 | border-bottom-left-radius: $radius;
14 | }
15 | @mixin border-left-radius($radius) {
16 | border-bottom-left-radius: $radius;
17 | border-top-left-radius: $radius;
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_buttons.scss:
--------------------------------------------------------------------------------
1 | // Button variants
2 | //
3 | // Easily pump out default styles, as well as :hover, :focus, :active,
4 | // and disabled options for all buttons
5 |
6 | @mixin button-variant($color, $background, $border) {
7 | color: $color;
8 | background-color: $background;
9 | border-color: $border;
10 |
11 | &:focus,
12 | &.focus {
13 | color: $color;
14 | background-color: darken($background, 10%);
15 | border-color: darken($border, 25%);
16 | }
17 | &:hover {
18 | color: $color;
19 | background-color: darken($background, 10%);
20 | border-color: darken($border, 12%);
21 | }
22 | &:active,
23 | &.active,
24 | .open > &.dropdown-toggle {
25 | color: $color;
26 | background-color: darken($background, 10%);
27 | border-color: darken($border, 12%);
28 |
29 | &:hover,
30 | &:focus,
31 | &.focus {
32 | color: $color;
33 | background-color: darken($background, 17%);
34 | border-color: darken($border, 25%);
35 | }
36 | }
37 | &:active,
38 | &.active,
39 | .open > &.dropdown-toggle {
40 | background-image: none;
41 | }
42 | &.disabled,
43 | &[disabled],
44 | fieldset[disabled] & {
45 | &:hover,
46 | &:focus,
47 | &.focus {
48 | background-color: $background;
49 | border-color: $border;
50 | }
51 | }
52 |
53 | .badge {
54 | color: $background;
55 | background-color: $color;
56 | }
57 | }
58 |
59 | // Button sizes
60 | @mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
61 | padding: $padding-vertical $padding-horizontal;
62 | font-size: $font-size;
63 | line-height: $line-height;
64 | border-radius: $border-radius;
65 | }
66 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_center-block.scss:
--------------------------------------------------------------------------------
1 | // Center-align a block level element
2 |
3 | @mixin center-block() {
4 | display: block;
5 | margin-left: auto;
6 | margin-right: auto;
7 | }
8 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_clearfix.scss:
--------------------------------------------------------------------------------
1 | // Clearfix
2 | //
3 | // For modern browsers
4 | // 1. The space content is one way to avoid an Opera bug when the
5 | // contenteditable attribute is included anywhere else in the document.
6 | // Otherwise it causes space to appear at the top and bottom of elements
7 | // that are clearfixed.
8 | // 2. The use of `table` rather than `block` is only necessary if using
9 | // `:before` to contain the top-margins of child elements.
10 | //
11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/
12 |
13 | @mixin clearfix() {
14 | &:before,
15 | &:after {
16 | content: " "; // 1
17 | display: table; // 2
18 | }
19 | &:after {
20 | clear: both;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_hide-text.scss:
--------------------------------------------------------------------------------
1 | // CSS image replacement
2 | //
3 | // Heads up! v3 launched with only `.hide-text()`, but per our pattern for
4 | // mixins being reused as classes with the same name, this doesn't hold up. As
5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`.
6 | //
7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
8 |
9 | // Deprecated as of v3.0.1 (has been removed in v4)
10 | @mixin hide-text() {
11 | font: 0/0 a;
12 | color: transparent;
13 | text-shadow: none;
14 | background-color: transparent;
15 | border: 0;
16 | }
17 |
18 | // New mixin to use as of v3.0.1
19 | @mixin text-hide() {
20 | @include hide-text;
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_image.scss:
--------------------------------------------------------------------------------
1 | // Image Mixins
2 | // - Responsive image
3 | // - Retina image
4 |
5 |
6 | // Responsive image
7 | //
8 | // Keep images from scaling beyond the width of their parents.
9 | @mixin img-responsive($display: block) {
10 | display: $display;
11 | max-width: 100%; // Part 1: Set a maximum relative to the parent
12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
13 | }
14 |
15 |
16 | // Retina image
17 | //
18 | // Short retina mixin for setting background-image and -size. Note that the
19 | // spelling of `min--moz-device-pixel-ratio` is intentional.
20 | @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
21 | background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$file-1x}"));
22 |
23 | @media
24 | only screen and (-webkit-min-device-pixel-ratio: 2),
25 | only screen and ( min--moz-device-pixel-ratio: 2),
26 | only screen and ( -o-min-device-pixel-ratio: 2/1),
27 | only screen and ( min-device-pixel-ratio: 2),
28 | only screen and ( min-resolution: 192dpi),
29 | only screen and ( min-resolution: 2dppx) {
30 | background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}"));
31 | background-size: $width-1x $height-1x;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_labels.scss:
--------------------------------------------------------------------------------
1 | // Labels
2 |
3 | @mixin label-variant($color) {
4 | background-color: $color;
5 |
6 | &[href] {
7 | &:hover,
8 | &:focus {
9 | background-color: darken($color, 10%);
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_list-group.scss:
--------------------------------------------------------------------------------
1 | // List Groups
2 |
3 | @mixin list-group-item-variant($state, $background, $color) {
4 | .list-group-item-#{$state} {
5 | color: $color;
6 | background-color: $background;
7 |
8 | // [converter] extracted a&, button& to a.list-group-item-#{$state}, button.list-group-item-#{$state}
9 | }
10 |
11 | a.list-group-item-#{$state},
12 | button.list-group-item-#{$state} {
13 | color: $color;
14 |
15 | .list-group-item-heading {
16 | color: inherit;
17 | }
18 |
19 | &:hover,
20 | &:focus {
21 | color: $color;
22 | background-color: darken($background, 5%);
23 | }
24 | &.active,
25 | &.active:hover,
26 | &.active:focus {
27 | color: #fff;
28 | background-color: $color;
29 | border-color: $color;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_nav-divider.scss:
--------------------------------------------------------------------------------
1 | // Horizontal dividers
2 | //
3 | // Dividers (basically an hr) within dropdowns and nav lists
4 |
5 | @mixin nav-divider($color: #e5e5e5) {
6 | height: 1px;
7 | margin: (($line-height-computed / 2) - 1) 0;
8 | overflow: hidden;
9 | background-color: $color;
10 | }
11 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss:
--------------------------------------------------------------------------------
1 | // Navbar vertical align
2 | //
3 | // Vertically center elements in the navbar.
4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
5 |
6 | @mixin navbar-vertical-align($element-height) {
7 | margin-top: (($navbar-height - $element-height) / 2);
8 | margin-bottom: (($navbar-height - $element-height) / 2);
9 | }
10 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_opacity.scss:
--------------------------------------------------------------------------------
1 | // Opacity
2 |
3 | @mixin opacity($opacity) {
4 | opacity: $opacity;
5 | // IE8 filter
6 | $opacity-ie: ($opacity * 100);
7 | filter: alpha(opacity=$opacity-ie);
8 | }
9 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_pagination.scss:
--------------------------------------------------------------------------------
1 | // Pagination
2 |
3 | @mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
4 | > li {
5 | > a,
6 | > span {
7 | padding: $padding-vertical $padding-horizontal;
8 | font-size: $font-size;
9 | line-height: $line-height;
10 | }
11 | &:first-child {
12 | > a,
13 | > span {
14 | @include border-left-radius($border-radius);
15 | }
16 | }
17 | &:last-child {
18 | > a,
19 | > span {
20 | @include border-right-radius($border-radius);
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_panels.scss:
--------------------------------------------------------------------------------
1 | // Panels
2 |
3 | @mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) {
4 | border-color: $border;
5 |
6 | & > .panel-heading {
7 | color: $heading-text-color;
8 | background-color: $heading-bg-color;
9 | border-color: $heading-border;
10 |
11 | + .panel-collapse > .panel-body {
12 | border-top-color: $border;
13 | }
14 | .badge {
15 | color: $heading-bg-color;
16 | background-color: $heading-text-color;
17 | }
18 | }
19 | & > .panel-footer {
20 | + .panel-collapse > .panel-body {
21 | border-bottom-color: $border;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_progress-bar.scss:
--------------------------------------------------------------------------------
1 | // Progress bars
2 |
3 | @mixin progress-bar-variant($color) {
4 | background-color: $color;
5 |
6 | // Deprecated parent class requirement as of v3.2.0
7 | .progress-striped & {
8 | @include gradient-striped;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_reset-filter.scss:
--------------------------------------------------------------------------------
1 | // Reset filters for IE
2 | //
3 | // When you need to remove a gradient background, do not forget to use this to reset
4 | // the IE filter for IE9 and below.
5 |
6 | @mixin reset-filter() {
7 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
8 | }
9 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_reset-text.scss:
--------------------------------------------------------------------------------
1 | @mixin reset-text() {
2 | font-family: $font-family-base;
3 | // We deliberately do NOT reset font-size.
4 | font-style: normal;
5 | font-weight: normal;
6 | letter-spacing: normal;
7 | line-break: auto;
8 | line-height: $line-height-base;
9 | text-align: left; // Fallback for where `start` is not supported
10 | text-align: start;
11 | text-decoration: none;
12 | text-shadow: none;
13 | text-transform: none;
14 | white-space: normal;
15 | word-break: normal;
16 | word-spacing: normal;
17 | word-wrap: normal;
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_resize.scss:
--------------------------------------------------------------------------------
1 | // Resize anything
2 |
3 | @mixin resizable($direction) {
4 | resize: $direction; // Options: horizontal, vertical, both
5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible`
6 | }
7 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss:
--------------------------------------------------------------------------------
1 | // Responsive utilities
2 |
3 | //
4 | // More easily include all the states for responsive-utilities.less.
5 | // [converter] $parent hack
6 | @mixin responsive-visibility($parent) {
7 | #{$parent} {
8 | display: block !important;
9 | }
10 | table#{$parent} { display: table !important; }
11 | tr#{$parent} { display: table-row !important; }
12 | th#{$parent},
13 | td#{$parent} { display: table-cell !important; }
14 | }
15 |
16 | // [converter] $parent hack
17 | @mixin responsive-invisibility($parent) {
18 | #{$parent} {
19 | display: none !important;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_size.scss:
--------------------------------------------------------------------------------
1 | // Sizing shortcuts
2 |
3 | @mixin size($width, $height) {
4 | width: $width;
5 | height: $height;
6 | }
7 |
8 | @mixin square($size) {
9 | @include size($size, $size);
10 | }
11 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_tab-focus.scss:
--------------------------------------------------------------------------------
1 | // WebKit-style focus
2 |
3 | @mixin tab-focus() {
4 | // Default
5 | outline: thin dotted;
6 | // WebKit
7 | outline: 5px auto -webkit-focus-ring-color;
8 | outline-offset: -2px;
9 | }
10 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_table-row.scss:
--------------------------------------------------------------------------------
1 | // Tables
2 |
3 | @mixin table-row-variant($state, $background) {
4 | // Exact selectors below required to override `.table-striped` and prevent
5 | // inheritance to nested tables.
6 | .table > thead > tr,
7 | .table > tbody > tr,
8 | .table > tfoot > tr {
9 | > td.#{$state},
10 | > th.#{$state},
11 | &.#{$state} > td,
12 | &.#{$state} > th {
13 | background-color: $background;
14 | }
15 | }
16 |
17 | // Hover states for `.table-hover`
18 | // Note: this is not available for cells or rows within `thead` or `tfoot`.
19 | .table-hover > tbody > tr {
20 | > td.#{$state}:hover,
21 | > th.#{$state}:hover,
22 | &.#{$state}:hover > td,
23 | &:hover > .#{$state},
24 | &.#{$state}:hover > th {
25 | background-color: darken($background, 5%);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss:
--------------------------------------------------------------------------------
1 | // Typography
2 |
3 | // [converter] $parent hack
4 | @mixin text-emphasis-variant($parent, $color) {
5 | #{$parent} {
6 | color: $color;
7 | }
8 | a#{$parent}:hover,
9 | a#{$parent}:focus {
10 | color: darken($color, 10%);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/assets/stylesheets/bootstrap/mixins/_text-overflow.scss:
--------------------------------------------------------------------------------
1 | // Text overflow
2 | // Requires inline-block or block for proper styling
3 |
4 | @mixin text-overflow() {
5 | overflow: hidden;
6 | text-overflow: ellipsis;
7 | white-space: nowrap;
8 | }
9 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/bootstrap-sass.gemspec:
--------------------------------------------------------------------------------
1 | lib = File.expand_path('../lib', __FILE__)
2 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3 | require 'bootstrap-sass/version'
4 |
5 | Gem::Specification.new do |s|
6 | s.name = 'bootstrap-sass'
7 | s.version = Bootstrap::VERSION
8 | s.authors = ['Thomas McDonald']
9 | s.email = 'tom@conceptcoding.co.uk'
10 | s.summary = 'bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.'
11 | s.homepage = 'https://github.com/twbs/bootstrap-sass'
12 | s.license = 'MIT'
13 |
14 | s.add_runtime_dependency 'sass', '>= 3.3.4'
15 | s.add_runtime_dependency 'autoprefixer-rails', '>= 5.2.1'
16 |
17 | # Testing dependencies
18 | s.add_development_dependency 'minitest', '~> 5.8'
19 | s.add_development_dependency 'minitest-reporters', '~> 1.1'
20 | # Integration testing
21 | s.add_development_dependency 'capybara', '>= 2.5.0'
22 | s.add_development_dependency 'poltergeist'
23 | # Dummy Rails app dependencies
24 | s.add_development_dependency 'actionpack', '>= 4.1.5'
25 | s.add_development_dependency 'activesupport', '>= 4.1.5'
26 | s.add_development_dependency 'json', '>= 1.8.1'
27 | s.add_development_dependency 'sprockets-rails', '>= 2.1.3'
28 | s.add_development_dependency 'jquery-rails', '>= 3.1.0'
29 | s.add_development_dependency 'slim-rails'
30 | s.add_development_dependency 'uglifier'
31 | # Converter
32 | s.add_development_dependency 'term-ansicolor'
33 |
34 | s.files = `git ls-files`.split("\n")
35 | s.test_files = `git ls-files -- test/*`.split("\n")
36 | end
37 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap-sass",
3 | "homepage": "https://github.com/twbs/bootstrap-sass",
4 | "authors": [
5 | "Thomas McDonald",
6 | "Tristan Harward",
7 | "Peter Gumeson",
8 | "Gleb Mazovetskiy"
9 | ],
10 | "description": "bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.",
11 | "moduleType": "globals",
12 | "main": [
13 | "assets/stylesheets/_bootstrap.scss",
14 | "assets/javascripts/bootstrap.js"
15 | ],
16 | "keywords": [
17 | "twbs",
18 | "bootstrap",
19 | "sass"
20 | ],
21 | "license": "MIT",
22 | "ignore": [
23 | "**/.*",
24 | "lib",
25 | "tasks",
26 | "templates",
27 | "test",
28 | "*.gemspec",
29 | "Rakefile",
30 | "Gemfile"
31 | ],
32 | "dependencies": {
33 | "jquery": ">= 1.9.0"
34 | },
35 | "version": "3.3.6"
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "twbs/bootstrap-sass",
3 | "description": "bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.",
4 | "keywords": ["bootstrap", "css", "sass"],
5 | "homepage": "http://github.com/twbs/bootstrap-sass",
6 | "authors": [
7 | {
8 | "name": "Thomas McDonald"
9 | },
10 | {
11 | "name": "Tristan Harward"
12 | },
13 | {
14 | "name": "Peter Gumeson"
15 | },
16 | {
17 | "name": "Gleb Mazovetskiy"
18 | },
19 | {
20 | "name": "Mark Otto"
21 | },
22 | {
23 | "name": "Jacob Thornton"
24 | }
25 | ],
26 | "support": {
27 | "issues": "https://github.com/twbs/bootstrap-sass/issues"
28 | },
29 | "license": "MIT",
30 | "extra": {
31 | "branch-alias": {
32 | "dev-master": "3.3.x-dev"
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/lib/bootstrap-sass.rb:
--------------------------------------------------------------------------------
1 | require 'bootstrap-sass/version'
2 | module Bootstrap
3 | class << self
4 | # Inspired by Kaminari
5 | def load!
6 | register_compass_extension if compass?
7 |
8 | if rails?
9 | register_rails_engine
10 | elsif lotus?
11 | register_lotus
12 | elsif sprockets?
13 | register_sprockets
14 | end
15 |
16 | configure_sass
17 | end
18 |
19 | # Paths
20 | def gem_path
21 | @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
22 | end
23 |
24 | def stylesheets_path
25 | File.join assets_path, 'stylesheets'
26 | end
27 |
28 | def fonts_path
29 | File.join assets_path, 'fonts'
30 | end
31 |
32 | def javascripts_path
33 | File.join assets_path, 'javascripts'
34 | end
35 |
36 | def assets_path
37 | @assets_path ||= File.join gem_path, 'assets'
38 | end
39 |
40 | # Environment detection helpers
41 | def sprockets?
42 | defined?(::Sprockets)
43 | end
44 |
45 | def compass?
46 | defined?(::Compass::Frameworks)
47 | end
48 |
49 | def rails?
50 | defined?(::Rails)
51 | end
52 |
53 | def lotus?
54 | defined?(::Lotus)
55 | end
56 |
57 | private
58 |
59 | def configure_sass
60 | require 'sass'
61 |
62 | ::Sass.load_paths << stylesheets_path
63 |
64 | # bootstrap requires minimum precision of 8, see https://github.com/twbs/bootstrap-sass/issues/409
65 | ::Sass::Script::Number.precision = [8, ::Sass::Script::Number.precision].max
66 | end
67 |
68 | def register_compass_extension
69 | ::Compass::Frameworks.register(
70 | 'bootstrap',
71 | :version => Bootstrap::VERSION,
72 | :path => gem_path,
73 | :stylesheets_directory => stylesheets_path,
74 | :templates_directory => File.join(gem_path, 'templates')
75 | )
76 | end
77 |
78 | def register_rails_engine
79 | require 'bootstrap-sass/engine'
80 | end
81 |
82 | def register_lotus
83 | Lotus::Assets.sources << assets_path
84 | end
85 |
86 | def register_sprockets
87 | Sprockets.append_path(stylesheets_path)
88 | Sprockets.append_path(fonts_path)
89 | Sprockets.append_path(javascripts_path)
90 | end
91 | end
92 | end
93 |
94 | Bootstrap.load!
95 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/lib/bootstrap-sass/engine.rb:
--------------------------------------------------------------------------------
1 | module Bootstrap
2 | module Rails
3 | class Engine < ::Rails::Engine
4 | initializer 'bootstrap-sass.assets.precompile' do |app|
5 | %w(stylesheets javascripts fonts images).each do |sub|
6 | app.config.assets.paths << root.join('assets', sub).to_s
7 | end
8 |
9 | # sprockets-rails 3 tracks down the calls to `font_path` and `image_path`
10 | # and automatically precompiles the referenced assets.
11 | unless Sprockets::Rails::VERSION.split('.', 2)[0].to_i >= 3
12 | app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff2?)$)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/lib/bootstrap-sass/version.rb:
--------------------------------------------------------------------------------
1 | module Bootstrap
2 | VERSION = '3.3.6'
3 | BOOTSTRAP_SHA = '81df608a40bf0629a1dc08e584849bb1e43e0b7a'
4 | end
5 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap-sass",
3 | "version": "3.3.6",
4 | "description": "bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.",
5 | "main": "assets/javascripts/bootstrap.js",
6 | "repository": {
7 | "type": "git",
8 | "url": "git://github.com/twbs/bootstrap-sass"
9 | },
10 | "keywords": [
11 | "bootstrap",
12 | "sass",
13 | "css"
14 | ],
15 | "contributors": [
16 | "Thomas McDonald",
17 | "Tristan Harward",
18 | "Peter Gumeson",
19 | "Gleb Mazovetskiy"
20 | ],
21 | "license": "MIT",
22 | "bugs": {
23 | "url": "https://github.com/twbs/bootstrap-sass/issues"
24 | },
25 | "devDependencies": {
26 | "node-sass": "~3.4.2",
27 | "mincer": "~1.3",
28 | "ejs": "~2.3"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/sache.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap-sass",
3 | "description": "bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.",
4 | "tags": ["bootstrap", "grid", "typography", "buttons", "ui", "responsive-web-design"]
5 | }
6 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/tasks/bower.rake:
--------------------------------------------------------------------------------
1 | require 'find'
2 | require 'json'
3 | require 'pathname'
4 |
5 | namespace :bower do
6 |
7 | find_files = ->(path) {
8 | Find.find(Pathname.new(path).relative_path_from(Pathname.new Dir.pwd).to_s).map do |path|
9 | path if File.file?(path)
10 | end.compact
11 | }
12 |
13 | desc 'update main and version in bower.json'
14 | task :generate do
15 | require 'bootstrap-sass'
16 | Dir.chdir Bootstrap.gem_path do
17 | spec = JSON.parse(File.read 'bower.json')
18 |
19 | spec['main'] =
20 | find_files.(File.join(Bootstrap.stylesheets_path, '_bootstrap.scss')) +
21 | find_files.(Bootstrap.fonts_path) +
22 | %w(assets/javascripts/bootstrap.js)
23 |
24 | spec['version'] = Bootstrap::VERSION
25 |
26 | File.open('bower.json', 'w') do |f|
27 | f.puts JSON.pretty_generate(spec)
28 | end
29 | end
30 | end
31 | end
32 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/tasks/converter/char_string_scanner.rb:
--------------------------------------------------------------------------------
1 | # regular string scanner works with bytes
2 | # this one works with chars and provides #scan_next
3 | class Converter
4 | class CharStringScanner
5 | extend Forwardable
6 |
7 | def initialize(*args)
8 | @s = StringScanner.new(*args)
9 | end
10 |
11 | def_delegators :@s, :scan_until, :skip_until, :string
12 |
13 | # advance scanner to pos after the next match of pattern and return the match
14 | def scan_next(pattern)
15 | return unless @s.scan_until(pattern)
16 | @s.matched
17 | end
18 |
19 | def pos
20 | byte_to_str_pos @s.pos
21 | end
22 |
23 | def pos=(i)
24 | @s.pos = str_to_byte_pos i
25 | i
26 | end
27 |
28 | private
29 |
30 | def byte_to_str_pos(pos)
31 | @s.string.byteslice(0, pos).length
32 | end
33 |
34 | def str_to_byte_pos(pos)
35 | @s.string.slice(0, pos).bytesize
36 | end
37 | end
38 | end
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/tasks/converter/fonts_conversion.rb:
--------------------------------------------------------------------------------
1 | class Converter
2 | module FontsConversion
3 | def process_font_assets
4 | log_status 'Processing fonts...'
5 | files = read_files('fonts', bootstrap_font_files)
6 | save_to = @save_to[:fonts]
7 | files.each do |name, content|
8 | save_file "#{save_to}/#{name}", content
9 | end
10 | end
11 |
12 | def bootstrap_font_files
13 | @bootstrap_font_files ||= get_paths_by_type('fonts', /\.(eot|svg|ttf|woff2?)$/)
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/tasks/converter/js_conversion.rb:
--------------------------------------------------------------------------------
1 | class Converter
2 | module JsConversion
3 | def process_javascript_assets
4 | log_status 'Processing javascripts...'
5 | save_to = @save_to[:js]
6 | contents = {}
7 | read_files('js', bootstrap_js_files).each do |name, file|
8 | contents[name] = file
9 | save_file("#{save_to}/#{name}", file)
10 | end
11 | log_processed "#{bootstrap_js_files * ' '}"
12 |
13 | log_status 'Updating javascript manifest'
14 | manifest = ''
15 | bootstrap_js_files.each do |name|
16 | name = name.gsub(/\.js$/, '')
17 | manifest << "//= require ./bootstrap/#{name}\n"
18 | end
19 | dist_js = read_files('dist/js', %w(bootstrap.js bootstrap.min.js))
20 | {
21 | 'assets/javascripts/bootstrap-sprockets.js' => manifest,
22 | 'assets/javascripts/bootstrap.js' => dist_js['bootstrap.js'],
23 | 'assets/javascripts/bootstrap.min.js' => dist_js['bootstrap.min.js'],
24 | }.each do |path, content|
25 | save_file path, content
26 | log_processed path
27 | end
28 | end
29 |
30 | def bootstrap_js_files
31 | @bootstrap_js_files ||= begin
32 | files = get_paths_by_type('js', /\.js$/).reject { |path| path =~ %r(^tests/) }
33 | files.sort_by { |f|
34 | case f
35 | # tooltip depends on popover and must be loaded earlier
36 | when /tooltip/ then
37 | 1
38 | when /popover/ then
39 | 2
40 | else
41 | 0
42 | end
43 | }
44 | end
45 | end
46 | end
47 | end
48 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/tasks/converter/logger.rb:
--------------------------------------------------------------------------------
1 | class Converter
2 | class Logger
3 | include Term::ANSIColor
4 |
5 | def log_status(status)
6 | puts bold status
7 | end
8 |
9 | def log_file_info(s)
10 | puts " #{magenta s}"
11 | end
12 |
13 | def log_transform(*args, from: caller[1][/`.*'/][1..-2].sub(/^block in /, ''))
14 | puts " #{cyan from}#{cyan ": #{args * ', '}" unless args.empty?}"
15 | end
16 |
17 | def log_processing(name)
18 | puts yellow " #{File.basename(name)}"
19 | end
20 |
21 | def log_processed(name)
22 | puts green " #{name}"
23 | end
24 |
25 | def log_http_get_file(url, cached = false)
26 | s = " #{'CACHED ' if cached}GET #{url}..."
27 | if cached
28 | puts dark green s
29 | else
30 | puts dark cyan s
31 | end
32 | end
33 |
34 | def log_http_get_files(files, from, cached = false)
35 | return if files.empty?
36 | s = " #{'CACHED ' if cached}GET #{files.length} files from #{from} #{files * ' '}..."
37 | if cached
38 | puts dark green s
39 | else
40 | puts dark cyan s
41 | end
42 | end
43 |
44 | def puts(*args)
45 | STDERR.puts *args unless @silence
46 | end
47 |
48 | alias log puts
49 |
50 | def silence_log
51 | @silence = true
52 | yield
53 | ensure
54 | @silence = false
55 | end
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/templates/project/manifest.rb:
--------------------------------------------------------------------------------
1 | description 'Bootstrap for Sass'
2 |
3 | # Stylesheet importing bootstrap
4 | stylesheet 'styles.sass'
5 |
6 | # Bootstrap variable overrides file
7 | stylesheet '_bootstrap-variables.sass', :to => '_bootstrap-variables.sass'
8 |
9 | # Copy JS and fonts
10 | manifest = Pathname.new(File.dirname(__FILE__))
11 | assets = File.expand_path('../../assets', manifest)
12 | {:javascript => 'javascripts',
13 | :font => 'fonts'
14 | }.each do |method, dir|
15 | root = Pathname.new(assets).join(dir)
16 | Dir.glob root.join('**', '*.*') do |path|
17 | path = Pathname.new(path)
18 | send method, path.relative_path_from(manifest).to_s, :to => path.relative_path_from(root).to_s
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/bootstrap/templates/project/styles.sass:
--------------------------------------------------------------------------------
1 | // Import Bootstrap Compass integration
2 | @import "bootstrap-compass"
3 | // Import custom Bootstrap variables
4 | @import "bootstrap-variables"
5 | // Import Bootstrap for Sass
6 | @import "bootstrap"
7 |
--------------------------------------------------------------------------------