├── .env.development ├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ └── build.yaml ├── .gitignore ├── .localer.yml ├── .pryrc ├── .railsrc ├── .rspec ├── .rubocop.yml ├── .rubocop_todo.yml ├── .ruby-version ├── CONTRIBUTING.md ├── Dockerfile ├── Gemfile ├── Gemfile.lock ├── Procfile ├── Rakefile ├── app.json ├── app ├── assets │ ├── images │ │ ├── black-Linen.png │ │ ├── close.png │ │ ├── favicon.ico │ │ ├── flags │ │ │ ├── de.png │ │ │ └── en.png │ │ ├── labels │ │ │ ├── andalucia.ico │ │ │ ├── andalucia.png │ │ │ ├── andalucia │ │ │ │ └── .gitkeep │ │ │ ├── barcelona.ico │ │ │ ├── barcelona.png │ │ │ ├── barcelona │ │ │ │ └── sponsors │ │ │ │ │ ├── .gitkeep │ │ │ │ │ ├── sequra.png │ │ │ │ │ └── xing.png │ │ │ ├── berlin.ico │ │ │ ├── berlin.png │ │ │ ├── dresden.ico │ │ │ ├── dresden.png │ │ │ ├── dresdenrb-icon.png │ │ │ ├── dresdenrb.png │ │ │ ├── dresdenrb │ │ │ │ ├── .gitkeep │ │ │ │ └── sponsors │ │ │ │ │ ├── fastly.png │ │ │ │ │ └── rubycentral.png │ │ │ ├── hamburg.ico │ │ │ ├── hamburg.png │ │ │ ├── hamburg │ │ │ │ └── sponsors │ │ │ │ │ ├── appsignal.png │ │ │ │ │ ├── engineyard.png │ │ │ │ │ ├── github.png │ │ │ │ │ ├── heroku.svg │ │ │ │ │ └── jetbrains.png │ │ │ ├── karlsruhe.ico │ │ │ ├── karlsruhe.png │ │ │ ├── leipzig.ico │ │ │ ├── leipzig.png │ │ │ ├── madridrb.ico │ │ │ ├── madridrb.png │ │ │ ├── madridrb │ │ │ │ ├── .gitkeep │ │ │ │ └── sponsors │ │ │ │ │ ├── aspgems.png │ │ │ │ │ ├── bebanjo.png │ │ │ │ │ ├── digital55.png │ │ │ │ │ ├── fastly.png │ │ │ │ │ ├── getro.png │ │ │ │ │ ├── jobandtalent.png │ │ │ │ │ ├── jobfluent.png │ │ │ │ │ ├── marketer.png │ │ │ │ │ ├── platform161.png │ │ │ │ │ ├── rubycentral.png │ │ │ │ │ ├── sngular.png │ │ │ │ │ └── tck.png │ │ │ ├── munich.ico │ │ │ ├── munich.png │ │ │ ├── munich │ │ │ │ └── .gitkeep │ │ │ ├── railsgirlshh.ico │ │ │ ├── railsgirlshh.png │ │ │ ├── railsgirlshh │ │ │ │ └── .gitkeep │ │ │ ├── saar.ico │ │ │ ├── saar.png │ │ │ ├── tallinn_rug.ico │ │ │ ├── tallinn_rug.png │ │ │ └── tallinn_rug │ │ │ │ └── sponsors │ │ │ │ └── rubycentral.png │ │ ├── logo.gif │ │ ├── logo.png │ │ ├── logo_icon.png │ │ ├── logo_small.png │ │ ├── rounded-avatars.png │ │ └── whitey.png │ ├── javascripts │ │ ├── administrate │ │ │ ├── application.js │ │ │ └── components │ │ │ │ ├── has_many_form.js │ │ │ │ └── table.js │ │ ├── application.js │ │ ├── custom.js │ │ ├── dropdown.js │ │ ├── labels │ │ │ ├── barcelona.js │ │ │ ├── barcelona │ │ │ │ └── .gitkeep │ │ │ ├── dresdenrb.js │ │ │ └── dresdenrb │ │ │ │ └── .gitkeep │ │ ├── map.js │ │ ├── navi.js │ │ ├── utility.js │ │ └── vendor │ │ │ └── jquery.collapser.js │ └── stylesheets │ │ ├── application.sass │ │ └── labels │ │ ├── andalucia.sass │ │ ├── andalucia │ │ └── .gitkeep │ │ ├── barcelona.sass │ │ ├── barcelona │ │ └── .gitkeep │ │ ├── dresden.sass │ │ ├── dresdenrb.sass │ │ ├── dresdenrb │ │ └── .gitkeep │ │ ├── hamburg.sass │ │ ├── leipzig.sass │ │ ├── madridrb.sass │ │ ├── munich.sass │ │ ├── munich │ │ └── .gitkeep │ │ ├── railsgirlshh.sass │ │ └── saar.sass ├── controllers │ ├── admin │ │ ├── application_controller.rb │ │ ├── events_controller.rb │ │ ├── highlights_controller.rb │ │ ├── jobs_controller.rb │ │ ├── locations_controller.rb │ │ ├── materials_controller.rb │ │ ├── topics_controller.rb │ │ └── users_controller.rb │ ├── api_controller.rb │ ├── application_controller.rb │ ├── concerns │ │ ├── locale_detection.rb │ │ ├── time_zone_detection.rb │ │ ├── user_handling.rb │ │ └── with_email_auth.rb │ ├── events_controller.rb │ ├── home_controller.rb │ ├── images_controller.rb │ ├── labels_controller.rb │ ├── likes_controller.rb │ ├── locations_controller.rb │ ├── participants_controller.rb │ ├── sessions_controller.rb │ ├── sitemaps_controller.rb │ ├── super_admin │ │ ├── application_controller.rb │ │ ├── authorizations_controller.rb │ │ ├── events_controller.rb │ │ ├── highlights_controller.rb │ │ ├── jobs_controller.rb │ │ ├── likes_controller.rb │ │ ├── locations_controller.rb │ │ ├── materials_controller.rb │ │ ├── participants_controller.rb │ │ ├── topics_controller.rb │ │ └── users_controller.rb │ ├── topics_controller.rb │ └── users_controller.rb ├── dashboards │ ├── authorization_dashboard.rb │ ├── event_dashboard.rb │ ├── highlight_dashboard.rb │ ├── job_dashboard.rb │ ├── like_dashboard.rb │ ├── location_dashboard.rb │ ├── material_dashboard.rb │ ├── participant_dashboard.rb │ ├── topic_dashboard.rb │ └── user_dashboard.rb ├── helpers │ ├── application_helper.rb │ ├── events_helper.rb │ ├── external_link_helper.rb │ ├── home_helper.rb │ ├── ical_helper.rb │ ├── link_helper.rb │ ├── map_helper.rb │ ├── preview_helper.rb │ ├── sitemaps_helper.rb │ ├── title_helper.rb │ └── topics_helper.rb ├── lib │ ├── email_auth_token.rb │ ├── preview_generator.rb │ ├── whitelabel_detection_middleware.rb │ └── whitelabel_translation.rb ├── mailers │ ├── application_mailer.rb │ ├── user_mailer.rb │ └── usergroup_mailer.rb ├── models │ ├── application_record.rb │ ├── authorization.rb │ ├── concerns │ │ ├── api_handling.rb │ │ └── slug.rb │ ├── event.rb │ ├── highlight.rb │ ├── job.rb │ ├── like.rb │ ├── location.rb │ ├── material.rb │ ├── participant.rb │ ├── topic.rb │ ├── user.rb │ └── usergroup.rb ├── routing │ └── main_domain_constraint.rb └── views │ ├── admin │ └── events │ │ ├── _collection.html.erb │ │ ├── index.html.erb │ │ └── show.html.erb │ ├── application │ ├── _app_info.slim │ ├── _footer.slim │ ├── _headline.slim │ ├── _hint.slim │ ├── _i18njs.slim │ ├── _meta.slim │ ├── _nav.slim │ ├── _route.slim │ └── _show_flash.slim │ ├── events │ ├── _badges.slim │ ├── _info.slim │ ├── _location.slim │ ├── _materials.slim │ ├── _participants.slim │ ├── _topics.slim │ ├── index.slim │ ├── index.xml.builder │ └── show.slim │ ├── home │ ├── _events.slim │ ├── _featured.slim │ ├── _locations.slim │ ├── _people.slim │ ├── _topics.slim │ └── index.slim │ ├── kaminari │ ├── _first_page.html.slim │ ├── _gap.html.slim │ ├── _last_page.html.slim │ ├── _next_page.html.slim │ ├── _page.html.slim │ ├── _paginator.html.slim │ └── _prev_page.html.slim │ ├── labels │ └── index.slim │ ├── layouts │ ├── application.slim │ └── labels.slim │ ├── locations │ ├── index.slim │ ├── none.de.slim │ ├── none.en.slim │ ├── none.es.slim │ ├── none.pl.slim │ └── show.slim │ ├── sessions │ ├── email.slim │ └── index.slim │ ├── sitemaps │ └── show.xml.builder │ ├── topics │ ├── _done.slim │ ├── _form.slim │ ├── _likes.slim │ ├── _materials.slim │ ├── _undone.slim │ ├── _upcoming.slim │ ├── edit.slim │ ├── index.slim │ ├── new.slim │ └── show.slim │ ├── user_mailer │ └── login_link.text.erb │ ├── usergroup_mailer │ ├── invitation_mail.html.erb │ └── invitation_mail.text.erb │ └── users │ ├── _list.slim │ ├── _user.slim │ ├── edit.slim │ ├── index.slim │ └── show.slim ├── bin ├── bundle ├── rails ├── rake ├── setup ├── update └── yarn ├── config.ru ├── config ├── application.rb ├── boot.rb ├── compass.rb ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── content_security_policy.rb │ ├── cookies_serializer.rb │ ├── filter_parameter_logging.rb │ ├── gc.rb │ ├── geocoder.rb │ ├── inflections.rb │ ├── kaminari_config.rb │ ├── link_thumbnailer.rb │ ├── mime_types.rb │ ├── new_framework_defaults.rb │ ├── new_framework_defaults_5_2.rb │ ├── new_framework_defaults_6_0.rb │ ├── new_framework_defaults_6_1.rb │ ├── omniauth.rb │ ├── permissions_policy.rb │ ├── secret_token.rb │ ├── session_store.rb │ ├── simple_form.rb │ ├── simple_form_bootstrap.rb │ ├── slim.rb │ ├── whitelabel.rb │ └── wrap_parameters.rb ├── locales │ ├── de.base.yml │ ├── de.formtastic.yml │ ├── de.label.yml │ ├── de.yml │ ├── en.base.yml │ ├── en.formtastic.yml │ ├── en.label.yml │ ├── en.yml │ ├── es.base.yml │ ├── es.formtastic.yml │ ├── es.label.yml │ ├── es.yml │ ├── pl.base.yml │ ├── pl.formtastic.yml │ ├── pl.label.yml │ ├── pl.yml │ └── simple_form.en.yml ├── puma.rb ├── routes.rb └── whitelabel.yml ├── db ├── migrate │ ├── 20180913110659_add_linkedin_to_users.rb │ ├── 20190515101441_add_github_issue_to_event_and_topic.rb │ ├── 20200529213652_add_attendee_informations.rb │ └── 20210113033955_add_virtual_locations.rb ├── old_migrations │ ├── 20101203111335_create_slugs.rb │ ├── 20101203111406_create_users.rb │ ├── 20101206104512_create_locations.rb │ ├── 20101206104730_create_events.rb │ ├── 20101206142850_create_participants.rb │ ├── 20101207100154_create_topics.rb │ ├── 20101207100938_create_materials.rb │ ├── 20101207183555_create_authorizations.rb │ ├── 20101211133306_rename_type_to_material_type.rb │ ├── 20101217142810_create_histories_table.rb │ ├── 20110107171220_add_published_to_events.rb │ ├── 20110109130958_create_wishes.rb │ ├── 20110109131046_create_votes.rb │ ├── 20110116154325_add_github_to_users.rb │ ├── 20110120094315_add_admin_to_users.rb │ ├── 20110311115143_rename_histories_to_rails_admin_histories.rb │ ├── 20110630120848_create_admin_notes.rb │ ├── 20110630120849_move_admin_notes_to_comments.rb │ ├── 20110717092958_add_data_to_user.rb │ ├── 20110720194144_add_company_to_location.rb │ ├── 20110721143350_remove_activity_from_wishes.rb │ ├── 20110722114954_add_done_to_wishes.rb │ ├── 20111006142134_delete_material_type_from_material.rb │ ├── 20120128121241_add_slugs.rb │ ├── 20120211123337_create_jobs.rb │ ├── 20120213173913_add_hide_jobs_to_user.rb │ ├── 20120224151318_create_highlights.rb │ ├── 20120604194617_add_labels.rb │ ├── 20120918141950_add_slug_to_location.rb │ ├── 20121113191723_add_vote_cache_to_wish.rb │ ├── 20121228174714_add_indices.rb │ ├── 20130111130456_add_twitter_to_user.rb │ ├── 20130217113418_add_likes.rb │ ├── 20130228201117_remove_wishes_and_likes.rb │ ├── 20130604012921_drop_table_rails_admin.rb │ ├── 20130804141702_add_emailto_users.rb │ ├── 20130804145438_add_proposal_type_to_topics.rb │ ├── 20131229124625_add_limit_to_events.rb │ ├── 20140504162938_add_super_admin_flag.rb │ ├── 20141129191015_add_wheelmap_ids_to_locations.rb │ ├── 20150203222133_add_preview_fields_to_material.rb │ ├── 20160217231126_attach_material_to_topic.rb │ └── 20170918091427_remove_slugs.rb ├── schema.rb └── seeds.rb ├── docker-compose.yml ├── lib ├── omni_auth │ └── strategies │ │ └── email.rb ├── tasks │ ├── api.rake │ ├── data.rake │ ├── fork.rake │ └── scheduler.rake └── templates │ └── slim │ └── scaffold │ └── _form.html.slim ├── log └── .gitkeep ├── media ├── rughh.png └── rughh.svg ├── node_modules ├── .yarn-integrity ├── jquery-ujs │ ├── .jshintrc │ ├── .npmignore │ ├── .travis.yml │ ├── CONTRIBUTING.md │ ├── MIT-LICENSE │ ├── README.md │ ├── RELEASE.md │ ├── bower.json │ ├── package.json │ └── src │ │ └── rails.js └── jquery │ ├── AUTHORS.txt │ ├── LICENSE.txt │ ├── README.md │ ├── bower.json │ ├── dist │ ├── core.js │ ├── jquery.js │ ├── jquery.min.js │ ├── jquery.min.map │ ├── jquery.slim.js │ ├── jquery.slim.min.js │ └── jquery.slim.min.map │ ├── external │ └── sizzle │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── sizzle.js │ │ ├── sizzle.min.js │ │ └── sizzle.min.map │ ├── package.json │ └── src │ ├── .eslintrc.json │ ├── ajax.js │ ├── ajax │ ├── jsonp.js │ ├── load.js │ ├── parseXML.js │ ├── script.js │ ├── var │ │ ├── location.js │ │ ├── nonce.js │ │ └── rquery.js │ └── xhr.js │ ├── attributes.js │ ├── attributes │ ├── attr.js │ ├── classes.js │ ├── prop.js │ ├── support.js │ └── val.js │ ├── callbacks.js │ ├── core.js │ ├── core │ ├── DOMEval.js │ ├── access.js │ ├── camelCase.js │ ├── init.js │ ├── isAttached.js │ ├── nodeName.js │ ├── parseHTML.js │ ├── ready-no-deferred.js │ ├── ready.js │ ├── readyException.js │ ├── stripAndCollapse.js │ ├── support.js │ ├── toType.js │ └── var │ │ └── rsingleTag.js │ ├── css.js │ ├── css │ ├── addGetHookIf.js │ ├── adjustCSS.js │ ├── curCSS.js │ ├── finalPropName.js │ ├── hiddenVisibleSelectors.js │ ├── showHide.js │ ├── support.js │ └── var │ │ ├── cssExpand.js │ │ ├── getStyles.js │ │ ├── isHiddenWithinTree.js │ │ ├── rboxStyle.js │ │ ├── rnumnonpx.js │ │ └── swap.js │ ├── data.js │ ├── data │ ├── Data.js │ └── var │ │ ├── acceptData.js │ │ ├── dataPriv.js │ │ └── dataUser.js │ ├── deferred.js │ ├── deferred │ └── exceptionHook.js │ ├── deprecated.js │ ├── dimensions.js │ ├── effects.js │ ├── effects │ ├── Tween.js │ └── animatedSelector.js │ ├── event.js │ ├── event │ ├── ajax.js │ ├── alias.js │ ├── focusin.js │ ├── support.js │ └── trigger.js │ ├── exports │ ├── amd.js │ └── global.js │ ├── jquery.js │ ├── manipulation.js │ ├── manipulation │ ├── _evalUrl.js │ ├── buildFragment.js │ ├── getAll.js │ ├── setGlobalEval.js │ ├── support.js │ ├── var │ │ ├── rscriptType.js │ │ └── rtagName.js │ └── wrapMap.js │ ├── offset.js │ ├── queue.js │ ├── queue │ └── delay.js │ ├── selector-native.js │ ├── selector-sizzle.js │ ├── selector.js │ ├── serialize.js │ ├── traversing.js │ ├── traversing │ ├── findFilter.js │ └── var │ │ ├── dir.js │ │ ├── rneedsContext.js │ │ └── siblings.js │ ├── var │ ├── ObjectFunctionString.js │ ├── arr.js │ ├── class2type.js │ ├── concat.js │ ├── document.js │ ├── documentElement.js │ ├── fnToString.js │ ├── getProto.js │ ├── hasOwn.js │ ├── indexOf.js │ ├── isFunction.js │ ├── isWindow.js │ ├── pnum.js │ ├── push.js │ ├── rcheckableType.js │ ├── rcssNum.js │ ├── rnothtmlwhite.js │ ├── slice.js │ ├── support.js │ └── toString.js │ └── wrap.js ├── package.json ├── public ├── .htaccess ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico ├── google8ebf7c850429421c.html ├── humans.txt ├── images │ └── labels │ │ └── cologne │ │ ├── gem-glas-full.png │ │ ├── gem-glas.png │ │ └── golden_ruby.png └── robots.txt ├── readme.md ├── script ├── ci │ ├── run │ └── setup ├── generate-humans ├── in_docker ├── request-time └── server ├── spec ├── controllers │ ├── admin │ │ ├── events_controller_spec.rb │ │ └── users_controller_spec.rb │ ├── concerns │ │ └── locale_detection_spec.rb │ ├── events_controller_spec.rb │ ├── home_controller_spec.rb │ ├── labels_controller_spec.rb │ ├── likes_controller_spec.rb │ ├── locations_controller_spec.rb │ ├── participants_controller_spec.rb │ ├── sessions_controller_spec.rb │ ├── sitemaps_controller_spec.rb │ ├── super_admin │ │ ├── events_controller_spec.rb │ │ └── users_controller_spec.rb │ ├── topics_controller_spec.rb │ ├── user_handling_spec.rb │ └── users_controller_spec.rb ├── helpers │ ├── application_helper_spec.rb │ ├── events_helper_spec.rb │ ├── external_link_helper_spec.rb │ ├── ical_helper_spec.rb │ ├── map_helper_spec.rb │ ├── preview_helper_spec.rb │ ├── sitemaps_helper_spec.rb │ ├── title_helper_spec.rb │ └── topics_helper_spec.rb ├── lib │ ├── preview_generator_spec.rb │ ├── sponsor_images_present_spec.rb │ ├── whitelabel_detection_middleware_spec.rb │ └── whitelabel_translation_spec.rb ├── mailers │ ├── user_mailer_spec.rb │ └── usergroup_mailer_spec.rb ├── models │ ├── authorization_spec.rb │ ├── event_spec.rb │ ├── highlight_spec.rb │ ├── job_spec.rb │ ├── like_spec.rb │ ├── location_spec.rb │ ├── material_spec.rb │ ├── participant_spec.rb │ ├── topic_spec.rb │ ├── user_spec.rb │ └── usergroup_spec.rb ├── requests │ ├── api_spec.rb │ ├── events_spec.rb │ ├── labels_spec.rb │ ├── locale_spec.rb │ ├── sitemaps_controller_spec.rb │ ├── time_zone_spec.rb │ └── whitelabel_spec.rb ├── routing │ └── main_domain_constraint_spec.rb ├── spec_helper.rb ├── support │ ├── data │ │ └── mailinglist_rss_feed.xml │ ├── factories │ │ ├── authorizations.rb │ │ ├── events.rb │ │ ├── highlights.rb │ │ ├── jobs.rb │ │ ├── likes.rb │ │ ├── locations.rb │ │ ├── materials.rb │ │ ├── participants.rb │ │ ├── topics.rb │ │ └── users.rb │ ├── geocoder_helper.rb │ ├── kaminari_helper.rb │ ├── online_helper.rb │ └── request_helper.rb └── views │ ├── events │ ├── _info.html_spec.rb │ ├── index.html_spec.rb │ ├── index.xml_spec.rb │ └── show.html_spec.rb │ ├── home │ └── index.html_spec.rb │ ├── labels │ └── index.html_spec.rb │ ├── locations │ ├── index.html_spec.rb │ ├── none.html_spec.rb │ └── show.html_spec.rb │ ├── sitemaps │ └── show.xml_spec.rb │ ├── topics │ ├── edit.html_spec.rb │ ├── index.html_spec.rb │ ├── new.html_spec.rb │ └── show.html_spec.rb │ └── users │ ├── edit.html_spec.rb │ └── show.html_spec.rb └── yarn.lock /.env.development: -------------------------------------------------------------------------------- 1 | HOR_API_KEY=HOR_API_KEY_TEST 2 | SECRET_TOKEN=SECRET_TOKEN_TEST_b7c7374eb0285b87c0c1c61c2c5401b9f92dd59209713801743202c 3 | RACK_ENV=development 4 | TWITTER_CONSUMER_KEY=oJ2y2wLAcoQdIMyWGJxusA 5 | TWITTER_CONSUMER_SECRET=kscsfZrdkqqv8KZQ0HFiDOiTDFGJbqerb5i9oIVa6s 6 | OMNIAUTH_GITHUB_RUGB_TEST_KEY=f859969acc060c3f1e41 7 | OMNIAUTH_GITHUB_RUGB_TEST_SECRET=93d2f12e662e79f23d8aa9cf8bd271bfd1462db7 8 | OMNIAUTH_GITHUB_ONRUBY_TEST_KEY=40476a2d1961166b313d 9 | OMNIAUTH_GITHUB_ONRUBY_TEST_SECRET=631246927040210ff8d21f7d734c291f7b8b8dcf 10 | ONE_SIGNAL_APP_ID=ONE_SIGNAL_TEST_APP_ID 11 | ONE_SIGNAL_KEY=ONE_SIGNAL_TEST_KEY 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.rb diff=ruby 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [phoet] 4 | patreon: on_ruby 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | log/*.log 3 | tmp/* 4 | db/*.sqlite3* 5 | coverage 6 | public/assets 7 | public/system 8 | public/javascripts/*_packaged.js 9 | public/stylesheets/admin 10 | doc/specs.html 11 | doc/features.html 12 | tags 13 | *.sw? 14 | *~ 15 | rerun.txt 16 | .bundle 17 | specifications 18 | spec/reports/ 19 | .vagrant 20 | Vagrantfile 21 | .ruby-version 22 | .ruby-gemset 23 | passenger.* 24 | .byebug_history 25 | -------------------------------------------------------------------------------- /.localer.yml: -------------------------------------------------------------------------------- 1 | Exclude: 2 | # disable gems 3 | - /faker/ # TODO: fork gem to add missing keys 4 | - /simple_form/ 5 | 6 | # disable default translations 7 | - /helpers.page_entries_info/ 8 | - /multibyte/ 9 | 10 | # disable special cases 11 | - /i18n.transliterate.rule/ # transliteration language rules 12 | - /time.formats.us/ # american time format only present in en-US locale 13 | 14 | # TODO: update the locale files de, en, es 15 | - /errors/ 16 | - /datetime/ 17 | - /date/ 18 | - /number/ 19 | -------------------------------------------------------------------------------- /.pryrc: -------------------------------------------------------------------------------- 1 | puts 'running with whitelabel hamburg' 2 | Whitelabel.label = Whitelabel.label_for('hamburg') 3 | -------------------------------------------------------------------------------- /.railsrc: -------------------------------------------------------------------------------- 1 | puts "running with whitelabel hamburg" 2 | Whitelabel.label = Whitelabel.label_for('hamburg') 3 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | --order random 4 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_from: .rubocop_todo.yml 2 | 3 | require: 4 | - rubocop-rspec 5 | - rubocop-rails 6 | 7 | AllCops: 8 | Exclude: 9 | - "*.ru" 10 | - "bin/*" 11 | - "db/**/*.rb" 12 | - "config/**/*.rb" 13 | - "app/controllers/admin/*" 14 | - "app/controllers/super_admin/*" 15 | - "app/dashboards/*" 16 | - "lib/tasks/*" 17 | - "vendor/**/*" 18 | 19 | Bundler/OrderedGems: 20 | Enabled: false 21 | 22 | Style/Documentation: 23 | Enabled: false 24 | 25 | Style/MethodCallWithoutArgsParentheses: 26 | Enabled: false 27 | 28 | Style/TrailingCommaInHashLiteral: 29 | EnforcedStyleForMultiline: consistent_comma 30 | 31 | Lint/NonDeterministicRequireOrder: 32 | Enabled: false 33 | 34 | Style/FrozenStringLiteralComment: 35 | Exclude: 36 | - "bin/**/*" 37 | - "config/**/*" 38 | - "db/**/*" 39 | - "lib/**/*" 40 | - "script/**/*" 41 | - "spec/**/*" 42 | - "config.ru" 43 | - "Gemfile" 44 | - "Rakefile" 45 | - ".*" 46 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.2.8 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute? 2 | 3 | 1. Fork the project to your own GitHub account 4 | 2. Clone your fork 5 | 3. Make sure that you have Ruby installed (you can check the supported Ruby 6 | versions in `.ruby-version`) 7 | 4. Run `bundle install`. If you see failures related to compiling native 8 | extensions you need to follow a 9 | [tutorial for setting up Ruby on Rails](https://gorails.com/setup) 10 | 5. Make sure that you have PostgreSQL installed and `postgres` role that does 11 | not require password to connect. 12 | 6. Run `rake db:setup` 13 | 7. Run the test suite with `rake` and check if all the tests pass 14 | 8. Switch to a feature branch - `git checkout -b my-new-feature` 15 | 9. Write the code and make sure that the tests are still passing 16 | 10. Push your branch and submit a pull request 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:3.2.8 2 | 3 | RUN apt-get update -qq && apt-get install -y build-essential 4 | 5 | RUN gem update --system 6 | 7 | # for postgres 8 | RUN apt-get install -y libpq-dev 9 | 10 | # for nokogiri 11 | RUN apt-get install -y libxml2-dev libxslt1-dev 12 | 13 | # for a JS runtime 14 | RUN apt-get install -y nodejs 15 | 16 | ENV BUNDLE_PATH /box 17 | 18 | ENV APP_HOME /app 19 | RUN mkdir $APP_HOME 20 | WORKDIR $APP_HOME 21 | 22 | ADD . $APP_HOME 23 | 24 | CMD script/server 25 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | release: bundle exec rake db:migrate 2 | web: bundle exec puma -C config/puma.rb 3 | -------------------------------------------------------------------------------- /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', __dir__) 5 | require 'rake' 6 | 7 | OnRuby::Application.load_tasks 8 | -------------------------------------------------------------------------------- /app/assets/images/black-Linen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/black-Linen.png -------------------------------------------------------------------------------- /app/assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/close.png -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /app/assets/images/flags/de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/flags/de.png -------------------------------------------------------------------------------- /app/assets/images/flags/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/flags/en.png -------------------------------------------------------------------------------- /app/assets/images/labels/andalucia.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/andalucia.ico -------------------------------------------------------------------------------- /app/assets/images/labels/andalucia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/andalucia.png -------------------------------------------------------------------------------- /app/assets/images/labels/andalucia/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/andalucia/.gitkeep -------------------------------------------------------------------------------- /app/assets/images/labels/barcelona.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/barcelona.ico -------------------------------------------------------------------------------- /app/assets/images/labels/barcelona.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/barcelona.png -------------------------------------------------------------------------------- /app/assets/images/labels/barcelona/sponsors/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/barcelona/sponsors/.gitkeep -------------------------------------------------------------------------------- /app/assets/images/labels/barcelona/sponsors/sequra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/barcelona/sponsors/sequra.png -------------------------------------------------------------------------------- /app/assets/images/labels/barcelona/sponsors/xing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/barcelona/sponsors/xing.png -------------------------------------------------------------------------------- /app/assets/images/labels/berlin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/berlin.ico -------------------------------------------------------------------------------- /app/assets/images/labels/berlin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/berlin.png -------------------------------------------------------------------------------- /app/assets/images/labels/dresden.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/dresden.ico -------------------------------------------------------------------------------- /app/assets/images/labels/dresden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/dresden.png -------------------------------------------------------------------------------- /app/assets/images/labels/dresdenrb-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/dresdenrb-icon.png -------------------------------------------------------------------------------- /app/assets/images/labels/dresdenrb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/dresdenrb.png -------------------------------------------------------------------------------- /app/assets/images/labels/dresdenrb/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/dresdenrb/.gitkeep -------------------------------------------------------------------------------- /app/assets/images/labels/dresdenrb/sponsors/fastly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/dresdenrb/sponsors/fastly.png -------------------------------------------------------------------------------- /app/assets/images/labels/dresdenrb/sponsors/rubycentral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/dresdenrb/sponsors/rubycentral.png -------------------------------------------------------------------------------- /app/assets/images/labels/hamburg.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/hamburg.ico -------------------------------------------------------------------------------- /app/assets/images/labels/hamburg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/hamburg.png -------------------------------------------------------------------------------- /app/assets/images/labels/hamburg/sponsors/appsignal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/hamburg/sponsors/appsignal.png -------------------------------------------------------------------------------- /app/assets/images/labels/hamburg/sponsors/engineyard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/hamburg/sponsors/engineyard.png -------------------------------------------------------------------------------- /app/assets/images/labels/hamburg/sponsors/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/hamburg/sponsors/github.png -------------------------------------------------------------------------------- /app/assets/images/labels/hamburg/sponsors/jetbrains.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/hamburg/sponsors/jetbrains.png -------------------------------------------------------------------------------- /app/assets/images/labels/karlsruhe.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/karlsruhe.ico -------------------------------------------------------------------------------- /app/assets/images/labels/karlsruhe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/karlsruhe.png -------------------------------------------------------------------------------- /app/assets/images/labels/leipzig.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/leipzig.ico -------------------------------------------------------------------------------- /app/assets/images/labels/leipzig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/leipzig.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb.ico -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/.gitkeep -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/aspgems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/aspgems.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/bebanjo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/bebanjo.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/digital55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/digital55.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/fastly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/fastly.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/getro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/getro.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/jobandtalent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/jobandtalent.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/jobfluent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/jobfluent.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/marketer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/marketer.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/platform161.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/platform161.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/rubycentral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/rubycentral.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/sngular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/sngular.png -------------------------------------------------------------------------------- /app/assets/images/labels/madridrb/sponsors/tck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/madridrb/sponsors/tck.png -------------------------------------------------------------------------------- /app/assets/images/labels/munich.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/munich.ico -------------------------------------------------------------------------------- /app/assets/images/labels/munich.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/munich.png -------------------------------------------------------------------------------- /app/assets/images/labels/munich/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/munich/.gitkeep -------------------------------------------------------------------------------- /app/assets/images/labels/railsgirlshh.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/railsgirlshh.ico -------------------------------------------------------------------------------- /app/assets/images/labels/railsgirlshh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/railsgirlshh.png -------------------------------------------------------------------------------- /app/assets/images/labels/railsgirlshh/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/railsgirlshh/.gitkeep -------------------------------------------------------------------------------- /app/assets/images/labels/saar.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/saar.ico -------------------------------------------------------------------------------- /app/assets/images/labels/saar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/saar.png -------------------------------------------------------------------------------- /app/assets/images/labels/tallinn_rug.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/tallinn_rug.ico -------------------------------------------------------------------------------- /app/assets/images/labels/tallinn_rug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/tallinn_rug.png -------------------------------------------------------------------------------- /app/assets/images/labels/tallinn_rug/sponsors/rubycentral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/labels/tallinn_rug/sponsors/rubycentral.png -------------------------------------------------------------------------------- /app/assets/images/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/logo.gif -------------------------------------------------------------------------------- /app/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/logo.png -------------------------------------------------------------------------------- /app/assets/images/logo_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/logo_icon.png -------------------------------------------------------------------------------- /app/assets/images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/logo_small.png -------------------------------------------------------------------------------- /app/assets/images/rounded-avatars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/rounded-avatars.png -------------------------------------------------------------------------------- /app/assets/images/whitey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/images/whitey.png -------------------------------------------------------------------------------- /app/assets/javascripts/administrate/application.js: -------------------------------------------------------------------------------- 1 | //= require jquery 2 | //= require jquery_ujs 3 | //= require selectize 4 | //= require_tree . 5 | -------------------------------------------------------------------------------- /app/assets/javascripts/administrate/components/has_many_form.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $(".field-unit--has-many select").selectize({}); 3 | $(".field-unit--belongs-to select").selectize({}); 4 | }); 5 | -------------------------------------------------------------------------------- /app/assets/javascripts/administrate/components/table.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | var keycodes = { space: 32, enter: 13 }; 3 | 4 | var visitDataUrl = function(event) { 5 | if (event.type == "click" || 6 | event.keyCode == keycodes.space || 7 | event.keyCode == keycodes.enter) { 8 | 9 | if (event.target.href) { 10 | return; 11 | } 12 | 13 | var dataUrl = $(event.target).closest("tr").data("url"); 14 | var selection = window.getSelection().toString(); 15 | if (selection.length === 0 && dataUrl) { 16 | window.location = dataUrl; 17 | } 18 | } 19 | }; 20 | 21 | $("table").on("click", ".js-table-row", visitDataUrl); 22 | $("table").on("keydown", ".js-table-row", visitDataUrl); 23 | }); 24 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | /* 2 | * decaffeinate suggestions: 3 | * DS102: Remove unnecessary code created because of implicit returns 4 | * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md 5 | */ 6 | //= require jquery 7 | //= require jquery_ujs 8 | //= require bootstrap 9 | //= require vendor/jquery.collapser 10 | //= require navi 11 | //= require utility 12 | //= require custom 13 | //= require map 14 | //= require dropdown 15 | 16 | $(function() { 17 | Utility.disable(); 18 | }); 19 | 20 | $.fn.random = function() { 21 | return this.eq(Math.floor(Math.random() * this.length)); 22 | }; 23 | -------------------------------------------------------------------------------- /app/assets/javascripts/labels/barcelona.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/javascripts/labels/barcelona.js -------------------------------------------------------------------------------- /app/assets/javascripts/labels/barcelona/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/javascripts/labels/barcelona/.gitkeep -------------------------------------------------------------------------------- /app/assets/javascripts/labels/dresdenrb.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/javascripts/labels/dresdenrb.js -------------------------------------------------------------------------------- /app/assets/javascripts/labels/dresdenrb/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/javascripts/labels/dresdenrb/.gitkeep -------------------------------------------------------------------------------- /app/assets/javascripts/utility.js: -------------------------------------------------------------------------------- 1 | /* 2 | * decaffeinate suggestions: 3 | * DS102: Remove unnecessary code created because of implicit returns 4 | * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md 5 | */ 6 | class Utility { 7 | static disable() { 8 | return $('form').on('click', 'input[data-disable]', function(event) { 9 | event.preventDefault(); 10 | return alert($(this).data('disable')); 11 | }); 12 | } 13 | } 14 | 15 | window.Utility = Utility; 16 | -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/andalucia.sass: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/andalucia.sass -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/andalucia/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/andalucia/.gitkeep -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/barcelona.sass: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/barcelona.sass -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/barcelona/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/barcelona/.gitkeep -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/dresden.sass: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/dresden.sass -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/dresdenrb.sass: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/dresdenrb.sass -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/dresdenrb/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/dresdenrb/.gitkeep -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/hamburg.sass: -------------------------------------------------------------------------------- 1 | header 2 | #logo 3 | margin-left: 1em 4 | margin-top: 0 5 | 6 | .sponsor-appsignal 7 | img 8 | width: 200px 9 | -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/leipzig.sass: -------------------------------------------------------------------------------- 1 | footer 2 | section 3 | .block 4 | padding-left: 5.5em 5 | .imprint 6 | margin-left: 0px 7 | -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/madridrb.sass: -------------------------------------------------------------------------------- 1 | footer section 2 | .usergroups ol, 3 | .railsgroups ol, 4 | .railssupporters ol 5 | list-style-type: square 6 | 7 | section .sponsors ol 8 | text-align: center 9 | 10 | li img 11 | height: auto 12 | width: 160px 13 | -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/munich.sass: -------------------------------------------------------------------------------- 1 | header 2 | #logo 3 | margin-left: 30px 4 | img 5 | height: 90px 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/munich/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/munich/.gitkeep -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/railsgirlshh.sass: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/app/assets/stylesheets/labels/railsgirlshh.sass -------------------------------------------------------------------------------- /app/assets/stylesheets/labels/saar.sass: -------------------------------------------------------------------------------- 1 | body 2 | color: #151515 3 | 4 | h1, h2, h3, h4, h5, h6 5 | color: #c10000 6 | 7 | header 8 | #title 9 | h1 10 | a, a:link, a:visited, a:focus, a:hover, a:active 11 | color: #ce0c14 12 | h2 13 | a, a:link, a:visited, a:focus, a:hover, a:active 14 | color: #FFF 15 | -------------------------------------------------------------------------------- /app/controllers/admin/highlights_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class HighlightsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Highlight. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Highlight.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/jobs_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class JobsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Job. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Job.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/locations_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class LocationsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Location. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Location.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/materials_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class MaterialsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Material. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Material.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/topics_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class TopicsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Topic. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Topic.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/users_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class UsersController < Admin::ApplicationController 3 | def find_resource(param) 4 | User.peers.from_slug(param) 5 | end 6 | 7 | def scoped_resource 8 | User.peers 9 | end 10 | 11 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 12 | # for more information 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/controllers/api_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApiController < ApplicationController 4 | before_action :api_sign_in 5 | 6 | expose(:topics) { Topic.all } 7 | expose(:locations) { Location.all } 8 | expose(:events) { Event.ordered } 9 | expose(:users) { User.ordered } 10 | 11 | def index 12 | hash = { 13 | topics: topics.as_api_response(:ios_v1), 14 | locations: locations.as_api_response(:ios_v1), 15 | events: events.as_api_response(:ios_v1), 16 | users: users.as_api_response(:ios_v1), 17 | } 18 | 19 | render json: hash 20 | end 21 | 22 | private 23 | 24 | def api_sign_in 25 | return unless request.format.json? 26 | 27 | key = request.headers['x-api-key'] || params['x-api-key'] 28 | head :unauthorized if key != ENV['HOR_API_KEY'] 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationController < ActionController::Base 4 | include LocaleDetection 5 | include TimeZoneDetection 6 | include UserHandling 7 | 8 | protect_from_forgery with: :exception 9 | 10 | before_action :setup 11 | 12 | helper_method :signed_in?, :current_user 13 | 14 | rescue_from ActiveRecord::RecordNotFound, with: :_404 15 | rescue_from ActionView::MissingTemplate, with: :_404 16 | rescue_from ActionController::UnknownFormat, with: :_404 17 | 18 | expose(:jobs) { Job.shuffled } 19 | expose(:main_user) { User.main } 20 | expose(:highlights) { Highlight.active } 21 | 22 | protected 23 | 24 | def setup 25 | switch_locale 26 | switch_time_zone 27 | end 28 | 29 | def _404(exception) 30 | Rails.logger.warn exception 31 | Rails.logger.warn "head 404 with params #{params}" 32 | 33 | head(:not_found) 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /app/controllers/concerns/time_zone_detection.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module TimeZoneDetection 4 | protected 5 | 6 | def switch_time_zone 7 | time_zone = params[:time_zone] 8 | 9 | Time.zone = allowed_time_zone?(time_zone) ? time_zone : default_time_zone 10 | end 11 | 12 | def allowed_time_zone?(time_zone) 13 | time_zone && ActiveSupport::TimeZone.new(time_zone).present? 14 | end 15 | 16 | def default_time_zone 17 | Whitelabel.label ? Whitelabel[:default_time_zone] : Rails.configuration.time_zone 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/controllers/events_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class EventsController < ApplicationController 4 | include IcalHelper 5 | 6 | expose(:events) { Event.ordered.page(params[:page]) } 7 | expose(:event) { Event.includes(materials: :user, topics: :user, participants: :user).from_param(params[:id]) } 8 | 9 | def index 10 | respond_to do |format| 11 | format.html 12 | format.xml { render layout: false } 13 | format.json { render json: events.as_api_response(:ios_v1) } 14 | format.ics { render plain: icalendar(*events) } 15 | end 16 | end 17 | 18 | def show 19 | respond_to do |format| 20 | format.html 21 | format.json do 22 | render json: event.as_api_response(:ios_v1) 23 | end 24 | format.ics do 25 | render plain: icalendar(event) 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class HomeController < ApplicationController 4 | expose(:current_event) { Event.current.first } 5 | expose(:events) { Event.latest.limit(10) } 6 | expose(:people) { User.peers.limit(3 * 5) } 7 | expose(:undone_topics) { Topic.ordered.undone } 8 | expose(:upcoming_topics) { Topic.ordered.upcoming } 9 | expose(:done_topics) { Topic.ordered.done.limit(10) } 10 | expose(:organizers) { User.organizers } 11 | expose(:locations) { Location.joins(:events).merge(Event.where(date: (2.years.ago.beginning_of_year)..)).distinct } 12 | expose(:zoom) { Whitelabel[:location][:zoom] } 13 | 14 | def index; end 15 | end 16 | -------------------------------------------------------------------------------- /app/controllers/labels_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class LabelsController < ActionController::Base 4 | include LocaleDetection 5 | protect_from_forgery with: :exception 6 | before_action :setup 7 | 8 | def index 9 | render layout: 'labels' 10 | end 11 | 12 | private 13 | 14 | def setup 15 | Whitelabel.reset! 16 | switch_locale 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/controllers/likes_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class LikesController < ApplicationController 4 | before_action :authenticate! 5 | 6 | expose(:topic, find: ->(id, scope) { scope.from_slug(id) }) 7 | expose(:like) 8 | 9 | def create 10 | like.topic = topic 11 | like.user = current_user 12 | if topic.already_liked?(current_user) 13 | flash[:alert] = t('flash.double_liked') 14 | elsif like.save 15 | flash[:notice] = t('flash.liked') 16 | else 17 | flash[:alert] = like.errors.full_messages.join(' ') 18 | end 19 | redirect_to topic_path(topic) 20 | end 21 | 22 | def destroy 23 | if topic.already_liked?(current_user) && like.destroy 24 | flash[:notice] = t('flash.unliked') 25 | else 26 | flash[:alert] = like.errors.full_messages.join(' ') 27 | end 28 | redirect_to topic_path(topic) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /app/controllers/locations_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class LocationsController < ApplicationController 4 | expose(:location, find: ->(id, scope) { scope.from_slug(id) }) 5 | expose(:locations) { Location.ordered } 6 | expose(:organizers) { User.organizers } 7 | expose(:stats) { Event.stats } 8 | 9 | def index; end 10 | 11 | def show; end 12 | 13 | def none; end 14 | end 15 | -------------------------------------------------------------------------------- /app/controllers/participants_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ParticipantsController < ApplicationController 4 | before_action :authenticate! 5 | 6 | expose(:event) { Event.from_param(params[:event_id]) } 7 | 8 | def create 9 | if event.closed? 10 | flash[:alert] = t('flash.already_closed') 11 | elsif event.particpate(current_user) 12 | flash[:notice] = t('flash.now_participating') 13 | else 14 | flash[:alert] = t('flash.already_participating') 15 | end 16 | redirect_to event_path(event) 17 | end 18 | 19 | def destroy 20 | participant = Participant.find params[:id] 21 | if participant.owned_by? current_user 22 | participant.destroy 23 | redirect_to event_path(participant.event), notice: t('flash.dont_participate') 24 | else 25 | redirect_to event_path(participant.event), alert: t('flash.forbidden') 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /app/controllers/sitemaps_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class SitemapsController < ApplicationController 4 | def show 5 | render layout: false 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/controllers/super_admin/authorizations_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class AuthorizationsController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Authorization. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Authorization.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/super_admin/highlights_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class HighlightsController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Highlight. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Highlight.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/super_admin/jobs_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class JobsController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Job. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Job.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/super_admin/likes_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class LikesController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Like. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Like.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/super_admin/locations_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class LocationsController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Location. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Location.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/super_admin/materials_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class MaterialsController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Material. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Material.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/super_admin/participants_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class ParticipantsController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Participant. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Participant.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/super_admin/topics_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class TopicsController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Topic. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Topic.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/super_admin/users_controller.rb: -------------------------------------------------------------------------------- 1 | module SuperAdmin 2 | class UsersController < SuperAdmin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = User. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # User.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/helpers/home_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module HomeHelper 4 | def next_event_date 5 | l(Whitelabel[:next_event_date], format: :long) 6 | end 7 | 8 | def localized_recurring_event_date 9 | Whitelabel[:localized_recurring] 10 | end 11 | 12 | def contact_text 13 | capture do 14 | concat t('home.send_us_an_email', mail_to: mail_to(Whitelabel[:email], 'E-Mail', title: 'E-Mail')).html_safe 15 | concat " #{t('home.or_message_on_twitter', twitter_link: link_to_twitter(Whitelabel[:twitter]))}".html_safe if Whitelabel[:twitter] 16 | concat '.' 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/helpers/ical_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module IcalHelper 4 | def icalendar(*events) 5 | cal = Icalendar::Calendar.new 6 | events.map do |event| 7 | cal.event do |item| 8 | item.summary = event.name 9 | item.description = "#{event.description} #{event_url(event)}" 10 | item.dtstart = Icalendar::Values::DateTime.new event.date.utc, tzid: 'UTC' 11 | item.dtend = Icalendar::Values::DateTime.new event.end_date.utc, tzid: 'UTC' 12 | item.url = event_url(event) 13 | item.location = [event.location.name, event.location.address].compact.join(',') if event.location 14 | end 15 | end 16 | cal.to_ical 17 | end 18 | 19 | def calendar_link 20 | link_to t('event.subscribe'), calendar_user_url(id: current_user, format: :ics, only_path: false, protocol: 'webcal') 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /app/helpers/map_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module MapHelper 4 | def static_map(*locations) 5 | options = { 6 | zoom: 12, 7 | sensor: false, 8 | key: 'AIzaSyBskJCTxAU9UbH3qijy46oNtZ1-4ad14PM', 9 | } 10 | params = options.collect { |k, v| "#{k}=#{v}" } 11 | params += locations.map { |l| "markers=#{l.lat},#{l.long}" } 12 | url = 'http://maps.googleapis.com/maps/api/staticmap' 13 | Addressable::URI.encode("#{url}?#{params.join('&')}") 14 | end 15 | 16 | def single_map(location, init = { zoom: 14 }) 17 | data = { 18 | map: Array(location).to_json, 19 | init: location.attributes.merge(init).to_json, 20 | } 21 | tag.div('', class: 'map_canvas', data:) 22 | end 23 | 24 | def map(locations, init = { zoom: 12 }) 25 | init = Whitelabel[:location].merge(init) 26 | data = { 27 | map: locations.to_json, 28 | init: init.to_json, 29 | } 30 | tag.div('', class: 'map_canvas', data:) 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /app/helpers/preview_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PreviewHelper 4 | def material_preview(material) 5 | return '' if material.preview_type.nil? || (material.preview_type == 'none') 6 | 7 | if material.preview_type == 'video' 8 | tag.div(class: 'preview video') do 9 | material.preview_code.html_safe 10 | end 11 | elsif material.preview_type == 'image' 12 | tag.div(class: 'preview image') do 13 | link_to material.url, title: material.name do 14 | image_tag(material.preview_code, alt: material.name) 15 | end 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/helpers/sitemaps_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module SitemapsHelper 4 | def urls 5 | subdomain = Whitelabel[:label_id] 6 | 7 | topics = Topic.ordered 8 | people = User.peers 9 | events = Event.ordered 10 | locations = Location.all 11 | 12 | urls = (topics + people + events + locations).map do |model| 13 | send(:"#{model.class.to_s.downcase}_url", model, subdomain:) 14 | end 15 | (urls + [root_url(subdomain:)]).flatten 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/helpers/title_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module TitleHelper 4 | def page_title 5 | "#{title} - #{title_mapping ? title_mapping.call : subtitle}" 6 | end 7 | 8 | def meta_desc 9 | "#{page_title} - #{I18n.tw('meta_desc')}" 10 | end 11 | 12 | def title 13 | I18n.tw('title') 14 | end 15 | 16 | def subtitle 17 | I18n.tw('subtitle') 18 | end 19 | 20 | private 21 | 22 | def title_mapping(controller_name = self.controller_name, action_name = self.action_name) 23 | { 24 | 'users/show' => -> { user.name }, 25 | 'topics/show' => -> { topic.name }, 26 | 'locations/show' => -> { location.name }, 27 | 'locations/none' => -> { I18n.t('show.no_location') }, 28 | 'events/show' => -> { event.name }, 29 | }["#{controller_name}/#{action_name}"] 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /app/helpers/topics_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module TopicsHelper 4 | def like_link(topic) 5 | if signed_in? 6 | if topic.user == current_user 7 | button_to t('topic.edit'), edit_topic_path(topic), method: :get, class: 'btn btn-primary' 8 | elsif like = topic.already_liked?(current_user) 9 | button_to t('topic.unlike'), topic_like_path(like.topic, like), method: :delete, class: 'btn btn-primary' 10 | else 11 | button_to t('topic.like'), topic_likes_path(topic), method: :post, class: 'btn btn-primary' 12 | end 13 | else 14 | button_to t('topic.like'), login_path, method: :get, params: { origin: request.path }, class: 'btn btn-primary' 15 | end 16 | end 17 | 18 | def proposal_type_selection 19 | Topic::PROPOSAL_TYPES.index_by { |type| I18n.t("topic.proposal_types.#{type}") } 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/lib/email_auth_token.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Based on https://github.com/weg-li/weg-li/blob/master/app/lib/token.rb 4 | # Original author: https://github.com/phoet 5 | 6 | class EmailAuthToken 7 | def self.generate( 8 | email, 9 | expiration: 15.minutes, 10 | secret: Rails.application.secrets.secret_key_base 11 | ) 12 | now_seconds = Time.now.to_i 13 | payload = { iss: email, iat: now_seconds, exp: now_seconds + expiration } 14 | token = ::JWT.encode(payload, secret, 'HS256') 15 | Base64.encode64(token) 16 | end 17 | 18 | def self.decode(string, secret: Rails.application.secrets.secret_key_base) 19 | token = Base64.decode64(string) 20 | JWT.decode(token, secret, true, algorithm: 'HS256').first 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /app/lib/preview_generator.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class PreviewGenerator 4 | attr_accessor :uri, :type, :code 5 | 6 | def initialize(uri) 7 | @uri = uri 8 | end 9 | 10 | def generate_preview 11 | website = LinkThumbnailer.generate(uri) 12 | 13 | video = website.videos.find { |v| v.embed_code.present? } 14 | if video 15 | self.code = video.embed_code 16 | self.type = :video 17 | else 18 | image = website.images.first 19 | if image 20 | self.code = image.src 21 | self.type = :image 22 | else 23 | self.type = :none 24 | end 25 | end 26 | rescue Net::HTTPClientException => e 27 | Rails.logger.warn("Could not generate preview for url #{uri}: #{e}") 28 | end 29 | 30 | def video? 31 | type == :video 32 | end 33 | 34 | def image? 35 | type == :image 36 | end 37 | 38 | def none? 39 | type == :none 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/lib/whitelabel_detection_middleware.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class WhitelabelDetectionMiddleware 4 | def initialize(app) 5 | @app = app 6 | end 7 | 8 | def call(env) 9 | Whitelabel.reset! 10 | request = ActionDispatch::Request.new(env) 11 | Whitelabel.label = detect_label(request) 12 | Appsignal.add_tags(label: Whitelabel.label.label_id) 13 | @app.call(env) 14 | end 15 | 16 | private 17 | 18 | def detect_label(request) 19 | Whitelabel.label_for(request.subdomains.first).tap { |label| return label unless label.nil? } 20 | 21 | Whitelabel.labels.find do |label| 22 | label.domains&.any? do |custom_domain| 23 | return label if request.host =~ /#{custom_domain}/ 24 | end 25 | end 26 | 27 | Whitelabel.labels.first 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /app/lib/whitelabel_translation.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module WhitelabelTranslation 4 | def translate_whitelabel(token, options = {}) 5 | sub = Whitelabel.label ? Whitelabel[:label_id] : 'default' 6 | t("label.#{sub}.#{token}".to_sym, **options.merge(default: ["label.default.#{token}".to_sym, token.to_sym])) 7 | end 8 | alias tw translate_whitelabel 9 | end 10 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationMailer < ActionMailer::Base 4 | end 5 | -------------------------------------------------------------------------------- /app/mailers/user_mailer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Based on https://github.com/weg-li/weg-li/blob/master/app/mailers/user_mailer.rb 4 | # Original author: https://github.com/phoet 5 | 6 | class UserMailer < ApplicationMailer 7 | COMMON_SENDER = 'global@onruby.de' 8 | 9 | def login_link(email, token, locale, label_name, label_link) 10 | @token = token 11 | @label_name = label_name 12 | @label_link = label_link 13 | 14 | I18n.with_locale(locale) do 15 | mail from: COMMON_SENDER, to: email, 16 | subject: t('email_auth.subject', label: label_name) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/mailers/usergroup_mailer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class UsergroupMailer < ApplicationMailer 4 | def invitation_mail(event) 5 | @event = event 6 | options = { 7 | from: %("#{I18n.tw('name')}" ), 8 | to: 'rubyonrails-ug-germany@googlegroups.com', 9 | subject: "#{Whitelabel[:label_id].upcase} Info: #{event.name}", 10 | } 11 | default_url_options[:host] = Whitelabel[:canonical_url] 12 | mail(options) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationRecord < ActiveRecord::Base 4 | self.abstract_class = true 5 | end 6 | -------------------------------------------------------------------------------- /app/models/concerns/api_handling.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ApiHandling 4 | def expose_api(*fields) 5 | acts_as_api 6 | 7 | api_accessible :ios_v1 do |template| 8 | fields.each { |field| template.add field } 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/models/concerns/slug.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Slug 4 | def self.included(clazz) 5 | def clazz.from_param(token) 6 | id = if match = token.match(/.*-(\d+)/) 7 | match[1] 8 | else 9 | token 10 | end 11 | 12 | found = where(id: id.to_i).or(where("#{table_name}.#{slugger} ILIKE ?", token.tr('-', '%'))).first 13 | raise ActiveRecord::RecordNotFound, "Could not find by slug #{token}" unless found 14 | 15 | found 16 | end 17 | 18 | def clazz.from_slug(token) 19 | from_param(token) 20 | end 21 | 22 | def clazz.slugged_by(column) 23 | @slugger = column 24 | end 25 | 26 | def clazz.slugger 27 | @slugger || :name 28 | end 29 | end 30 | 31 | def slug 32 | send(self.class.slugger).parameterize 33 | end 34 | 35 | def to_param 36 | "#{slug}-#{id}" 37 | end 38 | 39 | def as_json(options = {}) 40 | h = super(options) 41 | h[:slug] = slug 42 | h 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /app/models/highlight.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Highlight < ApplicationRecord 4 | validates :description, :url, :start_at, :end_at, presence: true 5 | 6 | default_scope -> { where(label: Whitelabel[:label_id]) } 7 | 8 | scope :active, -> { where('end_at > ?', Time.now).order(start_at: :asc).limit(1) } 9 | 10 | def disabled? 11 | end_at <= Time.now 12 | end 13 | 14 | def disable! 15 | update! start_at: Time.now, end_at: Time.now 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/models/job.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Job < ApplicationRecord 4 | validates :name, :url, :location, presence: true 5 | 6 | default_scope -> { where(label: Whitelabel[:label_id]) } 7 | 8 | belongs_to :location 9 | 10 | def self.shuffled 11 | includes(:location).shuffle 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/models/like.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Like < ApplicationRecord 4 | validates :user, :topic, presence: true 5 | 6 | belongs_to :user 7 | belongs_to :topic 8 | end 9 | -------------------------------------------------------------------------------- /app/models/location.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Location < ApplicationRecord 4 | include Slug 5 | extend ApiHandling 6 | expose_api :id, :name, :url, :virtual, :city, :street, :house_number, :zip, :wheelmap_id 7 | 8 | geocoded_by :geo_coder_address, latitude: :lat, longitude: :long 9 | after_validation :geocode, unless: :virtual? 10 | 11 | has_many :events 12 | has_many :jobs 13 | 14 | validates :name, :url, presence: true 15 | validates :city, :street, :house_number, :zip, presence: true, unless: :virtual? 16 | validates :url, length: { maximum: 255 } 17 | 18 | scope :ordered, -> { order('name ASC') } 19 | default_scope -> { where(label: Whitelabel[:label_id]) } 20 | 21 | def geo_coder_address 22 | "#{street} #{house_number}, #{zip} #{city}, #{country}" 23 | end 24 | 25 | def country 26 | Whitelabel.find_label(label).country 27 | end 28 | 29 | def address 30 | "#{street} #{house_number}, #{zip} #{city}" 31 | end 32 | 33 | def nice_url 34 | URI.parse(url).host 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /app/models/material.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Material < ApplicationRecord 4 | include Slug 5 | extend ApiHandling 6 | expose_api :id, :name, :url, :event_id, :user_id 7 | 8 | validates :name, :url, :event, presence: true 9 | validates_url :url, url: true, message: 'not a valid URL' 10 | 11 | belongs_to :user 12 | belongs_to :event 13 | belongs_to :topic 14 | 15 | scope :naked, -> { where('preview_type IS NULL AND preview_code is NULL') } 16 | 17 | default_scope -> { joins(:event).where('events.label' => Whitelabel[:label_id]).readonly(false) } 18 | 19 | def generate_preview 20 | generator = PreviewGenerator.new(url) 21 | generator.generate_preview 22 | self.preview_type = generator.type 23 | self.preview_code = generator.code 24 | save 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /app/models/participant.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Participant < ApplicationRecord 4 | extend ApiHandling 5 | expose_api :id, :user_id, :event_id 6 | 7 | validates :user, :event, presence: true 8 | 9 | belongs_to :user 10 | belongs_to :event 11 | 12 | def owned_by?(other_user) 13 | user.id == other_user.id 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/models/topic.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Topic < ApplicationRecord 4 | include Slug 5 | extend ApiHandling 6 | expose_api :id, :event_id, :user_id, :name, :description, :user 7 | 8 | PROPOSAL_TYPES = %w[proposal enquiry].freeze 9 | validates :user, :name, :description, :label, presence: true 10 | validates :proposal_type, inclusion: { in: PROPOSAL_TYPES } 11 | validates :name, length: { maximum: 255 } 12 | 13 | belongs_to :user 14 | belongs_to :event, optional: true 15 | 16 | has_many :likes, dependent: :destroy 17 | has_many :materials 18 | 19 | scope :ordered, -> { order('created_at DESC') } 20 | scope :undone, -> { where('event_id IS NULL') } 21 | scope :done, -> { joins(:event).where('date <= ?', Time.now - 2.hours) } 22 | scope :upcoming, -> { joins(:event).where('date > ?', Time.now - 2.hours) } 23 | 24 | default_scope -> { where(label: Whitelabel[:label_id]) } 25 | 26 | def already_liked?(user) 27 | likes.detect { |like| like.user == user } 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /app/routing/main_domain_constraint.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class MainDomainConstraint 4 | def matches?(request) 5 | request.host =~ /www\.onruby\.\w+/ 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/views/application/_app_info.slim: -------------------------------------------------------------------------------- 1 | | 2 | - if ENV['MY_SHA_REVISION'].present? 3 | | 4 | - if defined?(Puma) 5 | | 6 | -------------------------------------------------------------------------------- /app/views/application/_headline.slim: -------------------------------------------------------------------------------- 1 | header.d-none.d-xl-block 2 | .row 3 | .col-lg-2.text-center 4 | = link_to(root_path, title: title) do 5 | =image_tag("labels/#{Whitelabel[:label_id]}.png", title: title, id: :logo) 6 | 7 | .col-lg-10 8 | = link_to(root_path, id: :title, title: title) do 9 | h1= title 10 | h2.mt-4= subtitle 11 | -------------------------------------------------------------------------------- /app/views/application/_i18njs.slim: -------------------------------------------------------------------------------- 1 | javascript: 2 | I18n = {}; 3 | I18n.showMore = '#{t("home.show_more")}'; 4 | -------------------------------------------------------------------------------- /app/views/application/_meta.slim: -------------------------------------------------------------------------------- 1 | title= page_title 2 | meta charset="utf-8" 3 | meta name="description" content="#{meta_desc}" 4 | link type="text/plain" rel="author" href="/humans.txt" 5 | meta content='width=device-width, initial-scale=1, shrink-to-fit=no' name='viewport' 6 | -------------------------------------------------------------------------------- /app/views/application/_route.slim: -------------------------------------------------------------------------------- 1 | .banner= wheelmap_badge location 2 | h3#route 3 | = t("show.route") 4 | = single_map(location) 5 | = link_to_external_route(location) 6 | -------------------------------------------------------------------------------- /app/views/application/_show_flash.slim: -------------------------------------------------------------------------------- 1 | - if flash.present? 2 | = hint do 3 | - flash.each do |key, value| 4 | strong(class=key)= value 5 | -------------------------------------------------------------------------------- /app/views/events/_badges.slim: -------------------------------------------------------------------------------- 1 | span.badge.badge-card-header.mr-2 2 | = fa_icon('calendar', text: link_to(l(event.date, format: :long), event_path(event, format: :ics))) 3 | - if event.location.present? && !event.location.virtual? 4 | span.badge.badge-card-header.mr-2 5 | = fa_icon('map-marker', text: link_to(event.location.address, '#route', title: event.location.address)) 6 | span.badge.badge-card-header.mr-2 7 | = fa_icon('external-link', text: link_to_external_route(event.location)) 8 | - if Whitelabel[:coc].present? 9 | span.badge.badge-card-header.mr-2 10 | = fa_icon('file-text-o', text: link_to('Code of Conduct', Whitelabel[:coc], target: '_blank')) 11 | - if event.github_issue? 12 | span.badge.badge-card-header.mr-2 13 | = fa_icon('github', text: link_to('Github Planning Issue', github_issue_url(event.github_issue), target: '_blank')) 14 | -------------------------------------------------------------------------------- /app/views/events/_info.slim: -------------------------------------------------------------------------------- 1 | .row.card-title 2 | .col-lg-9 3 | h2= link_to_event(event) 4 | small.text-muted 5 | = t("show.hosted_by") 6 | =< link_to_user(event.user) 7 | - if event.location.present? 8 | =< t('show.at') 9 | =< link_to_location(event.location) 10 | = ", #{l(event.date, format: :long)}" 11 | 12 | .col-lg-3 13 | = participation_link(event, link_class: 'btn btn-primary btn-block') 14 | = remote_url_link(event, link_class: 'btn btn-primary btn-block') 15 | 16 | .card-text 17 | == markdown(event.description) 18 | 19 | - if event.attendee_information? 20 | - if signed_in? 21 | .card-text 22 | == markdown(event.attendee_information) 23 | - else 24 | .card-text 25 | mark= t('show.attend_to_view_attendees_information') 26 | -------------------------------------------------------------------------------- /app/views/events/_location.slim: -------------------------------------------------------------------------------- 1 | - if event.location.present? && !event.location.virtual? 2 | h3.card-title 3 | = t("show.route") 4 | - if event.location.wheelmap_id? 5 | .pull-right 6 | = wheelmap_badge(event.location) 7 | 8 | #route= single_map(event.location) 9 | -------------------------------------------------------------------------------- /app/views/events/_materials.slim: -------------------------------------------------------------------------------- 1 | - if materials.present? 2 | h3.card-title#materials= t("main.materials") 3 | ul 4 | - materials.each do |material| 5 | li 6 | = link_to_material(material) 7 | == " (#{link_to_user(material.user)})" if material.user 8 | = material_preview(material) 9 | -------------------------------------------------------------------------------- /app/views/events/_participants.slim: -------------------------------------------------------------------------------- 1 | - if event.participants.present? 2 | h3.card-title= t("show.attendees", count: event.limit || 0, participant_count: event.participants.count) 3 | p= render 'users/list', users: event.users 4 | -------------------------------------------------------------------------------- /app/views/events/_topics.slim: -------------------------------------------------------------------------------- 1 | - if event.topics.present? 2 | h3.card-title= t("main.topics") 3 | 4 | .card-deck 5 | - event.topics.each do |topic| 6 | .card 7 | .card-header 8 | .pull-left 9 | = link_to(topic.user) do 10 | = user_image(topic.user, image_class: 'card-img-topic-header') 11 | = link_to_user(topic.user) 12 | .card-body 13 | h5.card-title= link_to_topic(topic) 14 | .card-text.collapser== markdown(topic.description) 15 | - if topic.materials.present? 16 | ul.list-group.list-group-flush 17 | - topic.materials.each do |material| 18 | li.list-group-item= link_to_material(material) 19 | .card-footer 20 | small.text-muted 21 | = link_to t('topic.likes', count: topic.likes.count), topic 22 | -------------------------------------------------------------------------------- /app/views/events/index.slim: -------------------------------------------------------------------------------- 1 | = section_box :events do 2 | - events.each do |event| 3 | p 4 | strong= link_to_event event 5 | = " (#{l(event.date, format: :date)})" 6 | ul.more-list.undone.clearfix 7 | - event.topics.each do |topic| 8 | li.topic= link_to_topic topic 9 | = paginate events 10 | 11 | p.meta 12 | - if signed_in? 13 | span.pull-right 14 | = t('events.im_attending_html', events_im_attending_link: events_im_attending_link) 15 | 16 | = t 'events.calendar_html', 17 | webcal_link: all_events_webcal_link, 18 | rss_link: all_events_rss_link 19 | -------------------------------------------------------------------------------- /app/views/events/index.xml.builder: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | xml.instruct! 4 | 5 | xml.rss 'version' => '2.0', 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/' do 6 | xml.channel do 7 | xml.title I18n.tw('title') 8 | xml.link url_for only_path: false, controller: 'events' 9 | xml.description I18n.tw('name') 10 | 11 | events.each do |event| 12 | xml.item do 13 | xml.title l(event.date) + ' ' + event.name 14 | xml.link url_for only_path: false, controller: 'events', action: 'show', id: event.id 15 | xml.description event.description 16 | xml.guid url_for only_path: false, controller: 'events', action: 'show', id: event.id 17 | xml.pubDate event.created_at.rfc822 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/views/events/show.slim: -------------------------------------------------------------------------------- 1 | .card 2 | .card-header 3 | = render('badges', event: event) 4 | 5 | .card-body 6 | = render('info', event: event) 7 | = render('topics', event: event) 8 | = render('participants', event: event) 9 | = render('location', event: event) 10 | 11 | .card-footer 12 | small 13 | = I18n.tw("home.like_to_talk") 14 | br 15 | = contact_text 16 | -------------------------------------------------------------------------------- /app/views/home/_featured.slim: -------------------------------------------------------------------------------- 1 | - if current_event.present? 2 | .card 3 | .card-header 4 | = render('events/badges', event: current_event) 5 | 6 | .card-body 7 | = render('events/info', event: current_event) 8 | = render('events/topics', event: current_event) 9 | = render('events/participants', event: current_event) 10 | = render('events/location', event: current_event) 11 | -------------------------------------------------------------------------------- /app/views/home/_locations.slim: -------------------------------------------------------------------------------- 1 | = section_box :locations do 2 | p= map(locations, { zoom: zoom }) 3 | - options = { location_link: link_to(t("main.locations"), locations_path, title: t("main.locations")) } 4 | p== I18n.tw("home.usergroup_locations", options) 5 | p== I18n.tw("home.company_workers") 6 | p 7 | == I18n.tw("home.company_missing", email_link: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail")) 8 | - if Whitelabel[:twitter] 9 | ==< I18n.tw("home.company_missing_or_message_twitter", twitter_link: link_to_twitter(Whitelabel[:twitter])) 10 | | . 11 | -------------------------------------------------------------------------------- /app/views/home/_people.slim: -------------------------------------------------------------------------------- 1 | = section_box :people do 2 | = slackin_js 3 | p== I18n.tw("home.the_usergroup", usergroup: I18n.tw("name")) 4 | = render 'users/list', users: people 5 | = fa_icon 'mail-forward', text: link_to(t('home.all_people'), users_path) 6 | -------------------------------------------------------------------------------- /app/views/home/_topics.slim: -------------------------------------------------------------------------------- 1 | = section_box :topics do 2 | p 3 | strong=> I18n.tw("home.like_to_talk") 4 | = contact_text 5 | = render 'users/list', users: organizers 6 | p== I18n.tw("home.engage") 7 | = link_to t("home.add_topic"), new_topic_path, class: 'btn btn-primary' 8 | = render 'topics/upcoming', topics: upcoming_topics 9 | = render 'topics/undone', topics: undone_topics 10 | = render 'topics/done', topics: done_topics 11 | -------------------------------------------------------------------------------- /app/views/home/index.slim: -------------------------------------------------------------------------------- 1 | = render 'featured', current_event: current_event 2 | = render 'events', events: events, current_event: current_event 3 | = render 'topics', undone_topics: undone_topics, done_topics: done_topics, upcoming_topics: upcoming_topics, organizers: organizers 4 | = render 'people', people: people 5 | = render 'locations', locations: locations 6 | -------------------------------------------------------------------------------- /app/views/kaminari/_first_page.html.slim: -------------------------------------------------------------------------------- 1 | li.page-item 2 | = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' 3 | -------------------------------------------------------------------------------- /app/views/kaminari/_gap.html.slim: -------------------------------------------------------------------------------- 1 | li.page-item.disabled 2 | = link_to raw(t 'views.pagination.truncate'), '#', class: 'page-link' 3 | -------------------------------------------------------------------------------- /app/views/kaminari/_last_page.html.slim: -------------------------------------------------------------------------------- 1 | li.page-item 2 | = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, remote: remote, class: 'page-link' 3 | -------------------------------------------------------------------------------- /app/views/kaminari/_next_page.html.slim: -------------------------------------------------------------------------------- 1 | li.page-item 2 | = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' 3 | -------------------------------------------------------------------------------- /app/views/kaminari/_page.html.slim: -------------------------------------------------------------------------------- 1 | - if page.current? 2 | li.page-item.active 3 | = content_tag :a, page, data: { remote: remote }, rel: page.rel, class: 'page-link' 4 | - else 5 | li.page-item 6 | = link_to page, url, remote: remote, rel: page.rel, class: 'page-link' 7 | -------------------------------------------------------------------------------- /app/views/kaminari/_paginator.html.slim: -------------------------------------------------------------------------------- 1 | = paginator.render do 2 | nav 3 | ul.pagination 4 | == first_page_tag unless current_page.first? 5 | == prev_page_tag unless current_page.first? 6 | - each_page do |page| 7 | - if page.left_outer? || page.right_outer? || page.inside_window? 8 | == page_tag page 9 | - elsif !page.was_truncated? 10 | == gap_tag 11 | == next_page_tag unless current_page.last? 12 | == last_page_tag unless current_page.last? 13 | -------------------------------------------------------------------------------- /app/views/kaminari/_prev_page.html.slim: -------------------------------------------------------------------------------- 1 | li.page-item 2 | = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' 3 | -------------------------------------------------------------------------------- /app/views/labels/index.slim: -------------------------------------------------------------------------------- 1 | section.mt-4 2 | h1= title 3 | 4 | - Whitelabel.labels.select(&:enabled?).in_groups_of(3).each do |labels| 5 | .card-deck.mb-4 6 | - labels.compact.each do |label| 7 | - name = t("label.#{label.label_id}.name") 8 | - title = t("label.#{label.label_id}.title") 9 | - subtitle = t("label.#{label.label_id}.subtitle") 10 | .card 11 | .text-center 12 | span.image= image_tag("labels/#{label.label_id}.png", alt: name, style: "max-height:100px;padding-top:10px") 13 | .card-body 14 | h5.card-title= title 15 | 16 | p.card-text 17 | small= subtitle 18 | = link_to(label_url(label), title: name, class: "btn btn-primary", target: '_blank') do 19 | = fa_icon('external-link', text: name) 20 | -------------------------------------------------------------------------------- /app/views/layouts/application.slim: -------------------------------------------------------------------------------- 1 | doctype 5 2 | html 3 | head 4 | = render 'meta' 5 | = canonical_url 6 | = browser_icon 7 | = touch_icon 8 | = rss_feed 9 | = csrf_meta_tag 10 | = stylesheet_link_tag :application, "//fonts.googleapis.com/css?family=Raleway" 11 | = whitelabel_stylesheet_link_tag 12 | body 13 | .container-xl#on_ruby 14 | = render 'nav' 15 | .main 16 | = render 'headline' 17 | = render 'hint' 18 | = yield 19 | footer 20 | = render 'footer' 21 | 22 | = render 'app_info' 23 | = render 'i18njs' 24 | = javascript_include_tag :application, "//maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyDvgVnoO2zQ_K_dDhAFiz2nENTQSH4TivY" 25 | = whitelabel_javascript_include_tag 26 | -------------------------------------------------------------------------------- /app/views/layouts/labels.slim: -------------------------------------------------------------------------------- 1 | doctype 5 2 | html 3 | head 4 | = render 'application/meta' 5 | = browser_icon 6 | = touch_icon 7 | = stylesheet_link_tag :application, "//fonts.googleapis.com/css?family=Raleway" 8 | body 9 | .container 10 | .main 11 | = yield 12 | 13 | #sponsors.row.m-4.hr 14 | .col-sm-12 15 | h2= t("footer.sponsored_by") 16 | .col-sm.pb-4.sponsors(class="sponsor-appsignal") 17 | => link_to 'https://appsignal.com', title: 'AppSignal', target: '_blank' do 18 | => image_tag("labels/hamburg/sponsors/appsignal.png", alt: 'AppSignal', width: 250) 19 | 20 | = render 'application/app_info' 21 | -------------------------------------------------------------------------------- /app/views/locations/index.slim: -------------------------------------------------------------------------------- 1 | section 2 | h2= title 3 | = map(locations) 4 | br 5 | ul.more-list.enumeration 6 | - locations.each do |location| 7 | li= link_to location.name, location 8 | -------------------------------------------------------------------------------- /app/views/sessions/email.slim: -------------------------------------------------------------------------------- 1 | section 2 | h3= t("email_auth.header") 3 | 4 | .d-flex.justify-content-center 5 | = form_tag email_login_path do |form| 6 | legend= t('email_auth.enter_email') 7 | - email = signed_in? ? current_user.email : params[:email] 8 | = email_field_tag :email, email, placeholder: 'me@example.com', required: true 9 | = submit_tag t('email_auth.submit'), class: 'btn-primary' 10 | -------------------------------------------------------------------------------- /app/views/sessions/index.slim: -------------------------------------------------------------------------------- 1 | section 2 | h3= t("show.login_before_attend") 3 | 4 | .d-flex.justify-content-center 5 | ul.list-group.list-group-horizontal 6 | - login_providers.each do |provider| 7 | li.list-group-item 8 | = button_to(label_auth_url(provider)) do 9 | = fa_icon(icon_for_provider(provider), class: 'fa-fw dropdown-list-icon', text: t("login.#{provider}_login")) 10 | -------------------------------------------------------------------------------- /app/views/sitemaps/show.xml.builder: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | xml.instruct! 4 | 5 | xml.urlset xmlns: 'http://www.sitemaps.org/schemas/sitemap/0.9', 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation': 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd' do 6 | urls.each do |url| 7 | xml.url do 8 | xml.loc url 9 | xml.changefreq 'always' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/views/topics/_done.slim: -------------------------------------------------------------------------------- 1 | - if topics.present? 2 | #done 3 | h3= t('home.old_topics') 4 | ul.more-list.clearfix 5 | - topics.each do |topic| 6 | li.topic 7 | = link_to_topic topic 8 | li.all= fa_icon 'mail-forward', text: link_to(t('topic.all_topics'), topics_path) 9 | -------------------------------------------------------------------------------- /app/views/topics/_form.slim: -------------------------------------------------------------------------------- 1 | = simple_form_for topic do |f| 2 | = f.input :name 3 | = f.input :proposal_type, as: :select, include_blank: false, collection: proposal_type_selection 4 | p.info== t("topic.markdown") 5 | = f.input :description 6 | = f.button :submit, class: 'btn-primary' 7 | -------------------------------------------------------------------------------- /app/views/topics/_likes.slim: -------------------------------------------------------------------------------- 1 | - if topic.likes.present? 2 | h3= t 'topic.likes', count: topic.likes.size 3 | ul 4 | - topic.likes.each do |like| 5 | li 6 | = fa_icon 'thumbs-o-up', class: 'pull-left' 7 | = link_to_user like.user 8 | -------------------------------------------------------------------------------- /app/views/topics/_materials.slim: -------------------------------------------------------------------------------- 1 | - if materials.present? 2 | h3#materials= t("main.materials") 3 | ul 4 | - materials.each do |material| 5 | li 6 | = link_to_material(material) 7 | == " (#{link_to_user(material.user)})" if material.user 8 | = material_preview(material) 9 | -------------------------------------------------------------------------------- /app/views/topics/_undone.slim: -------------------------------------------------------------------------------- 1 | #undone 2 | h3= t("home.new_topics") 3 | - if topics.present? 4 | ul.more-list.undone.clearfix 5 | - topics.each do |topic| 6 | li.topic 7 | = link_to_topic topic 8 | - else 9 | p== t("home.no_new_topics", new_topic_link: link_to(t('topic.topic'), new_topic_path)) 10 | -------------------------------------------------------------------------------- /app/views/topics/_upcoming.slim: -------------------------------------------------------------------------------- 1 | - if topics.present? 2 | #upcoming 3 | h3= t('home.upcoming_topics') 4 | ul.more-list.clearfix 5 | - topics.each do |topic| 6 | li.topic 7 | = link_to_topic topic 8 | -------------------------------------------------------------------------------- /app/views/topics/edit.slim: -------------------------------------------------------------------------------- 1 | = section_box :topics do 2 | p.info== t("topic.markdown") 3 | p= render 'form', topic: topic 4 | = render 'undone', topics: undone_topics 5 | -------------------------------------------------------------------------------- /app/views/topics/index.slim: -------------------------------------------------------------------------------- 1 | = section_box :topics do 2 | - events.each do |event| 3 | p 4 | strong= link_to_event event 5 | = " (#{l(event.date, format: :date)})" 6 | ul.more-list.undone.clearfix 7 | - event.topics.each do |topic| 8 | li.topic= link_to_topic topic 9 | = paginate events 10 | -------------------------------------------------------------------------------- /app/views/topics/new.slim: -------------------------------------------------------------------------------- 1 | = section_box :topics do 2 | p.info== t("topic.markdown") 3 | p= render 'form', topic: topic 4 | 5 | = render 'undone', topics: undone_topics 6 | -------------------------------------------------------------------------------- /app/views/user_mailer/login_link.text.erb: -------------------------------------------------------------------------------- 1 | <%= t("email_auth.body.salute") %>, 2 | 3 | <%= t("email_auth.body.intro", label: @label_name) %>, 4 | 5 | <%= provider_callback_url(provider: :email, token: @token, host: @label_link) %> 6 | 7 | <%= t("email_auth.body.final_details") %> 8 | 9 | -- 10 | <%= @label_name %> 11 | <%= @label_link %> 12 | -------------------------------------------------------------------------------- /app/views/usergroup_mailer/invitation_mail.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%= @event.name %> 4 | 5 | 6 |

<%= @event.name %>

7 |

<%= @event.description %>

8 |

Folgende Themen sind vorgesehen:

9 | 14 |

Mehr Informationen findet ihr auf <%= link_to("onruby.de", event_url(@event)) %>.

15 |

Bis bald!

16 | 17 | -------------------------------------------------------------------------------- /app/views/usergroup_mailer/invitation_mail.text.erb: -------------------------------------------------------------------------------- 1 | <%= @event.name %> 2 | 3 | <%= @event.description %> 4 | 5 | Folgende Themen sind vorgesehen: 6 | 7 | <% @event.topics.each do |topic| %> 8 | <%= topic.name %> 9 | <% end %> 10 | 11 | Mehr Informationen findet ihr auf <%= event_url(@event) %>. 12 | 13 | Bis bald! -------------------------------------------------------------------------------- /app/views/users/_list.slim: -------------------------------------------------------------------------------- 1 | .card-columns 2 | - users.each do |user| 3 | = render(user) 4 | -------------------------------------------------------------------------------- /app/views/users/_user.slim: -------------------------------------------------------------------------------- 1 | .card 2 | .card-body 3 | .pull-left 4 | - if user.organizer? 5 | span.badge.badge-card-header.badge-organizer 6 | = fa_icon('star', text: 'Organizer') 7 | = link_to(user) do 8 | = user_image(user, image_class: 'card-img-topic') 9 | 10 | p 11 | small.text-muted 12 | = link_to_user(user) 13 | br 14 | = "#{t('main.events')}: #{user.participations.count}" 15 | br 16 | = "#{t('main.topics')}: #{user.topics.count}" 17 | -------------------------------------------------------------------------------- /app/views/users/index.slim: -------------------------------------------------------------------------------- 1 | = section_box :people do 2 | .card-columns 3 | - users.each do |user| 4 | = render(user) 5 | 6 | = paginate(users) 7 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../config/application', __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'fileutils' 3 | include FileUtils 4 | 5 | # path to your application root. 6 | APP_ROOT = File.expand_path('..', __dir__) 7 | 8 | def system!(*args) 9 | system(*args) || abort("\n== Command #{args} failed ==") 10 | end 11 | 12 | chdir APP_ROOT do 13 | # This script is a way to update your development environment automatically. 14 | # Add necessary update steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies if using Yarn 21 | # system('bin/yarn') 22 | 23 | puts "\n== Updating database ==" 24 | system! 'bin/rails db:migrate' 25 | 26 | puts "\n== Removing old logs and tempfiles ==" 27 | system! 'bin/rails log:clear tmp:clear' 28 | 29 | puts "\n== Restarting application server ==" 30 | system! 'bin/rails restart' 31 | end 32 | -------------------------------------------------------------------------------- /bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | yarn = ENV["PATH"].split(File::PATH_SEPARATOR). 5 | select { |dir| File.expand_path(dir) != __dir__ }. 6 | product(["yarn", "yarn.cmd", "yarn.ps1"]). 7 | map { |dir, file| File.expand_path(file, dir) }. 8 | find { |file| File.executable?(file) } 9 | 10 | if yarn 11 | exec yarn, *ARGV 12 | else 13 | $stderr.puts "Yarn executable was not detected in the system." 14 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 15 | exit 1 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /config/compass.rb: -------------------------------------------------------------------------------- 1 | # This configuration file works with both the Compass command line tool and within Rails. 2 | # Require any additional compass plugins here. 3 | project_type = :rails 4 | # Set this to the root of your project when deployed: 5 | http_path = '/' 6 | css_dir = 'tmp/stylesheets' 7 | sass_dir = 'app/stylesheets' 8 | # To enable relative paths to assets via compass helper functions. Uncomment: 9 | # relative_assets = true 10 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | development: &default 2 | adapter: postgresql 3 | database: onruby_development 4 | min_messages: WARNING 5 | pool: 5 6 | username: postgres 7 | password: <%= ENV["POSTGRES_PASSWORD"] || "INSECURE_LOCAL_DEVELOPMENT_PASSWORD" %> 8 | host: <%= ENV["POSTGRES_PORT_5432_TCP_ADDR"] || '127.0.0.1' %> 9 | port: <%= ENV["POSTGRES_PORT_5432_TCP_PORT"] || 5432 %> 10 | 11 | test: 12 | <<: *default 13 | database: onruby_test 14 | 15 | production: 16 | url: <%= ENV["DATABASE_URL"] %> 17 | pool: <%= ENV["DB_POOL"] || ENV["MAX_THREADS"] || 5 %> 18 | encoding: utf8 -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /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 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | Rails.application.config.assets.precompile += %w[labels/*] 16 | -------------------------------------------------------------------------------- /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| /my_noisy_library/.match?(line) } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 7 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". 8 | Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] 9 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /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 += [ 5 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 6 | ] 7 | -------------------------------------------------------------------------------- /config/initializers/gc.rb: -------------------------------------------------------------------------------- 1 | GC::Profiler.enable 2 | -------------------------------------------------------------------------------- /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/kaminari_config.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Kaminari.configure do |config| 4 | config.default_per_page = 10 5 | # config.max_per_page = nil 6 | # config.window = 4 7 | # config.outer_window = 0 8 | # config.left = 0 9 | # config.right = 0 10 | # config.page_method_name = :page 11 | # config.param_name = :page 12 | # config.params_on_first_page = false 13 | end 14 | -------------------------------------------------------------------------------- /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 | require_relative '../../lib/omni_auth/strategies/email' 2 | 3 | OmniAuth.config.logger = Rails.logger 4 | 5 | Rails.application.config.middleware.use OmniAuth::Builder do 6 | provider :google_oauth2, ENV['GOOGLE_CONSUMER_KEY'], ENV['GOOGLE_CONSUMER_SECRET'], verify_iss: false 7 | provider :twitter, ENV['TWITTER_CONSUMER_KEY'], ENV['TWITTER_CONSUMER_SECRET'] 8 | provider :github, { 9 | setup: proc do |env| 10 | host = env['SERVER_NAME'] 11 | tld = host[/(.+\.)?(.+\..+)/, 2] 12 | token = tld.delete('-').split('.').join('_').upcase 13 | name = "OMNIAUTH_GITHUB_#{token}" 14 | 15 | env['omniauth.strategy'].options[:client_id] = ENV["#{name}_KEY"] 16 | env['omniauth.strategy'].options[:client_secret] = ENV["#{name}_SECRET"] 17 | end, 18 | } 19 | provider :email 20 | end 21 | -------------------------------------------------------------------------------- /config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | # Make sure the secret is at least 30 characters and all random, 6 | # no regular words or you'll be exposed to dictionary attacks. 7 | secret_token = ENV['SECRET_TOKEN'] || 'secret' 8 | OnRuby::Application.config.secret_key_base = secret_token.reverse 9 | -------------------------------------------------------------------------------- /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, key: '_on_ruby_v2' 4 | -------------------------------------------------------------------------------- /config/initializers/slim.rb: -------------------------------------------------------------------------------- 1 | Slim::Engine.set_options pretty: true if Rails.env.development? 2 | -------------------------------------------------------------------------------- /config/initializers/whitelabel.rb: -------------------------------------------------------------------------------- 1 | Usergroup.initialize! 2 | 3 | I18n.extend WhitelabelTranslation 4 | 5 | Rails.application.config.middleware.insert_before OmniAuth::Builder, WhitelabelDetectionMiddleware 6 | -------------------------------------------------------------------------------- /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] 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/de.formtastic.yml: -------------------------------------------------------------------------------- 1 | de: 2 | formtastic: 3 | labels: 4 | topic: 5 | name: 'Dein Vorschlag' 6 | proposal_type: 'Art des Vorschlags' 7 | description: 'Genauere Beschreibung' 8 | user: 9 | hide_jobs: 'Jobs ausblenden' 10 | available: 'auf Job-/Projektsuche' 11 | description: 'Beschreibung' 12 | placeholders: 13 | github: 'GitHub-Username' 14 | actions: 15 | topic: 16 | create: 'eintragen' 17 | user: 18 | update: 'aktualisieren' 19 | -------------------------------------------------------------------------------- /config/locales/en.formtastic.yml: -------------------------------------------------------------------------------- 1 | en: 2 | formtastic: 3 | labels: 4 | topic: 5 | name: 'Your Topic' 6 | proposal_type: 'Type of proposal' 7 | description: 'Description' 8 | user: 9 | hide_jobs: 'hide Jobs' 10 | available: 'looking for Jobs/Projects' 11 | description: 'Description' 12 | placeholders: 13 | github: 'GitHub-Username' 14 | actions: 15 | topic: 16 | create: 'add' 17 | user: 18 | update: 'update' 19 | -------------------------------------------------------------------------------- /config/locales/es.formtastic.yml: -------------------------------------------------------------------------------- 1 | es: 2 | formtastic: 3 | labels: 4 | topic: 5 | name: 'Tu tema' 6 | proposal_type: 'Tipo de propuesta' 7 | description: 'Descripción' 8 | user: 9 | hide_jobs: 'Ocultar trabajos' 10 | available: 'Actualmente estoy buscando trabajos/proyectos' 11 | description: 'Descripción' 12 | placeholders: 13 | github: 'Nombre de usuario en GitHub' 14 | actions: 15 | topic: 16 | create: 'Añadir' 17 | user: 18 | update: 'Actualizar' 19 | -------------------------------------------------------------------------------- /config/locales/pl.formtastic.yml: -------------------------------------------------------------------------------- 1 | pl: 2 | formtastic: 3 | labels: 4 | topic: 5 | name: 'Twój temat' 6 | proposal_type: 'Typ zgłoszenia' 7 | description: 'Opis' 8 | user: 9 | hide_jobs: 'ukryj oferty pracy' 10 | available: 'poszukuję pracy/projektu' 11 | description: 'Opis' 12 | placeholders: 13 | github: 'GitHub-Nazwa użytkownika' 14 | actions: 15 | topic: 16 | create: 'dodaj' 17 | user: 18 | update: 'zaktualizuj' 19 | -------------------------------------------------------------------------------- /config/locales/simple_form.en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | simple_form: 3 | "yes": 'Yes' 4 | "no": 'No' 5 | required: 6 | text: 'required' 7 | mark: '*' 8 | # You can uncomment the line below if you need to overwrite the whole required html. 9 | # When using html, text and mark won't be used. 10 | # html: '*' 11 | error_notification: 12 | default_message: "Please review the problems below:" 13 | # Examples 14 | # labels: 15 | # defaults: 16 | # password: 'Password' 17 | # user: 18 | # new: 19 | # email: 'E-mail to sign in.' 20 | # edit: 21 | # email: 'E-mail.' 22 | # hints: 23 | # defaults: 24 | # username: 'User name to sign in.' 25 | # password: 'No special characters, please.' 26 | # include_blanks: 27 | # defaults: 28 | # age: 'Rather not say' 29 | # prompts: 30 | # defaults: 31 | # age: 'Select your age' 32 | -------------------------------------------------------------------------------- /db/migrate/20180913110659_add_linkedin_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddLinkedinToUsers < ActiveRecord::Migration[5.0] 2 | def up 3 | add_column :users, :linkedin, :string 4 | end 5 | 6 | def down 7 | remove_column :users, :linkedin 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20190515101441_add_github_issue_to_event_and_topic.rb: -------------------------------------------------------------------------------- 1 | class AddGithubIssueToEventAndTopic < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :events, :github_issue, :integer 4 | add_column :topics, :github_issue, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200529213652_add_attendee_informations.rb: -------------------------------------------------------------------------------- 1 | class AddAttendeeInformations < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :events, :attendee_information, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210113033955_add_virtual_locations.rb: -------------------------------------------------------------------------------- 1 | class AddVirtualLocations < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :locations, :virtual, :boolean, default: false 4 | add_column :events, :remote_url, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/old_migrations/20101203111335_create_slugs.rb: -------------------------------------------------------------------------------- 1 | class CreateSlugs < ActiveRecord::Migration 2 | def self.up 3 | create_table :slugs do |t| 4 | t.string :name 5 | t.integer :sluggable_id 6 | t.integer :sequence, null: false, default: 1 7 | t.string :sluggable_type, limit: 40 8 | t.string :scope 9 | t.datetime :created_at 10 | end 11 | add_index :slugs, :sluggable_id 12 | add_index :slugs, %i[name sluggable_type sequence scope], name: 'index_slugs_on_n_s_s_and_s', unique: true 13 | end 14 | 15 | def self.down 16 | drop_table :slugs 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/old_migrations/20101203111406_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def self.up 3 | create_table(:users) do |t| 4 | t.string :nickname 5 | t.string :name 6 | t.string :image 7 | t.string :url 8 | t.string :location 9 | t.text :description 10 | 11 | t.timestamps 12 | end 13 | 14 | add_index :users, :nickname, unique: true 15 | end 16 | 17 | def self.down 18 | drop_table :users 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /db/old_migrations/20101206104512_create_locations.rb: -------------------------------------------------------------------------------- 1 | class CreateLocations < ActiveRecord::Migration 2 | def self.up 3 | create_table :locations do |t| 4 | t.string :name 5 | t.string :url 6 | t.string :street 7 | t.string :house_number 8 | t.string :city 9 | t.string :zip 10 | t.float :lat 11 | t.float :long 12 | 13 | t.timestamps 14 | end 15 | end 16 | 17 | def self.down 18 | drop_table :locations 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /db/old_migrations/20101206104730_create_events.rb: -------------------------------------------------------------------------------- 1 | class CreateEvents < ActiveRecord::Migration 2 | def self.up 3 | create_table :events do |t| 4 | t.string :name 5 | t.timestamp :date 6 | t.text :description 7 | t.references :location 8 | t.references :user 9 | 10 | t.timestamps 11 | end 12 | end 13 | 14 | def self.down 15 | drop_table :events 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/old_migrations/20101206142850_create_participants.rb: -------------------------------------------------------------------------------- 1 | class CreateParticipants < ActiveRecord::Migration 2 | def self.up 3 | create_table :participants do |t| 4 | t.references :user 5 | t.references :event 6 | t.boolean :maybe 7 | t.text :comment 8 | 9 | t.timestamps 10 | end 11 | end 12 | 13 | def self.down 14 | drop_table :participants 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/old_migrations/20101207100154_create_topics.rb: -------------------------------------------------------------------------------- 1 | class CreateTopics < ActiveRecord::Migration 2 | def self.up 3 | create_table :topics do |t| 4 | t.string :name 5 | t.text :description 6 | t.references :user 7 | t.references :event 8 | 9 | t.timestamps 10 | end 11 | end 12 | 13 | def self.down 14 | drop_table :topics 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/old_migrations/20101207100938_create_materials.rb: -------------------------------------------------------------------------------- 1 | class CreateMaterials < ActiveRecord::Migration 2 | def self.up 3 | create_table :materials do |t| 4 | t.string :name 5 | t.text :description 6 | t.string :url 7 | t.string :type 8 | t.references :user 9 | t.references :event 10 | 11 | t.timestamps 12 | end 13 | end 14 | 15 | def self.down 16 | drop_table :materials 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/old_migrations/20101207183555_create_authorizations.rb: -------------------------------------------------------------------------------- 1 | class CreateAuthorizations < ActiveRecord::Migration 2 | def self.up 3 | create_table :authorizations do |t| 4 | t.string :provider 5 | t.string :uid 6 | t.integer :user_id 7 | 8 | t.timestamps 9 | end 10 | end 11 | 12 | def self.down 13 | drop_table :authorizations 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/old_migrations/20101211133306_rename_type_to_material_type.rb: -------------------------------------------------------------------------------- 1 | class RenameTypeToMaterialType < ActiveRecord::Migration 2 | def self.up 3 | rename_column :materials, :type, :material_type 4 | end 5 | 6 | def self.down 7 | rename_column :materials, :material_type, :type 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20101217142810_create_histories_table.rb: -------------------------------------------------------------------------------- 1 | class CreateHistoriesTable < ActiveRecord::Migration 2 | def self.up 3 | create_table :histories do |t| 4 | t.string :message # title, name, or object_id 5 | t.string :username 6 | t.integer :item 7 | t.string :table 8 | t.integer :month, limit: 2 9 | t.integer :year, limit: 5 10 | t.timestamps 11 | end 12 | add_index(:histories, %i[item table month year], name: 'index_histories_on_item_and_date') 13 | end 14 | 15 | def self.down 16 | drop_table :histories 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/old_migrations/20110107171220_add_published_to_events.rb: -------------------------------------------------------------------------------- 1 | class AddPublishedToEvents < ActiveRecord::Migration 2 | def self.up 3 | add_column :events, :published, :boolean 4 | end 5 | 6 | def self.down 7 | remove_column :events, :published 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20110109130958_create_wishes.rb: -------------------------------------------------------------------------------- 1 | class CreateWishes < ActiveRecord::Migration 2 | def self.up 3 | create_table :wishes do |t| 4 | t.string :name 5 | t.text :description 6 | t.string :activity 7 | t.references :user 8 | 9 | t.timestamps 10 | end 11 | end 12 | 13 | def self.down 14 | drop_table :whishes 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/old_migrations/20110109131046_create_votes.rb: -------------------------------------------------------------------------------- 1 | class CreateVotes < ActiveRecord::Migration 2 | def self.up 3 | create_table :votes do |t| 4 | t.references :wish 5 | t.references :user 6 | t.integer :count 7 | t.text :comment 8 | 9 | t.timestamps 10 | end 11 | end 12 | 13 | def self.down 14 | drop_table :votes 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/old_migrations/20110116154325_add_github_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddGithubToUsers < ActiveRecord::Migration 2 | def self.up 3 | add_column :users, :github, :string 4 | end 5 | 6 | def self.down 7 | remove_column :users, :github 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20110120094315_add_admin_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddAdminToUsers < ActiveRecord::Migration 2 | def self.up 3 | add_column :users, :admin, :boolean 4 | end 5 | 6 | def self.down 7 | remove_column :users, :admin 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20110311115143_rename_histories_to_rails_admin_histories.rb: -------------------------------------------------------------------------------- 1 | class RenameHistoriesToRailsAdminHistories < ActiveRecord::Migration 2 | def self.up 3 | rename_table :histories, :rails_admin_histories 4 | end 5 | 6 | def self.down 7 | rename_table :rails_admin_histories, :histories 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20110630120848_create_admin_notes.rb: -------------------------------------------------------------------------------- 1 | class CreateAdminNotes < ActiveRecord::Migration 2 | def self.up 3 | create_table :admin_notes do |t| 4 | t.references :resource, polymorphic: true, null: false 5 | t.references :admin_user, polymorphic: true 6 | t.text :body 7 | t.timestamps 8 | end 9 | add_index :admin_notes, %i[resource_type resource_id] 10 | add_index :admin_notes, %i[admin_user_type admin_user_id] 11 | end 12 | 13 | def self.down 14 | drop_table :admin_notes 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/old_migrations/20110717092958_add_data_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddDataToUser < ActiveRecord::Migration 2 | def self.up 3 | add_column :users, :freelancer, :boolean 4 | add_column :users, :available, :boolean 5 | end 6 | 7 | def self.down 8 | remove_column :users, :available 9 | remove_column :users, :freelancer 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/old_migrations/20110721143350_remove_activity_from_wishes.rb: -------------------------------------------------------------------------------- 1 | class RemoveActivityFromWishes < ActiveRecord::Migration 2 | def self.up 3 | remove_column :wishes, :activity 4 | end 5 | 6 | def self.down 7 | add_column :wishes, :activity, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20110722114954_add_done_to_wishes.rb: -------------------------------------------------------------------------------- 1 | class AddDoneToWishes < ActiveRecord::Migration 2 | def self.up 3 | add_column :wishes, :done, :boolean, default: false 4 | end 5 | 6 | def self.down 7 | remove_column :wishes, :done 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20111006142134_delete_material_type_from_material.rb: -------------------------------------------------------------------------------- 1 | class DeleteMaterialTypeFromMaterial < ActiveRecord::Migration 2 | def up 3 | remove_column :materials, :material_type 4 | end 5 | 6 | def down 7 | add_column :materials, :done, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20120128121241_add_slugs.rb: -------------------------------------------------------------------------------- 1 | class AddSlugs < ActiveRecord::Migration 2 | def up 3 | %i[users events].each do |table| 4 | add_column table, :slug, :string 5 | add_index table, :slug, unique: true 6 | end 7 | end 8 | 9 | def down 10 | %i[users events].each do |table| 11 | remove_index table, :slug 12 | remove_column table, :slug 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/old_migrations/20120211123337_create_jobs.rb: -------------------------------------------------------------------------------- 1 | class CreateJobs < ActiveRecord::Migration 2 | def change 3 | create_table :jobs do |t| 4 | t.string :name 5 | t.string :url 6 | t.references :location 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/old_migrations/20120213173913_add_hide_jobs_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddHideJobsToUser < ActiveRecord::Migration 2 | def change 3 | add_column :users, :hide_jobs, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/old_migrations/20120224151318_create_highlights.rb: -------------------------------------------------------------------------------- 1 | class CreateHighlights < ActiveRecord::Migration 2 | def change 3 | create_table :highlights do |t| 4 | t.string :description 5 | t.string :url 6 | t.timestamp :start_at 7 | t.timestamp :end_at 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/old_migrations/20120604194617_add_labels.rb: -------------------------------------------------------------------------------- 1 | class AddLabels < ActiveRecord::Migration 2 | def change 3 | %i[events highlights jobs locations].each do |table| 4 | add_column table, :label, :string, default: 'hamburg' 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/old_migrations/20120918141950_add_slug_to_location.rb: -------------------------------------------------------------------------------- 1 | class AddSlugToLocation < ActiveRecord::Migration 2 | def change 3 | add_column Location, :slug, :string 4 | add_index Location, :slug, unique: true 5 | # Location.unscoped.all.map(&:save!) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/old_migrations/20121113191723_add_vote_cache_to_wish.rb: -------------------------------------------------------------------------------- 1 | class AddVoteCacheToWish < ActiveRecord::Migration 2 | def self.up 3 | add_column :wishes, :stars, :integer, default: 0 4 | end 5 | 6 | def self.down 7 | remove_column :wishes, :stars 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/old_migrations/20130111130456_add_twitter_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddTwitterToUser < ActiveRecord::Migration 2 | def change 3 | add_column User, :twitter, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/old_migrations/20130217113418_add_likes.rb: -------------------------------------------------------------------------------- 1 | class AddLikes < ActiveRecord::Migration 2 | def change 3 | create_table :likes do |t| 4 | t.references :user 5 | t.references :topic 6 | 7 | t.timestamps 8 | end 9 | 10 | add_column Topic, :label, :string, default: 'hamburg' 11 | add_column Topic, :slug, :string 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/old_migrations/20130228201117_remove_wishes_and_likes.rb: -------------------------------------------------------------------------------- 1 | class RemoveWishesAndLikes < ActiveRecord::Migration 2 | def change 3 | drop_table :wishes 4 | drop_table :votes 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/old_migrations/20130604012921_drop_table_rails_admin.rb: -------------------------------------------------------------------------------- 1 | class DropTableRailsAdmin < ActiveRecord::Migration 2 | def change 3 | remove_index :rails_admin_histories, :index_histories_on_item_and_table_and_month_and_year if index_exists? :rails_admin_histories, :index_histories_on_item_and_table_and_month_and_year 4 | drop_table :rails_admin_histories 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/old_migrations/20130804141702_add_emailto_users.rb: -------------------------------------------------------------------------------- 1 | class AddEmailtoUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :email, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/old_migrations/20130804145438_add_proposal_type_to_topics.rb: -------------------------------------------------------------------------------- 1 | class AddProposalTypeToTopics < ActiveRecord::Migration 2 | def change 3 | add_column :topics, :proposal_type, :string, default: 'proposal' 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/old_migrations/20131229124625_add_limit_to_events.rb: -------------------------------------------------------------------------------- 1 | class AddLimitToEvents < ActiveRecord::Migration 2 | def change 3 | add_column :events, :limit, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/old_migrations/20140504162938_add_super_admin_flag.rb: -------------------------------------------------------------------------------- 1 | class AddSuperAdminFlag < ActiveRecord::Migration 2 | def change 3 | add_column :users, :super_admin, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/old_migrations/20141129191015_add_wheelmap_ids_to_locations.rb: -------------------------------------------------------------------------------- 1 | class AddWheelmapIdsToLocations < ActiveRecord::Migration 2 | def change 3 | add_column :locations, :wheelmap_id, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/old_migrations/20150203222133_add_preview_fields_to_material.rb: -------------------------------------------------------------------------------- 1 | class AddPreviewFieldsToMaterial < ActiveRecord::Migration 2 | def change 3 | add_column :materials, :preview_type, :string 4 | add_column :materials, :preview_code, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/old_migrations/20160217231126_attach_material_to_topic.rb: -------------------------------------------------------------------------------- 1 | class AttachMaterialToTopic < ActiveRecord::Migration 2 | def change 3 | add_column :materials, :topic_id, :integer, index: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/old_migrations/20170918091427_remove_slugs.rb: -------------------------------------------------------------------------------- 1 | class RemoveSlugs < ActiveRecord::Migration 2 | def change 3 | remove_column Topic, :slug 4 | remove_column Event, :slug 5 | remove_column User, :slug 6 | remove_column Location, :slug 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | puts '*' * 100 2 | puts "The app runs without any data. If need example-data, grab it from heruko: 'heroku db:pull'" 3 | puts '*' * 100 4 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | postgres: 3 | image: postgres:14.12 4 | ports: 5 | - "5432:5432" 6 | environment: 7 | POSTGRES_PASSWORD: INSECURE_LOCAL_DEVELOPMENT_PASSWORD -------------------------------------------------------------------------------- /lib/omni_auth/strategies/email.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Based on https://github.com/weg-li/weg-li/blob/master/app/lib/omni_auth/strategies/email.rb 4 | # Original author: https://github.com/phoet 5 | 6 | require 'base64' 7 | 8 | module OmniAuth 9 | module Strategies 10 | class Email 11 | include OmniAuth::Strategy 12 | 13 | def request_phase 14 | redirect '/sessions/email' 15 | end 16 | 17 | def callback_phase 18 | token = request.params['token'] 19 | fail!(:authenticity_error) if token.blank? 20 | 21 | # Not catching the exception until this is more tested 22 | # This way we'll get it reported in AppSignal for diagnosing 23 | decoded_token = EmailAuthToken.decode(token) 24 | 25 | @email = decoded_token['iss'].to_s.downcase 26 | fail!(:authenticity_error) if @email.blank? 27 | 28 | super 29 | end 30 | 31 | uid { Digest::SHA256.new.hexdigest(@email) } 32 | 33 | info { { 'email' => @email } } 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/tasks/api.rake: -------------------------------------------------------------------------------- 1 | namespace :api do 2 | desc 'calls the api with given api-key' 3 | task :call, [:key] do |_task, args| 4 | key = args[:key] 5 | url = 'http://hamburg.onruby.de/api.json' 6 | cmd = "curl --header 'x-api-key: #{key}' #{url}" 7 | puts "executing: #{cmd}" 8 | pp JSON.parse(`#{cmd}`) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/tasks/data.rake: -------------------------------------------------------------------------------- 1 | namespace :data do 2 | desc 'creates test-data' 3 | task create: :setup do 4 | Whitelabel.each_label do 5 | 5.times { FactoryBot.create(:location) } 6 | 5.times { FactoryBot.create(:topic) } 7 | 5.times { FactoryBot.create(:event, date: rand(100).days.ago) } 8 | 5.times { FactoryBot.create(:participant) } 9 | end 10 | puts 'now open your browser at http://hamburg.onruby.localhost:3000/' 11 | end 12 | 13 | task setup: ['environment', 'db:migrate'] do 14 | require 'factory_bot' 15 | Dir[Rails.root.join('spec/support/factories/*.rb')].each { |f| require f } 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/tasks/scheduler.rake: -------------------------------------------------------------------------------- 1 | namespace :scheduler do 2 | desc 'update geocoding' 3 | task update_geocoding: :environment do 4 | with_tracking do 5 | puts 'updating all geocoding' 6 | Whitelabel.each_label do 7 | Location.all.each do |location| 8 | location.geocode 9 | location.save! 10 | sleep(1) # rate limiting 11 | end 12 | end 13 | end 14 | end 15 | 16 | desc 'update previews' 17 | task update_preview: :environment do 18 | with_tracking do 19 | puts 'updating previews' 20 | Whitelabel.each_label do 21 | Material.naked.each do |material| 22 | material.generate_preview 23 | sleep(1) # rate limiting 24 | end 25 | end 26 | end 27 | end 28 | 29 | private 30 | 31 | def with_tracking 32 | yield 33 | rescue StandardError => e 34 | ExceptionNotifier.notify_exception(e) if Rails.env.production? 35 | Rails.logger.error("exception during task invocation: #{e}\n#{e.backtrace.join("\n")}") 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /lib/templates/slim/scaffold/_form.html.slim: -------------------------------------------------------------------------------- 1 | = simple_form_for(@<%= singular_table_name %>) do |f| 2 | = f.error_notification 3 | = f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? 4 | 5 | .form-inputs 6 | <%- attributes.each do |attribute| -%> 7 | = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> 8 | <%- end -%> 9 | 10 | .form-actions 11 | = f.button :submit 12 | -------------------------------------------------------------------------------- /log/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/log/.gitkeep -------------------------------------------------------------------------------- /media/rughh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/media/rughh.png -------------------------------------------------------------------------------- /node_modules/.yarn-integrity: -------------------------------------------------------------------------------- 1 | { 2 | "systemParams": "darwin-x64-67", 3 | "modulesFolders": [ 4 | "node_modules" 5 | ], 6 | "flags": [], 7 | "linkedModules": [], 8 | "topLevelPatterns": [ 9 | "jquery-ujs@^1.2.2" 10 | ], 11 | "lockfileEntries": { 12 | "jquery-ujs@^1.2.2": "https://registry.yarnpkg.com/jquery-ujs/-/jquery-ujs-1.2.2.tgz#6a8ef1020e6b6dda385b90a4bddc128c21c56397", 13 | "jquery@>=1.8.0": "https://registry.yarnpkg.com/jquery/-/jquery-3.4.0.tgz#8de513fa0fa4b2c7d2e48a530e26f0596936efdf" 14 | }, 15 | "files": [], 16 | "artifacts": {} 17 | } -------------------------------------------------------------------------------- /node_modules/jquery-ujs/.npmignore: -------------------------------------------------------------------------------- 1 | script/ 2 | test/ 3 | Rakefile 4 | Gemfile* 5 | -------------------------------------------------------------------------------- /node_modules/jquery-ujs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | sudo: false 3 | cache: 4 | - bundler 5 | - directories: 6 | - $HOME/.npm 7 | script: ./script/cibuild 8 | before_install: 9 | - "npm install jshint -g" 10 | env: 11 | - JQUERY_VERSION: 1.8.0 12 | - JQUERY_VERSION: 1.8.1 13 | - JQUERY_VERSION: 1.8.2 14 | - JQUERY_VERSION: 1.8.3 15 | - JQUERY_VERSION: 1.9.0 16 | - JQUERY_VERSION: 1.9.1 17 | - JQUERY_VERSION: 1.10.0 18 | - JQUERY_VERSION: 1.10.1 19 | - JQUERY_VERSION: 1.10.2 20 | - JQUERY_VERSION: 1.11.0 21 | - JQUERY_VERSION: 1.11.1 22 | - JQUERY_VERSION: 1.11.2 23 | - JQUERY_VERSION: 1.12.0 24 | - JQUERY_VERSION: 2.0.0 25 | - JQUERY_VERSION: 2.1.0 26 | - JQUERY_VERSION: 2.1.1 27 | - JQUERY_VERSION: 2.1.2 28 | - JQUERY_VERSION: 2.1.3 29 | - JQUERY_VERSION: 2.2.0 30 | -------------------------------------------------------------------------------- /node_modules/jquery-ujs/RELEASE.md: -------------------------------------------------------------------------------- 1 | ## Releasing jquery-ujs 2 | 3 | ### Releasing to npm 4 | 5 | Make sure npm's configuration `sign-git-tag` is set to true. 6 | 7 | ``` 8 | npm config set sign-git-tag true 9 | ``` 10 | 11 | Release it to npm using the [npm version command](https://docs.npmjs.com/cli/version). Like: 12 | 13 | ``` 14 | npm version patch 15 | ``` 16 | 17 | This will: 18 | 19 | * Bump a patch version 20 | * Commit the change 21 | * Generate the tag 22 | * Push the commit and the tag to the repository 23 | * Publish the package in https://www.npmjs.com 24 | -------------------------------------------------------------------------------- /node_modules/jquery-ujs/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-ujs", 3 | "homepage": "https://github.com/rails/jquery-ujs", 4 | "authors": ["Stephen St. Martin", "Steve Schwartz"], 5 | "description": "Ruby on Rails unobtrusive scripting adapter for jQuery", 6 | "main": "src/rails.js", 7 | "license": "MIT", 8 | "dependencies": { 9 | "jquery": ">1.8.*" 10 | }, 11 | "ignore": [ 12 | "**/.*", 13 | "Gemfile*", 14 | "Rakefile", 15 | "bower_components", 16 | "script", 17 | "test" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/jquery-ujs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-ujs", 3 | "version": "1.2.2", 4 | "description": "Unobtrusive scripting adapter for jQuery", 5 | "main": "src/rails.js", 6 | "scripts": { 7 | "test": "echo \"See the wiki: https://github.com/rails/jquery-ujs/wiki/Running-Tests-and-Contributing\" && exit 1", 8 | "postversion": "git push && git push --tags && npm publish" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/rails/jquery-ujs.git" 13 | }, 14 | "author": [ 15 | "Stephen St. Martin", 16 | "Steve Schwartz" 17 | ], 18 | "license": "MIT", 19 | "bugs": { 20 | "url": "https://github.com/rails/jquery-ujs/issues" 21 | }, 22 | "homepage": "https://github.com/rails/jquery-ujs#readme", 23 | "dependencies": { 24 | "jquery": ">=1.8.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /node_modules/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ] 14 | } -------------------------------------------------------------------------------- /node_modules/jquery/src/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | 4 | "extends": "../.eslintrc-browser.json", 5 | 6 | "globals": { 7 | "jQuery": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /node_modules/jquery/src/ajax/parseXML.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | // Cross-browser xml parsing 8 | jQuery.parseXML = function( data ) { 9 | var xml; 10 | if ( !data || typeof data !== "string" ) { 11 | return null; 12 | } 13 | 14 | // Support: IE 9 - 11 only 15 | // IE throws on parseFromString with invalid input. 16 | try { 17 | xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 18 | } catch ( e ) { 19 | xml = undefined; 20 | } 21 | 22 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 23 | jQuery.error( "Invalid XML: " + data ); 24 | } 25 | return xml; 26 | }; 27 | 28 | return jQuery.parseXML; 29 | 30 | } ); 31 | -------------------------------------------------------------------------------- /node_modules/jquery/src/ajax/var/location.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return window.location; 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/ajax/var/nonce.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return Date.now(); 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/ajax/var/rquery.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /\?/ ); 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/attributes.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./attributes/attr", 4 | "./attributes/prop", 5 | "./attributes/classes", 6 | "./attributes/val" 7 | ], function( jQuery ) { 8 | 9 | "use strict"; 10 | 11 | // Return jQuery for attributes-only inclusion 12 | return jQuery; 13 | } ); 14 | -------------------------------------------------------------------------------- /node_modules/jquery/src/attributes/support.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/document", 3 | "../var/support" 4 | ], function( document, support ) { 5 | 6 | "use strict"; 7 | 8 | ( function() { 9 | var input = document.createElement( "input" ), 10 | select = document.createElement( "select" ), 11 | opt = select.appendChild( document.createElement( "option" ) ); 12 | 13 | input.type = "checkbox"; 14 | 15 | // Support: Android <=4.3 only 16 | // Default value for a checkbox should be "on" 17 | support.checkOn = input.value !== ""; 18 | 19 | // Support: IE <=11 only 20 | // Must access selectedIndex to make default options select 21 | support.optSelected = opt.selected; 22 | 23 | // Support: IE <=11 only 24 | // An input loses its value after becoming a radio 25 | input = document.createElement( "input" ); 26 | input.value = "t"; 27 | input.type = "radio"; 28 | support.radioValue = input.value === "t"; 29 | } )(); 30 | 31 | return support; 32 | 33 | } ); 34 | -------------------------------------------------------------------------------- /node_modules/jquery/src/core/camelCase.js: -------------------------------------------------------------------------------- 1 | define( [], function() { 2 | 3 | "use strict"; 4 | 5 | // Matches dashed string for camelizing 6 | var rmsPrefix = /^-ms-/, 7 | rdashAlpha = /-([a-z])/g; 8 | 9 | // Used by camelCase as callback to replace() 10 | function fcamelCase( all, letter ) { 11 | return letter.toUpperCase(); 12 | } 13 | 14 | // Convert dashed to camelCase; used by the css and data modules 15 | // Support: IE <=9 - 11, Edge 12 - 15 16 | // Microsoft forgot to hump their vendor prefix (#9572) 17 | function camelCase( string ) { 18 | return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 19 | } 20 | 21 | return camelCase; 22 | 23 | } ); 24 | -------------------------------------------------------------------------------- /node_modules/jquery/src/core/isAttached.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/documentElement", 4 | "../selector" // jQuery.contains 5 | ], function( jQuery, documentElement ) { 6 | "use strict"; 7 | 8 | var isAttached = function( elem ) { 9 | return jQuery.contains( elem.ownerDocument, elem ); 10 | }, 11 | composed = { composed: true }; 12 | 13 | // Check attachment across shadow DOM boundaries when possible (gh-3504) 14 | if ( documentElement.attachShadow ) { 15 | isAttached = function( elem ) { 16 | return jQuery.contains( elem.ownerDocument, elem ) || 17 | elem.getRootNode( composed ) === elem.ownerDocument; 18 | }; 19 | } 20 | 21 | return isAttached; 22 | } ); 23 | -------------------------------------------------------------------------------- /node_modules/jquery/src/core/nodeName.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | function nodeName( elem, name ) { 6 | 7 | return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 8 | 9 | }; 10 | 11 | return nodeName; 12 | 13 | } ); 14 | -------------------------------------------------------------------------------- /node_modules/jquery/src/core/readyException.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | jQuery.readyException = function( error ) { 8 | window.setTimeout( function() { 9 | throw error; 10 | } ); 11 | }; 12 | 13 | } ); 14 | -------------------------------------------------------------------------------- /node_modules/jquery/src/core/stripAndCollapse.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/rnothtmlwhite" 3 | ], function( rnothtmlwhite ) { 4 | "use strict"; 5 | 6 | // Strip and collapse whitespace according to HTML spec 7 | // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 8 | function stripAndCollapse( value ) { 9 | var tokens = value.match( rnothtmlwhite ) || []; 10 | return tokens.join( " " ); 11 | } 12 | 13 | return stripAndCollapse; 14 | } ); 15 | -------------------------------------------------------------------------------- /node_modules/jquery/src/core/support.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/document", 3 | "../var/support" 4 | ], function( document, support ) { 5 | 6 | "use strict"; 7 | 8 | // Support: Safari 8 only 9 | // In Safari 8 documents created via document.implementation.createHTMLDocument 10 | // collapse sibling forms: the second one becomes a child of the first one. 11 | // Because of that, this security measure has to be disabled in Safari 8. 12 | // https://bugs.webkit.org/show_bug.cgi?id=137337 13 | support.createHTMLDocument = ( function() { 14 | var body = document.implementation.createHTMLDocument( "" ).body; 15 | body.innerHTML = "
"; 16 | return body.childNodes.length === 2; 17 | } )(); 18 | 19 | return support; 20 | } ); 21 | -------------------------------------------------------------------------------- /node_modules/jquery/src/core/toType.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/class2type", 3 | "../var/toString" 4 | ], function( class2type, toString ) { 5 | 6 | "use strict"; 7 | 8 | function toType( obj ) { 9 | if ( obj == null ) { 10 | return obj + ""; 11 | } 12 | 13 | // Support: Android <=2.3 only (functionish RegExp) 14 | return typeof obj === "object" || typeof obj === "function" ? 15 | class2type[ toString.call( obj ) ] || "object" : 16 | typeof obj; 17 | } 18 | 19 | return toType; 20 | } ); 21 | -------------------------------------------------------------------------------- /node_modules/jquery/src/core/var/rsingleTag.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | // rsingleTag matches a string consisting of a single HTML element with no attributes 5 | // and captures the element's name 6 | return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/css/addGetHookIf.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | function addGetHookIf( conditionFn, hookFn ) { 6 | 7 | // Define the hook, we'll check on the first run if it's really needed. 8 | return { 9 | get: function() { 10 | if ( conditionFn() ) { 11 | 12 | // Hook not needed (or it's not possible to use it due 13 | // to missing dependency), remove it. 14 | delete this.get; 15 | return; 16 | } 17 | 18 | // Hook needed; redefine it so that the support test is not executed again. 19 | return ( this.get = hookFn ).apply( this, arguments ); 20 | } 21 | }; 22 | } 23 | 24 | return addGetHookIf; 25 | 26 | } ); 27 | -------------------------------------------------------------------------------- /node_modules/jquery/src/css/finalPropName.js: -------------------------------------------------------------------------------- 1 | define( [ "../var/document" ], function( document ) { 2 | 3 | "use strict"; 4 | 5 | var cssPrefixes = [ "Webkit", "Moz", "ms" ], 6 | emptyStyle = document.createElement( "div" ).style, 7 | vendorProps = {}; 8 | 9 | // Return a vendor-prefixed property or undefined 10 | function vendorPropName( name ) { 11 | 12 | // Check for vendor prefixed names 13 | var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 14 | i = cssPrefixes.length; 15 | 16 | while ( i-- ) { 17 | name = cssPrefixes[ i ] + capName; 18 | if ( name in emptyStyle ) { 19 | return name; 20 | } 21 | } 22 | } 23 | 24 | // Return a potentially-mapped jQuery.cssProps or vendor prefixed property 25 | function finalPropName( name ) { 26 | var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 27 | 28 | if ( final ) { 29 | return final; 30 | } 31 | if ( name in emptyStyle ) { 32 | return name; 33 | } 34 | return vendorProps[ name ] = vendorPropName( name ) || name; 35 | } 36 | 37 | return finalPropName; 38 | 39 | } ); 40 | -------------------------------------------------------------------------------- /node_modules/jquery/src/css/hiddenVisibleSelectors.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../selector" 4 | ], function( jQuery ) { 5 | 6 | "use strict"; 7 | 8 | jQuery.expr.pseudos.hidden = function( elem ) { 9 | return !jQuery.expr.pseudos.visible( elem ); 10 | }; 11 | jQuery.expr.pseudos.visible = function( elem ) { 12 | return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 13 | }; 14 | 15 | } ); 16 | -------------------------------------------------------------------------------- /node_modules/jquery/src/css/var/cssExpand.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return [ "Top", "Right", "Bottom", "Left" ]; 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/css/var/getStyles.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return function( elem ) { 5 | 6 | // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 7 | // IE throws on elements created in popups 8 | // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 9 | var view = elem.ownerDocument.defaultView; 10 | 11 | if ( !view || !view.opener ) { 12 | view = window; 13 | } 14 | 15 | return view.getComputedStyle( elem ); 16 | }; 17 | } ); 18 | -------------------------------------------------------------------------------- /node_modules/jquery/src/css/var/rboxStyle.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./cssExpand" 3 | ], function( cssExpand ) { 4 | "use strict"; 5 | 6 | return new RegExp( cssExpand.join( "|" ), "i" ); 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/css/var/rnumnonpx.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../../var/pnum" 3 | ], function( pnum ) { 4 | "use strict"; 5 | 6 | return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/css/var/swap.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | // A method for quickly swapping in/out CSS properties to get correct calculations. 6 | return function( elem, options, callback, args ) { 7 | var ret, name, 8 | old = {}; 9 | 10 | // Remember the old values, and insert the new ones 11 | for ( name in options ) { 12 | old[ name ] = elem.style[ name ]; 13 | elem.style[ name ] = options[ name ]; 14 | } 15 | 16 | ret = callback.apply( elem, args || [] ); 17 | 18 | // Revert the old values 19 | for ( name in options ) { 20 | elem.style[ name ] = old[ name ]; 21 | } 22 | 23 | return ret; 24 | }; 25 | 26 | } ); 27 | -------------------------------------------------------------------------------- /node_modules/jquery/src/data/var/acceptData.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | /** 6 | * Determines whether an object can have data 7 | */ 8 | return function( owner ) { 9 | 10 | // Accepts only: 11 | // - Node 12 | // - Node.ELEMENT_NODE 13 | // - Node.DOCUMENT_NODE 14 | // - Object 15 | // - Any 16 | return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 17 | }; 18 | 19 | } ); 20 | -------------------------------------------------------------------------------- /node_modules/jquery/src/data/var/dataPriv.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../Data" 3 | ], function( Data ) { 4 | "use strict"; 5 | 6 | return new Data(); 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/data/var/dataUser.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../Data" 3 | ], function( Data ) { 4 | "use strict"; 5 | 6 | return new Data(); 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/deferred/exceptionHook.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../deferred" 4 | ], function( jQuery ) { 5 | 6 | "use strict"; 7 | 8 | // These usually indicate a programmer mistake during development, 9 | // warn about them ASAP rather than swallowing them by default. 10 | var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 11 | 12 | jQuery.Deferred.exceptionHook = function( error, stack ) { 13 | 14 | // Support: IE 8 - 9 only 15 | // Console exists when dev tools are open, which can happen at any time 16 | if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 17 | window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 18 | } 19 | }; 20 | 21 | } ); 22 | -------------------------------------------------------------------------------- /node_modules/jquery/src/effects/animatedSelector.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../selector", 4 | "../effects" 5 | ], function( jQuery ) { 6 | 7 | "use strict"; 8 | 9 | jQuery.expr.pseudos.animated = function( elem ) { 10 | return jQuery.grep( jQuery.timers, function( fn ) { 11 | return elem === fn.elem; 12 | } ).length; 13 | }; 14 | 15 | } ); 16 | -------------------------------------------------------------------------------- /node_modules/jquery/src/event/ajax.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../event" 4 | ], function( jQuery ) { 5 | 6 | "use strict"; 7 | 8 | // Attach a bunch of functions for handling common AJAX events 9 | jQuery.each( [ 10 | "ajaxStart", 11 | "ajaxStop", 12 | "ajaxComplete", 13 | "ajaxError", 14 | "ajaxSuccess", 15 | "ajaxSend" 16 | ], function( i, type ) { 17 | jQuery.fn[ type ] = function( fn ) { 18 | return this.on( type, fn ); 19 | }; 20 | } ); 21 | 22 | } ); 23 | -------------------------------------------------------------------------------- /node_modules/jquery/src/event/alias.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | 4 | "../event", 5 | "./trigger" 6 | ], function( jQuery ) { 7 | 8 | "use strict"; 9 | 10 | jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + 11 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 12 | "change select submit keydown keypress keyup contextmenu" ).split( " " ), 13 | function( i, name ) { 14 | 15 | // Handle event binding 16 | jQuery.fn[ name ] = function( data, fn ) { 17 | return arguments.length > 0 ? 18 | this.on( name, null, data, fn ) : 19 | this.trigger( name ); 20 | }; 21 | } ); 22 | 23 | jQuery.fn.extend( { 24 | hover: function( fnOver, fnOut ) { 25 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 26 | } 27 | } ); 28 | 29 | } ); 30 | -------------------------------------------------------------------------------- /node_modules/jquery/src/event/support.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | "use strict"; 6 | 7 | support.focusin = "onfocusin" in window; 8 | 9 | return support; 10 | 11 | } ); 12 | -------------------------------------------------------------------------------- /node_modules/jquery/src/exports/global.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery, noGlobal ) { 4 | 5 | "use strict"; 6 | 7 | var 8 | 9 | // Map over jQuery in case of overwrite 10 | _jQuery = window.jQuery, 11 | 12 | // Map over the $ in case of overwrite 13 | _$ = window.$; 14 | 15 | jQuery.noConflict = function( deep ) { 16 | if ( window.$ === jQuery ) { 17 | window.$ = _$; 18 | } 19 | 20 | if ( deep && window.jQuery === jQuery ) { 21 | window.jQuery = _jQuery; 22 | } 23 | 24 | return jQuery; 25 | }; 26 | 27 | // Expose jQuery and $ identifiers, even in AMD 28 | // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 29 | // and CommonJS for browser emulators (#13566) 30 | if ( !noGlobal ) { 31 | window.jQuery = window.$ = jQuery; 32 | } 33 | 34 | } ); 35 | -------------------------------------------------------------------------------- /node_modules/jquery/src/jquery.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./selector", 4 | "./traversing", 5 | "./callbacks", 6 | "./deferred", 7 | "./deferred/exceptionHook", 8 | "./core/ready", 9 | "./data", 10 | "./queue", 11 | "./queue/delay", 12 | "./attributes", 13 | "./event", 14 | "./event/focusin", 15 | "./manipulation", 16 | "./manipulation/_evalUrl", 17 | "./wrap", 18 | "./css", 19 | "./css/hiddenVisibleSelectors", 20 | "./serialize", 21 | "./ajax", 22 | "./ajax/xhr", 23 | "./ajax/script", 24 | "./ajax/jsonp", 25 | "./ajax/load", 26 | "./event/ajax", 27 | "./effects", 28 | "./effects/animatedSelector", 29 | "./offset", 30 | "./dimensions", 31 | "./deprecated", 32 | "./exports/amd", 33 | "./exports/global" 34 | ], function( jQuery ) { 35 | 36 | "use strict"; 37 | 38 | return jQuery; 39 | 40 | } ); 41 | -------------------------------------------------------------------------------- /node_modules/jquery/src/manipulation/_evalUrl.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../ajax" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | jQuery._evalUrl = function( url, options ) { 8 | return jQuery.ajax( { 9 | url: url, 10 | 11 | // Make this explicit, since user can override this through ajaxSetup (#11264) 12 | type: "GET", 13 | dataType: "script", 14 | cache: true, 15 | async: false, 16 | global: false, 17 | 18 | // Only evaluate the response if it is successful (gh-4126) 19 | // dataFilter is not invoked for failure responses, so using it instead 20 | // of the default converter is kludgy but it works. 21 | converters: { 22 | "text script": function() {} 23 | }, 24 | dataFilter: function( response ) { 25 | jQuery.globalEval( response, options ); 26 | } 27 | } ); 28 | }; 29 | 30 | return jQuery._evalUrl; 31 | 32 | } ); 33 | -------------------------------------------------------------------------------- /node_modules/jquery/src/manipulation/getAll.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../core/nodeName" 4 | ], function( jQuery, nodeName ) { 5 | 6 | "use strict"; 7 | 8 | function getAll( context, tag ) { 9 | 10 | // Support: IE <=9 - 11 only 11 | // Use typeof to avoid zero-argument method invocation on host objects (#15151) 12 | var ret; 13 | 14 | if ( typeof context.getElementsByTagName !== "undefined" ) { 15 | ret = context.getElementsByTagName( tag || "*" ); 16 | 17 | } else if ( typeof context.querySelectorAll !== "undefined" ) { 18 | ret = context.querySelectorAll( tag || "*" ); 19 | 20 | } else { 21 | ret = []; 22 | } 23 | 24 | if ( tag === undefined || tag && nodeName( context, tag ) ) { 25 | return jQuery.merge( [ context ], ret ); 26 | } 27 | 28 | return ret; 29 | } 30 | 31 | return getAll; 32 | } ); 33 | -------------------------------------------------------------------------------- /node_modules/jquery/src/manipulation/setGlobalEval.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../data/var/dataPriv" 3 | ], function( dataPriv ) { 4 | 5 | "use strict"; 6 | 7 | // Mark scripts as having already been evaluated 8 | function setGlobalEval( elems, refElements ) { 9 | var i = 0, 10 | l = elems.length; 11 | 12 | for ( ; i < l; i++ ) { 13 | dataPriv.set( 14 | elems[ i ], 15 | "globalEval", 16 | !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 17 | ); 18 | } 19 | } 20 | 21 | return setGlobalEval; 22 | } ); 23 | -------------------------------------------------------------------------------- /node_modules/jquery/src/manipulation/var/rscriptType.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /^$|^module$|\/(?:java|ecma)script/i ); 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/manipulation/var/rtagName.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | // rtagName captures the name from the first start tag in a string of HTML 5 | // https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state 6 | // https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state 7 | return ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 8 | } ); 9 | -------------------------------------------------------------------------------- /node_modules/jquery/src/manipulation/wrapMap.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | // We have to close these tags to support XHTML (#13200) 6 | var wrapMap = { 7 | 8 | // Support: IE <=9 only 9 | option: [ 1, "" ], 10 | 11 | // XHTML parsers do not magically insert elements in the 12 | // same way that tag soup parsers do. So we cannot shorten 13 | // this by omitting or other required elements. 14 | thead: [ 1, "", "
" ], 15 | col: [ 2, "", "
" ], 16 | tr: [ 2, "", "
" ], 17 | td: [ 3, "", "
" ], 18 | 19 | _default: [ 0, "", "" ] 20 | }; 21 | 22 | // Support: IE <=9 only 23 | wrapMap.optgroup = wrapMap.option; 24 | 25 | wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 26 | wrapMap.th = wrapMap.td; 27 | 28 | return wrapMap; 29 | } ); 30 | -------------------------------------------------------------------------------- /node_modules/jquery/src/queue/delay.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../queue", 4 | "../effects" // Delay is optional because of this dependency 5 | ], function( jQuery ) { 6 | 7 | "use strict"; 8 | 9 | // Based off of the plugin by Clint Helfers, with permission. 10 | // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 11 | jQuery.fn.delay = function( time, type ) { 12 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 13 | type = type || "fx"; 14 | 15 | return this.queue( type, function( next, hooks ) { 16 | var timeout = window.setTimeout( next, time ); 17 | hooks.stop = function() { 18 | window.clearTimeout( timeout ); 19 | }; 20 | } ); 21 | }; 22 | 23 | return jQuery.fn.delay; 24 | } ); 25 | -------------------------------------------------------------------------------- /node_modules/jquery/src/selector-sizzle.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "../external/sizzle/dist/sizzle" 4 | ], function( jQuery, Sizzle ) { 5 | 6 | "use strict"; 7 | 8 | jQuery.find = Sizzle; 9 | jQuery.expr = Sizzle.selectors; 10 | 11 | // Deprecated 12 | jQuery.expr[ ":" ] = jQuery.expr.pseudos; 13 | jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 14 | jQuery.text = Sizzle.getText; 15 | jQuery.isXMLDoc = Sizzle.isXML; 16 | jQuery.contains = Sizzle.contains; 17 | jQuery.escapeSelector = Sizzle.escape; 18 | 19 | } ); 20 | -------------------------------------------------------------------------------- /node_modules/jquery/src/selector.js: -------------------------------------------------------------------------------- 1 | define( [ "./selector-sizzle" ], function() { 2 | "use strict"; 3 | } ); 4 | -------------------------------------------------------------------------------- /node_modules/jquery/src/traversing/var/dir.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | return function( elem, dir, until ) { 8 | var matched = [], 9 | truncate = until !== undefined; 10 | 11 | while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 12 | if ( elem.nodeType === 1 ) { 13 | if ( truncate && jQuery( elem ).is( until ) ) { 14 | break; 15 | } 16 | matched.push( elem ); 17 | } 18 | } 19 | return matched; 20 | }; 21 | 22 | } ); 23 | -------------------------------------------------------------------------------- /node_modules/jquery/src/traversing/var/rneedsContext.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../../core", 3 | "../../selector" 4 | ], function( jQuery ) { 5 | "use strict"; 6 | 7 | return jQuery.expr.match.needsContext; 8 | } ); 9 | -------------------------------------------------------------------------------- /node_modules/jquery/src/traversing/var/siblings.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | return function( n, elem ) { 6 | var matched = []; 7 | 8 | for ( ; n; n = n.nextSibling ) { 9 | if ( n.nodeType === 1 && n !== elem ) { 10 | matched.push( n ); 11 | } 12 | } 13 | 14 | return matched; 15 | }; 16 | 17 | } ); 18 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/ObjectFunctionString.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./fnToString" 3 | ], function( fnToString ) { 4 | "use strict"; 5 | 6 | return fnToString.call( Object ); 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/arr.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return []; 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/class2type.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | // [[Class]] -> type pairs 5 | return {}; 6 | } ); 7 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/concat.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./arr" 3 | ], function( arr ) { 4 | "use strict"; 5 | 6 | return arr.concat; 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/document.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return window.document; 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/documentElement.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./document" 3 | ], function( document ) { 4 | "use strict"; 5 | 6 | return document.documentElement; 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/fnToString.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./hasOwn" 3 | ], function( hasOwn ) { 4 | "use strict"; 5 | 6 | return hasOwn.toString; 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/getProto.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return Object.getPrototypeOf; 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/hasOwn.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./class2type" 3 | ], function( class2type ) { 4 | "use strict"; 5 | 6 | return class2type.hasOwnProperty; 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/indexOf.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./arr" 3 | ], function( arr ) { 4 | "use strict"; 5 | 6 | return arr.indexOf; 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/isFunction.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return function isFunction( obj ) { 5 | 6 | // Support: Chrome <=57, Firefox <=52 7 | // In some browsers, typeof returns "function" for HTML elements 8 | // (i.e., `typeof document.createElement( "object" ) === "function"`). 9 | // We don't want to classify *any* DOM node as a function. 10 | return typeof obj === "function" && typeof obj.nodeType !== "number"; 11 | }; 12 | 13 | } ); 14 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/isWindow.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return function isWindow( obj ) { 5 | return obj != null && obj === obj.window; 6 | }; 7 | 8 | } ); 9 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/pnum.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/push.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./arr" 3 | ], function( arr ) { 4 | "use strict"; 5 | 6 | return arr.push; 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/rcheckableType.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /^(?:checkbox|radio)$/i ); 5 | } ); 6 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/rcssNum.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/pnum" 3 | ], function( pnum ) { 4 | 5 | "use strict"; 6 | 7 | return new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 8 | 9 | } ); 10 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/rnothtmlwhite.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | // Only count HTML whitespace 5 | // Other whitespace should count in values 6 | // https://infra.spec.whatwg.org/#ascii-whitespace 7 | return ( /[^\x20\t\r\n\f]+/g ); 8 | } ); 9 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/slice.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./arr" 3 | ], function( arr ) { 4 | "use strict"; 5 | 6 | return arr.slice; 7 | } ); 8 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/support.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | // All support tests are defined in their respective modules. 5 | return {}; 6 | } ); 7 | -------------------------------------------------------------------------------- /node_modules/jquery/src/var/toString.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./class2type" 3 | ], function( class2type ) { 4 | "use strict"; 5 | 6 | return class2type.toString; 7 | } ); 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "on_ruby", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "repository": "git@github.com:phoet/on_ruby.git", 6 | "author": "phoet ", 7 | "license": "MIT", 8 | "dependencies": { 9 | "jquery-ujs": "^1.2.3" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | 4 | RewriteCond %{THE_REQUEST} ^(GET|HEAD) 5 | RewriteCond %{REQUEST_URI} ^(.*)$ 6 | RewriteCond %{DOCUMENT_ROOT}/cache/$1.html -f 7 | RewriteRule ^(.*)$ /cache/$1.html 8 | 9 | 10 | 11 | ExpiresActive On 12 | ExpiresDefault "access plus 1 year" 13 | 14 | 15 | FileETag None 16 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The page you were looking for doesn't exist.

23 |

You may have mistyped the address or the page may have moved.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The change you wanted was rejected.

23 |

Maybe you tried to change something you didn't have access to.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

We're sorry, but something went wrong.

23 |

We've been notified about this issue and we'll take a look at it shortly.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/public/favicon.ico -------------------------------------------------------------------------------- /public/google8ebf7c850429421c.html: -------------------------------------------------------------------------------- 1 | google-site-verification: google8ebf7c850429421c.html -------------------------------------------------------------------------------- /public/images/labels/cologne/gem-glas-full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/public/images/labels/cologne/gem-glas-full.png -------------------------------------------------------------------------------- /public/images/labels/cologne/gem-glas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/public/images/labels/cologne/gem-glas.png -------------------------------------------------------------------------------- /public/images/labels/cologne/golden_ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rughh/on_ruby/fd902033a06acbb535b5114dfbb40a39f1ec7ba3/public/images/labels/cologne/golden_ruby.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.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: /admin/* 6 | Disallow: /auth/* 7 | -------------------------------------------------------------------------------- /script/ci/run: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | set -e 3 | 4 | bundle exec rubocop --config .rubocop.yml 5 | bundle exec rake 6 | -------------------------------------------------------------------------------- /script/ci/setup: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | set -e 3 | 4 | if [[ `psql -U postgres -tAc "SELECT 1 FROM pg_database WHERE datname='onruby_test'"` == "1" ]] 5 | then 6 | echo "Database already exists" 7 | else 8 | psql -U postgres -tAc 'create database onruby_test;' 9 | fi 10 | 11 | 12 | RAILS_ENV=test bundle exec rake db:test:prepare 13 | -------------------------------------------------------------------------------- /script/in_docker: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$DOCKER_HOST" ]; then 4 | docker-compose run web $@ 5 | else 6 | sudo docker-compose run web $@ 7 | fi 8 | -------------------------------------------------------------------------------- /script/request-time: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | FORMAT = <<-FORMAT 4 | time_namelookup: %{time_namelookup} 5 | time_connect: %{time_connect} 6 | time_appconnect: %{time_appconnect} 7 | time_pretransfer: %{time_pretransfer} 8 | time_redirect: %{time_redirect} 9 | time_starttransfer: %{time_starttransfer} 10 | ---------- 11 | time_total: %{time_total} 12 | FORMAT 13 | 14 | url = ARGV[0] || 'http://hamburg.onruby.de' 15 | 16 | puts "request-time of '#{url}'" 17 | puts `curl -w "#{FORMAT}" -s -o /dev/null "#{url}"` 18 | -------------------------------------------------------------------------------- /script/server: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | export HOR_API_KEY=HOR_API_KEY_TEST 4 | export SECRET_TOKEN=SECRET_TOKEN_TEST_b7c7374eb0285b87c0c1c61c2c5401b9f92dd59209713801743202c 5 | export RACK_ENV=development 6 | export TWITTER_CONSUMER_KEY=oJ2y2wLAcoQdIMyWGJxusA 7 | export TWITTER_CONSUMER_SECRET=kscsfZrdkqqv8KZQ0HFiDOiTDFGJbqerb5i9oIVa6s 8 | export OMNIAUTH_GITHUB_RUGB_TEST_KEY=f859969acc060c3f1e41 9 | export OMNIAUTH_GITHUB_RUGB_TEST_SECRET=93d2f12e662e79f23d8aa9cf8bd271bfd1462db7 10 | export OMNIAUTH_GITHUB_ONRUBY_TEST_KEY=40476a2d1961166b313d 11 | export OMNIAUTH_GITHUB_ONRUBY_TEST_SECRET=631246927040210ff8d21f7d734c291f7b8b8dcf 12 | 13 | bundle check || bundle install 14 | 15 | bin/rails server -b 0.0.0.0 16 | -------------------------------------------------------------------------------- /spec/controllers/admin/events_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Admin::EventsController do 4 | render_views 5 | 6 | let(:user) { build(:admin_user) } 7 | 8 | context 'with logged-in user' do 9 | before do 10 | allow(controller).to receive_messages(current_user: user) 11 | end 12 | 13 | context 'GET :index' do 14 | it 'assign the events and renders the template' do 15 | create(:event) 16 | 17 | get :index 18 | 19 | expect(response).to render_template(:index) 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/controllers/admin/users_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Admin::UsersController do 4 | render_views 5 | 6 | before { set_subdomain } 7 | 8 | let(:user) { build(:admin_user) } 9 | let!(:event) do 10 | Whitelabel.with_label(Whitelabel.labels.first) do 11 | create(:event_with_participants) 12 | end 13 | end 14 | let!(:other_event) do 15 | Whitelabel.with_label(Whitelabel.labels.last) do 16 | create(:event_with_participants) 17 | end 18 | end 19 | 20 | context 'with logged-in user' do 21 | before do 22 | allow(controller).to receive_messages(current_user: user) 23 | end 24 | 25 | context 'GET :index' do 26 | it 'assign the users and renders the template' do 27 | get :index 28 | 29 | expect(response).to render_template(:index) 30 | expect(response.body).to include(event.participants.first.user.nickname) 31 | expect(response.body).not_to include(other_event.participants.first.user.nickname) 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /spec/controllers/home_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe HomeController do 4 | context 'subdomains' do 5 | before { set_subdomain } 6 | 7 | context 'GET :index' do 8 | it 'renders the :index template' do 9 | get :index 10 | expect(response).to render_template(:index) 11 | end 12 | end 13 | end 14 | 15 | context 'custom domains' do 16 | before { set_custom_domain } 17 | 18 | context 'GET :index' do 19 | it 'renders the :index template' do 20 | get :index 21 | expect(response).to render_template(:index) 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /spec/controllers/labels_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe LabelsController do 4 | context 'GET :index' do 5 | it 'renders the :index template' do 6 | get :index 7 | expect(response).to render_template(:index) 8 | end 9 | 10 | it 'renders the :index template for mobile devices' do 11 | get :index 12 | expect(response).to render_template(:index) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/controllers/locations_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe LocationsController do 4 | context 'GET :index' do 5 | it 'renders the :index template' do 6 | get :index 7 | expect(response).to render_template(:index) 8 | end 9 | end 10 | 11 | context 'GET :show' do 12 | let(:location) { create(:location) } 13 | 14 | it 'renders the :show template' do 15 | get :show, params: { id: location } 16 | 17 | expect(controller.location).to eql(location) 18 | expect(response).to render_template(:show) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/controllers/sitemaps_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe SitemapsController do 4 | context 'GET :show' do 5 | it 'renders a sitemap' do 6 | get :show, params: { id: 'hamburg', format: :xml } 7 | expect(response).to render_template(:show) 8 | expect(response.headers['Content-Type']).to eql('application/xml; charset=utf-8') 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/controllers/super_admin/events_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe SuperAdmin::EventsController do 4 | render_views 5 | 6 | let(:user) { build(:admin_user) } 7 | 8 | context 'with logged-in user' do 9 | before do 10 | allow(controller).to receive_messages(current_user: user) 11 | end 12 | 13 | context 'GET :index' do 14 | it 'assign the events and renders the template' do 15 | create(:event) 16 | 17 | get :index 18 | 19 | expect(response).to render_template(:index) 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/controllers/super_admin/users_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe SuperAdmin::UsersController do 4 | render_views 5 | 6 | before { set_subdomain } 7 | 8 | let(:user) { build(:admin_user) } 9 | let!(:event) do 10 | Whitelabel.with_label(Whitelabel.labels.first) do 11 | create(:event_with_participants) 12 | end 13 | end 14 | let!(:other_event) do 15 | Whitelabel.with_label(Whitelabel.labels.last) do 16 | create(:event_with_participants) 17 | end 18 | end 19 | 20 | context 'with logged-in user' do 21 | before do 22 | allow(controller).to receive_messages(current_user: user) 23 | end 24 | 25 | context 'GET :index' do 26 | it 'assign the users and renders the template' do 27 | get :index 28 | 29 | expect(response).to render_template(:index) 30 | expect(response.body).to include(event.participants.first.user.nickname) 31 | expect(response.body).to include(other_event.participants.first.user.nickname) 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /spec/helpers/application_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe ApplicationHelper do 4 | context 'markdown' do 5 | it 'underlines' do 6 | expect(helper.markdown('*underline*')).to match('underline') 7 | end 8 | 9 | it 'autolinks' do 10 | expect(helper.markdown('auto http://href.org')).to match('auto http://href.org') 11 | end 12 | 13 | it 'escapes html tags' do 14 | expect(helper.markdown('')) 15 | .to include('<script>alert("xss");</script>') 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/helpers/events_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe EventsHelper do 4 | let(:event) { create(:event) } 5 | let(:participant) { create(:participant, user: event.user) } 6 | let(:participation_event) { create(:event, participants: [participant]) } 7 | 8 | context 'signed_in user' do 9 | before do 10 | allow(helper).to receive_messages(signed_in?: true, current_user: event.user) 11 | end 12 | 13 | describe '#participation_link' do 14 | it 'renders a paritcipate button' do 15 | expect(helper.participation_link(event)).to match('Teilnehmen') 16 | end 17 | 18 | it 'disbales the button on closed events' do 19 | event = build(:closed_event) 20 | expect(helper.participation_link(event)).to match('data-disable') 21 | end 22 | 23 | it 'renders a cancel button' do 24 | expect(helper.participation_link(participation_event)).to match('Absagen') 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /spec/helpers/ical_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe IcalHelper do 4 | let(:event) { build(:event, id: 123, name: 'awesome ottawa', date: '11.11.2011 19:00 +02:00') } 5 | 6 | it 'creates a valid icalendar event' do 7 | helper.icalendar(event).to_s.tap do |it| 8 | expect(it).to match('http://test.host/events/awesome-ottawa-123') 9 | expect(it).to match('SUMMARY:awesome ottawa') 10 | expect(it).to match('DTSTART:20111111T170000Z') 11 | end 12 | end 13 | 14 | it 'handles events with no location' do 15 | event.location = nil 16 | helper.icalendar(event).to_s.tap do |it| 17 | expect(it).to match('BEGIN:VCALENDAR') 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /spec/helpers/map_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe MapHelper do 4 | describe '#link_to_github' do 5 | it 'generates the link' do 6 | location = build(:location, lat: 12, long: 11) 7 | expect(helper.static_map(location)).to eql('http://maps.googleapis.com/maps/api/staticmap?zoom=12&sensor=false&key=AIzaSyBskJCTxAU9UbH3qijy46oNtZ1-4ad14PM&markers=12.0,11.0') 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/helpers/sitemaps_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe SitemapsHelper do 4 | let(:sitemap_urls) { ['http://hamburg.test.host/events/tesssstooo-999', 'http://hamburg.test.host/locations/blau-mobilfunk-gmbh-999', 'http://hamburg.test.host/'] } 5 | 6 | it 'returns the right urls' do 7 | location = create(:location, id: 999, name: 'blau mobilfunk gmbh') 8 | create(:event, name: 'tesssstooo', id: 999, label: 'hamburg', location:) 9 | expect(helper.urls).to eql(sitemap_urls) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/helpers/title_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe TitleHelper do 4 | describe '#page_title' do 5 | it 'generates a page_title' do 6 | expect(helper.page_title).to eql('Hamburg on Ruby - Heimathafen der Hamburger Ruby Community') 7 | end 8 | 9 | it 'generates a page_title for a user page' do 10 | allow(helper).to receive_messages(controller_name: 'users', action_name: 'show', user: build(:user, name: 'uschi')) 11 | 12 | expect(helper.page_title).to eql('Hamburg on Ruby - uschi') 13 | end 14 | 15 | it 'has a page_title for default label' do 16 | Whitelabel.reset! 17 | 18 | expect(helper.page_title).to eql('OnRuby - Die Ruby und Rails Usergroup Plattform - Ruby / Rails Communities Deutschland') 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/helpers/topics_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe TopicsHelper do 4 | let(:topic) { build(:topic, id: 123) } 5 | 6 | describe '#like_link' do 7 | context 'with logged-in user' do 8 | let(:user) { build(:user) } 9 | 10 | before do 11 | allow(helper).to receive_messages(signed_in?: true, current_user: user) 12 | end 13 | 14 | it 'shows a button for liking a topic' do 15 | expect(helper.like_link(topic)).to match('gefällt mir') 16 | end 17 | 18 | it 'shows a button for un-liking a topic' do 19 | create(:like, user:, topic:) 20 | 21 | expect(helper.like_link(topic)).to match('gefällt nicht') 22 | end 23 | 24 | it 'shows an eidt button for the owner' do 25 | topic.update!(user:) 26 | 27 | expect(helper.like_link(topic)).to match('bearbeiten') 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /spec/lib/sponsor_images_present_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'Sponsors' do 4 | Whitelabel.labels.each do |label| 5 | describe "for '#{label.label_id}'" do 6 | label.sponsors&.each do |sponsor| 7 | specify sponsor[:banner] do 8 | expect(Rails.root.join('app/assets/images/labels').join(label.label_id).join('sponsors').join(sponsor[:banner])).to be_exist 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/lib/whitelabel_detection_middleware_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'whitelabel_detection_middleware' 3 | 4 | describe WhitelabelDetectionMiddleware do 5 | subject(:middleware) { described_class.new(dummy_app) } 6 | 7 | let(:dummy_app) { ->(_env) { response } } 8 | let(:host) { 'localhost' } 9 | let(:rack_env) { { 'HTTP_HOST' => host } } 10 | let(:response) { [418, { 'Content-Type' => 'text/plain' }, ['418 No coffee here.']] } 11 | 12 | before { middleware.call(rack_env) } 13 | 14 | { 15 | 'hamburg.onruby.de' => 'hamburg', 16 | 'onruby.eu' => 'hamburg', 17 | 'dresdenrb.onruby.de' => 'dresdenrb', 18 | 'tallinn.ruby.ee' => 'tallinn_rug', 19 | 'www.rug-b.de' => 'berlin', 20 | }.each do |host, label| 21 | context "with host '#{host}'" do 22 | let(:host) { host } 23 | 24 | it "uses Whitelabel '#{label}'" do 25 | expect(Whitelabel[:label_id]).to eq(label) 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /spec/lib/whitelabel_translation_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe WhitelabelTranslation do 4 | describe '#tw' do 5 | it 'translates in scope of a whitelabel' do 6 | expect(I18n.tw('title')).to eql('Hamburg on Ruby') 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/mailers/usergroup_mailer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe UsergroupMailer do 4 | let(:event) { create(:event) } 5 | 6 | context 'sending a mail' do 7 | it 'sends the mail' do 8 | email = UsergroupMailer.invitation_mail(event).deliver_now 9 | expect(ActionMailer::Base.deliveries).not_to be_empty 10 | 11 | expect(email.to).to eql(['rubyonrails-ug-germany@googlegroups.com']) 12 | expect(email.subject).to match(event.name) 13 | expect(email.encoded).to match(%r{

#{event.name}

}) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/models/highlight_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Highlight do 4 | let(:highlight) { build(:highlight) } 5 | let(:active_highlight) { build(:highlight, start_at: Date.tomorrow, end_at: 2.days.since) } 6 | 7 | it 'is valid' do 8 | expect(highlight).to be_valid 9 | end 10 | 11 | it 'is active' do 12 | expect(active_highlight).not_to be_disabled 13 | end 14 | 15 | it 'disables a highlight' do 16 | active_highlight.disable! 17 | expect(active_highlight).to be_disabled 18 | end 19 | 20 | context 'finder' do 21 | before do 22 | active_highlight.save! 23 | end 24 | 25 | it 'finds the active highlight' do 26 | expect(Highlight.active).to have(1).elements 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /spec/models/job_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Job do 4 | subject { Job.new } 5 | 6 | it 'validates presence' do 7 | expect(subject).to have(1).errors_on(:name) 8 | expect(subject).to have(1).errors_on(:url) 9 | expect(subject).to have(2).errors_on(:location) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/models/like_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Like do 4 | let(:like) { create(:like) } 5 | 6 | context 'validation' do 7 | it 'is valid' do 8 | expect(like).to be_valid 9 | end 10 | 11 | it 'validates presence' do 12 | Like.new.tap do |it| 13 | expect(it).to have(2).errors_on(:user) 14 | expect(it).to have(2).errors_on(:topic) 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/models/participant_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Participant do 4 | it 'validates presence' do 5 | expect(subject).to have(2).errors_on(:event) 6 | expect(subject).to have(2).errors_on(:user) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/requests/api_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'Api' do 4 | before do 5 | ENV['HOR_API_KEY'] = 'bla' 6 | end 7 | 8 | context 'authorization' do 9 | it 'redirects and have status not_authorized' do 10 | get api_path(format: :json), headers: { 'x-api-key' => '' } 11 | 12 | expect(response.status).to be(401) 13 | expect(response.body).to be_empty 14 | end 15 | 16 | it 'renders json with valid api-key' do 17 | get api_path(format: :json), headers: { 'x-api-key' => ENV['HOR_API_KEY'] } 18 | 19 | expect(response).to be_ok 20 | expect(JSON.parse(response.body).keys).to eql(%w[topics locations events users]) 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/requests/events_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'Events' do 4 | let(:event) { create(:event) } 5 | 6 | context 'GET /events.json' do 7 | it 'renders valid json' do 8 | get event_path(event, format: :json) 9 | json = JSON.parse(response.body) 10 | expect(json['name']).to eql(event.name) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/requests/labels_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'Labels' do 4 | context 'GET /' do 5 | before do 6 | host! 'www.onruby.test' 7 | end 8 | 9 | it 'works!' do 10 | get '/' 11 | expect(response).to be_ok 12 | end 13 | 14 | it 'also works for mobile devices' do 15 | get '/?mobile=1' 16 | expect(response).to be_ok 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/requests/sitemaps_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe SitemapsController do 4 | context 'GET :show' do 5 | before do 6 | create(:participant_user, id: 999, nickname: 'uschi') 7 | end 8 | 9 | it 'renders a sitemap' do 10 | get sitemap_path(id: 'hamburg', format: :xml) 11 | expect(response.body).to match('http://hamburg.onruby.test/') 12 | expect(response.body).to match('http://hamburg.onruby.test/users/uschi-999') 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/routing/main_domain_constraint_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe MainDomainConstraint do 4 | it 'matches the right domain' do 5 | ['www.onruby.de', 'www.onruby.test', 'www.onruby.org', 'www.onruby.co'].each do |host| 6 | request = OpenStruct.new(host:) 7 | expect(subject.matches?(request)).to be_truthy 8 | end 9 | ['onruby.de', 'www.rug-b.de'].each do |host| 10 | request = OpenStruct.new(host:) 11 | expect(subject.matches?(request)).to be_falsey 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/support/factories/events.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :event do 3 | name { Faker::Lorem.words(number: 6).join } 4 | date { rand(3).days.from_now } 5 | description { Faker::Lorem.sentences(number: 3).join } 6 | attendee_information { Faker::Lorem.sentences(number: 3).join } 7 | remote_url { Faker::Internet.url } 8 | association :location, strategy: :build 9 | association :user, strategy: :build 10 | created_at { Time.now.utc } 11 | updated_at { Time.now.utc } 12 | end 13 | 14 | factory :event_with_participants, parent: :event do 15 | after(:create) { |event| create_list(:participant, 3, event:) } 16 | end 17 | 18 | factory :full_event, parent: :event_with_participants do 19 | after(:create) do |event| 20 | event.participants << create(:participant) 21 | event.materials << create(:material) 22 | event.topics << create(:topic) 23 | end 24 | end 25 | 26 | factory :closed_event, parent: :event do 27 | limit { 0 } 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /spec/support/factories/highlights.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :highlight do 3 | description { Faker::Lorem.words(number: 6).join } 4 | url { Faker::Internet.url } 5 | start_at { Date.tomorrow } 6 | end_at { rand(5).days.from_now } 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/support/factories/jobs.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :job do 3 | name { Faker::Name.name } 4 | url { Faker::Internet.url } 5 | association :location, strategy: :build 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/support/factories/likes.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :like do 3 | association :topic, strategy: :build 4 | association :user, strategy: :build 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/support/factories/locations.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :location do 3 | label { 'hamburg' } 4 | name { Faker::Name.name } 5 | url { Faker::Internet.url } 6 | street { Faker::Address.street_name } 7 | house_number { Faker::Address.street_suffix } 8 | city { Faker::Address.city } 9 | zip { Faker::Address.zip_code } 10 | lat { "53.5#{rand(1000)}".to_f } 11 | long { "9.9#{rand(1000)}".to_f } 12 | virtual { false } 13 | end 14 | 15 | factory :virtual_location, class: Location do 16 | label { 'hamburg' } 17 | name { Faker::Name.name } 18 | url { Faker::Internet.url } 19 | virtual { true } 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/support/factories/materials.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :material do 3 | event 4 | user 5 | topic 6 | name { Faker::Lorem.words(number: 5).join } 7 | url { Faker::Internet.url } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/support/factories/participants.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :participant do 3 | association :user, strategy: :build 4 | association :event, strategy: :build 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/support/factories/topics.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :proposal, class: :topic do 3 | user 4 | name { Faker::Lorem.words(number: 5).join } 5 | description { Faker::Lorem.sentences(number: 3).join } 6 | proposal_type { 'proposal' } 7 | end 8 | 9 | factory :topic, parent: :proposal do 10 | event 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/support/factories/users.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :user do 3 | name { Faker::Name.name } 4 | nickname { Faker::Name.name.downcase.tr(' ', '_') } 5 | github { Faker::Name.name.gsub(/\W/, '-') } 6 | twitter { Faker::Name.name.gsub(/\W/, '-') } 7 | email { Faker::Internet.email } 8 | image { 'http://www.onruby.de/assets/labels/hamburg.png' } 9 | end 10 | 11 | factory :admin_user, parent: :user do 12 | admin { true } 13 | super_admin { true } 14 | end 15 | 16 | factory :organizer_user, parent: :user do 17 | after(:create) { |user| create(:event, user:) } 18 | end 19 | 20 | factory :participant_user, parent: :user do 21 | after(:create) { |user| create_list(:participant, 1, user:) } 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/support/geocoder_helper.rb: -------------------------------------------------------------------------------- 1 | module GeocoderHelper 2 | def stub_geocoder 3 | Geocoder.configure(lookup: :test) 4 | Geocoder::Lookup::Test.set_default_stub( 5 | [ 6 | { 7 | 'coordinates' => [45.1891676, 5.6997775], 8 | 'address' => '8 Avenue Aristide Briand, 38600 Fontaine, France', 9 | 'state' => 'Rhone-Alpes', 10 | 'state_code' => 'RA', 11 | 'country' => 'France', 12 | 'country_code' => 'FR', 13 | } 14 | ] 15 | ) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/support/kaminari_helper.rb: -------------------------------------------------------------------------------- 1 | module KaminariHelper 2 | def paged(*items) 3 | Kaminari.paginate_array(Array(items)).page(0).per(25) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/support/online_helper.rb: -------------------------------------------------------------------------------- 1 | module OnlineHelper 2 | def online? 3 | @_online = ping if @_online.nil? 4 | @_online 5 | end 6 | 7 | private 8 | 9 | def ping 10 | Timeout.timeout(5) do 11 | s = TCPSocket.new('www.google.com', 80) 12 | s.close 13 | end 14 | true 15 | rescue StandardError 16 | false 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/support/request_helper.rb: -------------------------------------------------------------------------------- 1 | module RequestHelper 2 | def set_referer(referer = root_url) 3 | @request.env['HTTP_REFERER'] = referer 4 | end 5 | 6 | def set_subdomain(subdomain = 'hamburg') 7 | @request.host = "#{subdomain}.onruby.test" 8 | end 9 | 10 | def set_custom_domain(domain = 'www.rug-b.de') 11 | @request.host = domain 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/events/index.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'events/index' do 4 | let(:event) { build(:event, id: 123) } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(events: paged(event)) 8 | 9 | render 10 | 11 | expect(rendered).to include(event.name) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/events/index.xml_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'events/index' do 4 | let(:events) { Array.new(3) { build(:event, id: 123) } } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(events:) 8 | render 9 | 10 | expect(rendered).to include(events.first.name) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/views/events/show.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'events/show' do 4 | let(:user) { build(:user, id: 456) } 5 | let(:event) { build(:event, id: 123) } 6 | 7 | it 'renders successfully' do 8 | allow(view).to receive_messages(signed_in?: true, current_user: user, event:, likes: '') 9 | view.lookup_context.prefixes = %w[events application] 10 | 11 | expect(rendered).not_to be_nil 12 | end 13 | 14 | context 'materials' do 15 | let(:materials) { [build(:material)] } 16 | 17 | it 'renders without an error' do 18 | render partial: 'materials', locals: { materials: } 19 | 20 | expect(rendered).not_to be_nil 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/views/home/index.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'home/index' do 4 | let(:event) { build(:event, id: 123) } 5 | let(:user) { build(:user, id: 123) } 6 | let(:location) { build(:location) } 7 | let(:topic) { build(:topic) } 8 | let(:company) { build(:location, company: true) } 9 | let(:zoom) { rand(1..20) } 10 | 11 | it 'renders successfully' do 12 | allow(view).to receive_messages(events: [event], current_event: event, people: [user]) 13 | allow(view).to receive_messages(locations: [location], done_topics: [topic]) 14 | allow(view).to receive_messages(undone_topics: [topic], organizers: [user], upcoming_topics: [topic]) 15 | allow(view).to receive_messages(companies: [company], main_user: user, signed_in?: false) 16 | allow(view).to receive_messages(zoom:) 17 | 18 | render 19 | 20 | expect(rendered).to include(event.name) 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/views/labels/index.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'labels/index' do 4 | it 'renders successfully' do 5 | Whitelabel.reset! 6 | 7 | render 8 | 9 | expect(rendered).to include(Whitelabel.labels.select(&:enabled?).first.label_id) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/views/locations/index.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'locations/index' do 4 | let(:locations) { [build(:location)] } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(locations:) 8 | 9 | render 10 | 11 | expect(rendered).to include(locations.first.name) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/locations/none.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'locations/none' do 4 | let!(:organizers) { [build(:user, id: 123)] } 5 | let(:stats) { { participants: 10, topics: 2 } } 6 | 7 | it 'renders successfully' do 8 | %w[en de].each do |locale| 9 | I18n.with_locale(locale) do 10 | allow(view).to receive_messages(organizers:, stats:) 11 | render 12 | 13 | expect(rendered).to include(organizers.first.name) 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/views/locations/show.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'locations/show' do 4 | let(:location) { build(:location) } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(location:) 8 | view.lookup_context.prefixes = %w[locations application] 9 | 10 | render 11 | 12 | expect(rendered).to include(location.name) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/views/sitemaps/show.xml_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'sitemaps/show' do 4 | let(:example_urls) { %w[url1 url2] } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(urls: example_urls) 8 | 9 | render 10 | 11 | expect(rendered).to include(example_urls.first) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/topics/edit.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'topics/edit' do 4 | let(:topic) { build(:topic) } 5 | let(:user) { build(:user) } 6 | 7 | it 'renders successfully' do 8 | allow(view).to receive_messages(current_user: user, topic:, undone_topics: [topic]) 9 | 10 | render 11 | 12 | expect(rendered).to include(topic.name) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/views/topics/index.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'topics/index' do 4 | let(:event) { build(:event) } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(events: paged(event)) 8 | 9 | render 10 | 11 | expect(rendered).to include(event.name) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/topics/new.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'topics/new' do 4 | let(:topic) { Topic.new } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(signed_in?: true, topic:, undone_topics: [topic]) 8 | 9 | render 10 | 11 | expect(rendered).to include(topic.name.to_s) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/topics/show.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'topics/show' do 4 | let(:topic) { build(:topic, user: build(:user, id: 123)) } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(topic:, signed_in?: false) 8 | 9 | render 10 | 11 | expect(rendered).to include(topic.name) 12 | end 13 | 14 | context 'materials' do 15 | let(:materials) { [build(:material)] } 16 | 17 | it 'renders without an error' do 18 | render partial: 'materials', locals: { materials: } 19 | 20 | expect(rendered).to include(materials.first.name) 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/views/users/edit.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'users/edit' do 4 | let(:user) { build(:user, id: 123) } 5 | 6 | it 'renders successfully' do 7 | allow(view).to receive_messages(current_user: user, user:) 8 | 9 | render 10 | 11 | expect(rendered).to include(user.name) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/users/show.html_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'users/show' do 4 | let(:user) { build(:user, id: 123) } 5 | let(:dom) { Nokogiri::HTML(rendered) } 6 | 7 | before { allow(view).to receive_messages(current_user: user, user:) } 8 | 9 | it 'renders successfully' do 10 | render 11 | 12 | expect(dom.at_css('.card .card-body .card-title').inner_text).to include(user.nickname) 13 | end 14 | 15 | context 'when user was just created through email OTP' do 16 | let(:user) { User.create_from_hash!(EMAIL_AUTH_HASH) } 17 | 18 | it 'hides nickname' do 19 | render 20 | 21 | expect(dom.at_css('.card .card-body .card-title').inner_text).not_to include(user.nickname) 22 | end 23 | 24 | it 'shows name placeholder', :aggregate_failures do 25 | render 26 | 27 | expect(dom.at_css('.card .card-body .card-title').inner_text).not_to include(user.name) 28 | expect(dom.at_css('.card .card-body .card-title').inner_text).to include('-') 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | jquery-ujs@^1.2.3: 6 | version "1.2.3" 7 | resolved "https://registry.yarnpkg.com/jquery-ujs/-/jquery-ujs-1.2.3.tgz#dcac6026ab7268e5ee41faf9d31c997cd4ddd603" 8 | integrity sha512-59wvfx5vcCTHMeQT1/OwFiAj+UffLIwjRIoXdpO7Z7BCFGepzq9T9oLVeoItjTqjoXfUrHJvV7QU6pUR+UzOoA== 9 | --------------------------------------------------------------------------------