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 #176 from omu/develop
Merge develop into master
- Loading branch information
Showing
82 changed files
with
1,246 additions
and
512 deletions.
There are no files selected for viewing
File renamed without changes.
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,9 @@ | ||
.app-footer { | ||
position: fixed; | ||
bottom: 0; | ||
width: 100%; | ||
height: 30px; /* Set the fixed height of the footer here */ | ||
line-height: 30px; /* Vertically center the text there */ | ||
background-color: #f5f5f5; | ||
opacity: .8; | ||
} |
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,53 @@ | ||
# frozen_string_literal: true | ||
|
||
module Account | ||
class DutiesController < ApplicationController | ||
before_action :set_user | ||
before_action :set_employee | ||
before_action :set_duty, only: %i[show edit update destroy] | ||
|
||
def show | ||
@positions = @duty.positions.includes(:administrative_function) | ||
end | ||
|
||
def new | ||
@duty = @employee.duties.new | ||
end | ||
|
||
def create | ||
@duty = @employee.duties.new(duty_params) | ||
@duty.save ? redirect_to([@user, @employee, @duty], notice: t('.success')) : render(:new) | ||
end | ||
|
||
def edit; end | ||
|
||
def update | ||
@duty.update(duty_params) ? redirect_to([@user, @employee, @duty], notice: t('.success')) : render(:edit) | ||
end | ||
|
||
def destroy | ||
@duty.destroy ? redirect_to([@user, @employee], notice: t('.success')) : redirect_with('warning') | ||
end | ||
|
||
private | ||
|
||
def set_user | ||
@user = User.friendly.find(params[:user_id]) | ||
not_found unless @user | ||
end | ||
|
||
def set_employee | ||
@employee = @user.employees.find(params[:employee_id]) | ||
not_found unless @employee | ||
end | ||
|
||
def set_duty | ||
@duty = @employee.duties.find(params[:id]) | ||
not_found unless @duty | ||
end | ||
|
||
def duty_params | ||
params.require(:duty).permit(:temporary, :start_date, :end_date, :unit_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,47 @@ | ||
# frozen_string_literal: true | ||
|
||
module Account | ||
class EmployeesController < ApplicationController | ||
before_action :set_user | ||
before_action :set_employee, only: %i[show edit update destroy] | ||
|
||
def show | ||
@duties = @employee.duties.includes(:unit) | ||
end | ||
|
||
def new | ||
@employee = @user.employees.new | ||
end | ||
|
||
def create | ||
@employee = @user.employees.new(employee_params) | ||
@employee.save ? redirect_to([@user, @employee], notice: t('.success')) : render(:new) | ||
end | ||
|
||
def edit; end | ||
|
||
def update | ||
@employee.update(employee_params) ? redirect_to([@user, @employee], notice: t('.success')) : render(:edit) | ||
end | ||
|
||
def destroy | ||
@employee.destroy ? redirect_to(@user, notice: t('.success')) : redirect_with('warning') | ||
end | ||
|
||
private | ||
|
||
def set_user | ||
@user = User.friendly.find(params[:user_id]) | ||
not_found unless @user | ||
end | ||
|
||
def set_employee | ||
@employee = @user.employees.find(params[:id]) | ||
not_found unless @employee | ||
end | ||
|
||
def employee_params | ||
params.require(:employee).permit(:active, :title_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
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,55 @@ | ||
# frozen_string_literal: true | ||
|
||
module Account | ||
class PositionsController < ApplicationController | ||
before_action :set_user | ||
before_action :set_employee | ||
before_action :set_duty | ||
before_action :set_position, only: %i[edit update destroy] | ||
|
||
def new | ||
@position = @duty.positions.new | ||
end | ||
|
||
def create | ||
@position = @duty.positions.new(position_params) | ||
@position.save ? redirect_to([@user, @employee, @duty], notice: t('.success')) : render(:new) | ||
end | ||
|
||
def edit; end | ||
|
||
def update | ||
@position.update(position_params) ? redirect_to([@user, @employee, @duty], notice: t('.success')) : render(:edit) | ||
end | ||
|
||
def destroy | ||
@position.destroy ? redirect_to([@user, @employee, @duty], notice: t('.success')) : redirect_with('warning') | ||
end | ||
|
||
private | ||
|
||
def set_user | ||
@user = User.friendly.find(params[:user_id]) | ||
not_found unless @user | ||
end | ||
|
||
def set_employee | ||
@employee = @user.employees.find(params[:employee_id]) | ||
not_found unless @employee | ||
end | ||
|
||
def set_duty | ||
@duty = @user.duties.find(params[:duty_id]) | ||
not_found unless @duty | ||
end | ||
|
||
def set_position | ||
@position = @user.positions.find(params[:id]) | ||
not_found unless @position | ||
end | ||
|
||
def position_params | ||
params.require(:position).permit(:administrative_function_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
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,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module DateHelper | ||
def as_date(date = nil) | ||
date&.strftime('%d.%m.%Y') | ||
end | ||
|
||
def as_date_and_time(date = nil) | ||
date&.strftime('%d.%m.%Y - %H:%M') | ||
end | ||
end |
Oops, something went wrong.