This repository has been archived by the owner on Jun 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #306 from omu/develop
Merge develop into master
- Loading branch information
Showing
88 changed files
with
1,646 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
name: Use Case | ||
about: Product ekibi tarafından hazırlanmış `use case` için iş kaydı. | ||
|
||
--- | ||
|
||
**Use case dokümanı:** | ||
|
||
**Açıklama:** | ||
|
||
[//]: # (Kısa ve net bir şekilde konuyla ilişkili olarak sizin önerileriniz neler, sizin öneriniz kabul edilirse neler olacak, uygulamada neler iyileşecek açıklayınız.) | ||
|
||
**Kontrol listesi** | ||
|
||
* [ ] İş kaydınızın başlığı kurallara (sadece ilk harf büyük, emir kipinde problem cümlesi vb.) uygun mu? | ||
* [ ] Use case, product ekibi tarafından incelenip onaylandı mı? | ||
* [ ] Use case ve oluşturulan mockup'lar müşteri tarafından onaylandı mı? | ||
|
||
**Ek içerik:** | ||
|
||
[//]: # (Kaynaklar, dış bağlantılar, ekran görüntüleri, örnek çözümler ve benzeri diğer kaynakları ekleyiniz.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# frozen_string_literal: true | ||
|
||
module Committee | ||
class AgendaTypesController < ApplicationController | ||
before_action :set_agenda_type, only: %i[edit update destroy] | ||
|
||
def index | ||
@agenda_types = pagy_by_search(AgendaType.all) | ||
end | ||
|
||
def new | ||
@agenda_type = AgendaType.new | ||
end | ||
|
||
def edit; end | ||
|
||
def create | ||
@agenda_type = AgendaType.new(agenda_type_params) | ||
@agenda_type.save ? redirect_with('success') : render(:new) | ||
end | ||
|
||
def update | ||
@agenda_type.update(agenda_type_params) ? redirect_with('success') : render(:edit) | ||
end | ||
|
||
def destroy | ||
@agenda_type.destroy ? redirect_with('success') : redirect_with('warning') | ||
end | ||
|
||
private | ||
|
||
def redirect_with(message) | ||
redirect_to(agenda_types_path, notice: t(".#{message}")) | ||
end | ||
|
||
def set_agenda_type | ||
@agenda_type = AgendaType.find(params[:id]) | ||
end | ||
|
||
def agenda_type_params | ||
params.require(:agenda_type).permit(:name) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# frozen_string_literal: true | ||
|
||
module Committee | ||
class AgendasController < ApplicationController | ||
before_action :set_committee | ||
before_action :set_agenda, only: %i[edit update destroy] | ||
|
||
def index | ||
@agendas = pagy_by_search(@committee.agendas.includes(:agenda_type)) | ||
end | ||
|
||
def new | ||
@agenda = @committee.agendas.new | ||
end | ||
|
||
def edit; end | ||
|
||
def create | ||
@agenda = @committee.agendas.new(agenda_params) | ||
@agenda.save ? redirect_with('success') : render(:new) | ||
end | ||
|
||
def update | ||
@agenda.update(agenda_params) ? redirect_with('success') : render(:edit) | ||
end | ||
|
||
def destroy | ||
@agenda.destroy ? redirect_with('success') : redirect_with('warning') | ||
end | ||
|
||
private | ||
|
||
def redirect_with(message) | ||
redirect_to(committee_agendas_path(@committee), notice: t(".#{message}")) | ||
end | ||
|
||
def set_committee | ||
@committee = Unit.find(params[:committee_id]) | ||
end | ||
|
||
def set_agenda | ||
@agenda = @committee.agendas.find(params[:id]) if @committee | ||
end | ||
|
||
def agenda_params | ||
params.require(:agenda).permit(:description, :status, :unit_id, :agenda_type_id) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module Committee | ||
class DashboardController < ApplicationController | ||
def index | ||
@committees = pagy_by_search( | ||
Unit.committees.includes(:unit_type, :unit_status, district: :city) | ||
) | ||
end | ||
|
||
def show | ||
@agendas = pagy_by_search( | ||
Unit.find(params[:id]).agendas.includes(:agenda_type) | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module PagyBackendWithHelpers | ||
extend ActiveSupport::Concern | ||
include Pagy::Backend | ||
|
||
def pagy_by_search(collection) | ||
@pagy, items = pagy((term = params[:term]).present? ? collection.search(term) : collection) | ||
items | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.