-
-
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.
- Loading branch information
1 parent
63a6320
commit 82deb5e
Showing
7 changed files
with
42 additions
and
19 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
30 changes: 29 additions & 1 deletion
30
app/controllers/notice/admin/member_annunciates_controller.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
class Notice::Admin::MemberAnnunciatesController < Notice::Admin::BaseController | ||
module Notice | ||
class Admin::MemberAnnunciatesController < Admin::BaseController | ||
before_action :set_annunciation | ||
before_action :set_departments, only: [:new, :create] | ||
before_action :set_new_member_annunciate, only: [:new, :create] | ||
|
||
def index | ||
@member_annunciates = @annunciation.annunciates | ||
end | ||
|
||
private | ||
def set_annunciation | ||
@annunciation = Annunciation.find params[:annunciation_id] | ||
end | ||
|
||
def set_departments | ||
@departments = Org::Department.default_where(default_params) | ||
end | ||
|
||
def set_new_member_annunciate | ||
@member_annunciate = @annunciation.annunciates.build(member_annunciate_params) | ||
end | ||
|
||
def member_annunciate_params | ||
params.fetch(:member_annunciate, {}).permit( | ||
:department_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
4 changes: 0 additions & 4 deletions
4
app/views/notice/admin/annunciations/_edit_member/_member_form.html.erb
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
app/views/notice/admin/annunciations/edit_member.turbo_stream.erb
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
app/views/notice/admin/member_annunciates/_new_form.html.erb
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,12 @@ | ||
<%= form_with model: @member_annunciate, url: { action: 'create' }, class: 'modal-card' do |f| %> | ||
<header class="modal-card-head"> | ||
<p class="modal-card-title"><%= t('.title') %></p> | ||
<button type="button" data-action="modal#close" class="delete"></button> | ||
</header> | ||
<section class="modal-card-body"> | ||
<%= f.collection_select :department_ids, @departments, :id, :name, { label: Notice::Annunciation.human_attribute_name(:user_tags) }, { multiple: true, data: { controller: 'choice' } } %> | ||
</section> | ||
<footer class="modal-card-foot"> | ||
<%= f.submit %> | ||
</footer> | ||
<% 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