-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic view of news popups to admin
- Loading branch information
Showing
3 changed files
with
101 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
.admin-background { | ||
background-size: 20px 20px; | ||
background-image: radial-gradient(circle, #bebebe 1px, #ffffff00 1px); | ||
} | ||
|
||
|
||
#admin-news { | ||
max-width: 1400px; | ||
} |
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,55 +1,101 @@ | ||
<div class="row mt-3 p-2"> | ||
<div class="col-7"> | ||
<h4> | ||
<%= t('basics.news') %> | ||
</h4> | ||
<div class="container" id="admin-news"> | ||
|
||
<%# News popups %> | ||
<div class="row mt-3 p-2"> | ||
<div class="col-12"> | ||
<h4> | ||
News Popups | ||
</h4> | ||
</div> | ||
</div> | ||
<div class="col-3"> | ||
<%= paginate @announcements, window: 2 %> | ||
|
||
<div class="row p-2"> | ||
<div class="col-12"> | ||
<table class="table table-striped bg-white border border-primary-subtle shadow"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Created at</th> | ||
<th scope="col">Updated at</th> | ||
<th scope="col">Name</th> | ||
<th scope="col">Active</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @news_popups.each do |popup| %> | ||
<tr> | ||
<td><%= popup.created_at %></td> | ||
<td><%= popup.updated_at %></td> | ||
<td><%= link_to popup.name, | ||
'/news_popups/' + popup.name + '.html', | ||
target: :_blank %> | ||
</td> | ||
<td> | ||
<div class="form-check form-switch"> | ||
<% is_checked = popup.active ? 'checked' : '' %> | ||
<input class="form-check-input" type="checkbox" role="switch" <%= is_checked %>> | ||
</div> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
<div class="col-2 text-end"> | ||
<%= link_to t('buttons.create_announcement'), | ||
new_announcement_path, | ||
class: 'btn btn-sm btn-secondary', | ||
remote: true %> | ||
|
||
<%# News %> | ||
<div class="row mt-3 p-2"> | ||
<div class="col-7"> | ||
<h4> | ||
<%= t('basics.news') %> | ||
</h4> | ||
</div> | ||
<div class="col-3"> | ||
<%= paginate @announcements, window: 2 %> | ||
</div> | ||
<div class="col-2 text-end"> | ||
<%= link_to t('buttons.create_announcement'), | ||
new_announcement_path, | ||
class: 'btn btn-sm btn-secondary', | ||
remote: true %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row bg-mdb-color-lighten-2 mx-2 px-4 py-3"> | ||
<div class="col-2 text-light"> | ||
<strong> | ||
<%= t('basics.date') %> | ||
</strong> | ||
</div> | ||
<div class="col-2 text-light"> | ||
<strong> | ||
<%= t('basics.author') %> | ||
</strong> | ||
</div> | ||
<div class="col-5 text-light"> | ||
<strong> | ||
<%= t('basics.text') %> | ||
</strong> | ||
<div class="row bg-mdb-color-lighten-2 mx-2 px-4 py-3"> | ||
<div class="col-2 text-light"> | ||
<strong> | ||
<%= t('basics.date') %> | ||
</strong> | ||
</div> | ||
<div class="col-2 text-light"> | ||
<strong> | ||
<%= t('basics.author') %> | ||
</strong> | ||
</div> | ||
<div class="col-5 text-light"> | ||
<strong> | ||
<%= t('basics.text') %> | ||
</strong> | ||
</div> | ||
<div class="col-1 text-light"> | ||
<strong> | ||
<%= t('admin.announcement.main_page') %> | ||
</strong> | ||
</div> | ||
<div class="col-2 text-light"> | ||
<strong> | ||
<%= t('basics.action') %> | ||
</strong> | ||
</div> | ||
</div> | ||
<div class="col-1 text-light"> | ||
<strong> | ||
<%= t('admin.announcement.main_page') %> | ||
</strong> | ||
<div id="row-new-announcement" | ||
class="border-bottom mx-2 py-2" | ||
style="display: none;"> | ||
</div> | ||
<div class="col-2 text-light"> | ||
<strong> | ||
<%= t('basics.action') %> | ||
</strong> | ||
</div> | ||
</div> | ||
<div id="row-new-announcement" | ||
class="border-bottom mx-2 py-2" | ||
style="display: none;" > | ||
<% @announcements.each do |a| %> | ||
<div class="row border-bottom mx-2 px-4 py-2 bg-white" | ||
id="row-announcement-<%= a.id %>"> | ||
<%= render partial: 'announcements/row', | ||
locals: { announcement: a } %> | ||
</div> | ||
<% end %> | ||
<%= render partial: 'announcements/modal' %> | ||
</div> | ||
<% @announcements.each do |a| %> | ||
<div class="row border-bottom mx-2 px-4 py-2" | ||
id="row-announcement-<%= a.id %>"> | ||
<%= render partial: 'announcements/row', | ||
locals: { announcement: a }%> | ||
</div> | ||
<% end %> | ||
<%= render partial: 'announcements/modal' %> |