Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #483 from omu/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
msdundar authored Oct 31, 2018
2 parents 2afe8ec + d9e3f66 commit 7c27514
Show file tree
Hide file tree
Showing 193 changed files with 76,335 additions and 6,809 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Vagrantfile @roktas @huseyin @ecylmz @sinansh
.codebeatsettings @msdundar @roktas @isubas @ecmelkytz
.gitignore @msdundar @roktas @isubas @ecmelkytz
.rubocop.yml @msdundar @roktas @isubas @ecmelkytz
/docs/ @msdundar @roktas @isubas @ecmelkytz
/doc/ @msdundar @roktas @isubas @ecmelkytz

# Back-end
/app/ @msdundar @ecmelkytz @dilara @isubas @sinansh
Expand Down
16 changes: 8 additions & 8 deletions docs/CONTRIBUTING.md → .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Bu projede herhangi bir güvenlik açığı tespit ederseniz lütfen `security@b

- Projeye katkı sağlamadan önce, katkı sağlamak istediğiniz konuyla ilişkili bir iş kaydı açın. İş kaydı bulunmayan ve bir iş kaydına atıfta bulunmayan pull request'ler değerlendirmeye alınmayabilir veya geç değerlendirmeye alınabilir.

- [Issue](/docs/git/issue.md) kurallarını dikkatlice gözden geçirin.
- [Issue](/doc/git/issue.md) kurallarını dikkatlice gözden geçirin.

### Geliştirme Öncesi
---------------------
Expand All @@ -51,21 +51,21 @@ Harici servisler yalnızca BAUM-VPN'e açıktır. Geliştirme yaparken ihtiyaç

- Projeye yazma yetkiniz varsa projeyi klonlayın, yazma yetkiniz yoksa projeyi `fork` edin.

- [Branch](/docs/git/branch.md) kurallarını dikkatlice gözden geçirin.
- [Branch](/doc/git/branch.md) kurallarını dikkatlice gözden geçirin.

- Proje klonunda veya kendi `fork`'unuzda, branch kurallarını dikkate alan bir branch oluşturun: `git checkout -b my-awesome-feature`

- [Kurulum dokümanını](/docs/development/installation.md) takip ederek projenin kurulumunu yapın.
- [Kurulum dokümanını](/doc/development/installation.md) takip ederek projenin kurulumunu yapın.

- [Stil](/docs/style/) kurallarını dikkatlice gözden geçirin.
- [Stil](/doc/style/) kurallarını dikkatlice gözden geçirin.

- Kod üzerinde değişiklikleri yapın.

- [Commit](/docs/git/commit.md) kurallarını dikkatlice gözden geçirin.
- [Commit](/doc/git/commit.md) kurallarını dikkatlice gözden geçirin.

- Değişiklerinizi commit'leyin.

- [Test Coverage](/docs/development/test-coverage.md) kurallarını dikkatlice gözden geçirin.
- [Test Coverage](/doc/development/test-coverage.md) kurallarını dikkatlice gözden geçirin.

- Yaptığınız değişikliğin test coverage oranını düşürmediğinden emin olun.

Expand All @@ -78,10 +78,10 @@ Harici servisler yalnızca BAUM-VPN'e açıktır. Geliştirme yaparken ihtiyaç
### Geliştirme Sonrası
----------------------

- [Pull Request](/docs/git/pull-request.md) kurallarını dikkatlice gözden geçirin.
- [Pull Request](/doc/git/pull-request.md) kurallarını dikkatlice gözden geçirin.

- Geliştirmenizi tamamladıktan sonra kendi branch'inizden `develop`'a doğru bir `pull request` (diğer adıyla `merge request`) açın.

- [Review](/docs/git/review.md) kurallarını dikkatlice gözden geçirin.
- [Review](/doc/git/review.md) kurallarını dikkatlice gözden geçirin.

- Pull request'inizin review sürecinin tamamlanmasını bekleyin.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
**Kontrol listesi:**

* [ ] Açtığınız PR'in başlığı kurallara (sadece ilk harf büyük, emir kipinde problem cümlesi vb.) uygun mu?
* [ ] [Katkı sağlama dokümanını](https://github.com/omu/nokul/CONTRIBUTING.md) okudunuz mu?
* [ ] [Katkı sağlama dokümanını](https://github.com/omu/nokul/.github/CONTRIBUTING.md) okudunuz mu?
* [ ] Yaptığınız iş/değişikliği dokümante ettiniz mi?
* [ ] Yaptığınız iş/değişikliğin testlerini yazdınız mı?
* [ ] Test coverage oranını kontrol ettiniz mi?
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ gem 'simple_form'

# api
gem 'jbuilder', '~> 2.5'
gem 'savon', '~> 2.12.0'

# security
gem 'bcrypt', '~> 3.1.7'
Expand Down
62 changes: 21 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,23 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
akami (1.3.1)
gyoku (>= 0.4.0)
nokogiri
ancestry (3.0.2)
ancestry (3.0.3)
activerecord (>= 3.2.0)
archive-zip (0.11.0)
io-like (~> 0.3.0)
arel (9.0.0)
ast (2.4.0)
aws-eventstream (1.0.1)
aws-partitions (1.105.0)
aws-sdk-core (3.29.0)
aws-partitions (1.106.0)
aws-sdk-core (3.35.0)
aws-eventstream (~> 1.0)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-kms (1.9.0)
aws-sdk-kms (1.11.0)
aws-sdk-core (~> 3, >= 3.26.0)
aws-sigv4 (~> 1.0)
aws-sdk-s3 (1.20.0)
aws-sdk-s3 (1.23.0)
aws-sdk-core (~> 3, >= 3.26.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.0)
Expand All @@ -81,20 +78,21 @@ GEM
bundler (~> 1.2)
thor (~> 0.18)
byebug (10.0.2)
capybara (3.8.2)
capybara (3.10.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
xpath (~> 3.1)
regexp_parser (~> 1.2)
xpath (~> 3.2)
chartkick (3.0.1)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (2.1.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
cocoon (1.2.11)
cocoon (1.2.12)
codacy-coverage (2.1.0)
simplecov
coderay (1.1.2)
Expand Down Expand Up @@ -126,14 +124,9 @@ GEM
activerecord (>= 4.0.0)
globalid (0.4.1)
activesupport (>= 4.2.0)
groupdate (4.0.1)
groupdate (4.0.2)
activesupport (>= 4.2)
gyoku (1.3.1)
builder (>= 2.1.2)
httpi (2.4.4)
rack
socksify
i18n (1.1.0)
i18n (1.1.1)
concurrent-ruby (~> 1.0)
image_processing (1.7.1)
mini_magick (~> 4.0)
Expand All @@ -153,10 +146,10 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.2.2)
loofah (2.2.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
Expand All @@ -172,9 +165,8 @@ GEM
nio4r (2.3.1)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
nori (2.6.0)
orm_adapter (0.5.0)
pagy (0.20.0)
pagy (0.21.0)
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
Expand Down Expand Up @@ -226,19 +218,20 @@ GEM
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redis (4.0.2)
regexp_parser (1.2.0)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rollbar (2.18.0)
multi_json
rubocop (0.59.2)
rubocop (0.60.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
unicode-display_width (~> 1.4.0)
ruby-progressbar (1.10.0)
ruby-vips (2.0.13)
ffi (~> 1.9)
Expand All @@ -259,17 +252,9 @@ GEM
sprockets (> 2.11)
sprockets-rails
tilt
savon (2.12.0)
akami (~> 1.2)
builder (>= 2.1.2)
gyoku (~> 1.2)
httpi (~> 2.3)
nokogiri (>= 1.8.1)
nori (~> 2.4)
wasabi (~> 3.4)
selenium-webdriver (3.14.0)
selenium-webdriver (3.14.1)
childprocess (~> 0.5)
rubyzip (~> 1.2)
rubyzip (~> 1.2, >= 1.2.2)
sidekiq (5.2.2)
connection_pool (~> 2.2, >= 2.2.2)
rack-protection (>= 1.5.0)
Expand All @@ -284,7 +269,6 @@ GEM
simplecov-html (0.10.2)
simpleidn (0.1.1)
unf (~> 0.1.4)
socksify (1.7.1)
spring (2.0.2)
activesupport (>= 4.2)
spring-watcher-listen (2.0.1)
Expand Down Expand Up @@ -312,9 +296,6 @@ GEM
uniform_notifier (1.11.0)
warden (1.2.7)
rack (>= 1.0)
wasabi (3.5.0)
httpi (~> 2.0)
nokogiri (>= 1.4.2)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
Expand All @@ -323,7 +304,7 @@ GEM
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
xpath (3.1.0)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
Expand Down Expand Up @@ -365,7 +346,6 @@ DEPENDENCIES
rubocop
ruby-progressbar
sassc-rails
savon (~> 2.12.0)
selenium-webdriver
sidekiq
simple_form
Expand All @@ -379,4 +359,4 @@ RUBY VERSION
ruby 2.5.1p57

BUNDLED WITH
1.16.3
1.16.6
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Dealing with ill-structured processes of a university is hard, especially when t

## Installation

See [installation guide](/docs/development/installation.md) for details.
See [installation guide](/doc/development/installation.md) for details.

## Contributing

See [contributing guide](/docs/CONTRIBUTING.md) for details.
See [contributing guide](/.github/CONTRIBUTING.md) for details.

## HowTo

See [/docs](/docs) for other documents.
See [/docs](/doc) for other documents.

## License

Expand Down
19 changes: 12 additions & 7 deletions app/controllers/account/addresses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ module Account
class AddressesController < ApplicationController
include LastUpdateFromMernis

before_action :set_user
before_action :set_address, only: %i[edit update destroy]
before_action :set_elapsed_time, only: %i[save_from_mernis]

def index
@addresses = current_user.addresses.includes(district: [:city])
@addresses = @user.addresses.includes(district: [:city])
end

def new
@address = current_user.addresses.informal.new
@address = @user.addresses.informal.new
end

def edit; end

def create
@address = current_user.addresses.informal.new(address_params)
@address = @user.addresses.informal.new(address_params)
@address.save ? redirect_with('success') : render(:new)
end

Expand All @@ -31,25 +32,29 @@ def destroy
end

def save_from_mernis
Kps::AddressSaveJob.perform_later(current_user)
Kps::AddressSaveJob.perform_later(@user)
redirect_with('will_update')
end

private

def set_user
@user = User.friendly.find(params[:user_id])
end

def set_address
@address = current_user.addresses.informal.find(params[:id])
@address = @user.addresses.informal.find(params[:id])
end

def set_elapsed_time
formal_address = current_user.addresses.formal
formal_address = @user.addresses.formal
return if formal_address.blank?

elapsed_time(formal_address.first)
end

def redirect_with(message)
redirect_to(addresses_path, notice: t(".#{message}"))
redirect_to(user_addresses_path(@user), notice: t(".#{message}"))
end

def address_params
Expand Down
19 changes: 12 additions & 7 deletions app/controllers/account/identities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ module Account
class IdentitiesController < ApplicationController
include LastUpdateFromMernis

before_action :set_user
before_action :set_identity, only: %i[edit update destroy]
before_action :set_elapsed_time, only: %i[save_from_mernis]

def index
@identities = current_user.identities.includes(:student)
@identities = @user.identities
end

def new
@identity = current_user.identities.informal.new
@identity = @user.identities.informal.new
end

def edit; end

def create
@identity = current_user.identities.informal.new(identity_params)
@identity = @user.identities.informal.new(identity_params)
@identity.save ? redirect_with('success') : render(:new)
end

Expand All @@ -31,25 +32,29 @@ def destroy
end

def save_from_mernis
Kps::IdentitySaveJob.perform_later(current_user)
Kps::IdentitySaveJob.perform_later(@user)
redirect_with('will_update')
end

private

def set_user
@user = User.friendly.find(params[:user_id])
end

def set_identity
@identity = current_user.identities.informal.find(params[:id])
@identity = @user.identities.informal.find(params[:id])
end

def set_elapsed_time
formal_identity = current_user.identities.user_identity
formal_identity = @user.identities.user_identity
return if formal_identity.blank?

elapsed_time(formal_identity)
end

def redirect_with(message)
redirect_to(identities_path, notice: t(".#{message}"))
redirect_to(user_identities_path(@user), notice: t(".#{message}"))
end

def identity_params
Expand Down
Loading

0 comments on commit 7c27514

Please sign in to comment.