mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
Add posts and comments to admin panel
This commit is contained in:
20
app/views/admin/application/_flashes.html.erb
Normal file
20
app/views/admin/application/_flashes.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<%#
|
||||
# Flash Partial
|
||||
|
||||
This partial renders flash messages on every page.
|
||||
|
||||
## Relevant Helpers:
|
||||
|
||||
- `flash`:
|
||||
Returns a hash,
|
||||
where the keys are the type of flash (alert, error, notice, etc)
|
||||
and the values are the message to be displayed.
|
||||
%>
|
||||
|
||||
<% if flash.any? %>
|
||||
<div class="flashes">
|
||||
<% flash.each do |key, value| -%>
|
||||
<div class="flash flash-<%= key %>"><%= value.html_safe %></div>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end %>
|
||||
13
app/views/admin/application/_icons.html.erb
Normal file
13
app/views/admin/application/_icons.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
||||
<symbol id="icon-cancel" viewBox="0 0 48 48">
|
||||
<path fill-rule="evenodd" d="M24 19.757l-8.485-8.485c-.784-.783-2.047-.782-2.827 0l-1.417 1.416c-.777.777-.78 2.046.002 2.827L19.757 24l-8.485 8.485c-.783.784-.782 2.047 0 2.827l1.416 1.417c.777.777 2.046.78 2.827-.002L24 28.243l8.485 8.485c.784.783 2.047.782 2.827 0l1.417-1.416c.777-.777.78-2.046-.002-2.827L28.243 24l8.485-8.485c.783-.784.782-2.047 0-2.827l-1.416-1.417c-.777-.777-2.046-.78-2.827.002L24 19.757zM24 47c12.703 0 23-10.297 23-23S36.703 1 24 1 1 11.297 1 24s10.297 23 23 23z" />
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-eyeglass" viewBox="0 0 48 48">
|
||||
<path d="M27.885 32.515c-2.864 1.966-6.333 3.116-10.07 3.116C7.976 35.63 0 27.656 0 17.817 0 7.976 7.976 0 17.816 0S35.63 7.976 35.63 17.816c0 3.736-1.15 7.205-3.115 10.07l14.53 14.53c1.278 1.277 1.275 3.352 0 4.628-1.28 1.278-3.353 1.278-4.63 0l-14.53-14.53zm-10.07-3.736c6.056 0 10.964-4.91 10.964-10.964 0-6.055-4.91-10.964-10.964-10.964-6.055 0-10.964 4.91-10.964 10.964 0 6.055 4.91 10.963 10.964 10.963z" />
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-up-caret" viewBox="0 0 48 48">
|
||||
<path d="M2.988 33.02c-1.66 0-1.943-.81-.618-1.824l20-15.28c.878-.672 2.31-.67 3.188 0l20.075 15.288c1.316 1.003 1.048 1.816-.62 1.816H2.987z" />
|
||||
</symbol>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
21
app/views/admin/application/_javascript.html.erb
Normal file
21
app/views/admin/application/_javascript.html.erb
Normal file
@@ -0,0 +1,21 @@
|
||||
<%#
|
||||
# Javascript Partial
|
||||
|
||||
This partial imports the necessary javascript on each page.
|
||||
By default, it includes the application JS,
|
||||
but each page can define additional JS sources
|
||||
by providing a `content_for(:javascript)` block.
|
||||
%>
|
||||
|
||||
<% Administrate::Engine.javascripts.each do |js_path| %>
|
||||
<%= javascript_include_tag js_path %>
|
||||
<% end %>
|
||||
|
||||
<%= yield :javascript %>
|
||||
|
||||
<% if Rails.env.test? %>
|
||||
<%= javascript_tag do %>
|
||||
$.fx.off = true;
|
||||
$.ajaxSetup({ async: false });
|
||||
<% end %>
|
||||
<% end %>
|
||||
14
app/views/admin/application/_stylesheet.html.erb
Normal file
14
app/views/admin/application/_stylesheet.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<%#
|
||||
# Stylesheet Partial
|
||||
|
||||
This partial imports the necessary stylesheets on each page.
|
||||
By default, it includes the application CSS,
|
||||
but each page can define additional CSS sources
|
||||
by providing a `content_for(:stylesheet)` block.
|
||||
%>
|
||||
|
||||
<% Administrate::Engine.stylesheets.each do |css_path| %>
|
||||
<%= stylesheet_link_tag css_path %>
|
||||
<% end %>
|
||||
|
||||
<%= yield :stylesheet %>
|
||||
41
app/views/layouts/admin/application.html.erb
Normal file
41
app/views/layouts/admin/application.html.erb
Normal file
@@ -0,0 +1,41 @@
|
||||
<%#
|
||||
# Application Layout
|
||||
|
||||
This view template is used as the layout
|
||||
for every page that Administrate generates.
|
||||
|
||||
By default, it renders:
|
||||
- Navigation
|
||||
- Content for a search bar
|
||||
(if provided by a `content_for` block in a nested page)
|
||||
- Flashes
|
||||
- Links to stylesheets and JavaScripts
|
||||
%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= I18n.locale %>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="ROBOTS" content="NOODP">
|
||||
<meta name="viewport" content="initial-scale=1">
|
||||
<title>
|
||||
<%= content_for(:title) %> - Admin Panel - <%= Rails.application.name %>
|
||||
</title>
|
||||
<%= render "stylesheet" %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
<body>
|
||||
<%= render "icons" %>
|
||||
|
||||
<div class="app-container">
|
||||
<%= render "navigation" -%>
|
||||
|
||||
<main class="main-content" role="main">
|
||||
<%= render "flashes" -%>
|
||||
<%= yield %>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<%= render "javascript" %>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user