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 #430 from omu/develop
Merge develop into master
- Loading branch information
Showing
27 changed files
with
411 additions
and
114 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
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,49 @@ | ||
# frozen_string_literal: true | ||
|
||
module Committee | ||
class MeetingsController < ApplicationController | ||
before_action :set_committee | ||
before_action :set_meeting, only: %i[edit update destroy] | ||
|
||
def index | ||
@meetings = @committee.meetings.order(year: :desc, meeting_no: :asc) | ||
end | ||
|
||
def new | ||
@meeting = @committee.meetings.new | ||
end | ||
|
||
def edit; end | ||
|
||
def create | ||
@meeting = @committee.meetings.new(meeting_params) | ||
@meeting.save ? redirect_with('success') : render(:new) | ||
end | ||
|
||
def update | ||
@meeting.update(meeting_params) ? redirect_with('success') : render(:edit) | ||
end | ||
|
||
def destroy | ||
@meeting.destroy ? redirect_with('success') : redirect_with('warning') | ||
end | ||
|
||
private | ||
|
||
def redirect_with(message) | ||
redirect_to(committee_meetings_path(@committee), notice: t(".#{message}")) | ||
end | ||
|
||
def set_committee | ||
@committee = Unit.find(params[:committee_id]) | ||
end | ||
|
||
def set_meeting | ||
@meeting = @committee.meetings.find(params[:id]) | ||
end | ||
|
||
def meeting_params | ||
params.require(:committee_meeting).permit(:meeting_no, :meeting_date) | ||
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,15 @@ | ||
# frozen_string_literal: true | ||
|
||
class CommitteeMeeting < ApplicationRecord | ||
# relations | ||
belongs_to :unit | ||
|
||
# validations | ||
validates :meeting_no, presence: true, uniqueness: { scope: %i[unit year] }, | ||
numericality: { only_integer: true, greater_than_or_equal_to: 1 } | ||
validates :meeting_date, presence: true | ||
validates :year, presence: true | ||
|
||
# callbacks | ||
before_validation { self.year = meeting_date.try(:year) } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
<%= render 'form', agenda: @agenda, form_title: t('.form_title') %> | ||
<%= render 'form', | ||
agenda: @agenda, | ||
url: committee_agenda_path(@committee, @agenda), | ||
method: :patch, form_title: t('.form_title') %> |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
<%= render 'form', agenda: @agenda, form_title: t('.form_title') %> | ||
<%= render 'form', | ||
agenda: @agenda, | ||
url: committee_agendas_path(@committee), | ||
method: :post, form_title: t('.form_title') %> |
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 was deleted.
Oops, something went wrong.
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,30 @@ | ||
<div class='row'> | ||
<div class='col-sm-12'> | ||
<div class='card'> | ||
<div class='card-header'> | ||
<%= fa_icon 'archive' %> | ||
<strong><%= form_title %></strong> | ||
</div> | ||
<div class='card-body'> | ||
<%= simple_form_for(meeting, url: url, method: method) do |f| %> | ||
<div class='row'> | ||
<div class='form-group col-sm-12'> | ||
<%= f.error_notification %> | ||
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> | ||
</div> | ||
<div class='form-group col-sm-6'> | ||
<%= f.input :meeting_no, required: true, input_html: { min: 1 } %> | ||
</div> | ||
<div class='form-group col-sm-6'> | ||
<%= f.input :meeting_date %> | ||
</div> | ||
<div class='form-group col-sm-12'> | ||
<%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> | ||
<%= link_to_back(:back) %> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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,3 @@ | ||
<%= render 'form', meeting: @meeting, | ||
url: committee_meeting_path(@committee, @meeting), | ||
method: :patch, form_title: t('.form_title') %> |
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,40 @@ | ||
<div class='alert alert-light'> | ||
<%= link_to_new new_committee_meeting_path(@committee), t('.new_committee_meeting_link') %> | ||
</div> | ||
|
||
<div class='row'> | ||
<div class='col-lg-12'> | ||
<div class='card'> | ||
<div class='card-header'> | ||
<%= fa_icon 'archive', text: t('.card_header') %> | ||
</div> | ||
<div class='card-body'> | ||
<table class='table table-responsive-sm table-striped'> | ||
<thead> | ||
<tr> | ||
<th><%= t('.meeting_no') %></th> | ||
<th><%= t('.meeting_date') %></th> | ||
<th><%= t('.year') %></th> | ||
<th><%= t('.unit') %></th> | ||
<th><%= t('actions') %></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @meetings.each do |meeting| %> | ||
<tr> | ||
<td><%= meeting.meeting_no %></td> | ||
<td><%= meeting.meeting_date %></td> | ||
<td><%= meeting.year %></td> | ||
<td><%= meeting.unit.name %></td> | ||
<td> | ||
<%= link_to_edit(edit_committee_meeting_path(@committee, meeting)) %> | ||
<%= link_to_destroy(committee_meeting_path(@committee, meeting)) %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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,3 @@ | ||
<%= render 'form', meeting: @meeting, | ||
url: committee_meetings_path(@committee), | ||
method: :post, form_title: t('.form_title') %> |
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 |
---|---|---|
@@ -1,23 +1,21 @@ | ||
--- | ||
en: | ||
pagy: | ||
compact: | ||
of: of | ||
page: Page | ||
nav: | ||
prev: "‹ Prev" | ||
next: "Next ›" | ||
gap: "…" | ||
info: | ||
item_name: | ||
one: item | ||
other: items | ||
zero: items | ||
multiple_pages: Displaying %{item_name} <b>%{from}-%{to}</b> of <b>%{count}</b> in total | ||
single_page: | ||
one: Displaying <b>1</b> %{item_name} | ||
other: Displaying <b>all %{count}</b> %{item_name} | ||
zero: No %{item_name} found | ||
zero: "No %{item_name} found" | ||
one: "Displaying <b>1</b> %{item_name}" | ||
other: "Displaying <b>all %{count}</b> %{item_name}" | ||
multiple_pages: "Displaying %{item_name} <b>%{from}-%{to}</b> of <b>%{count}</b> in total" | ||
item_name: | ||
zero: "items" | ||
one: "item" | ||
other: "items" | ||
compact: "Page %{page_input} of %{pages}" | ||
items: | ||
items: items per page | ||
show: Show | ||
nav: | ||
gap: "…" | ||
next: Next › | ||
prev: "‹ Prev" | ||
one: "Show %{items_input} item per page" | ||
other: "Show %{items_input} items per page" |
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 |
---|---|---|
@@ -1,23 +1,21 @@ | ||
--- | ||
tr: | ||
pagy: | ||
compact: | ||
of: "/" | ||
page: Sayfa | ||
nav: | ||
prev: "‹ Önceki" | ||
next: "Sonraki ›" | ||
gap: "…" | ||
info: | ||
item_name: | ||
one: kayıt | ||
other: kayıt | ||
zero: kayıt | ||
multiple_pages: "<b>%{count}</b> %{item_name} içerisinden <b>%{from}-%{to}</b> kadarı gösteriliyor." | ||
single_page: | ||
zero: "Hiç %{item_name} bulunamadı." | ||
one: "<b>1</b> %{item_name} gösteriliyor." | ||
other: Toplam <b>%{count}</b> %{item_name} gösteriliyor. | ||
zero: Hiç %{item_name} bulunamadı. | ||
other: "Toplam <b>%{count}</b> %{item_name} gösteriliyor." | ||
multiple_pages: "<b>%{count}</b> %{item_name} içerisinden <b>%{from}-%{to}</b> kadarı gösteriliyor." | ||
item_name: | ||
zero: "kayıt" | ||
one: "kayıt" | ||
other: "kayıt" | ||
compact: "Sayfa %{page_input} / %{pages}" | ||
items: | ||
items: sayfa başı | ||
show: Göster | ||
nav: | ||
gap: "…" | ||
next: Sonraki › | ||
prev: "‹ Önceki" | ||
one: "Sayfada %{items_input} kayıt göster" | ||
other: "Sayfada %{items_input} kayıt göster" |
Oops, something went wrong.