├── .github ├── ISSUE_TEMPLATE │ ├── gelistirme_istegi.md │ └── hata_bildirimi.md ├── pull_request_template.md └── workflows │ └── test.yml ├── .gitignore ├── .rubocop.yml ├── .ruby-version ├── .tool-versions ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── Guardfile ├── LICENSE ├── Procfile ├── README.md ├── Rakefile ├── app ├── admin │ ├── admin_user.rb │ ├── announcement.rb │ ├── company.rb │ ├── dashboard.rb │ ├── job.rb │ └── user.rb ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ ├── .keep │ │ ├── friendlyrb.png │ │ ├── image.png │ │ └── ruby-logo@2x.png │ ├── javascripts │ │ ├── active_admin.js.coffee │ │ ├── application.coffee │ │ └── pages.coffee │ └── stylesheets │ │ ├── _animate.min.css │ │ ├── _config.scss │ │ ├── _flexiblegs.min.css │ │ ├── _normalize.css │ │ ├── active_admin.scss │ │ ├── application.scss │ │ └── pages.scss ├── controllers │ ├── application_controller.rb │ ├── callbacks_controller.rb │ ├── companies_controller.rb │ ├── concerns │ │ └── .keep │ ├── pages_controller.rb │ ├── users │ │ ├── registrations_controller.rb │ │ └── sessions_controller.rb │ └── users_controller.rb ├── helpers │ ├── application_helper.rb │ └── users_helper.rb ├── jobs │ └── application_job.rb ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── admin_user.rb │ ├── announcement.rb │ ├── application_record.rb │ ├── company.rb │ ├── concerns │ │ └── .keep │ ├── job.rb │ └── user.rb └── views │ ├── companies │ ├── index.html.erb │ └── new.html.erb │ ├── devise │ └── registrations │ │ └── edit.html.erb │ ├── layouts │ └── application.html.erb │ ├── pages │ ├── events.html.erb │ ├── irc.html.erb │ └── main.html.erb │ ├── shared │ ├── _footer.html.erb │ ├── _github_ribbon.html │ ├── _header.html.erb │ └── _notice.erb │ └── users │ ├── _user.html.erb │ ├── index.html.erb │ └── new.html.erb ├── bin ├── bundle ├── bundler ├── coderay ├── erubis ├── rackup ├── rails ├── rake ├── rspec ├── sass ├── sass-convert ├── scss ├── setup ├── sprockets ├── thin ├── thor ├── tilt ├── tt ├── update └── yarn ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── active_admin.rb │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── content_security_policy.rb │ ├── cookies_serializer.rb │ ├── devise.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── new_framework_defaults_5_1.rb │ ├── new_framework_defaults_6_1.rb │ ├── new_framework_defaults_7_0.rb │ ├── permissions_policy.rb │ ├── raven.rb │ ├── secret_token.rb │ ├── session_store.rb │ ├── simple_form.rb │ └── wrap_parameters.rb ├── locales │ ├── devise.en.yml │ ├── devise.tr.yml │ ├── en.yml │ ├── kaminari.en.yml │ ├── kaminari.tr.yml │ ├── simple_form.en.yml │ └── tr.yml ├── puma.rb ├── routes.rb ├── secrets.yml ├── spring.rb └── storage.yml ├── db ├── migrate │ ├── 20131213201929_create_people.rb │ ├── 20131213211058_add_gravatar_url_to_people.rb │ ├── 20151018192124_devise_create_admin_users.rb │ ├── 20151018192129_create_active_admin_comments.rb │ ├── 20151018193729_create_jobs.rb │ ├── 20160402211614_add_published_to_jobs.rb │ ├── 20161201130752_rename_people_to_users.rb │ ├── 20161202180219_add_devise_and_omniauth_fields_to_users.rb │ ├── 20170509000632_create_companies.rb │ ├── 20170509001158_add_published_field_to_companies.rb │ ├── 20170920095950_create_announcements.rb │ ├── 20170922084456_change_user_to_admin_user_in_announcement.rb │ ├── 20170928090543_add_user_id_to_companies.rb │ ├── 20210402184528_fix_active_admin_comments_index_name.rb │ ├── 20220613161552_add_service_name_to_active_storage_blobs.active_storage.rb │ ├── 20220613161553_create_active_storage_variant_records.active_storage.rb │ └── 20220613161554_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep ├── tasks │ └── .keep └── templates │ └── erb │ └── scaffold │ └── _form.html.erb ├── log └── .keep ├── public ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico ├── robots.txt └── ruby_turkiye.png ├── spec ├── controllers │ ├── callbacks_controller_spec.rb │ ├── companies_controller_spec.rb │ ├── pages_controller_spec.rb │ ├── users │ │ ├── registrations_controller_spec.rb │ │ └── sessions_controller_spec.rb │ └── users_controller_spec.rb ├── factories │ ├── admin_users.rb │ ├── announcements.rb │ ├── companies.rb │ └── user.rb ├── helpers │ └── users_helper_spec.rb ├── models │ ├── admin_user_spec.rb │ ├── announcement_spec.rb │ ├── company_spec.rb │ └── user_spec.rb └── spec_helper.rb └── vendor └── assets ├── javascripts ├── .keep └── bootstrap.min.js └── stylesheets └── .keep /.github/ISSUE_TEMPLATE/gelistirme_istegi.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Geliştirme İsteği 3 | about: Geliştirilmesi için bir istekte bulun 4 | title: "[GELİŞTİRME] - (Burayı doldurunuz)" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **İsteğiniz bir problem ile mi alakalı? Lütfen açıklayınız.** 11 | Kısa ve öz bir şekilde problemi açıklayınız. Örneğin: 'Şirketler sayfasını her açtığımda..' 12 | 13 | **Olası çözüm önerilerinizi paylaşın** 14 | Çözümü siz gerçekleştiriyor olsaydınız, ne yapmayı planlardınız. 15 | 16 | **Düşündüğünüz alternatif yolları paylaşın** 17 | Aklınıza gelen alternatif çözümleri paylaşın. 18 | 19 | **Ek açıklamalar** 20 | Yukarıda bulunan konu başlıklarına uymayan ama paylaşılması gereken tüm başlıkları buraya ekleyin. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/hata_bildirimi.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Hata Bildirimi 3 | about: Düzeltilmesi için hata bildiriminde bulun 4 | title: "[HATA] - (Burayı doldurunuz)" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Hatanın tarifi 11 | Kısa ve öz bir şekilde bulduğunuz hatayı açıklayın. 12 | 13 | **Tekrarlamak için ne yapmalıyız?** 14 | Tekrarlamak için yapılacaklar: 15 | 1. Hedef url adresine gidilir ```/companies/new``` 16 | 2. Butona basılır ```'Yeni bir şirket ekle'``` 17 | 3. Açılan modalda butona basılır ```'Ekle'``` 18 | 4. Hata ekrana düşecektir 19 | 20 | **Olması gereken** 21 | Kısa ve öz bir şekilde ne olması gerektiğini açıklayın. 22 | 23 | **Ekran görüntüleri** 24 | Eğer probleminiz için uygunsa ekran görüntülerini buraya kopyalayın. 25 | 26 | **Ek açıklamalar** 27 | Yukarıda bulunan konu başlıklarına uymayan ama paylaşılması gereken tüm başlıkları buraya ekleyin. 28 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Bağlantılı olduğu issue 2 | 3 | Resolves #001 4 | 5 | ### Kontrol listesi 6 | 7 | * [ ] Kendi yazdığım kodun özdeğerlendirmesini yaptım 8 | * [ ] Gerekliyse anlaşılması zor olan yerleri yorum ekleyerek açıkladım 9 | * [ ] Gerekliyse `README.md` dosyası ve dokümanlarda gerekli değişiklikleri yaptım 10 | * [ ] Yazdığım kodun veya düzelttiğim hatanın testlerini ekledim 11 | * [ ] `bundle exec rake` komutunu çalıştırdım ve tüm testlerim geçti 12 | * [ ] `rubocop` komutunu çalıştırdım ve hiç bir hata almadım 13 | * [ ] Eğer PR'ım yazımı hala devam ediyorsa başlıkta 'WIP' olarak belirttim veya draft PR olarak açtım[draft PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests) 14 | * [ ] Yaptığım değişiklikleri anlamlı olacak bütünlükte ve ayrı ayrı commitledim. 15 | 16 | ### Açıklama 17 | 18 | 26 | 27 | ### Değişiklik tipi 28 | 29 | 30 | 31 | * Hata düzeltme (uygulamada çok fazla değişikliğe yol açmayan sadece hata çözen değişiklik) 32 | * Yeni geliştirme (uygulamada daha önce olmayan bir özellik ekleyen değişiklik) 33 | * Kırılmaya sebep olan değişiklik (uygulamanın başka kısımlarında istemsiz değişikliklere sebebiyet veren değişiklik) 34 | * Dokümanlar ile alakalı değişiklik 35 | 36 | ### Bu PR için hangi testler yazıldı? Ve bu testlerin olası beklenen sonuçları nelerdir? 37 | 38 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | # 1. Run on every push 4 | # 2. Show commit title 5 | on: 6 | push: 7 | branches: 8 | - main 9 | pull_request: 10 | 11 | jobs: 12 | Rubocop: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | 18 | - name: Install system dependencies 19 | run: sudo apt-get update && sudo apt-get -yqq install libsqlite3-dev sqlite3 20 | 21 | - name: Set up ruby 22 | uses: ruby/setup-ruby@v1 23 | with: 24 | ruby-version: 3.2.1 25 | bundler-cache: true 26 | 27 | - name: Run 28 | run: bundle exec rubocop 29 | 30 | Rspec: 31 | runs-on: ubuntu-latest 32 | 33 | steps: 34 | - uses: actions/checkout@v2 35 | 36 | - name: Install system dependencies 37 | run: sudo apt-get update && sudo apt-get -yqq install libsqlite3-dev sqlite3 38 | 39 | - name: Set up ruby 40 | uses: ruby/setup-ruby@v1 41 | with: 42 | ruby-version: 3.2.1 43 | bundler-cache: true 44 | 45 | - name: Prepare test database 46 | run: bundle exec rails db:test:prepare 47 | 48 | - name: Run 49 | run: bundle exec rspec 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/*.log 16 | /tmp 17 | .DS_Store 18 | .idea/ 19 | .generators 20 | .rspec 21 | vendor/bundle 22 | .rbenv-vars 23 | 24 | # Simplecov coverage files 25 | /coverage 26 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | Exclude: 3 | - 'bin/*' 4 | - 'config/**/*' 5 | - 'db/**/*' 6 | - 'spec/spec_helper.rb' 7 | - 'tmp/**/*' 8 | - 'vendor/**/*' 9 | - 'Guardfile' 10 | NewCops: enable 11 | SuggestExtensions: false 12 | Layout/LineLength: 13 | Max: 100 14 | Metrics/BlockLength: 15 | IgnoredMethods: ['describe', 'context', 'feature'] 16 | Metrics/MethodLength: 17 | Max: 15 18 | Style/AsciiComments: 19 | Enabled: false 20 | Style/Documentation: 21 | Enabled: false 22 | Style/FrozenStringLiteralComment: 23 | Enabled: false 24 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.2.1 2 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | ruby 3.0.4 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Katkıda Bulunma 2 | 3 | Eğer herhangi bir hata bulduysanız veya bir geliştirme isteğiniz varsa lütfen 4 | önce [bildirimde][1] bulununuz. Bildirimde bulunacağınız konu üzerinde halihazırda 5 | çalışan veya çalışmış kişiler olabilir ya da topluluk içinde konuşulup karara bağlanmış ve 6 | yapılmayacak bir talepte bulunuyor olabilirsiniz. 7 | 8 | ## Ana esaslar 9 | 10 | * Daha önce pek fazla Git ve açık kaynak tecrübeniz yok ise okumanızı tavsiye ederiz. [Git üzerinde basit işlemler ve açık kaynak koda nasıl katkı sağlarım][2] (İngilizce kaynak). 11 | * Projeyi forklayın. 12 | * [RVM](https://rvm.io/rvm/install) ya da [rbenv](https://github.com/rbenv/rbenv#installation) kullanarak `ruby@2.6.6` versiyonunu bilgisayarınıza yükleyin. 13 | * Proje dizinine gelerek `bundle install` komutunu çalıştırın ve gerekli ruby kütüphanelerini yükleyin. 14 | * `rails db:create:all` ve `rails db:migrate RAILS_ENV=development` ve `rails db:migrate RAILS_ENV=test` komutlarını çalıştırarak veritabanlarını ve tabloları oluşturun. 15 | * [Anlamlı commit mesajları][3] (İngilizce kaynak) yazın. 16 | * Uygulama içerisinde takip edilmiş standartları uygulayın. 17 | * Yaptığınız değişiklik içinize sinene kadar göndermeyin. 18 | * Yaptığınız her değişiklik için (çok ufak bile olsa) test eklemeyi unutmayın. 19 | * PR açmadan önce yazdığınız ve var olan testlerin geçtiğinden emin olmak için `bundle exec rspec` komutunu çalıştırın. 20 | * Yaptığınız değişikliklerin RuboCop hatası fırlatmadığından emin olmak için `bundle exec rubocop` komutunu çalıştırın. 21 | * Birbirleri ile alakalı commitleri [Squash ederek PR açın][4] (İngilizce kaynak). 22 | 23 | [1]: https://github.com/rubytr/ruby-tr/issues 24 | [2]: https://www.gun.io/blog/how-to-github-fork-branch-and-pull-request 25 | [3]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 26 | [4]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html 27 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | ruby '~> 3.2.1' 4 | 5 | # core 6 | gem 'puma' 7 | gem 'rails', '~> 7.0.4.3' 8 | 9 | # assets 10 | gem 'bootstrap-sass', '>= 3.4.1' 11 | gem 'bootswatch-rails' 12 | gem 'coffee-rails', '~> 5.0' 13 | gem 'font_awesome5_rails' 14 | gem 'jbuilder', '~> 2.10' 15 | gem 'jquery-datatables-rails', '~> 3.4.0' 16 | gem 'jquery-rails', '~> 4.4' 17 | gem 'jquery-rails-cdn' 18 | gem 'sass-rails', '~> 6.0.0' 19 | gem 'turbolinks' 20 | gem 'uglifier', '>= 1.3.0' 21 | 22 | # rest 23 | gem 'activeadmin', '~> 2.4' 24 | gem 'devise' 25 | gem 'gravatar-ultimate', '~> 2.0.0' 26 | gem 'kaminari' 27 | gem 'kramdown', require: false 28 | gem 'omniauth' 29 | gem 'omniauth-github' 30 | gem 'omniauth-rails_csrf_protection' 31 | gem 'sentry-raven', '~> 3.0' 32 | gem 'simple_form' 33 | gem 'slack-notifier' 34 | gem 'sprockets-rails', '2.3.3' 35 | gem 'xmlrpc' 36 | 37 | group :production do 38 | gem 'pg' 39 | gem 'rails_12factor', '~> 0.0.2' 40 | end 41 | 42 | group :development, :test do 43 | gem 'database_cleaner' 44 | gem 'factory_bot_rails' 45 | gem 'faker', require: false 46 | gem 'guard' 47 | gem 'guard-rubocop', require: false 48 | gem 'guard-spork' 49 | gem 'rails-controller-testing' 50 | gem 'rspec-rails' 51 | gem 'shoulda' 52 | gem 'simplecov', require: false 53 | gem 'spork', '~> 1.0rc' 54 | gem 'sqlite3', '~> 1.4' 55 | gem 'webmock' 56 | end 57 | 58 | group :development do 59 | gem 'binding_of_caller', git: 'https://github.com/walski/binding_of_caller.git', branch: 'ruby-3' 60 | gem 'rubocop' 61 | gem 'spring' 62 | end 63 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/walski/binding_of_caller.git 3 | revision: e8f99e518fe70d8d81c681aa4d826432d316912a 4 | branch: ruby-3 5 | specs: 6 | binding_of_caller (0.8.0) 7 | debug_inspector (>= 0.0.1) 8 | 9 | GEM 10 | remote: https://rubygems.org/ 11 | specs: 12 | actioncable (7.0.4.3) 13 | actionpack (= 7.0.4.3) 14 | activesupport (= 7.0.4.3) 15 | nio4r (~> 2.0) 16 | websocket-driver (>= 0.6.1) 17 | actionmailbox (7.0.4.3) 18 | actionpack (= 7.0.4.3) 19 | activejob (= 7.0.4.3) 20 | activerecord (= 7.0.4.3) 21 | activestorage (= 7.0.4.3) 22 | activesupport (= 7.0.4.3) 23 | mail (>= 2.7.1) 24 | net-imap 25 | net-pop 26 | net-smtp 27 | actionmailer (7.0.4.3) 28 | actionpack (= 7.0.4.3) 29 | actionview (= 7.0.4.3) 30 | activejob (= 7.0.4.3) 31 | activesupport (= 7.0.4.3) 32 | mail (~> 2.5, >= 2.5.4) 33 | net-imap 34 | net-pop 35 | net-smtp 36 | rails-dom-testing (~> 2.0) 37 | actionpack (7.0.4.3) 38 | actionview (= 7.0.4.3) 39 | activesupport (= 7.0.4.3) 40 | rack (~> 2.0, >= 2.2.0) 41 | rack-test (>= 0.6.3) 42 | rails-dom-testing (~> 2.0) 43 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 44 | actiontext (7.0.4.3) 45 | actionpack (= 7.0.4.3) 46 | activerecord (= 7.0.4.3) 47 | activestorage (= 7.0.4.3) 48 | activesupport (= 7.0.4.3) 49 | globalid (>= 0.6.0) 50 | nokogiri (>= 1.8.5) 51 | actionview (7.0.4.3) 52 | activesupport (= 7.0.4.3) 53 | builder (~> 3.1) 54 | erubi (~> 1.4) 55 | rails-dom-testing (~> 2.0) 56 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 57 | activeadmin (2.14.0) 58 | arbre (~> 1.2, >= 1.2.1) 59 | formtastic (>= 3.1, < 5.0) 60 | formtastic_i18n (~> 0.4) 61 | inherited_resources (~> 1.7) 62 | jquery-rails (~> 4.2) 63 | kaminari (~> 1.0, >= 1.2.1) 64 | railties (>= 6.1, < 7.1) 65 | ransack (>= 2.1.1, < 4) 66 | activejob (7.0.4.3) 67 | activesupport (= 7.0.4.3) 68 | globalid (>= 0.3.6) 69 | activemodel (7.0.4.3) 70 | activesupport (= 7.0.4.3) 71 | activerecord (7.0.4.3) 72 | activemodel (= 7.0.4.3) 73 | activesupport (= 7.0.4.3) 74 | activestorage (7.0.4.3) 75 | actionpack (= 7.0.4.3) 76 | activejob (= 7.0.4.3) 77 | activerecord (= 7.0.4.3) 78 | activesupport (= 7.0.4.3) 79 | marcel (~> 1.0) 80 | mini_mime (>= 1.1.0) 81 | activesupport (7.0.4.3) 82 | concurrent-ruby (~> 1.0, >= 1.0.2) 83 | i18n (>= 1.6, < 2) 84 | minitest (>= 5.1) 85 | tzinfo (~> 2.0) 86 | addressable (2.8.6) 87 | public_suffix (>= 2.0.2, < 6.0) 88 | arbre (1.7.0) 89 | activesupport (>= 3.0.0) 90 | ruby2_keywords (>= 0.0.2) 91 | ast (2.4.2) 92 | autoprefixer-rails (10.4.16.0) 93 | execjs (~> 2) 94 | base64 (0.2.0) 95 | bcrypt (3.1.20) 96 | bigdecimal (3.1.6) 97 | bootstrap-sass (3.4.1) 98 | autoprefixer-rails (>= 5.2.1) 99 | sassc (>= 2.0.0) 100 | bootswatch-rails (3.3.5) 101 | railties (>= 3.1) 102 | builder (3.2.4) 103 | childprocess (5.0.0) 104 | coderay (1.1.3) 105 | coffee-rails (5.0.0) 106 | coffee-script (>= 2.2.0) 107 | railties (>= 5.2.0) 108 | coffee-script (2.4.1) 109 | coffee-script-source 110 | execjs 111 | coffee-script-source (1.12.2) 112 | concurrent-ruby (1.2.3) 113 | crack (1.0.0) 114 | bigdecimal 115 | rexml 116 | crass (1.0.6) 117 | database_cleaner (2.0.2) 118 | database_cleaner-active_record (>= 2, < 3) 119 | database_cleaner-active_record (2.1.0) 120 | activerecord (>= 5.a) 121 | database_cleaner-core (~> 2.0.0) 122 | database_cleaner-core (2.0.1) 123 | date (3.3.4) 124 | debug_inspector (1.2.0) 125 | devise (4.9.3) 126 | bcrypt (~> 3.0) 127 | orm_adapter (~> 0.1) 128 | railties (>= 4.1.0) 129 | responders 130 | warden (~> 1.2.3) 131 | diff-lcs (1.5.1) 132 | docile (1.4.0) 133 | erubi (1.12.0) 134 | execjs (2.9.1) 135 | factory_bot (6.4.6) 136 | activesupport (>= 5.0.0) 137 | factory_bot_rails (6.4.3) 138 | factory_bot (~> 6.4) 139 | railties (>= 5.0.0) 140 | faker (3.2.3) 141 | i18n (>= 1.8.11, < 2) 142 | faraday (2.9.0) 143 | faraday-net_http (>= 2.0, < 3.2) 144 | faraday-net_http (3.1.0) 145 | net-http 146 | ffi (1.16.3) 147 | font_awesome5_rails (1.5.0) 148 | nokogiri (>= 1.11.3) 149 | railties (>= 4.2) 150 | formatador (1.1.0) 151 | formtastic (4.0.0) 152 | actionpack (>= 5.2.0) 153 | formtastic_i18n (0.7.0) 154 | globalid (1.2.1) 155 | activesupport (>= 6.1) 156 | gravatar-ultimate (2.0.0) 157 | activesupport (>= 2.3.14) 158 | rack 159 | guard (2.18.1) 160 | formatador (>= 0.2.4) 161 | listen (>= 2.7, < 4.0) 162 | lumberjack (>= 1.0.12, < 2.0) 163 | nenv (~> 0.1) 164 | notiffany (~> 0.0) 165 | pry (>= 0.13.0) 166 | shellany (~> 0.0) 167 | thor (>= 0.18.1) 168 | guard-compat (1.2.1) 169 | guard-rubocop (1.5.0) 170 | guard (~> 2.0) 171 | rubocop (< 2.0) 172 | guard-spork (2.1.0) 173 | childprocess (>= 0.2.3) 174 | guard (~> 2.0) 175 | guard-compat (~> 1.0) 176 | spork (>= 0.8.4) 177 | has_scope (0.8.2) 178 | actionpack (>= 5.2) 179 | activesupport (>= 5.2) 180 | hashdiff (1.1.0) 181 | hashie (5.0.0) 182 | i18n (1.14.1) 183 | concurrent-ruby (~> 1.0) 184 | inherited_resources (1.14.0) 185 | actionpack (>= 6.0) 186 | has_scope (>= 0.6) 187 | railties (>= 6.0) 188 | responders (>= 2) 189 | jbuilder (2.11.5) 190 | actionview (>= 5.0.0) 191 | activesupport (>= 5.0.0) 192 | jquery-datatables-rails (3.4.0) 193 | actionpack (>= 3.1) 194 | jquery-rails 195 | railties (>= 3.1) 196 | sass-rails 197 | jquery-rails (4.6.0) 198 | rails-dom-testing (>= 1, < 3) 199 | railties (>= 4.2.0) 200 | thor (>= 0.14, < 2.0) 201 | jquery-rails-cdn (1.2.0) 202 | jquery-rails 203 | json (2.7.1) 204 | jwt (2.8.1) 205 | base64 206 | kaminari (1.2.2) 207 | activesupport (>= 4.1.0) 208 | kaminari-actionview (= 1.2.2) 209 | kaminari-activerecord (= 1.2.2) 210 | kaminari-core (= 1.2.2) 211 | kaminari-actionview (1.2.2) 212 | actionview 213 | kaminari-core (= 1.2.2) 214 | kaminari-activerecord (1.2.2) 215 | activerecord 216 | kaminari-core (= 1.2.2) 217 | kaminari-core (1.2.2) 218 | kramdown (2.4.0) 219 | rexml 220 | language_server-protocol (3.17.0.3) 221 | listen (3.9.0) 222 | rb-fsevent (~> 0.10, >= 0.10.3) 223 | rb-inotify (~> 0.9, >= 0.9.10) 224 | loofah (2.22.0) 225 | crass (~> 1.0.2) 226 | nokogiri (>= 1.12.0) 227 | lumberjack (1.2.10) 228 | mail (2.8.1) 229 | mini_mime (>= 0.1.1) 230 | net-imap 231 | net-pop 232 | net-smtp 233 | marcel (1.0.4) 234 | method_source (1.0.0) 235 | mini_mime (1.1.5) 236 | mini_portile2 (2.8.8) 237 | minitest (5.22.2) 238 | multi_xml (0.6.0) 239 | nenv (0.3.0) 240 | net-http (0.4.1) 241 | uri 242 | net-imap (0.4.10) 243 | date 244 | net-protocol 245 | net-pop (0.1.2) 246 | net-protocol 247 | net-protocol (0.2.2) 248 | timeout 249 | net-smtp (0.4.0.1) 250 | net-protocol 251 | nio4r (2.7.0) 252 | nokogiri (1.18.4) 253 | mini_portile2 (~> 2.8.2) 254 | racc (~> 1.4) 255 | notiffany (0.1.3) 256 | nenv (~> 0.1) 257 | shellany (~> 0.0) 258 | oauth2 (2.0.9) 259 | faraday (>= 0.17.3, < 3.0) 260 | jwt (>= 1.0, < 3.0) 261 | multi_xml (~> 0.5) 262 | rack (>= 1.2, < 4) 263 | snaky_hash (~> 2.0) 264 | version_gem (~> 1.1) 265 | omniauth (2.1.2) 266 | hashie (>= 3.4.6) 267 | rack (>= 2.2.3) 268 | rack-protection 269 | omniauth-github (2.0.1) 270 | omniauth (~> 2.0) 271 | omniauth-oauth2 (~> 1.8) 272 | omniauth-oauth2 (1.8.0) 273 | oauth2 (>= 1.4, < 3) 274 | omniauth (~> 2.0) 275 | omniauth-rails_csrf_protection (1.0.1) 276 | actionpack (>= 4.2) 277 | omniauth (~> 2.0) 278 | orm_adapter (0.5.0) 279 | parallel (1.24.0) 280 | parser (3.3.0.5) 281 | ast (~> 2.4.1) 282 | racc 283 | pg (1.5.6) 284 | pry (0.14.2) 285 | coderay (~> 1.1) 286 | method_source (~> 1.0) 287 | public_suffix (5.0.4) 288 | puma (6.4.2) 289 | nio4r (~> 2.0) 290 | racc (1.8.1) 291 | rack (2.2.14) 292 | rack-protection (3.2.0) 293 | base64 (>= 0.1.0) 294 | rack (~> 2.2, >= 2.2.4) 295 | rack-test (2.1.0) 296 | rack (>= 1.3) 297 | rails (7.0.4.3) 298 | actioncable (= 7.0.4.3) 299 | actionmailbox (= 7.0.4.3) 300 | actionmailer (= 7.0.4.3) 301 | actionpack (= 7.0.4.3) 302 | actiontext (= 7.0.4.3) 303 | actionview (= 7.0.4.3) 304 | activejob (= 7.0.4.3) 305 | activemodel (= 7.0.4.3) 306 | activerecord (= 7.0.4.3) 307 | activestorage (= 7.0.4.3) 308 | activesupport (= 7.0.4.3) 309 | bundler (>= 1.15.0) 310 | railties (= 7.0.4.3) 311 | rails-controller-testing (1.0.5) 312 | actionpack (>= 5.0.1.rc1) 313 | actionview (>= 5.0.1.rc1) 314 | activesupport (>= 5.0.1.rc1) 315 | rails-dom-testing (2.2.0) 316 | activesupport (>= 5.0.0) 317 | minitest 318 | nokogiri (>= 1.6) 319 | rails-html-sanitizer (1.6.0) 320 | loofah (~> 2.21) 321 | nokogiri (~> 1.14) 322 | rails_12factor (0.0.3) 323 | rails_serve_static_assets 324 | rails_stdout_logging 325 | rails_serve_static_assets (0.0.5) 326 | rails_stdout_logging (0.0.5) 327 | railties (7.0.4.3) 328 | actionpack (= 7.0.4.3) 329 | activesupport (= 7.0.4.3) 330 | method_source 331 | rake (>= 12.2) 332 | thor (~> 1.0) 333 | zeitwerk (~> 2.5) 334 | rainbow (3.1.1) 335 | rake (13.1.0) 336 | ransack (3.2.1) 337 | activerecord (>= 6.1.5) 338 | activesupport (>= 6.1.5) 339 | i18n 340 | rb-fsevent (0.11.2) 341 | rb-inotify (0.10.1) 342 | ffi (~> 1.0) 343 | regexp_parser (2.9.0) 344 | responders (3.1.1) 345 | actionpack (>= 5.2) 346 | railties (>= 5.2) 347 | rexml (3.3.9) 348 | rspec-core (3.13.0) 349 | rspec-support (~> 3.13.0) 350 | rspec-expectations (3.13.0) 351 | diff-lcs (>= 1.2.0, < 2.0) 352 | rspec-support (~> 3.13.0) 353 | rspec-mocks (3.13.0) 354 | diff-lcs (>= 1.2.0, < 2.0) 355 | rspec-support (~> 3.13.0) 356 | rspec-rails (6.1.1) 357 | actionpack (>= 6.1) 358 | activesupport (>= 6.1) 359 | railties (>= 6.1) 360 | rspec-core (~> 3.12) 361 | rspec-expectations (~> 3.12) 362 | rspec-mocks (~> 3.12) 363 | rspec-support (~> 3.12) 364 | rspec-support (3.13.1) 365 | rubocop (1.61.0) 366 | json (~> 2.3) 367 | language_server-protocol (>= 3.17.0) 368 | parallel (~> 1.10) 369 | parser (>= 3.3.0.2) 370 | rainbow (>= 2.2.2, < 4.0) 371 | regexp_parser (>= 1.8, < 3.0) 372 | rexml (>= 3.2.5, < 4.0) 373 | rubocop-ast (>= 1.30.0, < 2.0) 374 | ruby-progressbar (~> 1.7) 375 | unicode-display_width (>= 2.4.0, < 3.0) 376 | rubocop-ast (1.31.1) 377 | parser (>= 3.3.0.4) 378 | ruby-progressbar (1.13.0) 379 | ruby2_keywords (0.0.5) 380 | sass-rails (6.0.0) 381 | sassc-rails (~> 2.1, >= 2.1.1) 382 | sassc (2.4.0) 383 | ffi (~> 1.9) 384 | sassc-rails (2.1.2) 385 | railties (>= 4.0.0) 386 | sassc (>= 2.0) 387 | sprockets (> 3.0) 388 | sprockets-rails 389 | tilt 390 | sentry-raven (3.1.2) 391 | faraday (>= 1.0) 392 | shellany (0.0.1) 393 | shoulda (4.0.0) 394 | shoulda-context (~> 2.0) 395 | shoulda-matchers (~> 4.0) 396 | shoulda-context (2.0.0) 397 | shoulda-matchers (4.5.1) 398 | activesupport (>= 4.2.0) 399 | simple_form (5.3.0) 400 | actionpack (>= 5.2) 401 | activemodel (>= 5.2) 402 | simplecov (0.22.0) 403 | docile (~> 1.1) 404 | simplecov-html (~> 0.11) 405 | simplecov_json_formatter (~> 0.1) 406 | simplecov-html (0.12.3) 407 | simplecov_json_formatter (0.1.4) 408 | slack-notifier (2.4.0) 409 | snaky_hash (2.0.1) 410 | hashie 411 | version_gem (~> 1.1, >= 1.1.1) 412 | spork (1.0.0rc4) 413 | spring (4.1.3) 414 | sprockets (3.7.2) 415 | concurrent-ruby (~> 1.0) 416 | rack (> 1, < 3) 417 | sprockets-rails (2.3.3) 418 | actionpack (>= 3.0) 419 | activesupport (>= 3.0) 420 | sprockets (>= 2.8, < 4.0) 421 | sqlite3 (1.7.2) 422 | mini_portile2 (~> 2.8.0) 423 | thor (1.3.1) 424 | tilt (2.3.0) 425 | timeout (0.4.1) 426 | turbolinks (5.2.1) 427 | turbolinks-source (~> 5.2) 428 | turbolinks-source (5.2.0) 429 | tzinfo (2.0.6) 430 | concurrent-ruby (~> 1.0) 431 | uglifier (4.2.0) 432 | execjs (>= 0.3.0, < 3) 433 | unicode-display_width (2.5.0) 434 | uri (0.13.0) 435 | version_gem (1.1.3) 436 | warden (1.2.9) 437 | rack (>= 2.0.9) 438 | webmock (3.23.0) 439 | addressable (>= 2.8.0) 440 | crack (>= 0.3.2) 441 | hashdiff (>= 0.4.0, < 2.0.0) 442 | webrick (1.8.1) 443 | websocket-driver (0.7.6) 444 | websocket-extensions (>= 0.1.0) 445 | websocket-extensions (0.1.5) 446 | xmlrpc (0.3.3) 447 | webrick 448 | zeitwerk (2.6.13) 449 | 450 | PLATFORMS 451 | ruby 452 | 453 | DEPENDENCIES 454 | activeadmin (~> 2.4) 455 | binding_of_caller! 456 | bootstrap-sass (>= 3.4.1) 457 | bootswatch-rails 458 | coffee-rails (~> 5.0) 459 | database_cleaner 460 | devise 461 | factory_bot_rails 462 | faker 463 | font_awesome5_rails 464 | gravatar-ultimate (~> 2.0.0) 465 | guard 466 | guard-rubocop 467 | guard-spork 468 | jbuilder (~> 2.10) 469 | jquery-datatables-rails (~> 3.4.0) 470 | jquery-rails (~> 4.4) 471 | jquery-rails-cdn 472 | kaminari 473 | kramdown 474 | omniauth 475 | omniauth-github 476 | omniauth-rails_csrf_protection 477 | pg 478 | puma 479 | rails (~> 7.0.4.3) 480 | rails-controller-testing 481 | rails_12factor (~> 0.0.2) 482 | rspec-rails 483 | rubocop 484 | sass-rails (~> 6.0.0) 485 | sentry-raven (~> 3.0) 486 | shoulda 487 | simple_form 488 | simplecov 489 | slack-notifier 490 | spork (~> 1.0rc) 491 | spring 492 | sprockets-rails (= 2.3.3) 493 | sqlite3 (~> 1.4) 494 | turbolinks 495 | uglifier (>= 1.3.0) 496 | webmock 497 | xmlrpc 498 | 499 | RUBY VERSION 500 | ruby 3.2.1p31 501 | 502 | BUNDLED WITH 503 | 2.2.33 504 | -------------------------------------------------------------------------------- /Guardfile: -------------------------------------------------------------------------------- 1 | # A sample Guardfile 2 | # More info at https://github.com/guard/guard#readme 3 | 4 | guard :rspec, cmd: 'bundle exec rspec', :cli => "--format d --color", :all_after_pass => false, :all_on_start => false do 5 | watch(%r{^spec/.+_spec\.rb$}) 6 | watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } 7 | watch('spec/spec_helper.rb') { "spec" } 8 | 9 | # Rails example 10 | watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } 11 | watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } 12 | watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } 13 | watch(%r{^spec/support/(.+)\.rb$}) { "spec" } 14 | watch('config/routes.rb') { "spec/routing" } 15 | watch('app/controllers/application_controller.rb') { "spec/controllers" } 16 | 17 | # Capybara features specs 18 | watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" } 19 | 20 | # Turnip features and steps 21 | watch(%r{^spec/acceptance/(.+)\.feature$}) 22 | watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } 23 | end 24 | 25 | 26 | guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do 27 | watch('config/application.rb') 28 | watch('config/environment.rb') 29 | watch('config/environments/test.rb') 30 | watch(%r{^config/initializers/.+\.rb$}) 31 | watch('Gemfile.lock') 32 | watch('spec/spec_helper.rb') { :rspec } 33 | watch('test/test_helper.rb') { :test_unit } 34 | watch(%r{features/support/}) { :cucumber } 35 | end 36 | 37 | guard :rubocop do 38 | watch(%r{.+\.rb$}) 39 | watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) } 40 | end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013 - 2020 Ruby Türkiye 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec puma -C config/puma.rb 2 | release: bundle exec rails db:migrate -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [![Ruby Türkiye](./public/ruby_turkiye.png)][website] 2 | 3 | ![](https://github.com/rubytr/ruby-tr/workflows/Test/badge.svg) 4 | 5 | Bu repo [Ruby Türkiye][website] sitesinin kaynak kodunu barındırmaktadır. 6 | 7 | ## Katkıda Bulunma 8 | 9 | Ruby Türkiye sitesine katkıda bulunmak için [Katkıda Bulunma Rehberi][contributing]'ni inceleyebilirsiniz. 10 | 11 | [contributing]: https://github.com/rubytr/ruby-tr/blob/main/CONTRIBUTING.md 12 | [website]: https://rubyturkiye.org/ 13 | -------------------------------------------------------------------------------- /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 | 6 | RubyTr::Application.load_tasks 7 | -------------------------------------------------------------------------------- /app/admin/admin_user.rb: -------------------------------------------------------------------------------- 1 | ActiveAdmin.register AdminUser do 2 | permit_params :email, :password, :password_confirmation 3 | 4 | index do 5 | selectable_column 6 | id_column 7 | column :email 8 | column :current_sign_in_at 9 | column :sign_in_count 10 | column :created_at 11 | actions 12 | end 13 | 14 | filter :email 15 | filter :current_sign_in_at 16 | filter :sign_in_count 17 | filter :created_at 18 | 19 | form do |f| 20 | f.inputs 'Admin Details' do 21 | f.input :email 22 | f.input :password 23 | f.input :password_confirmation 24 | end 25 | f.actions 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /app/admin/announcement.rb: -------------------------------------------------------------------------------- 1 | def admin_collection 2 | proc { 3 | AdminUser.all.map { |a| [a.email, a.id] } 4 | } 5 | end 6 | 7 | ActiveAdmin.register Announcement do 8 | permit_params :title, :content, :admin_user_id 9 | 10 | form do |f| 11 | f.inputs 'Announcement Details' do 12 | f.input :admin_user, as: :select, collection: admin_collection 13 | f.input :title 14 | f.input :content 15 | f.submit 16 | end 17 | end 18 | 19 | filter :admin_user, as: :select, collection: admin_collection 20 | end 21 | -------------------------------------------------------------------------------- /app/admin/company.rb: -------------------------------------------------------------------------------- 1 | ActiveAdmin.register Company do 2 | permit_params :title, :sector, :url, :github, :twitter, :city, :published 3 | end 4 | -------------------------------------------------------------------------------- /app/admin/dashboard.rb: -------------------------------------------------------------------------------- 1 | ActiveAdmin.register_page 'Dashboard' do 2 | menu priority: 1, label: proc { I18n.t('active_admin.dashboard') } 3 | 4 | content title: proc { I18n.t('active_admin.dashboard') } do 5 | div class: 'blank_slate_container', id: 'dashboard_default_message' do 6 | span class: 'blank_slate' do 7 | span I18n.t('active_admin.dashboard_welcome.welcome') 8 | small I18n.t('active_admin.dashboard_welcome.call_to_action') 9 | end 10 | end 11 | 12 | # Here is an example of a simple dashboard with columns and panels. 13 | # 14 | # columns do 15 | # column do 16 | # panel "Recent Posts" do 17 | # ul do 18 | # Post.recent(5).map do |post| 19 | # li link_to(post.title, admin_post_path(post)) 20 | # end 21 | # end 22 | # end 23 | # end 24 | 25 | # column do 26 | # panel "Info" do 27 | # para "Welcome to ActiveAdmin." 28 | # end 29 | # end 30 | # end 31 | # content 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /app/admin/job.rb: -------------------------------------------------------------------------------- 1 | ActiveAdmin.register Job do 2 | permit_params :title, :company, :description, :link, :location, :published 3 | end 4 | -------------------------------------------------------------------------------- /app/admin/user.rb: -------------------------------------------------------------------------------- 1 | ActiveAdmin.register User do 2 | permit_params :name, :email, :web, :github, :twitter 3 | end 4 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubytr/ruby-tr/92775e56f7ae1c0955866981cecf81e99f20554f/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/images/friendlyrb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubytr/ruby-tr/92775e56f7ae1c0955866981cecf81e99f20554f/app/assets/images/friendlyrb.png -------------------------------------------------------------------------------- /app/assets/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubytr/ruby-tr/92775e56f7ae1c0955866981cecf81e99f20554f/app/assets/images/image.png -------------------------------------------------------------------------------- /app/assets/images/ruby-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubytr/ruby-tr/92775e56f7ae1c0955866981cecf81e99f20554f/app/assets/images/ruby-logo@2x.png -------------------------------------------------------------------------------- /app/assets/javascripts/active_admin.js.coffee: -------------------------------------------------------------------------------- 1 | #= require active_admin/base 2 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.coffee: -------------------------------------------------------------------------------- 1 | #= require jquery_ujs 2 | #= require bootstrap.min 3 | #= require ./pages 4 | 5 | jQuery -> 6 | forum_embed = $("#forum_embed") 7 | if forum_embed.length > 0 8 | forum_embed.attr("src", "https://groups.google.com/forum/embed/?place=forum/ruby-tr&showsearch=true&showpopout=true&parenturl=#{encodeURIComponent(window.location.href)}") 9 | 10 | top_navbar_right = $("#top-navbar-right") 11 | top_navbar_right_child_length = top_navbar_right.children().length 12 | 13 | top_navbar_right.children().each (index, element) => 14 | $(element).addClass('lg-' + top_navbar_right_child_length + '-1') 15 | -------------------------------------------------------------------------------- /app/assets/javascripts/pages.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | 5 | jQuery -> 6 | events = $('aside #events') 7 | 8 | $(window).on 'load', () => 9 | $.ajax 10 | url: '/events.json' 11 | method: 'GET', 12 | contentType: 'application/json', 13 | success: (res) => 14 | if res.length 15 | $.each res, (index, event) => 16 | events.find('ul').append '
  • '+event.name+'
  • ' 17 | 18 | events.css { display: 'block' } 19 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_config.scss: -------------------------------------------------------------------------------- 1 | $font-family: 'Open Sans', sans-serif; 2 | 3 | // Colors 4 | $base: #585450; 5 | $inverse: #CC342D; 6 | $light: #FFFFFF; 7 | $lightgray: #EAEAEA; 8 | $copy: #555555; 9 | 10 | $twitter: #00acee; 11 | $github: #000000; 12 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.1 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox. 29 | * Correct `block` display not defined for `main` in IE 11. 30 | */ 31 | 32 | article, 33 | aside, 34 | details, 35 | figcaption, 36 | figure, 37 | footer, 38 | header, 39 | hgroup, 40 | main, 41 | nav, 42 | section, 43 | summary { 44 | display: block; 45 | } 46 | 47 | /** 48 | * 1. Correct `inline-block` display not defined in IE 8/9. 49 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 50 | */ 51 | 52 | audio, 53 | canvas, 54 | progress, 55 | video { 56 | display: inline-block; /* 1 */ 57 | vertical-align: baseline; /* 2 */ 58 | } 59 | 60 | /** 61 | * Prevent modern browsers from displaying `audio` without controls. 62 | * Remove excess height in iOS 5 devices. 63 | */ 64 | 65 | audio:not([controls]) { 66 | display: none; 67 | height: 0; 68 | } 69 | 70 | /** 71 | * Address `[hidden]` styling not present in IE 8/9/10. 72 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 73 | */ 74 | 75 | [hidden], 76 | template { 77 | display: none; 78 | } 79 | 80 | /* Links 81 | ========================================================================== */ 82 | 83 | /** 84 | * Remove the gray background color from active links in IE 10. 85 | */ 86 | 87 | a { 88 | background: transparent; 89 | } 90 | 91 | /** 92 | * Improve readability when focused and also mouse hovered in all browsers. 93 | */ 94 | 95 | a:active, 96 | a:hover { 97 | outline: 0; 98 | } 99 | 100 | /* Text-level semantics 101 | ========================================================================== */ 102 | 103 | /** 104 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 105 | */ 106 | 107 | abbr[title] { 108 | border-bottom: 1px dotted; 109 | } 110 | 111 | /** 112 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 113 | */ 114 | 115 | b, 116 | strong { 117 | font-weight: bold; 118 | } 119 | 120 | /** 121 | * Address styling not present in Safari and Chrome. 122 | */ 123 | 124 | dfn { 125 | font-style: italic; 126 | } 127 | 128 | /** 129 | * Address variable `h1` font-size and margin within `section` and `article` 130 | * contexts in Firefox 4+, Safari, and Chrome. 131 | */ 132 | 133 | h1 { 134 | font-size: 2em; 135 | margin: 0.67em 0; 136 | } 137 | 138 | /** 139 | * Address styling not present in IE 8/9. 140 | */ 141 | 142 | mark { 143 | background: #ff0; 144 | color: #000; 145 | } 146 | 147 | /** 148 | * Address inconsistent and variable font size in all browsers. 149 | */ 150 | 151 | small { 152 | font-size: 80%; 153 | } 154 | 155 | /** 156 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 157 | */ 158 | 159 | sub, 160 | sup { 161 | font-size: 75%; 162 | line-height: 0; 163 | position: relative; 164 | vertical-align: baseline; 165 | } 166 | 167 | sup { 168 | top: -0.5em; 169 | } 170 | 171 | sub { 172 | bottom: -0.25em; 173 | } 174 | 175 | /* Embedded content 176 | ========================================================================== */ 177 | 178 | /** 179 | * Remove border when inside `a` element in IE 8/9/10. 180 | */ 181 | 182 | img { 183 | border: 0; 184 | } 185 | 186 | /** 187 | * Correct overflow not hidden in IE 9/10/11. 188 | */ 189 | 190 | svg:not(:root) { 191 | overflow: hidden; 192 | } 193 | 194 | /* Grouping content 195 | ========================================================================== */ 196 | 197 | /** 198 | * Address margin not present in IE 8/9 and Safari. 199 | */ 200 | 201 | figure { 202 | margin: 1em 40px; 203 | } 204 | 205 | /** 206 | * Address differences between Firefox and other browsers. 207 | */ 208 | 209 | hr { 210 | -moz-box-sizing: content-box; 211 | box-sizing: content-box; 212 | height: 0; 213 | } 214 | 215 | /** 216 | * Contain overflow in all browsers. 217 | */ 218 | 219 | pre { 220 | overflow: auto; 221 | } 222 | 223 | /** 224 | * Address odd `em`-unit font size rendering in all browsers. 225 | */ 226 | 227 | code, 228 | kbd, 229 | pre, 230 | samp { 231 | font-family: monospace, monospace; 232 | font-size: 1em; 233 | } 234 | 235 | /* Forms 236 | ========================================================================== */ 237 | 238 | /** 239 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 240 | * styling of `select`, unless a `border` property is set. 241 | */ 242 | 243 | /** 244 | * 1. Correct color not being inherited. 245 | * Known issue: affects color of disabled elements. 246 | * 2. Correct font properties not being inherited. 247 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 248 | */ 249 | 250 | button, 251 | input, 252 | optgroup, 253 | select, 254 | textarea { 255 | color: inherit; /* 1 */ 256 | font: inherit; /* 2 */ 257 | margin: 0; /* 3 */ 258 | } 259 | 260 | /** 261 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 262 | */ 263 | 264 | button { 265 | overflow: visible; 266 | } 267 | 268 | /** 269 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 270 | * All other form control elements do not inherit `text-transform` values. 271 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 272 | * Correct `select` style inheritance in Firefox. 273 | */ 274 | 275 | button, 276 | select { 277 | text-transform: none; 278 | } 279 | 280 | /** 281 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 282 | * and `video` controls. 283 | * 2. Correct inability to style clickable `input` types in iOS. 284 | * 3. Improve usability and consistency of cursor style between image-type 285 | * `input` and others. 286 | */ 287 | 288 | button, 289 | html input[type="button"], /* 1 */ 290 | input[type="reset"], 291 | input[type="submit"] { 292 | -webkit-appearance: button; /* 2 */ 293 | cursor: pointer; /* 3 */ 294 | } 295 | 296 | /** 297 | * Re-set default cursor for disabled elements. 298 | */ 299 | 300 | button[disabled], 301 | html input[disabled] { 302 | cursor: default; 303 | } 304 | 305 | /** 306 | * Remove inner padding and border in Firefox 4+. 307 | */ 308 | 309 | button::-moz-focus-inner, 310 | input::-moz-focus-inner { 311 | border: 0; 312 | padding: 0; 313 | } 314 | 315 | /** 316 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 317 | * the UA stylesheet. 318 | */ 319 | 320 | input { 321 | line-height: normal; 322 | } 323 | 324 | /** 325 | * It's recommended that you don't attempt to style these elements. 326 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 327 | * 328 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 329 | * 2. Remove excess padding in IE 8/9/10. 330 | */ 331 | 332 | input[type="checkbox"], 333 | input[type="radio"] { 334 | box-sizing: border-box; /* 1 */ 335 | padding: 0; /* 2 */ 336 | } 337 | 338 | /** 339 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 340 | * `font-size` values of the `input`, it causes the cursor style of the 341 | * decrement button to change from `default` to `text`. 342 | */ 343 | 344 | input[type="number"]::-webkit-inner-spin-button, 345 | input[type="number"]::-webkit-outer-spin-button { 346 | height: auto; 347 | } 348 | 349 | /** 350 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 351 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 352 | * (include `-moz` to future-proof). 353 | */ 354 | 355 | input[type="search"] { 356 | -webkit-appearance: textfield; /* 1 */ 357 | -moz-box-sizing: content-box; 358 | -webkit-box-sizing: content-box; /* 2 */ 359 | box-sizing: content-box; 360 | } 361 | 362 | /** 363 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 364 | * Safari (but not Chrome) clips the cancel button when the search input has 365 | * padding (and `textfield` appearance). 366 | */ 367 | 368 | input[type="search"]::-webkit-search-cancel-button, 369 | input[type="search"]::-webkit-search-decoration { 370 | -webkit-appearance: none; 371 | } 372 | 373 | /** 374 | * Define consistent border, margin, and padding. 375 | */ 376 | 377 | fieldset { 378 | border: 1px solid #c0c0c0; 379 | margin: 0 2px; 380 | padding: 0.35em 0.625em 0.75em; 381 | } 382 | 383 | /** 384 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 385 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 386 | */ 387 | 388 | legend { 389 | border: 0; /* 1 */ 390 | padding: 0; /* 2 */ 391 | } 392 | 393 | /** 394 | * Remove default vertical scrollbar in IE 8/9/10/11. 395 | */ 396 | 397 | textarea { 398 | overflow: auto; 399 | } 400 | 401 | /** 402 | * Don't inherit the `font-weight` (applied by a rule above). 403 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 404 | */ 405 | 406 | optgroup { 407 | font-weight: bold; 408 | } 409 | 410 | /* Tables 411 | ========================================================================== */ 412 | 413 | /** 414 | * Remove most spacing between table cells. 415 | */ 416 | 417 | table { 418 | border-collapse: collapse; 419 | border-spacing: 0; 420 | } 421 | 422 | td, 423 | th { 424 | padding: 0; 425 | } 426 | -------------------------------------------------------------------------------- /app/assets/stylesheets/active_admin.scss: -------------------------------------------------------------------------------- 1 | // SASS variable overrides must be declared before loading up Active Admin's styles. 2 | // 3 | // To view the variables that Active Admin provides, take a look at 4 | // `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the 5 | // Active Admin source. 6 | // 7 | // For example, to change the sidebar width: 8 | // $sidebar-width: 242px; 9 | 10 | // Active Admin's got SASS! 11 | @import "active_admin/mixins"; 12 | @import "active_admin/base"; 13 | 14 | // Overriding any non-variable SASS must be done after the fact. 15 | // For example, to change the default status-tag color: 16 | // 17 | // .status_tag { background: #6090DB; } 18 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | @import "normalize"; 2 | @import "flexiblegs.min"; 3 | @import "animate.min"; 4 | @import "font_awesome5_webfont"; 5 | @import "config"; 6 | @import "bootstrap-sprockets"; 7 | @import "bootstrap"; 8 | 9 | /* Wrapper */ 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | html, body { 16 | font-family: 'Open Sans', sans-serif; 17 | font-size: 14px; 18 | color: #222222; 19 | background: #fff; 20 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 21 | margin: 0 0 0 0; /* Footer Fixed */ 22 | } 23 | .row > * { 24 | font-size: 14px; 25 | } 26 | .container { 27 | max-width: 1140px; 28 | margin: 0 auto; 29 | } 30 | aside{ 31 | padding: 0 20px 10px 20px; 32 | border: 1px solid #e8e8e8; 33 | border-radius: 3px; 34 | border-radius: 3px; 35 | } 36 | .news { 37 | border: 1px solid #e8e8e8; 38 | border-radius: 3px; 39 | background: #f5f5f5; 40 | display: block; 41 | overflow: hidden; 42 | padding: 0 20px; 43 | margin-bottom: 20px; 44 | } 45 | aside #events { 46 | display: none; 47 | } 48 | .events { 49 | text-align: left; 50 | border: 1px solid #e8e8e8; 51 | border-radius: 3px; 52 | background: #f5f5f5; 53 | display: block; 54 | overflow: hidden; 55 | padding: 0 20px; 56 | margin-bottom: 20px; 57 | } 58 | .news:last-child{ 59 | margin-bottom: 0; 60 | } 61 | 62 | /* Header */ 63 | 64 | header { 65 | padding:20px 0; 66 | border-bottom: 10px solid #CA3633; 67 | margin-bottom: 20px; 68 | } 69 | header img{ 70 | width: 50px; 71 | vertical-align: middle; 72 | margin-right: 10px; 73 | } 74 | header h1{ 75 | margin: 10px 0; 76 | } 77 | header h1 span{ 78 | font-weight: normal; 79 | } 80 | header a { 81 | color: #CA3633; 82 | } 83 | header a:hover { 84 | color: #CA3633; 85 | } 86 | .nav { 87 | margin-top: 10px; 88 | } 89 | .nav a { 90 | display: block; 91 | border: 1px solid #CA3633; 92 | font-size: 14px; 93 | margin: 10px 0; 94 | font-size: 14px; 95 | -webkit-font-smoothing: antialiased; 96 | font-weight: normal; 97 | border-radius: 3px; 98 | line-height: 32px; 99 | } 100 | .nav a.truncate { 101 | white-space: nowrap; 102 | overflow: hidden; 103 | text-overflow: ellipsis; 104 | } 105 | .nav a:hover, .nav a.active{ 106 | color: #fff; 107 | background: #CA3633; 108 | } 109 | span.user-name { 110 | color: #CA3633; 111 | margin-top: 10px; 112 | display: inline-block; 113 | line-height: 32px; 114 | } 115 | 116 | a.btn, input.btn { 117 | &.btn-green { 118 | display: block; 119 | text-align: center; 120 | border: 1px solid #39CA74; 121 | font-size: 14px; 122 | margin: 10px 0; 123 | font-size: 14px; 124 | -webkit-font-smoothing: antialiased; 125 | font-weight: normal; 126 | border-radius: 3px; 127 | line-height: 44px; 128 | color: #fff; 129 | background: #39CA74; 130 | width: 100%; 131 | } 132 | 133 | &.btn-github { 134 | display: inline-block; 135 | padding: 0px 10px 0px 8px; 136 | color: #333; 137 | vertical-align: middle; 138 | cursor: pointer; 139 | background-color: #ddd; 140 | border: 1px solid #d5d5d5; 141 | background-image: linear-gradient(to bottom,#eee 0,#ddd 100%); 142 | font-size: 16px; 143 | line-height: 40px; 144 | vertical-align: center; 145 | border-radius: 4px; 146 | margin-bottom: 20px; 147 | 148 | > i { 149 | line-height: 40px; 150 | float: left; 151 | margin-right: 5px; 152 | } 153 | } 154 | } 155 | 156 | input[type=text]{ 157 | width: 100%; 158 | border:1px solid #e8e8e8; 159 | padding: 10px; 160 | margin: 5px 0; 161 | border-radius: 3px; 162 | } 163 | 164 | textarea { 165 | width: 100%; 166 | border:1px solid #e8e8e8; 167 | padding: 10px; 168 | margin: 5px 0; 169 | border-radius: 3px; 170 | min-height: 150px; 171 | resize: none; 172 | } 173 | 174 | .form-title{ 175 | margin: 15px 0; 176 | } 177 | .error, .field_with_errors{ 178 | font-style: italic; 179 | color: #CA3633; 180 | } 181 | .image-circle { 182 | border-radius: 50%; 183 | overflow: hidden; 184 | width: 125px; 185 | height: 125px; 186 | margin: 0 auto; 187 | } 188 | .thumbnail { 189 | border-radius: 3px; 190 | border: 1px solid #e8e8e8; 191 | background: #f5f5f5; 192 | padding: 10px; 193 | margin-bottom: 20px; 194 | min-height: 223px; 195 | } 196 | .thumbnail a { 197 | display: inline-block; 198 | margin: 0 2px; 199 | color: #a1a1a1; 200 | } 201 | .thumbnail a:hover{ 202 | color: #222222; 203 | } 204 | .thumbnail h3{ 205 | margin: 10px 0; 206 | font-weight: normal; 207 | } 208 | .person-thumbnail { 209 | min-height: 223px; 210 | } 211 | 212 | .list-item { 213 | border-radius: 3px; 214 | border: 1px solid #e8e8e8; 215 | background: #f5f5f5; 216 | padding: 12px; 217 | margin: 10px; 218 | } 219 | 220 | .list-item h3 { 221 | -webkit-margin-before: 0; 222 | } 223 | 224 | /* Footer */ 225 | 226 | footer { 227 | padding:20px 0; 228 | border-top: 10px solid #CA3633; 229 | margin-top: 20px; 230 | } 231 | 232 | footer .text-right a { 233 | display: inline-block; 234 | padding: 0 10px; 235 | font-size: 16px; 236 | font-weight: normal; 237 | } 238 | 239 | footer .text-right a:last-child { 240 | padding-right: 0; 241 | } 242 | 243 | footer .text-right a:focus { 244 | text-decoration: none; 245 | } 246 | 247 | /* Typography */ 248 | 249 | h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { 250 | display: block; 251 | margin: 20px 0; 252 | padding: 0; 253 | line-height: 28px; 254 | font-weight: 600; 255 | } 256 | h1, .h1 { 257 | font-size: 32px; 258 | letter-spacing: -1pt; 259 | } 260 | h2, .h2 { 261 | font-size: 25px; 262 | letter-spacing: -1pt; 263 | } 264 | h3, .h3 { 265 | font-size: 18px; 266 | margin-bottom:10px; 267 | } 268 | h4, .h4 { 269 | font-size: 16px; 270 | margin-top: 10px; 271 | } 272 | h5, .h5 { 273 | font-size: 14px; 274 | } 275 | h6, .h6 { 276 | font-size: 12px; 277 | line-height: 18px; 278 | } 279 | .page-header { 280 | padding-bottom: 15px; 281 | margin: 10px 0 20px 0; 282 | border-bottom: 1px solid #e8e8e8; 283 | } 284 | .page-header h2, .page-header .h2 { 285 | margin: 0 0 20px 0; 286 | } 287 | hr { 288 | margin-top: 20px; 289 | margin-bottom: 20px; 290 | border: 0; 291 | border-top: 1px solid #e8e8e8; 292 | } 293 | ul,ol { 294 | list-style-position:inside; 295 | margin: 10px 0; 296 | padding: 0; 297 | 298 | } 299 | ul ul,ol ol { 300 | margin: 5px 15px; 301 | } 302 | ul li a,ol li a{ 303 | // display: block; 304 | margin: 10px 0; 305 | color: #222; 306 | font-weight: normal; 307 | } 308 | a { 309 | color: #CA3633; 310 | font-weight: bold; 311 | text-decoration: none; 312 | -moz-transition: all 0.1s ease-in; 313 | -webkit-transition: all 0.1s ease-in; 314 | -o-transition: all 0.1s ease-in; 315 | transition: all 0.1s ease-in; 316 | } 317 | a:hover { 318 | color: #222222; 319 | text-decoration: none; 320 | } 321 | p { 322 | margin: 0 0 10px 0; 323 | line-height: 28px; 324 | color: #555555; 325 | } 326 | 327 | @-moz-document url-prefix() { 328 | .connect-links li a{ 329 | margin-top: -20px; 330 | margin-left: 15px; 331 | } 332 | } 333 | 334 | /* Responsive */ 335 | 336 | /* lg */ 337 | 338 | @media (max-width: 1024px) { 339 | 340 | } 341 | 342 | /* md */ 343 | 344 | @media (max-width: 768px) { 345 | 346 | header h1 { 347 | margin-bottom: 30px; 348 | } 349 | 350 | } 351 | 352 | /* sm */ 353 | 354 | @media (max-width: 568px) { 355 | 356 | } 357 | 358 | /* xs */ 359 | 360 | @media (max-width: 320px) { 361 | 362 | } 363 | 364 | .github-ribbon { 365 | position: fixed; 366 | display: block; 367 | top: 0; 368 | right: 0; 369 | width: auto; 370 | height: auto; 371 | z-index: 10; 372 | & > a { 373 | position: absolute; 374 | top: 40px; 375 | right: -50px; 376 | width: 220px; 377 | background-color: #950d07; 378 | padding: 5px 40px; 379 | font-size: 1rem; 380 | line-height: 2rem; 381 | box-sizing: border-box; 382 | white-space: nowrap; 383 | color: #fff; 384 | text-align: center; 385 | transform: rotate(45deg); 386 | box-shadow: 4px 4px 10px rgba(0,0,0,0.8); 387 | &:hover, 388 | &:focus { 389 | color: darken(#fff, 10%) 390 | } 391 | &::before, 392 | &::after { 393 | content: ""; 394 | position: absolute; 395 | top: 1px; 396 | left: 0; 397 | display: block; 398 | width: 100%; 399 | height: 1px; 400 | background-color: #fff; 401 | } 402 | &::after{ 403 | top: auto; 404 | bottom: 1px; 405 | } 406 | } 407 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/pages.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the pages controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception, prepend: true 5 | before_action :set_raven_context 6 | 7 | private 8 | 9 | # Overwriting the sign_out redirect path method 10 | def after_sign_out_path_for(_resource) 11 | users_path 12 | end 13 | 14 | def set_raven_context 15 | Raven.user_context(id: session[:current_user_id]) # or anything else in session 16 | Raven.extra_context(params: params.to_unsafe_h, url: request.url) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/controllers/callbacks_controller.rb: -------------------------------------------------------------------------------- 1 | class CallbacksController < Devise::OmniauthCallbacksController 2 | def github 3 | @user = User.from_omniauth(request.env['omniauth.auth']) 4 | sign_in @user 5 | flash[:notice] = I18n.t('devise.omniauth_callbacks.success', kind: 'Github') 6 | redirect_to edit_user_registration_path 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/controllers/companies_controller.rb: -------------------------------------------------------------------------------- 1 | class CompaniesController < ApplicationController 2 | before_action :authenticate_user!, only: %i[new create] 3 | 4 | def index 5 | @companies = Company.published.order(:title) 6 | end 7 | 8 | def new 9 | @company = Company.new 10 | end 11 | 12 | def create 13 | if current_user.companies.create(company_params) 14 | flash[:notice] = 'Firmanız site yöneticisi tarafından onaylandıktan sonra gözükecektir.' 15 | redirect_to(companies_path) 16 | else 17 | render(:new) 18 | end 19 | end 20 | 21 | private 22 | 23 | def company_params 24 | params.require(:company).permit(:title, :sector, :url, :github, :twitter, :city) 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubytr/ruby-tr/92775e56f7ae1c0955866981cecf81e99f20554f/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/pages_controller.rb: -------------------------------------------------------------------------------- 1 | require 'kramdown' 2 | require 'uri' 3 | require 'net/http' 4 | require 'json' 5 | 6 | class PagesController < ApplicationController 7 | def irc; end 8 | 9 | def main 10 | @announcements = Announcement.all.order(created_at: :desc) 11 | end 12 | 13 | def events 14 | group = 'Ruby-Turkiye' 15 | url_detail = 'events?sign=true&photo-host=public&photo-host=public&page=20&page=20' 16 | url = URI("https://api.meetup.com/#{group}/#{url_detail}") 17 | http = Net::HTTP.new(url.host, url.port) 18 | http.use_ssl = true 19 | http.verify_mode = OpenSSL::SSL::VERIFY_NONE 20 | 21 | response = http.request(Net::HTTP::Get.new(url)) 22 | 23 | @events = JSON.parse(response.read_body) 24 | 25 | respond_to do |format| 26 | format.html 27 | format.json { render json: @events } 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /app/controllers/users/registrations_controller.rb: -------------------------------------------------------------------------------- 1 | module Users 2 | class RegistrationsController < Devise::RegistrationsController 3 | def update 4 | self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key) 5 | updated = update_resource(resource, account_update_params) 6 | if updated 7 | redirect_to edit_user_registration_path 8 | else 9 | respond_with resource 10 | end 11 | end 12 | 13 | protected 14 | 15 | def update_resource(resource, params) 16 | resource.update_without_password(params) 17 | end 18 | 19 | def account_update_params 20 | params.require(:user).permit(:email, :name, :twitter, :web) 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /app/controllers/users/sessions_controller.rb: -------------------------------------------------------------------------------- 1 | module Users 2 | class SessionsController < Devise::SessionsController 3 | def new 4 | redirect_to users_path 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/controllers/users_controller.rb: -------------------------------------------------------------------------------- 1 | class UsersController < ApplicationController 2 | def index 3 | @users = User.page(params[:page]) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | def resource_name 3 | :user 4 | end 5 | 6 | # rubocop:disable Naming/MemoizedInstanceVariableName 7 | def resource 8 | @user ||= User.new 9 | end 10 | # rubocop:enable Naming/MemoizedInstanceVariableName 11 | 12 | def devise_mapping 13 | @devise_mapping ||= Devise.mappings[:user] 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | def url_with_protocol(url) 3 | if url.blank? 4 | '#' 5 | elsif /^http/.match?(url) 6 | url 7 | else 8 | "http://#{url}" 9 | end 10 | end 11 | 12 | def gravatar_picture(user) 13 | image_tag "#{user.gravatar_url}?s=250", width: '125' 14 | end 15 | 16 | def twitter_url(user) 17 | "http://twitter.com/#{user.twitter}" 18 | end 19 | 20 | def github_url(user) 21 | "http://github.com/#{user.github}" 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubytr/ruby-tr/92775e56f7ae1c0955866981cecf81e99f20554f/app/mailers/.keep -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubytr/ruby-tr/92775e56f7ae1c0955866981cecf81e99f20554f/app/models/.keep -------------------------------------------------------------------------------- /app/models/admin_user.rb: -------------------------------------------------------------------------------- 1 | class AdminUser < ApplicationRecord 2 | # Include default devise modules. Others available are: 3 | # :confirmable, :lockable, :timeoutable and :omniauthable 4 | devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable 5 | has_many :announcements 6 | end 7 | -------------------------------------------------------------------------------- /app/models/announcement.rb: -------------------------------------------------------------------------------- 1 | class Announcement < ApplicationRecord 2 | belongs_to :admin_user 3 | validates :title, :content, presence: true 4 | end 5 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/company.rb: -------------------------------------------------------------------------------- 1 | class Company < ApplicationRecord 2 | belongs_to :user 3 | 4 | after_commit :send_notification, on: :create if Rails.env.production? 5 | 6 | validates :title, :sector, :city, :url, presence: true 7 | validates :title, uniqueness: { case_sensitive: false } 8 | 9 | scope :published, -> { where(published: true) } 10 | 11 | def send_notification 12 | Slack::Notifier.new(ENV.fetch('WEBHOOK_URL', 13 | nil)).ping("Yeni şirket eklendi: #{Company.last.title}") 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubytr/ruby-tr/92775e56f7ae1c0955866981cecf81e99f20554f/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/job.rb: -------------------------------------------------------------------------------- 1 | class Job < ApplicationRecord 2 | validates :title, :company, :description, :link, :location, presence: true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ApplicationRecord 2 | has_many :companies 3 | 4 | validates :name, presence: true 5 | 6 | before_save :the_gravatar_url 7 | devise :database_authenticatable, :registerable, :rememberable, :trackable, :validatable, 8 | :omniauthable, omniauth_providers: [:github] 9 | default_scope { order(created_at: :asc) } 10 | # rubocop:disable Metrics/AbcSize 11 | def self.from_omniauth(auth) 12 | where('email=? OR uid=?', auth.info.email, auth.uid).first_or_create do |user| 13 | user.email = auth.info.email 14 | user.uid = auth.uid 15 | user.gravatar_url = auth.info.image if auth.info.image 16 | user.provider = auth.provider 17 | user.password = Devise.friendly_token[0, 20] 18 | user.name = auth.info.name 19 | user.github = auth.extra.raw_info.login 20 | end 21 | end 22 | # rubocop:enable Metrics/AbcSize 23 | 24 | private 25 | 26 | def the_gravatar_url 27 | self.gravatar_url = Gravatar.new(email).image_url 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /app/views/companies/index.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 8 |
    9 |
    10 |
    11 | <% if user_signed_in? %> 12 | <%= link_to new_company_path do %> 13 | <%= fa_icon "plus-square", text: "Yeni firma ekle" %> 14 | <% end %> 15 | <% else %> 16 | <%= link_to user_github_omniauth_authorize_path, class: 'btn btn-github', method: :post do %> 17 | <%= fab_icon "github", text: "Yeni firma eklemek için GitHub ile giriş yapın" %> 18 | <% end %> 19 | <% end %> 20 |
    21 |
    22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | <% @companies.each do |company| %> 33 | 34 | 35 | 36 | 37 | 46 | 47 | <% end %> 48 | 49 |
    ŞirketSektörŞehirURLs
    <%= company.title %><%= company.sector %><%= company.city %> 38 | <%= link_to fa_icon("globe"), "http://#{company.url}", target: "_blank" %> 39 | <% if company.github.present? %> 40 | <%= link_to fab_icon("github"), "http://github.com/#{company.github}", target: "_blank" %> 41 | <% end %> 42 | <% if company.twitter.present? %> 43 | <%= link_to fab_icon("twitter"), "http://twitter.com/#{company.twitter}", target: "_blank" %> 44 | <% end %> 45 |
    50 |
    51 | -------------------------------------------------------------------------------- /app/views/companies/new.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 7 | 8 | <%= simple_form_for @company do |f| %> 9 |
    10 |
    <%= f.label :title, "Firma adı *" %>
    11 |
    <%= f.input :title, label: false %>
    12 |
    13 | 14 |
    15 |
    <%= f.label :sector, "Sektörünüz *" %>
    16 |
    <%= f.input :sector, label: false, placeholder: 'Eğitim, Sağlık, E-ticaret vb.' %>
    17 |
    18 | 19 |
    20 |
    <%= f.label :city, "Şehir *" %>
    21 |
    <%= f.input :city, label: false %>
    22 |
    23 | 24 |
    25 |
    <%= f.label :url, "Web sayfanız *" %>
    26 |
    <%= f.input :url, label: false, as: :string, placeholder: 'firmaniz.com' %>
    27 |
    28 | 29 |
    30 |
    <%= f.label :github, "Github kullanıcı adı" %>
    31 |
    <%= f.input :github, label: false %>
    32 |
    33 | 34 |
    35 |
    <%= f.label :twitter, "Twitter kullanıcı adı" %>
    36 |
    <%= f.input :twitter, label: false %>
    37 |
    38 | 39 |
    40 | 41 |
    42 |
    <%= f.button :submit, "Firma Ekle" %>
    43 |
    44 | 45 |
    46 | 47 |
    48 | 49 |
    50 | <% end %> 51 |
    52 |
    53 |
    54 | -------------------------------------------------------------------------------- /app/views/devise/registrations/edit.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 11 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> 12 | <%= devise_error_messages! %> 13 |
    14 |
    15 | <%= f.label :email %> 16 |
    17 |
    18 | <%= f.text_field :email, class: "form-control" %> 19 |
    20 |
    21 |
    22 |
    23 | <%= f.label :name %> 24 |
    25 |
    26 | <%= f.text_field :name, class: "form-control" %> 27 |
    28 |
    29 |
    30 |
    31 | <%= f.label :twitter %> 32 |
    33 |
    34 | <%= f.text_field :twitter, class: "form-control" %> 35 |
    36 |
    37 |
    38 |
    39 | <%= f.label :web %> 40 |
    41 |
    42 | <%= f.text_field :web, class: "form-control" %> 43 |
    44 |
    45 |
    46 |
    <%= f.submit 'Kaydet', class: "btn btn-green" %>
    47 |
    48 | <% end %> 49 |
    50 |
    51 |
    52 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ruby Türkiye 6 | 7 | 8 | 9 | <%= stylesheet_link_tag "application", media: "all" %> 10 | <%= csrf_meta_tags %> 11 | 12 | 13 | <%= render 'shared/header' %> 14 | <%= render 'shared/github_ribbon' %> 15 | <%= yield %> 16 | <%= render 'shared/footer' %> 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/views/pages/events.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 7 |
    8 |
    9 |
    10 |
    11 | <% @events.each do |event| %> 12 | 16 | <% end %> 17 |
    18 |
    19 |
    20 | -------------------------------------------------------------------------------- /app/views/pages/irc.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 7 | 8 |
    9 |
    10 |
    11 | -------------------------------------------------------------------------------- /app/views/pages/main.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | <% @announcements.each do |announcement| %> 5 |
    6 |

    <%= announcement.title %>

    7 |

    <%= Kramdown::Document.new(announcement.content).to_html.html_safe %>

    8 |
    9 | <% end %> 10 |
    11 |
    12 | 38 | 44 |
    45 |
    46 |
    47 | -------------------------------------------------------------------------------- /app/views/shared/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 22 | <%= jquery_include_tag :google %> 23 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %> 24 | 35 | -------------------------------------------------------------------------------- /app/views/shared/_github_ribbon.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 | Fork me on Github 4 | 5 |
    -------------------------------------------------------------------------------- /app/views/shared/_header.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 7 |
    8 | 37 |
    38 |
    39 |
    40 |
    41 | -------------------------------------------------------------------------------- /app/views/shared/_notice.erb: -------------------------------------------------------------------------------- 1 | <% if flash[:notice] %> 2 |
    <%= flash[:notice] %>
    3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/users/_user.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | <%= gravatar_picture user %> 5 |
    6 |

    <%= user.name %>

    7 | <% unless user.twitter.blank? %> 8 | <%= link_to twitter_url(user), class: "link", target: "blank", title: "Twitter" do %> 9 | 10 | <% end %> 11 | <% end %> 12 | <% unless user.github.blank? %> 13 | <%= link_to github_url(user), class: "link", target: "blank", title: "Github" do %> 14 | 15 | <% end %> 16 | <% end %> 17 | <% unless user.web.blank? %> 18 | <%= link_to url_with_protocol(user.web), class: "link", target: "blank", title: "Blog" do %> 19 | 20 | <% end %> 21 | <% end %> 22 |
    23 |
    24 | -------------------------------------------------------------------------------- /app/views/users/index.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 7 |
    8 |
    9 | <% unless current_user %> 10 | <%= link_to user_github_omniauth_authorize_path, method: :post, class: "btn btn-github" do %> 11 | Github ile Giriş Yap 12 | <% end %> 13 | <% end %> 14 |
    15 |
    16 |
    17 |
    18 |
    19 |
    20 | <%= render @users %> 21 |
    22 | <%= paginate @users %> 23 |
    24 |
    25 |
    26 | -------------------------------------------------------------------------------- /app/views/users/new.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 7 | 8 | <%= form_for @user do |f| %> 9 |
    10 |
    11 | <%= f.label :name %> 12 |
    13 |
    14 | <%= f.text_field :name, class: "form-control" %> 15 | <% if @user.errors.has_key?(:name) %> 16 | <%= @user.errors[:name].join(',') %> 17 | <% end %> 18 |
    19 |
    20 | 21 |
    22 |
    23 | <%= f.label :email %> 24 |
    25 |
    26 | <%= f.text_field :email, class: "form-control" %> 27 | <% if @user.errors.has_key?(:email) %> 28 | <%= @user.errors[:email].join(',') %> 29 | <% end %> 30 |
    31 |
    32 | 33 |
    34 |
    <%= f.label :web %>
    35 |
    <%= f.text_field :web, class: "form-control" %>
    36 |
    37 | 38 |
    39 |
    <%= f.label :github %>
    40 |
    <%= f.text_field :github, class: "form-control" %>
    41 |
    42 | 43 |
    44 |
    <%= f.label :twitter %>
    45 |
    <%= f.text_field :twitter, class: "form-control" %>
    46 |
    47 | 48 |
    49 |
    50 |
    <%= f.submit 'Kaydet', class: "btn" %>
    51 |
    52 | <% end %> 53 | 54 |
    55 |
    56 |
    57 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/bundler: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'bundler' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('bundler', 'bundler') 17 | -------------------------------------------------------------------------------- /bin/coderay: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'coderay' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('coderay', 'coderay') 17 | -------------------------------------------------------------------------------- /bin/erubis: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'erubis' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('erubis', 'erubis') 17 | -------------------------------------------------------------------------------- /bin/rackup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'rackup' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('rack', 'rackup') 17 | -------------------------------------------------------------------------------- /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/rspec: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | # 4 | # This file was generated by Bundler. 5 | # 6 | # The application 'rspec' is installed as part of a gem, and 7 | # this file is here to facilitate running it. 8 | # 9 | 10 | require "pathname" 11 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 12 | Pathname.new(__FILE__).realpath) 13 | 14 | require "rubygems" 15 | require "bundler/setup" 16 | 17 | load Gem.bin_path("rspec-core", "rspec") 18 | -------------------------------------------------------------------------------- /bin/sass: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'sass' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('sass', 'sass') 17 | -------------------------------------------------------------------------------- /bin/sass-convert: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'sass-convert' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('sass', 'sass-convert') 17 | -------------------------------------------------------------------------------- /bin/scss: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'scss' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('sass', 'scss') 17 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path("..", __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts "== Installing dependencies ==" 17 | system! "gem install bundler --conservative" 18 | system("bundle check") || system!("bundle install") 19 | 20 | # puts "\n== Copying sample files ==" 21 | # unless File.exist?("config/database.yml") 22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml" 23 | # end 24 | 25 | puts "\n== Preparing database ==" 26 | system! "bin/rails db:prepare" 27 | 28 | puts "\n== Removing old logs and tempfiles ==" 29 | system! "bin/rails log:clear tmp:clear" 30 | 31 | puts "\n== Restarting application server ==" 32 | system! "bin/rails restart" 33 | end 34 | -------------------------------------------------------------------------------- /bin/sprockets: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'sprockets' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('sprockets', 'sprockets') 17 | -------------------------------------------------------------------------------- /bin/thin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'thin' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('thin', 'thin') 17 | -------------------------------------------------------------------------------- /bin/thor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'thor' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('thor', 'thor') 17 | -------------------------------------------------------------------------------- /bin/tilt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'tilt' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('tilt', 'tilt') 17 | -------------------------------------------------------------------------------- /bin/tt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'tt' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require 'pathname' 10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", 11 | Pathname.new(__FILE__).realpath) 12 | 13 | require 'rubygems' 14 | require 'bundler/setup' 15 | 16 | load Gem.bin_path('treetop', 'tt') 17 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | require 'fileutils' 4 | include FileUtils 5 | 6 | # path to your application root. 7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 8 | 9 | def system!(*args) 10 | system(*args) || abort("\n== Command #{args} failed ==") 11 | end 12 | 13 | chdir APP_ROOT do 14 | # This script is a way to update your development environment automatically. 15 | # Add necessary update steps to this file. 16 | 17 | puts '== Installing dependencies ==' 18 | system! 'gem install bundler --conservative' 19 | system('bundle check') || system!('bundle install') 20 | 21 | puts "\n== Updating database ==" 22 | system! 'bin/rails db:migrate' 23 | 24 | puts "\n== Removing old logs and tempfiles ==" 25 | system! 'bin/rails log:clear tmp:clear' 26 | 27 | puts "\n== Restarting application server ==" 28 | system! 'bin/rails restart' 29 | end 30 | -------------------------------------------------------------------------------- /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/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module RubyTr 10 | class Application < Rails::Application 11 | # Initialize configuration defaults for originally generated Rails version. 12 | config.load_defaults 7.0 13 | 14 | # Configuration for the application, engines, and railties goes here. 15 | # 16 | # These settings can be overridden in specific environments using the files 17 | # in config/environments, which are processed later. 18 | # 19 | # config.time_zone = "Central Time (US & Canada)" 20 | # config.eager_load_paths << Rails.root.join("extras") 21 | 22 | config.i18n.default_locale = :tr 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /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/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: ruby_tr_production 11 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: postgresql 23 | pool: 5 24 | timeout: 5000 25 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # In the development environment your application's code is reloaded any time 7 | # it changes. This slows down response time but is perfect for development 8 | # since you don't have to restart the web server when you make code changes. 9 | config.cache_classes = false 10 | 11 | # Do not eager load code on boot. 12 | config.eager_load = false 13 | 14 | # Show full error reports. 15 | config.consider_all_requests_local = true 16 | 17 | # Enable server timing 18 | config.server_timing = true 19 | 20 | # Enable/disable caching. By default caching is disabled. 21 | # Run rails dev:cache to toggle caching. 22 | if Rails.root.join("tmp/caching-dev.txt").exist? 23 | config.action_controller.perform_caching = true 24 | config.action_controller.enable_fragment_cache_logging = true 25 | 26 | config.cache_store = :memory_store 27 | config.public_file_server.headers = { 28 | "Cache-Control" => "public, max-age=#{2.days.to_i}" 29 | } 30 | else 31 | config.action_controller.perform_caching = false 32 | 33 | config.cache_store = :null_store 34 | end 35 | 36 | # Store uploaded files on the local file system (see config/storage.yml for options). 37 | config.active_storage.service = :local 38 | 39 | # Don't care if the mailer can't send. 40 | config.action_mailer.raise_delivery_errors = false 41 | 42 | config.action_mailer.perform_caching = false 43 | 44 | # Print deprecation notices to the Rails logger. 45 | config.active_support.deprecation = :log 46 | 47 | # Raise exceptions for disallowed deprecations. 48 | config.active_support.disallowed_deprecation = :raise 49 | 50 | # Tell Active Support which deprecation messages to disallow. 51 | config.active_support.disallowed_deprecation_warnings = [] 52 | 53 | # Raise an error on page load if there are pending migrations. 54 | config.active_record.migration_error = :page_load 55 | 56 | # Highlight code that triggered database queries in logs. 57 | config.active_record.verbose_query_logs = true 58 | 59 | # Suppress logger output for asset requests. 60 | config.assets.quiet = true 61 | 62 | # Raises error for missing translations. 63 | # config.i18n.raise_on_missing_translations = true 64 | 65 | # Annotate rendered view with file names. 66 | # config.action_view.annotate_rendered_view_with_filenames = true 67 | 68 | # Uncomment if you wish to allow Action Cable access from any origin. 69 | # config.action_cable.disable_request_forgery_protection = true 70 | end 71 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # Code is not reloaded between requests. 7 | config.cache_classes = true 8 | 9 | # Eager load code on boot. This eager loads most of Rails and 10 | # your application in memory, allowing both threaded web servers 11 | # and those relying on copy on write to perform better. 12 | # Rake tasks automatically ignore this option for performance. 13 | config.eager_load = true 14 | 15 | # Full error reports are disabled and caching is turned on. 16 | config.consider_all_requests_local = false 17 | config.action_controller.perform_caching = true 18 | 19 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 20 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 21 | # config.require_master_key = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? 26 | 27 | # Compress CSS using a preprocessor. 28 | # config.assets.css_compressor = :sass 29 | 30 | # Do not fallback to assets pipeline if a precompiled asset is missed. 31 | config.assets.compile = true 32 | 33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 34 | # config.asset_host = "http://assets.example.com" 35 | 36 | # Specifies the header that your server uses for sending files. 37 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache 38 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX 39 | 40 | # Store uploaded files on the local file system (see config/storage.yml for options). 41 | config.active_storage.service = :local 42 | 43 | # Mount Action Cable outside main process or domain. 44 | # config.action_cable.mount_path = nil 45 | # config.action_cable.url = "wss://example.com/cable" 46 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] 47 | 48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 49 | # config.force_ssl = true 50 | 51 | # Include generic and useful information about system operation, but avoid logging too much 52 | # information to avoid inadvertent exposure of personally identifiable information (PII). 53 | config.log_level = :info 54 | 55 | # Prepend all log lines with the following tags. 56 | config.log_tags = [ :request_id ] 57 | 58 | # Use a different cache store in production. 59 | # config.cache_store = :mem_cache_store 60 | 61 | # Use a real queuing backend for Active Job (and separate queues per environment). 62 | # config.active_job.queue_adapter = :resque 63 | # config.active_job.queue_name_prefix = "ruby_tr_production" 64 | 65 | config.action_mailer.perform_caching = false 66 | 67 | # Ignore bad email addresses and do not raise email delivery errors. 68 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 69 | # config.action_mailer.raise_delivery_errors = false 70 | 71 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 72 | # the I18n.default_locale when a translation cannot be found). 73 | config.i18n.fallbacks = true 74 | 75 | # Don't log any deprecations. 76 | config.active_support.report_deprecations = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | 81 | # Use a different logger for distributed setups. 82 | # require "syslog/logger" 83 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") 84 | 85 | if ENV["RAILS_LOG_TO_STDOUT"].present? 86 | logger = ActiveSupport::Logger.new(STDOUT) 87 | logger.formatter = config.log_formatter 88 | config.logger = ActiveSupport::TaggedLogging.new(logger) 89 | end 90 | 91 | # Do not dump schema after migrations. 92 | config.active_record.dump_schema_after_migration = false 93 | end 94 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | 8 | Rails.application.configure do 9 | # Settings specified here will take precedence over those in config/application.rb. 10 | 11 | # Turn false under Spring and add config.action_view.cache_template_loading = true. 12 | config.cache_classes = true 13 | 14 | # Eager loading loads your whole application. When running a single test locally, 15 | # this probably isn't necessary. It's a good idea to do in a continuous integration 16 | # system, or in some way before deploying your code. 17 | config.eager_load = ENV["CI"].present? 18 | 19 | # Configure public file server for tests with Cache-Control for performance. 20 | config.public_file_server.enabled = true 21 | config.public_file_server.headers = { 22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}" 23 | } 24 | 25 | # Show full error reports and disable caching. 26 | config.consider_all_requests_local = true 27 | config.action_controller.perform_caching = false 28 | config.cache_store = :null_store 29 | 30 | # Raise exceptions instead of rendering exception templates. 31 | config.action_dispatch.show_exceptions = false 32 | 33 | # Disable request forgery protection in test environment. 34 | config.action_controller.allow_forgery_protection = false 35 | 36 | # Store uploaded files on the local file system in a temporary directory. 37 | config.active_storage.service = :test 38 | 39 | config.action_mailer.perform_caching = false 40 | 41 | # Tell Action Mailer not to deliver emails to the real world. 42 | # The :test delivery method accumulates sent emails in the 43 | # ActionMailer::Base.deliveries array. 44 | config.action_mailer.delivery_method = :test 45 | 46 | # Print deprecation notices to the stderr. 47 | config.active_support.deprecation = :stderr 48 | 49 | # Raise exceptions for disallowed deprecations. 50 | config.active_support.disallowed_deprecation = :raise 51 | 52 | # Tell Active Support which deprecation messages to disallow. 53 | config.active_support.disallowed_deprecation_warnings = [] 54 | 55 | # Raises error for missing translations. 56 | # config.i18n.raise_on_missing_translations = true 57 | 58 | # Annotate rendered view with file names. 59 | # config.action_view.annotate_rendered_view_with_filenames = true 60 | end 61 | -------------------------------------------------------------------------------- /config/initializers/active_admin.rb: -------------------------------------------------------------------------------- 1 | ActiveAdmin.setup do |config| 2 | # == Site Title 3 | # 4 | # Set the title that is displayed on the main layout 5 | # for each of the active admin pages. 6 | # 7 | config.site_title = "Ruby Tr" 8 | 9 | # Set the link url for the title. For example, to take 10 | # users to your main site. Defaults to no link. 11 | # 12 | # config.site_title_link = "/" 13 | 14 | # Set an optional image to be displayed for the header 15 | # instead of a string (overrides :site_title) 16 | # 17 | # Note: Aim for an image that's 21px high so it fits in the header. 18 | # 19 | # config.site_title_image = "logo.png" 20 | 21 | # == Default Namespace 22 | # 23 | # Set the default namespace each administration resource 24 | # will be added to. 25 | # 26 | # eg: 27 | # config.default_namespace = :hello_world 28 | # 29 | # This will create resources in the HelloWorld module and 30 | # will namespace routes to /hello_world/* 31 | # 32 | # To set no namespace by default, use: 33 | # config.default_namespace = false 34 | # 35 | # Default: 36 | # config.default_namespace = :admin 37 | # 38 | # You can customize the settings for each namespace by using 39 | # a namespace block. For example, to change the site title 40 | # within a namespace: 41 | # 42 | # config.namespace :admin do |admin| 43 | # admin.site_title = "Custom Admin Title" 44 | # end 45 | # 46 | # This will ONLY change the title for the admin section. Other 47 | # namespaces will continue to use the main "site_title" configuration. 48 | 49 | # == User Authentication 50 | # 51 | # Active Admin will automatically call an authentication 52 | # method in a before filter of all controller actions to 53 | # ensure that there is a currently logged in admin user. 54 | # 55 | # This setting changes the method which Active Admin calls 56 | # within the application controller. 57 | config.authentication_method = :authenticate_admin_user! 58 | 59 | # == User Authorization 60 | # 61 | # Active Admin will automatically call an authorization 62 | # method in a before filter of all controller actions to 63 | # ensure that there is a user with proper rights. You can use 64 | # CanCanAdapter or make your own. Please refer to documentation. 65 | # config.authorization_adapter = ActiveAdmin::CanCanAdapter 66 | 67 | # In case you prefer Pundit over other solutions you can here pass 68 | # the name of default policy class. This policy will be used in every 69 | # case when Pundit is unable to find suitable policy. 70 | # config.pundit_default_policy = "MyDefaultPunditPolicy" 71 | 72 | # You can customize your CanCan Ability class name here. 73 | # config.cancan_ability_class = "Ability" 74 | 75 | # You can specify a method to be called on unauthorized access. 76 | # This is necessary in order to prevent a redirect loop which happens 77 | # because, by default, user gets redirected to Dashboard. If user 78 | # doesn't have access to Dashboard, he'll end up in a redirect loop. 79 | # Method provided here should be defined in application_controller.rb. 80 | # config.on_unauthorized_access = :access_denied 81 | 82 | # == Current User 83 | # 84 | # Active Admin will associate actions with the current 85 | # user performing them. 86 | # 87 | # This setting changes the method which Active Admin calls 88 | # (within the application controller) to return the currently logged in user. 89 | config.current_user_method = :current_admin_user 90 | 91 | # == Logging Out 92 | # 93 | # Active Admin displays a logout link on each screen. These 94 | # settings configure the location and method used for the link. 95 | # 96 | # This setting changes the path where the link points to. If it's 97 | # a string, the strings is used as the path. If it's a Symbol, we 98 | # will call the method to return the path. 99 | # 100 | # Default: 101 | config.logout_link_path = :destroy_admin_user_session_path 102 | 103 | # This setting changes the http method used when rendering the 104 | # link. For example :get, :delete, :put, etc.. 105 | # 106 | # Default: 107 | # config.logout_link_method = :get 108 | 109 | # == Root 110 | # 111 | # Set the action to call for the root path. You can set different 112 | # roots for each namespace. 113 | # 114 | # Default: 115 | # config.root_to = 'dashboard#index' 116 | 117 | # == Admin Comments 118 | # 119 | # This allows your users to comment on any resource registered with Active Admin. 120 | # 121 | # You can completely disable comments: 122 | # config.comments = false 123 | # 124 | # You can disable the menu item for the comments index page: 125 | # config.show_comments_in_menu = false 126 | # 127 | # You can change the name under which comments are registered: 128 | # config.comments_registration_name = 'AdminComment' 129 | # 130 | # You can change the order for the comments and you can change the column 131 | # to be used for ordering 132 | # config.comments_order = 'created_at ASC' 133 | 134 | # == Batch Actions 135 | # 136 | # Enable and disable Batch Actions 137 | # 138 | config.batch_actions = true 139 | 140 | # == Controller Filters 141 | # 142 | # You can add before, after and around filters to all of your 143 | # Active Admin resources and pages from here. 144 | # 145 | # config.before_filter :do_something_awesome 146 | 147 | # == Localize Date/Time Format 148 | # 149 | # Set the localize format to display dates and times. 150 | # To understand how to localize your app with I18n, read more at 151 | # https://github.com/svenfuchs/i18n/blob/master/lib%2Fi18n%2Fbackend%2Fbase.rb#L52 152 | # 153 | config.localize_format = :long 154 | 155 | # == Setting a Favicon 156 | # 157 | # config.favicon = 'favicon.ico' 158 | 159 | # == Meta Tags 160 | # 161 | # Add additional meta tags to the head element of active admin pages. 162 | # 163 | # Add tags to all pages logged in users see: 164 | # config.meta_tags = { author: 'My Company' } 165 | 166 | # By default, sign up/sign in/recover password pages are excluded 167 | # from showing up in search engine results by adding a robots meta 168 | # tag. You can reset the hash of meta tags included in logged out 169 | # pages: 170 | # config.meta_tags_for_logged_out_pages = {} 171 | 172 | # == Removing Breadcrumbs 173 | # 174 | # Breadcrumbs are enabled by default. You can customize them for individual 175 | # resources or you can disable them globally from here. 176 | # 177 | # config.breadcrumb = false 178 | 179 | # == Register Stylesheets & Javascripts 180 | # 181 | # We recommend using the built in Active Admin layout and loading 182 | # up your own stylesheets / javascripts to customize the look 183 | # and feel. 184 | # 185 | # To load a stylesheet: 186 | # config.register_stylesheet 'my_stylesheet.css' 187 | # 188 | # You can provide an options hash for more control, which is passed along to stylesheet_link_tag(): 189 | # config.register_stylesheet 'my_print_stylesheet.css', media: :print 190 | # 191 | # To load a javascript file: 192 | # config.register_javascript 'my_javascript.js' 193 | 194 | # == CSV options 195 | # 196 | # Set the CSV builder separator 197 | # config.csv_options = { col_sep: ';' } 198 | # 199 | # Force the use of quotes 200 | # config.csv_options = { force_quotes: true } 201 | 202 | # == Menu System 203 | # 204 | # You can add a navigation menu to be used in your application, or configure a provided menu 205 | # 206 | # To change the default utility navigation to show a link to your website & a logout btn 207 | # 208 | # config.namespace :admin do |admin| 209 | # admin.build_menu :utility_navigation do |menu| 210 | # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank } 211 | # admin.add_logout_button_to_menu menu 212 | # end 213 | # end 214 | # 215 | # If you wanted to add a static menu item to the default menu provided: 216 | # 217 | # config.namespace :admin do |admin| 218 | # admin.build_menu :default do |menu| 219 | # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank } 220 | # end 221 | # end 222 | 223 | # == Download Links 224 | # 225 | # You can disable download links on resource listing pages, 226 | # or customize the formats shown per namespace/globally 227 | # 228 | # To disable/customize for the :admin namespace: 229 | # 230 | # config.namespace :admin do |admin| 231 | # 232 | # # Disable the links entirely 233 | # admin.download_links = false 234 | # 235 | # # Only show XML & PDF options 236 | # admin.download_links = [:xml, :pdf] 237 | # 238 | # # Enable/disable the links based on block 239 | # # (for example, with cancan) 240 | # admin.download_links = proc { can?(:view_download_links) } 241 | # 242 | # end 243 | 244 | # == Pagination 245 | # 246 | # Pagination is enabled by default for all resources. 247 | # You can control the default per page count for all resources here. 248 | # 249 | # config.default_per_page = 30 250 | # 251 | # You can control the max per page count too. 252 | # 253 | # config.max_per_page = 10_000 254 | 255 | # == Filters 256 | # 257 | # By default the index screen includes a "Filters" sidebar on the right 258 | # hand side with a filter for each attribute of the registered model. 259 | # You can enable or disable them for all resources here. 260 | # 261 | # config.filters = true 262 | # 263 | # By default the filters include associations in a select, which means 264 | # that every record will be loaded for each association. 265 | # You can enabled or disable the inclusion 266 | # of those filters by default here. 267 | # 268 | # config.include_default_association_filters = true 269 | end 270 | -------------------------------------------------------------------------------- /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 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in the app/assets 11 | # folder are already added. 12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 13 | -------------------------------------------------------------------------------- /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/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide content security policy. 4 | # See the Securing Rails Applications Guide for more information: 5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header 6 | 7 | # Rails.application.configure do 8 | # config.content_security_policy do |policy| 9 | # policy.default_src :self, :https 10 | # policy.font_src :self, :https, :data 11 | # policy.img_src :self, :https, :data 12 | # policy.object_src :none 13 | # policy.script_src :self, :https 14 | # policy.style_src :self, :https 15 | # # Specify URI for violation reports 16 | # # policy.report_uri "/csp-violation-report-endpoint" 17 | # end 18 | # 19 | # # Generate session nonces for permitted importmap and inline scripts 20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } 21 | # config.content_security_policy_nonce_directives = %w(script-src) 22 | # 23 | # # Report violations without enforcing the policy. 24 | # # config.content_security_policy_report_only = true 25 | # end 26 | -------------------------------------------------------------------------------- /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 = :hybrid 6 | -------------------------------------------------------------------------------- /config/initializers/devise.rb: -------------------------------------------------------------------------------- 1 | # Use this hook to configure devise mailer, warden hooks and so forth. 2 | # Many of these configuration options can be set straight in your model. 3 | Devise.setup do |config| 4 | # The secret key used by Devise. Devise uses this key to generate 5 | # random tokens. Changing this key will render invalid all existing 6 | # confirmation, reset password and unlock tokens in the database. 7 | # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key` 8 | # by default. You can change it below and use your own secret key. 9 | # config.secret_key = 'fa3a14047470b8e1f5a79494f429318b03022913143d1cc191fa149bdb4a8330f50d46e1b6ea2f5275fb319318babe36af4025c213d6313bf40375be6b2fa208' 10 | 11 | # ==> Mailer Configuration 12 | # Configure the e-mail address which will be shown in Devise::Mailer, 13 | # note that it will be overwritten if you use your own mailer class 14 | # with default "from" parameter. 15 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' 16 | 17 | # Configure the class responsible to send e-mails. 18 | # config.mailer = 'Devise::Mailer' 19 | 20 | # ==> ORM configuration 21 | # Load and configure the ORM. Supports :active_record (default) and 22 | # :mongoid (bson_ext recommended) by default. Other ORMs may be 23 | # available as additional gems. 24 | require 'devise/orm/active_record' 25 | 26 | # ==> Configuration for any authentication mechanism 27 | # Configure which keys are used when authenticating a user. The default is 28 | # just :email. You can configure it to use [:username, :subdomain], so for 29 | # authenticating a user, both parameters are required. Remember that those 30 | # parameters are used only when authenticating and not when retrieving from 31 | # session. If you need permissions, you should implement that in a before filter. 32 | # You can also supply a hash where the value is a boolean determining whether 33 | # or not authentication should be aborted when the value is not present. 34 | # config.authentication_keys = [:email] 35 | 36 | # Configure parameters from the request object used for authentication. Each entry 37 | # given should be a request method and it will automatically be passed to the 38 | # find_for_authentication method and considered in your model lookup. For instance, 39 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. 40 | # The same considerations mentioned for authentication_keys also apply to request_keys. 41 | # config.request_keys = [] 42 | 43 | # Configure which authentication keys should be case-insensitive. 44 | # These keys will be downcased upon creating or modifying a user and when used 45 | # to authenticate or find a user. Default is :email. 46 | config.case_insensitive_keys = [:email] 47 | 48 | # Configure which authentication keys should have whitespace stripped. 49 | # These keys will have whitespace before and after removed upon creating or 50 | # modifying a user and when used to authenticate or find a user. Default is :email. 51 | config.strip_whitespace_keys = [:email] 52 | 53 | # Tell if authentication through request.params is enabled. True by default. 54 | # It can be set to an array that will enable params authentication only for the 55 | # given strategies, for example, `config.params_authenticatable = [:database]` will 56 | # enable it only for database (email + password) authentication. 57 | # config.params_authenticatable = true 58 | 59 | # Tell if authentication through HTTP Auth is enabled. False by default. 60 | # It can be set to an array that will enable http authentication only for the 61 | # given strategies, for example, `config.http_authenticatable = [:database]` will 62 | # enable it only for database authentication. The supported strategies are: 63 | # :database = Support basic authentication with authentication key + password 64 | # config.http_authenticatable = false 65 | 66 | # If 401 status code should be returned for AJAX requests. True by default. 67 | # config.http_authenticatable_on_xhr = true 68 | 69 | # The realm used in Http Basic Authentication. 'Application' by default. 70 | # config.http_authentication_realm = 'Application' 71 | 72 | # It will change confirmation, password recovery and other workflows 73 | # to behave the same regardless if the e-mail provided was right or wrong. 74 | # Does not affect registerable. 75 | # config.paranoid = true 76 | 77 | # By default Devise will store the user in session. You can skip storage for 78 | # particular strategies by setting this option. 79 | # Notice that if you are skipping storage for all authentication paths, you 80 | # may want to disable generating routes to Devise's sessions controller by 81 | # passing skip: :sessions to `devise_for` in your config/routes.rb 82 | config.skip_session_storage = [:http_auth] 83 | 84 | # By default, Devise cleans up the CSRF token on authentication to 85 | # avoid CSRF token fixation attacks. This means that, when using AJAX 86 | # requests for sign in and sign up, you need to get a new CSRF token 87 | # from the server. You can disable this option at your own risk. 88 | # config.clean_up_csrf_token_on_authentication = true 89 | 90 | # ==> Configuration for :database_authenticatable 91 | # For bcrypt, this is the cost for hashing the password and defaults to 10. If 92 | # using other encryptors, it sets how many times you want the password re-encrypted. 93 | # 94 | # Limiting the stretches to just one in testing will increase the performance of 95 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use 96 | # a value less than 10 in other environments. Note that, for bcrypt (the default 97 | # encryptor), the cost increases exponentially with the number of stretches (e.g. 98 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). 99 | config.stretches = Rails.env.test? ? 1 : 10 100 | 101 | # Setup a pepper to generate the encrypted password. 102 | # config.pepper = '7b7762a27d10ee731f977c945f475bf1391c3c8c9c9e5ea383634c8fa18df9bf93e01fd8f20eefca18948361471ed1c4d4fcf52080609842d606ae350bb12692' 103 | 104 | # ==> Configuration for :confirmable 105 | # A period that the user is allowed to access the website even without 106 | # confirming their account. For instance, if set to 2.days, the user will be 107 | # able to access the website for two days without confirming their account, 108 | # access will be blocked just in the third day. Default is 0.days, meaning 109 | # the user cannot access the website without confirming their account. 110 | # config.allow_unconfirmed_access_for = 2.days 111 | 112 | # A period that the user is allowed to confirm their account before their 113 | # token becomes invalid. For example, if set to 3.days, the user can confirm 114 | # their account within 3 days after the mail was sent, but on the fourth day 115 | # their account can't be confirmed with the token any more. 116 | # Default is nil, meaning there is no restriction on how long a user can take 117 | # before confirming their account. 118 | # config.confirm_within = 3.days 119 | 120 | # If true, requires any email changes to be confirmed (exactly the same way as 121 | # initial account confirmation) to be applied. Requires additional unconfirmed_email 122 | # db field (see migrations). Until confirmed, new email is stored in 123 | # unconfirmed_email column, and copied to email column on successful confirmation. 124 | config.reconfirmable = true 125 | 126 | # Defines which key will be used when confirming an account 127 | # config.confirmation_keys = [:email] 128 | 129 | # ==> Configuration for :rememberable 130 | # The time the user will be remembered without asking for credentials again. 131 | # config.remember_for = 2.weeks 132 | 133 | # Invalidates all the remember me tokens when the user signs out. 134 | config.expire_all_remember_me_on_sign_out = true 135 | 136 | # If true, extends the user's remember period when remembered via cookie. 137 | # config.extend_remember_period = false 138 | 139 | # Options to be passed to the created cookie. For instance, you can set 140 | # secure: true in order to force SSL only cookies. 141 | # config.rememberable_options = {} 142 | 143 | # ==> Configuration for :validatable 144 | # Range for password length. 145 | config.password_length = 8..72 146 | 147 | # Email regex used to validate email formats. It simply asserts that 148 | # one (and only one) @ exists in the given string. This is mainly 149 | # to give user feedback and not to assert the e-mail validity. 150 | # config.email_regexp = /\A[^@]+@[^@]+\z/ 151 | 152 | # ==> Configuration for :timeoutable 153 | # The time you want to timeout the user session without activity. After this 154 | # time the user will be asked for credentials again. Default is 30 minutes. 155 | # config.timeout_in = 30.minutes 156 | 157 | # ==> Configuration for :lockable 158 | # Defines which strategy will be used to lock an account. 159 | # :failed_attempts = Locks an account after a number of failed attempts to sign in. 160 | # :none = No lock strategy. You should handle locking by yourself. 161 | # config.lock_strategy = :failed_attempts 162 | 163 | # Defines which key will be used when locking and unlocking an account 164 | # config.unlock_keys = [:email] 165 | 166 | # Defines which strategy will be used to unlock an account. 167 | # :email = Sends an unlock link to the user email 168 | # :time = Re-enables login after a certain amount of time (see :unlock_in below) 169 | # :both = Enables both strategies 170 | # :none = No unlock strategy. You should handle unlocking by yourself. 171 | # config.unlock_strategy = :both 172 | 173 | # Number of authentication tries before locking an account if lock_strategy 174 | # is failed attempts. 175 | # config.maximum_attempts = 20 176 | 177 | # Time interval to unlock the account if :time is enabled as unlock_strategy. 178 | # config.unlock_in = 1.hour 179 | 180 | # Warn on the last attempt before the account is locked. 181 | # config.last_attempt_warning = true 182 | 183 | # ==> Configuration for :recoverable 184 | # 185 | # Defines which key will be used when recovering the password for an account 186 | # config.reset_password_keys = [:email] 187 | 188 | # Time interval you can reset your password with a reset password key. 189 | # Don't put a too small interval or your users won't have the time to 190 | # change their passwords. 191 | config.reset_password_within = 6.hours 192 | 193 | # When set to false, does not sign a user in automatically after their password is 194 | # reset. Defaults to true, so a user is signed in automatically after a reset. 195 | # config.sign_in_after_reset_password = true 196 | 197 | # ==> Configuration for :encryptable 198 | # Allow you to use another encryption algorithm besides bcrypt (default). You can use 199 | # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, 200 | # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) 201 | # and :restful_authentication_sha1 (then you should set stretches to 10, and copy 202 | # REST_AUTH_SITE_KEY to pepper). 203 | # 204 | # Require the `devise-encryptable` gem when using anything other than bcrypt 205 | # config.encryptor = :sha512 206 | 207 | # ==> Scopes configuration 208 | # Turn scoped views on. Before rendering "sessions/new", it will first check for 209 | # "users/sessions/new". It's turned off by default because it's slower if you 210 | # are using only default views. 211 | # config.scoped_views = false 212 | 213 | # Configure the default scope given to Warden. By default it's the first 214 | # devise role declared in your routes (usually :user). 215 | # config.default_scope = :user 216 | 217 | # Set this configuration to false if you want /users/sign_out to sign out 218 | # only the current scope. By default, Devise signs out all scopes. 219 | # config.sign_out_all_scopes = true 220 | 221 | # ==> Navigation configuration 222 | # Lists the formats that should be treated as navigational. Formats like 223 | # :html, should redirect to the sign in page when the user does not have 224 | # access, but formats like :xml or :json, should return 401. 225 | # 226 | # If you have any extra navigational formats, like :iphone or :mobile, you 227 | # should add them to the navigational formats lists. 228 | # 229 | # The "*/*" below is required to match Internet Explorer requests. 230 | # config.navigational_formats = ['*/*', :html] 231 | 232 | # The default HTTP method used to sign out a resource. Default is :delete. 233 | config.sign_out_via = :delete 234 | 235 | # ==> OmniAuth 236 | # Add a new OmniAuth provider. Check the wiki for more information on setting 237 | # up on your models and hooks. 238 | config.omniauth :github, ENV['GITHUB_APP_ID'], ENV['GITHUB_APP_SECRET'], scope: 'user' 239 | 240 | # ==> Warden configuration 241 | # If you want to use other strategies, that are not supported by Devise, or 242 | # change the failure app, you can configure them inside the config.warden block. 243 | # 244 | # config.warden do |manager| 245 | # manager.intercept_401 = false 246 | # manager.default_strategies(scope: :user).unshift :some_external_strategy 247 | # end 248 | 249 | # ==> Mountable engine configurations 250 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine 251 | # is mountable, there are some extra configurations to be taken into account. 252 | # The following options are available, assuming the engine is mounted as: 253 | # 254 | # mount MyEngine, at: '/my_engine' 255 | # 256 | # The router that invoked `devise_for`, in the example above, would be: 257 | # config.router_name = :my_engine 258 | # 259 | # When using OmniAuth, Devise cannot automatically set OmniAuth path, 260 | # so you need to do it manually. For the users scope, it would be: 261 | # config.omniauth_path_prefix = '/my_engine/users/auth' 262 | end 263 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of 4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported 5 | # notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, "\\1en" 8 | # inflect.singular /^(ox)en/i, "\\1" 9 | # inflect.irregular "person", "people" 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym "RESTful" 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/new_framework_defaults_5_1.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file contains migration options to ease your Rails 5.1 upgrade. 4 | # 5 | # Once upgraded flip defaults one by one to migrate to the new default. 6 | # 7 | # Read the Guide for Upgrading Ruby on Rails for more info on each option. 8 | 9 | # Make `form_with` generate non-remote forms. 10 | Rails.application.config.action_view.form_with_generates_remote_forms = false 11 | 12 | # Unknown asset fallback will return the path passed in when the given 13 | # asset is not present in the asset pipeline. 14 | # Rails.application.config.assets.unknown_asset_fallback = false 15 | -------------------------------------------------------------------------------- /config/initializers/new_framework_defaults_6_1.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file contains migration options to ease your Rails 6.1 upgrade. 4 | # 5 | # Once upgraded flip defaults one by one to migrate to the new default. 6 | # 7 | # Read the Guide for Upgrading Ruby on Rails for more info on each option. 8 | 9 | # Support for inversing belongs_to -> has_many Active Record associations. 10 | # Rails.application.config.active_record.has_many_inversing = true 11 | 12 | # Track Active Storage variants in the database. 13 | # Rails.application.config.active_storage.track_variants = true 14 | 15 | # Apply random variation to the delay when retrying failed jobs. 16 | # Rails.application.config.active_job.retry_jitter = 0.15 17 | 18 | # Stop executing `after_enqueue`/`after_perform` callbacks if 19 | # `before_enqueue`/`before_perform` respectively halts with `throw :abort`. 20 | # Rails.application.config.active_job.skip_after_callbacks_if_terminated = true 21 | 22 | # Specify cookies SameSite protection level: either :none, :lax, or :strict. 23 | # 24 | # This change is not backwards compatible with earlier Rails versions. 25 | # It's best enabled when your entire app is migrated and stable on 6.1. 26 | # Rails.application.config.action_dispatch.cookies_same_site_protection = :lax 27 | 28 | # Generate CSRF tokens that are encoded in URL-safe Base64. 29 | # 30 | # This change is not backwards compatible with earlier Rails versions. 31 | # It's best enabled when your entire app is migrated and stable on 6.1. 32 | # Rails.application.config.action_controller.urlsafe_csrf_tokens = true 33 | 34 | # Specify whether `ActiveSupport::TimeZone.utc_to_local` returns a time with an 35 | # UTC offset or a UTC time. 36 | # ActiveSupport.utc_to_local_returns_utc_offset_times = true 37 | 38 | # Change the default HTTP status code to `308` when redirecting non-GET/HEAD 39 | # requests to HTTPS in `ActionDispatch::SSL` middleware. 40 | # Rails.application.config.action_dispatch.ssl_default_redirect_status = 308 41 | 42 | # Use new connection handling API. For most applications this won't have any 43 | # effect. For applications using multiple databases, this new API provides 44 | # support for granular connection swapping. 45 | # Rails.application.config.active_record.legacy_connection_handling = false 46 | 47 | # Make `form_with` generate non-remote forms by default. 48 | # Rails.application.config.action_view.form_with_generates_remote_forms = false 49 | 50 | # Set the default queue name for the analysis job to the queue adapter default. 51 | # Rails.application.config.active_storage.queues.analysis = nil 52 | 53 | # Set the default queue name for the purge job to the queue adapter default. 54 | # Rails.application.config.active_storage.queues.purge = nil 55 | 56 | # Set the default queue name for the incineration job to the queue adapter default. 57 | # Rails.application.config.action_mailbox.queues.incineration = nil 58 | 59 | # Set the default queue name for the routing job to the queue adapter default. 60 | # Rails.application.config.action_mailbox.queues.routing = nil 61 | 62 | # Set the default queue name for the mail deliver job to the queue adapter default. 63 | # Rails.application.config.action_mailer.deliver_later_queue_name = nil 64 | 65 | # Generate a `Link` header that gives a hint to modern browsers about 66 | # preloading assets when using `javascript_include_tag` and `stylesheet_link_tag`. 67 | # Rails.application.config.action_view.preload_links_header = true 68 | -------------------------------------------------------------------------------- /config/initializers/new_framework_defaults_7_0.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file eases your Rails 7.0 framework defaults upgrade. 4 | # 5 | # Uncomment each configuration one by one to switch to the new default. 6 | # Once your application is ready to run with all new defaults, you can remove 7 | # this file and set the `config.load_defaults` to `7.0`. 8 | # 9 | # Read the Guide for Upgrading Ruby on Rails for more info on each option. 10 | # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html 11 | 12 | # `button_to` view helper will render `