Giter VIP home page Giter VIP logo

grav-plugin-admin's Introduction

Grav Standard Administration Panel Plugin

This admin plugin for Grav is an HTML user interface that provides a convenient way to configure Grav and easily create and modify pages. This will remain a totally optional plugin, and is not in any way required or needed to use Grav effectively. In fact, the admin provides an intentionally limited view to ensure it remains easy to use and not overwhelming. I'm sure power users will still prefer to work with the configuration files directly.

Features

  • User login with automatic password encryption
  • Forgot password functionality
  • Logged-in-user management
  • One click Grav core updates
  • Dashboard with maintenance status, site activity and latest page updates
  • Notifications system for latest news, blogs, and announcements
  • Ajax-powered backup capability
  • Ajax-powered clear-cache capability
  • System configuration management
  • Site configuration management
  • Normal and Expert modes which allow editing via forms or YAML
  • Page listing with filtering and search
  • Page creation, editing, moving, copying, and deleting
  • Powerful syntax highlighting code editor with instant Grav-powered preview
  • Editor features, hot keys, toolbar, and distraction-free fullscreen mode
  • Drag-n-drop upload of page media files including drag-n-drop placement in the editor
  • One click theme and plugin updates
  • Plugin manager that allows listing and configuration of installed plugins
  • Theme manager that allows listing and configuration of installed themes
  • GPM-powered installation of new plugins and themes

Support

Support

We have tested internally, but we hope to use this public beta phase to identify, isolate, and fix issues related to the plugin to ensure it is as solid and reliable as possible.

For live chatting, please use the dedicated Discord Chat Room for discussions directly related to Grav.

For bugs, features, improvements, please ensure you create issues in the admin plugin GitHub repository.

Installation

First ensure you are running the latest Grav 1.6.7 or later. This is required for the admin plugin to run properly (-f forces a refresh of the GPM index).

$ bin/gpm selfupgrade -f

The admin plugin actually requires the help of 3 other plugins, so to get the admin plugin to work you first need to install admin, login, forms, and email plugins. These are available via GPM, and because the plugin has dependencies you just need to proceed and install the admin plugin, and agree when prompted to install the others:

$ bin/gpm install admin

Manual Installation

Manual installation is not the recommended method of installation, however, it is still possible to install the admin plugin manually. Basically, you need to download each of the following plugins individually:

Extract each archive file into your user/plugins folder, then ensure the folders are renamed to just admin/, login/, form/, and email/. Then proceed with the Usage instructions below.

Usage

Create User with CLI

After this you need to create a user account with admin privileges:

$ bin/plugin login new-user

Create User Manually

Alternatively, you can create a user account manually, in a file called user/accounts/admin.yaml. This filename is actually the username that you will use to login. The contents will contain the other information for the user.

password: 'password'
email: '[email protected]'
fullname: 'Johnny Appleseed'
title: 'Site Administrator'
access:
  admin:
    login: true
    super: true

Of course you should edit your email, password, fullname, and title to suit your needs.

You can use any password when you manually put it in this .yaml file. However, when you change your password in the admin, it must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters.

Accessing the Admin

By default, you can access the admin by pointing your browser to http://yoursite.com/admin. You can simply log in with the username and password set in the YAML file you configured earlier.

After logging in, your plaintext password will be removed and replaced by an encrypted one.

Standard Free & Paid Pro Versions

If you have been following the blog, Twitter, Discord chat, etc., you probably already know now that our intention is to provide two versions of this plugin.

The standard free version, is very powerful, and has more functionality than most commercial flat-file CMS systems.

We also intend to release in the near future a more feature-rich pro version that will include enhanced functionality, as well as some additional nice-to-have capabilities. This pro version will be a paid plugin the price of which is not yet 100% finalized.

Admin Events

General events

  • onAdminRegisterPermissions - (admin)
  • onAdminThemeInitialized
  • onAdminPage - (page)
  • onAdminMenu
  • onAdminTwigTemplatePaths - (paths)

Page specific events

  • onAdminDashboard
  • onAdminTools - (tools)
  • onAdminLogFiles - (logs)
  • onAdminGenerateReports - (reports)

Tasks

  • onAdminControllerInit - (controller)
  • onAdminTaskExecute - (controller, method)

Editing

  • onAdminData
  • onAdminSave - (object)
  • onAdminAfterSave - (object)

Pages

  • onAdminPageTypes - (types)
  • onAdminModularPageTypes
  • onAdminSave - (page)
  • onAdminAfterSaveAs - (path)
  • onAdminAfterSave - (page)
  • onAdminAfterDelete - (page)
  • onAdminAfterAddMedia - (page)
  • onAdminAfterDelMedia - (page)
  • onAdminCreatePageFrontmatter - (header, data)

Running Tests

First install the dev dependencies by running composer update from the Grav root. Then composer test will run the Unit Tests, which should be always executed successfully on any site.

grav-plugin-admin's People

Contributors

codebee-fr avatar david-szabo97 avatar dimayakovlev avatar diomed avatar drnasin avatar flamenco avatar flaviocopes avatar heraes-git avatar lufog avatar mahagr avatar maxfrigge avatar miguelsalespereira avatar newbthenewbd avatar nicolasdanelon avatar olevik avatar paulmassen avatar pboguslawski avatar pmoreno-rodriguez avatar qasedak avatar rhukster avatar ricardo118 avatar roblui avatar rotzbua avatar sommerregen avatar stephan-strate avatar tcsizmadia avatar tomone avatar vivalldi avatar w00fz avatar zzzzbov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grav-plugin-admin's Issues

Enhancement: Independent session management for Admin panel

Dear Grav Team,

as already mentioned in the gitter forum I want an indepedent session/cookie managment option for the admin panel. The use case is: As long as a visitor browsing through the site, I don't want Grav to set cookies/session. Only when a special route like /admin Grav should enable session/cookies in order to do a proper login (without you will always be redirected to the login page, which is clear why ;-)).

What I mean is using a different option than the sessions system option or at least to ignore the global flag session.enabled and assume that a session always have to be enabled for the admin panel.

File upload (defined in blueprints)

I have defined the following in the blueprints file of my theme (/user/themes/mytheme/blueprints/default.yaml) to add a new tab "Downloads" to each page's admin panel:

form:
  fields:
    tabs:
      type: tabs
      active: 1
      fields:
        downloads:
          type: tab
          title: Downloads
          fields:
            downloads:
              type: section
              title: Downloads
              underline: true
            header.downloads:
              type: list
              label: Downloads
              fields:
                .title:
                  type: text
                  label: Title
                  default:
                  validate:
                    required: true
                .file:
                  type: upload
                  label: File
                .icon:
                  type: text
                  label: Icon
                  default:
                  validate:
                    required: false

This works fine and the new tab is displayed. However, if I click on "save", the file won't upload and the page header contains:

file: 'C:\fakepath\test.bin'

The fakepath part is a security feature of Chrome. Grav should only use the last part of the filename.

(I'm not sure, if this is a problem with the admin plugin or with the forms plugin. Sorry, if I'm wrong here.)

System configuration in Admin Panel

  • If there is no system.yaml file in user/config folder admin panel saves changes into system/config/system.yaml instead of creating new user/config/system.yaml file. Maybe it's better to create new user configuration than overwrite initial system configuration?
  • When saving configuration, two keys (markdown and page) with value 1 are added into system.yaml file:
markdown: '1'
page: '1'

Next, each time you save configuration, values of 1 are added to these keys, so it becomes something like:

markdown:
  - '1'
  - '1'
  - '1'
  - '1'
  - '1'
page:
  - '1'
  - '1'
  - '1'
  - '1'
  - '1'

What is this intended for?

  • It would be useful to see which configuration file (system/config/system.yaml or user/config/system.yaml or user/localhost/config/system.yaml or other environment configuration) is in use and will be saved, or even add an option to select configuration file for editing.

Clear cache on save

Saving needs to clear all caches because pages are not refreshed until cache is updated

Enhancement/Bug: Support `param_sep` option

This is a gentle reminder that the config.system.param_sep option is not yet properly supported with the current version of the admin plugin.

This issue adresses #30, #36 and the ongoing changes to my open PR #35 . Any ideas and enhancements are welcome!

P.S.: Please leave #35 open as this is the branch I push changes to.

Page Titles with apostrophes

If you set a new page title as (Jane McGonigal's Life-Extending Recovery Game) it creates it as ('Jane McGonigal''s Life-Extending Recovery Game') adding an additional apostrophe in the title field within the frontmatter.

Pages tab in admin doesn't recognise more than two folders deep

Hi Guys,

Was playing around with the admin panel and the Aplha template last night and it has a demo content structure of 01.home/_content/01.main/01.intro/text.md.

All the pages were showing up in the dashboard but when you went into pages, I wasn't able to see any page structure deeper than two folders.

Button `Back to Themes` is missing.

When looking to add new themes if you click on a theme to read about it there is no way out of the theme without using the back button on the browser. The plugins however have a button that says Back to Plugins.

UX: Adding modular content

I am finding that the placement of the "Add Modular" button at the level of "Manage Pages" somewhat presents a less-than-clear conceptual model of what it's operation is. Initially I thought it would create a "New Page" of a modular type which then I would add Modular Content within the page itself, but that does not seem to be the case (if I understand things correctly).

There are various alternative approaches possible. One approach could be to only have the "Add Page" button at the level of "Manage Pages" and on that resulting dialog have an option to create a standard (Child) or Modular page. Another option could be to leave the "Add Page" dialog as is, but within a Page include the option to then add Modular Content with that same level, like how you can add Media to a Page.

I look forward to hearing others comments and thoughts on this issue.

Thanks,
Paul

Page Media with PHP build-in server not working

I cloned grav, did bin/grav install, bin/gpm install admin and run locally with php -S localhost:8000

I tried to drop an image on the "page media" pane. There's a thumbnail appearing. But hovering over shows some widget filled with HTML source. I can see the text inside saying: the requested resource /admin/media/home.json/task: addmedia was not found on this server. Maybe I do something wrong or something is not correctly installed?

Changing the slug generates a bug

When editing a page, then Advanced > checking slug and adding a new slug, then saving, you are redirected to the same page with a message saying that the changes were successfully saved, but the url to the page still contains the previous slug, so instead of being on an edit screen for the current page, you are in fact on a create screen for a new page for the previous slug (don't know if this is clear bug hopefully, replicating the issue you will find easily where the problem is).

mouse pointer on plugins-page

in the backend, I would add an cursor: pointer to the little arrow on the right side of each title of the accordion. For me, it's not necessairy, but in my opinion, it could be useful for usability.

Some translation keys aren't being parsed

I just installed the admin panel, and it appears that some translations are being parsed correctly.

Plugin Page

plugins___fineline_enterprises

Login Page

login___fineline_enterprises


I have another installation of the admin panel that does not have this problem. I am not sure what may be causing the issue. I would be happy to post any config files that may be beneficial.

Admin plugin with local installation

Just as from the forum: I am following reports of problems but does not seem to have been reported this problem: the three buttons, Clear Cache, Update and Backup in the local installation reporting the message Not Found as savescreen
screensaver 2015-08-07 09 53 09
OK in the online.
This happens with Grav 0.9.35 and 0.2.0 Admin Plugin: installations with no errors.
FYI I work on a computer with Ubuntu 14.04.3 LTS Ubuntu and PHP 5.5.9-1ubuntu4.11 Development Server, both with the latest Chrome and Firefox 39.0.3.
In the console of Chrome the message is Failed to load resource: the server responded with a status of 404 (Not Found)

Update Grav from admin

Right now an update is detected and an "Update Grav Now" button is shown, but when clicking it nothing happens. Need to add the update functionality.

UX: Clear cache options display on dashboard

Since adding the options to clear the cache in v0.2.0 they all display on top of the dashboard instead of a proper drop-down menu (broken?).
dashboardcacheoptions
NB: I manually upgraded later to latest Grav (0.9.35) since the upgrade button didn't work in the newer admin either (may be another issue): display glitch still here

Image files with spaces is not displayed

Hi,
I have uploaded an image that has spaces in file name and it was not displayed. I tested adding another one with no spaces and worked fine.

example

![](Screen Shot 2015-08-07 at 11.01.31.png)

Kind Regards,
Oras

Numeric password

Setting a password containing only digits in the admin.yaml file won't allow login.

infinite wheel on homepage

Hi,
My install have two days, i try to install a theme and some plugin, but something is wrong now, i have an infinite wheel on the home page ... as you can see.

http://these.sebastienreycoyrehourcq.fr/

Grav version 0.9.35

List of plugins :

Admin Panel v0.2.0
Email v0.1.0
Error v1.2.2
Form v1.0.0
Highlight v1.2.0
Login v0.1.0
Problems v1.1.6
Smileys v1.1.0
Themes Preview v1.2.1
Toc v1.2.0

Theme :

Foundation v1.0.5
Antimatter v 1.7.0

Any advice to repair that ?

website link backend

a <target="_blank"> link on the backend i think it's better to open the website. one tab backend and the other tab the website.

New pages are not created visible

When a new page is created, a numeric prefix is not prepended to the folder name when the directory is created on disk.

For example, when the user creates a new page of the name "Test1", the UI automatically fills in the folder name "test1". Clicking the continue button causes the module to create the directory "test1".

The expected behavior is for the module to enumerate the sibling pages and create the next directory in the sequence, such as "02.test1"

Steps to reproduce:
Install grav 0.9.34
Install beta admin module with gpm
Configure admin as per beta release blog post
Log into /admin
Click "Pages" in left nav panel
Click "+ Add Pages"
Enter "Test1" in "Page Title" input field
Leave all other fields as default
Click "continue"
Click "Save"

There will now be a sibling directory to "01.home" called "test1" in user/pages, instead of "02.test1".

Number automatically added to foldername on save

Within /user/pages/01.blog I have some folders like 'itemA', 'itemB', 'itemC' etc. So I don't use any numbers there. When I use the admin panel and update an existing page, numbers are automatically added at the beginning, e.g. '01.itemA'. I've cleared the number in field 'Ordering' before save but it does not change anything, '01.' is still added to the folder name.

Cannot add new page

If I am trying to add a new page without parent page (parent is root):

Whoops\Exception\ErrorException thrown with message "Call to a member function path() on a non-object"
Stacktrace:
#0  in D:\OpenServer\domains\grav\user\plugins\admin\classes\admin.php:525

If I am trying to save a new page with parent:
Errors
I am using local webserver with Apache/2.2.29 (Win32) and PHP 5.4.35.

Cannot put a dot in the folder name

I was testing the blog page from the Deliver skeleton. I had removed the order number from the folder name of the blog page so that it was a hidden page. Blog page was named bit-and-bites I tried to rename it to 09.bits-and-bites but the UI does not allow me to add a dot in the folder name. I was also getting an error when saving the page when not in "Expert" mode. I will report that separately after I test a bit.

Unable to remove theme

I found something which may be a bug. All the files are owned by the web server so I don't believe it's a permissions issue (I hope!).

Steps to recreate:

  1. Install any theme
  2. Try to uninstall it. The error message "Cannot delete non-existing folder." comes up and the theme remains installed.

Page-Edit: Could not go back from 'Expert' to 'Normal'

Hi all,
first: Thanks a lot for this great plugin!!

On the pages-menu I click on an existing page. I could click on all the header tabs. I also clicked on 'Expert' at the right side. The tabs are replaced by 'Content' and 'Options'. But nothing happens when I click on 'Options'. Same when I click on 'Normal' so I could not go back to the Normal-View. I also left the page and went back to the menu, clicked on another page, but there is the same result: It shows 'Content', 'Options', 'Normal' and 'Expert' but nothing happens when I click on one of them. Additionally I've noticed that the mouse pointer does not change when I hover one of these buttons, but it changes when I just move the mouse from 'Options' to 'Normal' on the tab row. It's changing to a 'drag-and-drop' mouse pointer, and I could hold the left button and drag one of my other pages appearing somehow.... Confusing to explain. If it does not happen on your installation please send me short info so I try to create a video of it.

Another thing: It would also be nice if the 'Please report it on Github' would contain a hyperlink to the repository.

Many thanks!!
Kai

UX: change Updates Available text

Please change the text: Updates Available on dashboard to:
No Updates Available

when there are no updates. And maybe hide the update button

UX: Date format option not precise enough

The default January 1st example is not to show the formatting differences. Pick a day bigger than the 12th so that it is easy to see which format is US (MM-DD) and which is EU/International (DD-MM).

January (or March...) the 31st (01-31 or 31-01) is a better example to help the user make a quick and easy choice.

Filesize in the Editor

If there is a picture below the Editor, the String of the filesize is not "KB" and "MB".
It is "KIB" and "MIB"

RTE preview functionality

First of all, I want to say: what a nice looking admin interface. This was the tipping point for me of choosing Grav from other flat file cms :) Very nice.

Here is the issue:
When I click the "preview" button in the RTE (The eye icon button, which I'm assuming is preview) when creating a new and/or editing a page, it shows a "Not found" popup when clicked. It also sometimes shows the RTE content as empty (as can be seen in the attached image). The markdowm text is still there though if I click back on the "markup" icon button.

I have a clean install of Grav 0.9.35, and have made no changes to the code, other than adding account yaml files to /user/accounts.

grav-preview-bug

Page preview with PHP build-in server not working

I cloned grav, did bin/grav install, bin/gpm install admin and run locally with php -S localhost:8000
I had a question regarding the admin plug-in and editing of pages; with the above setup there's just home to edit. There's an 'eye' icon and I was suspecting this is to 'preview' the editing? However, when clicking nothing happens except that for a few seconds a red widget appears saying "Not found". So my question is what is the purpose of the "eye" button and why is it saying "Not found". Should I install something extra?

Description and Keywords not shown without quotation mark

I don't use quotation marks for my metadata description and keywords, e.g.:

metadata:
description: This is a test
keywords: grav, test

instead of

metadata:
description: 'This is a test'
keywords: 'grav, test'

This seems to work fine for the output, metadata is shown correct in the source of my file. But when I open the blog entry via the admin plugin, keywords and description are empty. I've added them again and saved it to check the output, and I've seen that the admin panel then saves it with quotation marks around. (Additionally strange: I only added the keywords, but the description is still available, now also with quotation marks around it).
I've checked Grav Documentation at http://learn.getgrav.org/content/headers , but there are no quotation marks around it, so it seems that both should be working?
If so, it would be nice to display description and keywords (and maybe some other fields?) also correct in admin panel if no quotation marks are used.
Thanks a lot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.