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 #462 from omu/develop
Merge develop into master
- Loading branch information
Showing
83 changed files
with
2,447 additions
and
316 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -109,6 +109,17 @@ jobs: | |
- run: bin/yarn install | ||
- run: bundle exec rake quality:rails | ||
- run: bundle exec rake security:all | ||
- run: bin/yarn run lint | ||
deploy_develop: | ||
machine: | ||
enabled: true | ||
steps: | ||
- checkout | ||
- run: | ||
name: Deploy Develop to Dokku | ||
command: | | ||
git remote add develop [email protected]:nokul-develop && | ||
git push develop develop:master | ||
deploy: | ||
machine: | ||
enabled: true | ||
|
@@ -138,6 +149,12 @@ workflows: | |
- karma: | ||
requires: | ||
- bundle_assets | ||
- deploy_develop: | ||
requires: | ||
- karma | ||
filters: | ||
branches: | ||
only: develop | ||
- deploy: | ||
requires: | ||
- karma | ||
|
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 @@ | ||
{ | ||
"extends": "standard" | ||
} |
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,27 @@ | ||
FROM ondokuz/ruby-stretch:0.10.0 | ||
|
||
ARG RAILS_ENV | ||
ENV RAILS_ENV=$RAILS_ENV | ||
|
||
ARG RAILS_MASTER_KEY | ||
ENV RAILS_MASTER_KEY=$RAILS_MASTER_KEY | ||
|
||
ENV RAILS_SERVE_STATIC_FILES=enabled | ||
ENV RAILS_LOG_TO_STDOUT=enabled | ||
|
||
WORKDIR /app | ||
|
||
COPY .ruby-version ./ | ||
COPY Gemfile Gemfile.lock ./ | ||
COPY package.json yarn.lock ./ | ||
|
||
RUN bundle install --without development:test -j4 --deployment | ||
RUN yarn install | ||
|
||
COPY . ./ | ||
|
||
RUN bundle exec rake assets:precompile | ||
|
||
EXPOSE 3000 | ||
|
||
CMD bundle exec puma -C config/puma.rb |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
// App.cable = ActionCable.createConsumer(); | ||
}).call(this); | ||
*/ | ||
*/ |
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 @@ | ||
//= require cocoon | ||
//= require cocoon |
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,3 +1,5 @@ | ||
toastr.options.closeButton = true; | ||
toastr.options.showMethod = "slideDown"; | ||
toastr.options.progressBar = true; | ||
/* global toastr:true */ | ||
|
||
toastr.options.closeButton = true | ||
toastr.options.showMethod = 'slideDown' | ||
toastr.options.progressBar = true |
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 DecisionsController < ApplicationController | ||
before_action :set_committee_and_agenda | ||
before_action :set_decision, only: %i[show edit update] | ||
|
||
def show; end | ||
|
||
def new | ||
@decision = @agenda.build_decision | ||
end | ||
|
||
def create | ||
@decision = @agenda.build_decision(decision_params) | ||
@decision.save ? redirect_with('success') : render(:new) | ||
end | ||
|
||
def edit; end | ||
|
||
def update | ||
@decision.update(decision_params) ? redirect_with('success') : render(:edit) | ||
end | ||
|
||
private | ||
|
||
def redirect_with(message) | ||
redirect_to(committee_meeting_path(@committee, @agenda.committee_meeting), notice: t(".#{message}")) | ||
end | ||
|
||
def set_committee_and_agenda | ||
@committee = Unit.committees.find(params[:committee_id]) | ||
@agenda = @committee.meeting_agendas.find(params[:meeting_agenda_id]) | ||
end | ||
|
||
def set_decision | ||
@decision = @agenda.decision | ||
end | ||
|
||
def decision_params | ||
params.require(:committee_decision).permit(:description) | ||
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
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,30 @@ | ||
# frozen_string_literal: true | ||
|
||
class CommitteeDecision < ApplicationRecord | ||
# relations | ||
belongs_to :meeting_agenda | ||
has_one :agenda, through: :meeting_agenda | ||
|
||
# validations | ||
validates :description, presence: true | ||
validates :decision_no, presence: true, uniqueness: true | ||
validates :year, presence: true | ||
|
||
# callbacks | ||
before_validation :set_year_and_decision_no, on: :create | ||
after_create { agenda.update(status: :decided) } | ||
|
||
# delegates | ||
delegate :meeting_no, :meeting_date, :year, :unit, to: :meeting_agenda, prefix: true | ||
|
||
def count_of_decisions_by_year(year) | ||
meeting_agenda_unit.decisions.where(year: year).count | ||
end | ||
|
||
private | ||
|
||
def set_year_and_decision_no | ||
self.year = meeting_agenda_year | ||
self.decision_no = "#{year}/#{count_of_decisions_by_year(year) + 1}" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
class MeetingAgenda < ApplicationRecord | ||
# relations | ||
belongs_to :agenda | ||
belongs_to :committee_meeting | ||
has_one :decision, dependent: :destroy, class_name: 'CommitteeDecision' | ||
|
||
# validations | ||
validates :sequence_no, presence: true, uniqueness: { scope: %i[committee_meeting] }, | ||
numericality: { only_integer: true, greater_than_or_equal_to: 1 } | ||
validates :agenda_id, presence: true, uniqueness: { scope: :committee_meeting } | ||
|
||
# delegates | ||
delegate :description, :status, :agenda_type, to: :agenda | ||
delegate :meeting_no, :meeting_date, :year, :unit, to: :committee_meeting | ||
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
Oops, something went wrong.