-
Notifications
You must be signed in to change notification settings - Fork 41
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 #2060 from brave-intl/staging
Release 2019-07-18
- Loading branch information
Showing
19 changed files
with
432 additions
and
32 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
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,38 @@ | ||
module Admin | ||
class CaseRepliesController < AdminController | ||
def index | ||
@open_cases = Case.where(status: Case::OPEN) | ||
@assigned_cases = Case.where(assignee: current_user, status: Case::IN_PROGRESS) | ||
|
||
@replies = CaseReply.all | ||
end | ||
|
||
def create | ||
CaseReply.create(reply_params) | ||
redirect_to admin_case_replies_path, flash: { notice: "Your saved reply was created successfully."} | ||
end | ||
|
||
def edit | ||
@reply = CaseReply.find(params[:id]) | ||
@open_cases = Case.where(status: Case::OPEN) | ||
@assigned_cases = Case.where(assignee: current_user, status: Case::IN_PROGRESS) | ||
end | ||
|
||
def update | ||
CaseReply.find(params[:id]).update(reply_params) | ||
redirect_to admin_case_replies_path, flash: { notice: "Your saved reply was updated successfully."} | ||
end | ||
|
||
def destroy | ||
CaseReply.find(params[:id]).destroy | ||
redirect_to admin_case_replies_path, flash: { notice: "Deleted the reply"} | ||
end | ||
|
||
|
||
private | ||
|
||
def reply_params | ||
params.require(:case_reply).permit(:id, :title, :body) | ||
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
Oops, something went wrong.