Giter VIP home page Giter VIP logo

admin-template's Introduction

Admin Template

1. Features

Below is a non exhaustive list of notable features brought out of the box by this template:

  • Fully responsive

    • Its based on Bootstrap and AdminLTE two well tested and solid frameworks

  • Enhanced mobile experience

    • Material design load bar

    • Material design flat buttons

    • Ripple effect based on materialize css
      27104868 d9bfb33e 5063 11e7 83be 2201a3f8cda5

    • Touch enabled menu to slide in/out and show navbar on scroll up
      dd37121e 2296 11e7 855c 8f20b59dcf5f

    • Auto show and hide navbar based on page scroll

    • Scroll to top

  • Automatically activates (highlight) menu based on current page
    menu highlight

  • Custom error pages

  • Two menu modes, left and horizontal based menu

  • Configurable, see Configuration

  • Breadcrumb based navigation

  • Layout customization via Control Sidebar

  • High resolution and responsible icons based on Glyphycons and FontAwesome

  • Menu items search
    menu search

  • Builtin dark and light skins

  • Back to previous screen when logging in again after session expiration (or accessing a page via url without being logged in)

ℹ️
Most of the above features can be enabled/disabled via configuration mechanism.

2. Usage

First include it in your classpath:

<dependency>
    <groupId>com.github.adminfaces</groupId>
    <artifactId>admin-template</artifactId>
    <version>version</version>
</dependency>
⚠️

Admin template will bring the following transitive dependencies:

<dependency>
    <groupId>com.github.adminfaces</groupId>
    <artifactId>admin-theme</artifactId>
    <version>version</version>
</dependency>
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>12.0</version>
</dependency>

<dependency>
    <groupId>org.omnifaces</groupId>
    <artifactId>omnifaces</artifactId>
    <version>4.1</version>
</dependency>

Which you can override in your pom.xml as needed.

With the template dependency in classpath now you can use admin facelets template into your JSF pages.

2.1. Example

Consider the following sample page:

<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="jakarta.faces.facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/admin.xhtml"> (1)

    <ui:define name="head">
        <title>Admin Starter</title>
    </ui:define>

    <ui:define name="logo-lg">
        Admin Starter
    </ui:define>

    <ui:define name="logo-mini">
        Admin
    </ui:define>

    <ui:define name="menu">
        <ul class="sidebar-menu">
            <li>
                <p:link href="/index.xhtml" onclick="clearBreadCrumbs()">
                    <i class="fa fa-home"></i>
                    <span>Home</span>
                </p:link>
            </li>
	        <li class="header">
	            General
	        </li>
	        <li>
	            <p:link href="/car-list.xhtml">
	                <i class="fa fa-car"></i>
	                <span>Cars</span>
	            </p:link>
	        </li>
        </ul>
     </ui:define>

    <ui:define name="top-menu">
        <ui:include src="/includes/top-bar.xhtml"/>
    </ui:define>

      <ui:define name="title">
        <h2 class="align-center">
            Welcome to the <span class="text-aqua"> <i><a href="https://github.com/adminfaces/admin-starter" target="_blank"
                                                          style="text-transform: none;text-decoration: none"> AdminFaces Starter</a></i></span> Project!
            <br/>
            <small>Integrating <p:link value="Primefaces" href="http://primefaces.org"/>, <p:link value="Bootstrap"
                                                                                                  href="http://getbootstrap.com/"/> and
                <p:link value="Admin LTE" href="https://almsaeedstudio.com/themes/AdminLTE/index2.html/"/> into your
                <p:link value="JSF" href="https://javaserverfaces.java.net/"/> application.
            </small>
        </h2>
    </ui:define>

    <ui:define name="description">
        A page description
    </ui:define>

    <ui:define name="body">
    	<h2>Page body</h2>
    </ui:define>


    <ui:define name="footer">
          <a target="_blank"
           href="https://github.com/adminfaces/">
            Copyright (C) 2017 - AdminFaces
        </a>

        <div class="pull-right hidden-xs" style="color: gray">
            <i>1.0.0</i>
        </div>
    </ui:define>


</ui:composition>
  1. /admin.xhtml is the location of the template

The above page definition renders as follows:

template example

There are also other regions defined in admin.xhtml template, see here.

💡

A good practice is to define a template on your application which extends the admin template, see admin-starter application template here.

So in your pages you use your template instead of admin.

3. Application template

Instead of repeating sections like menu, logo, head and footer on every page we can create a template inside our application which uses admin.xhtml as template:

/WEB-INF/templates/template.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="jakarta.faces.facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/admin.xhtml">

    <ui:define name="head">
            <title>Admin Starter</title>
            <h:outputStylesheet library="css" name="starter.css"/>
    </ui:define>

    <ui:define name="logo-lg">
        Admin Starter
    </ui:define>

    <ui:define name="logo-mini">
        Admin
    </ui:define>

    <ui:define name="menu">
        <ul class="sidebar-menu">
            <li>
                <p:link href="/index.xhtml" onclick="clearBreadCrumbs()">
                    <i class="fa fa-home"></i>
                    <span>Home</span>
                </p:link>
            </li>
	        <li class="header">
	            General
	        </li>
	        <li>
	            <p:link href="/car-list.xhtml">
	                <i class="fa fa-car"></i>
	                <span>Cars</span>
	            </p:link>
	        </li>
        </ul>
     </ui:define>

    <ui:define name="top-menu">
        <ui:include src="/includes/top-bar.xhtml"/>
    </ui:define>

    <ui:define name="footer">
        <a target="_blank"
           href="https://github.com/adminfaces/">
            Copyright (C) 2017 - AdminFaces
        </a>

        <div class="pull-right hidden-xs" style="color: gray">
            <i>1.0.0</i>
        </div>
    </ui:define>

</ui:composition>

And now the page can just define its content and title:

/webapp/mypage.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="jakarta.faces.facelets"
                template="/WEB-INF/templates/template.xhtml">

    <ui:define name="title">
        A page title
    </ui:define>

    <ui:define name="description">
        A page description
    </ui:define>

    <ui:define name="body">
    	<h2>Page body</h2>
    </ui:define>

</ui:composition>

3.1. Switching between left menu and top menu templates

AdminFaces supports two layout modes, one is left based menu and the other is top based menu.

The user can change layout modes via control sidebar but to make it work you have to use LayoutMB to define page template:

/webapp/mypage.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="jakarta.faces.facelets"
                template="#{layoutMB.template}">

<!-- page content -->

</ui:composition>

As a convention over configuration LayoutMB will load templates from the following locations:

  • webapp/WEB-INF/templates/template.xhtml and resources/META-INF/resources/templates/template.xhtml for the left menu based template

  • webapp/WEB-INF/templates/template-top.xhtml and resources/META-INF/resources/templates/template-top.xhtml for horizontal menu layout.

ℹ️
If you don’t provide a Application template then built in admin.xhtml and admin-top.xhtml templates will be used.

4. Configuration

Template configuration is made through admin-config.properties file present in src/main/resources folder.

Here are the default values as well as its description:

admin.loginPage=login.xhtml (1)
admin.indexPage=index.xhtml (2)
admin.dateFormat= (3)
admin.breadcrumbSize=5 (4)
admin.renderMessages=true (5)
admin.renderAjaxStatus=true (6)
admin.disableFilter=false (7)
admin.renderBreadCrumb=true (8)
admin.enableSlideMenu=true (9)
admin.enableRipple=true (10)
admin.rippleElements= .ripplelink,button.ui-button,.ui-selectlistbox-item,.ui-multiselectlistbox-item,.ui-selectonemenu-label,.ui-selectcheckboxmenu,\
.ui-autocomplete-dropdown, .ui-autocomplete-item ... (the list goes on) (11)
admin.skin=skin-blue (12)
admin.autoShowNavbar=true (13)
admin.ignoredResources= (14)
admin.loadingImage=ajaxloadingbar.gif (15)
admin.extensionLessUrls=false (16)
admin.renderControlSidebar=false (17)
admin.controlSidebar.showOnMobile=false (18)
admin.controlSidebar.leftMenuTemplate=true (19)
admin.controlSidebar.fixedLayout=false (20)
admin.controlSidebar.boxedLayout=false (21)
admin.controlSidebar.sidebarCollapsed=false (22)
admin.controlSidebar.expandOnHover=false (23)
admin.controlSidebar.fixed=false (24)
admin.controlSidebar.darkSkin=true (25)
admin.rippleMobileOnly=true (26)
admin.renderMenuSearch=true (27)
admin.autoHideMessages=true (28)
admin.messagesHideTimeout=2500 (29)
admin.iconsEffect=true (30)
  1. login page location (relative to webapp). It you only be used if you configure Admin Session.

  2. index page location. User will be redirected to it when it access app root (contextPath/).

  3. Date format used in error page (500.xhtml), by default it is JVM default format.

  4. Number of breadcrumbs to queue before removing the older ones.

  5. When false, p:messages defined in admin template will not be rendered.

  6. When false ajaxStatus, which triggers the loading bar on every ajax request, will not be rendered.

  7. Disables AdminFilter, responsible for redirecting user after session timeout, sending user to logon page when it is not logged in among other things.

  8. When false, the breadCrumb component, declared in admin template, will not be rendered.

  9. If true will make left menu touch enable (can be closed or opened via touch). Can be enable/disabled per page with <ui:param name="enableSlideMenu" value="false".

  10. When true it will create a wave/ripple effect on elements specified by rippleElements.

  11. A list of comma separated list of (jquery) selector which elements will be affected by ripple effect.

  12. Default template skin.

  13. Automatic shows navbar when users scrolls page up on small screens. Can be enable/disabled per page with <ui:param name="autoShowNavbar" value="false".

  14. Comma separated resources (pages or urls) to be skiped by AdminFilter. Ex: /rest, /pages/car-list. Note that by default the filter skips pages under CONTEXT/public/ folder.

  15. image used for the loading popup. It must be under webapp/resources/images folder.

  16. Removes extension suffix from breadCrumb links.

  17. When true it will activate control sidebar component.

  18. When true control sidebar will be also rendered on mobile devices.

  19. Switches layout between left (default) and top menu.

  20. Toggles fixed layout where navbar is fixed on the page.

  21. Toggles boxed layout which is helpful when working on large screens because it prevents the site from stretching very wide.

  22. When true left sidebar will be collapsed.

  23. When true left sidebar will expand on mouse hover.

  24. When true control sidebar will be fixed on the page.

  25. Changes control sidebar skin between dark and light.

  26. When true the ripple effect will be enabled only on mobile (small) screens.

  27. Enables or disables menu search.

  28. If true PrimeFaces info messages will be hidden after a certain timeout.

  29. Timeout to hide info messages. Note that the timeout is composed by configured timeout + number of words in message.

  30. Enables material effect when icons (e.g modal close, calendar) are clicked.

You don’t need to declare all values in your admin-config.properties, you can specify only the ones you need to change.
💡
Since vRC16 config properties can be passed as Java system properties.
ℹ️
Controlsidebar entries (admin.controlSidebar.xxx) will be used only for initial/default values because they will be stored on browser local storage as soon as user changes them.

5. Admin Session

AdminSession is a simple session scoped bean which controls whether user is logged in or not.

 public boolean isLoggedIn(){
        return isLoggedIn; //always true by default
    }

By default the user is always logged in and you need to override it (by using bean specialization or via injection and calling setIsLoggedIn() method) to change its value, see Overriding AdminSession.

When isLoggedIn is false you got the following mechanisms activated:

  1. Access to any page, besides the login, redirects user to login;

  2. When session is expired user is redirected to logon and current page (before expiration) is saved so user is redirected back to where it was before session expiration.

ℹ️
It is up to you to decide whether the user is logged in or not.

5.1. Overriding AdminSession

There are two ways to override AdminSession default value which is specialization and injection.

5.1.1. AdminSession Specialization

A simple way to change AdminSession logged in value is by extending it:

import jakarta.enterprise.context.SessionScoped;
import jakarta.enterprise.inject.Specializes;
import com.github.adminfaces.template.session.AdminSession;
import org.omnifaces.util.Faces;
import java.io.Serializable;

@SessionScoped
@Specializes
public class LogonMB extends AdminSession implements Serializable {

    private String currentUser;
    private String email;
    private String password;
    private boolean remember;


    public void login() throws IOException {
        currentUser = email;
        addDetailMessage("Logged in successfully as <b>" + email + "</b>");
        Faces.getExternalContext().getFlash().setKeepMessages(true);
        Faces.redirect("index.xhtml");
    }

    @Override
    public boolean isLoggedIn() {

        return currentUser != null;
    }

    //getters&setters
}

5.2. AdminSession Injection

Another way is to inject it into your security authentication logic:

import com.github.adminfaces.template.session.AdminSession;
import org.omnifaces.util.Messages;
import org.omnifaces.util.Faces;

@SessionScoped
@Named("authorizer")
public class CustomAuthorizer implements Serializable {

    private String currentUser;

    @Inject
    AdminSession adminSession;

    public void login(String username) {
        currentUser = username;
        adminSession.setIsLoggedIn(true);
        Messages.addInfo(null,"Logged in sucessfully as <b>"+username+"</b>");
        Faces.redirect("index.xhtml");
    }

}
As isLoggedIn is true by default you need to set it to false on application startup so user is redirected to login page. This step is not needed when AdminSession Specialization.

6. Error Pages

The template comes with custom error pages like 403, 404, 500, ViewExpired and OptimisticLock.

500

User is going to be redirected to 500.xhtml whenever a 500 response code is returned in a request.

The page will also be triggered when a Throwable is raised (and not catch).

Here is how 500 page look like:

500
403

User is redirected to 403.xhtml whenever a 403 response code is returned in a request. The page will also be triggered when a com.github.adminfaces.template.exception.AccessDeniedException is raised.

403
404

User will be redirected to 404.xhtml whenever a 404 response code is returned from a request.

404
ViewExpired

When a JSF javax.faces.application.ViewExpiredException is raised user will be redirected to expired.xhtml.

expired
OptimisticLock

When a JPA javax.persistence.OptimisticLockException is thrown user will be redirected to optimistic.xhtml.

optimistic

6.1. Providing custom error pages

You can provide your own custom pages (and other status codes) by configuring them in web.xml, example:

<error-page>
    <error-code>404</error-code>
    <location>/404.xhtml</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/500.xhtml</location>
</error-page>
<error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/500.xhtml</location>
</error-page>

6.2. Overriding error pages

You can also override error pages by placing the pages (with same name) described in Error Pages section on the root of your application (webapp/).

7. Internationalization

Labels in error pages and control sidebar are provided via JSF resource bundle mechanism.

Following are the default labels in admin resource bundle:

src/main/resources/admin.properties
#general
admin.version=${project.version}
label.home=Home
label.go-back=Go back to
label.or-to=or to
label.previous-page=previous page

#403
label.403.header=403
label.403.message=Access denied! You do not have access to the requested page.

#404
label.404.header=404
label.404.message=Oops! Page not found

#500
label.500.header=500
label.500.message=Oops! Something went wrong
label.500.title=Unexpected error
label.500.detail=Details

#expired
label.expired.title=View expired
label.expired.message= The requested page could not be recovered.
label.expired.click-here= Click here to reload the page.

#optimistic
label.optimistic.title=Record already updated
label.optimistic.message= The requested record has been already updated by another user.
label.optimistic.click-here= Click here to reload the updated record from database.

#controlsidebar
controlsidebar.header=Layout Options
controlsidebar.label.restore-defaults=Restore defaults
controlsidebar.label.menu-horientation=Left menu layout
controlsidebar.txt.menu-horientation=Toggle menu orientation between <b class\="sidebar-bold">left</b> and <b class\="sidebar-bold">top</b> menu.
controlsidebar.label.fixed-layout=Fixed Layout
controlsidebar.txt.fixed-layout=Activate the fixed layout, if checked the top bar will be fixed on the page.
controlsidebar.label.boxed-layout=Boxed Layout
controlsidebar.txt.boxed-layout=Activate the boxed layout.
controlsidebar.label.sidebar-collapsed=Collapsed Sidebar
controlsidebar.txt.sidebar-collapsed=If checked the sidebar menu will be collapsed.
controlsidebar.label.sidebar-expand-hover=Sidebar Expand on Hover
controlsidebar.txt.sidebar-expand-hover=If checked the left sidebar will expand on hover.
controlsidebar.label.sidebar-slide=Control Sidebar fixed
controlsidebar.txt.sidebar-slide=If checked control sidebar will be fixed on the page.
controlsidebar.label.sidebar-skin=Dark Sidebar Skin
controlsidebar.txt.sidebar-skin=If checked <b class\="sidebar-bold">dark</b> skin will be used for control sidebar, otherwise <b class\="sidebar-bold">light</b> skin will be used.
controlsidebar.header.skins=Skins

#menu search
menu.search.placeholder=Search menu items...
💡

You can provide your own language bundle adding a file named admin_YOUR_LANGUAGE.properties in your application resources folder.

Don’t forget to add it as supported locale in faces-config, see example here.

You can contribute your language locale to AdminFaces, check here the current supported locales.

8. Control Sidebar

ControlSidebar is a component which provides a panel so user can customize the template layout:

controlsidebar

Options selected by user are stored on browser local storage so they are remembered no matter the user logs off the application.

8.1. Usage

To enable the control sidebar you need to add the following entry in src/main/resources/admin-config.properties:

admin.renderControlSidebar=true

And then add a link or button on your page which opens the sidebar. The link or button must use data-toggle attribute:

  <a href="#" id="layout-setup" data-toggle="control-sidebar" class="hidden-sm hidden-xs"><i class="fa fa-gears"></i></a>

On admin-starter the link is located on top-bar.xhtml.

{link-admin-showcase-openshift}/pages/layout/controlsidebar.xhtml[Click here^] to see controlsidebar in action on admin showcase.

By default the control sidebar comes only with the configuration tab but you can define additional tabs by defining controlsidebar-tabs and controlsidebar-content on your template. An example can be found on admin-starter template.

💡

ControlSidebar is hidden on mobile devices by default. You can change this on admin-config.properties:

 admin.controlSidebar.showOnMobile=true

Also don’t forget to remove the hidden-sm hidden-xs classes from the button/link that opens the sidebar:

   <a  href="#" class="ui-link ui-widget" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>

9. JakartaEE migration

Since version 1.6.0 admin-template supports jakartaEE by default, see admin-starter for a sample project.

11. Snapshots

Snapshots are published to maven central on each commit, to use it just declare the repository below on your pom.xml:

<repositories>
    <repository>
        <snapshots/>
        <id>snapshots</id>
        <name>libs-snapshot</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>

admin-template's People

Contributors

axl8713 avatar benkard avatar ghazyami avatar jomu78 avatar larsgrefer avatar maxusoltsev avatar persapiens avatar rmpestano avatar tmsanchez 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

admin-template's Issues

Add LogoutServlet

Currently we have a LogoutMB but a servlet would be easier to call, for example admin-starter-shiro uses this logout servlet, as it is generic we could put it in admin-template.

Use /admin-logout as pattern to avoid conflict issues.

Additional Information
  • Affected version: RC12

If used with security-constraint in web.xml, all redirects after login goes to 403.xhtml

Issue Overview

I have configured a realm and a security constraint in web.xml, in conjunction with AdminSession specialization bean. But the template saves the 403.xhml page as redirect url after login.

Current Behaviour

after login, redirects to 403.xhtml if the requested url is protected under a security-constraint

Expected Behaviour

after login, must redirect to the correct requested url.

How to reproduce

A sample xhtml code may help, ex:

web.xml

  <security-constraint>
    <display-name>all</display-name>
    <web-resource-collection>
      <web-resource-name>Config</web-resource-name>
      <url-pattern>/config/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <description/>
      <role-name>admin</role-name>
    </auth-constraint>
  </security-constraint>

LoginManager

@Named("loginManager")
@SessionScoped
@Specializes
public class AdminSessionImpl extends AdminSession implements Serializable {

  private String username;

  private String password;

  private boolean loggedIn = false;

  @Override
  public boolean isLoggedIn() {
    return loggedIn;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public void login() throws IOException {
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
    HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
    try {
      request.login(username, password);
      loggedIn = true;
      Faces.redirect("index.xhtml");
    }
    catch (ServletException e) {
      loggedIn = false;
      String loginErrorMessage = e.getLocalizedMessage();
      FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(loginErrorMessage));
    }
    finally {
      password = null;
    }
  }

  public void logout() throws IOException {
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
    externalContext.invalidateSession();
    Faces.redirect("login.xhtml");
  }

}
Additional Information
  • Affected version: I am using com.github.adminfaces:admin-theme:1.0.0-RC9
  • Browser version: N/A

span p:selectCheckboxMenu

A seta do combo não fica legal quando uso "p:selectCheckboxMenu"
image

<h:form prependId="false" id="formTarefas">
	<div class="ui-g ui-fluid">
		<div class="ui-g-3">
			<h:outputLabel for="usuarioFiltro" value="Usuários:" />
			<p:selectCheckboxMenu id="usuarioFiltro"
				value="#{tarefaPortalBean.userSelecionado}" label="Usuários"
				multiple="true" filter="true" filterMatchMode="startsWith"
				panelStyle="width:250px"
				converter="omnifaces.SelectItemsConverter">
				<f:selectItems value="#{tarefaPortalBean.usuarios}" var="u"
					itemLabel="#{u.name}" itemValue="#{u}" />
			</p:selectCheckboxMenu>
		</div>
	</div>
</form>

Outra coisa que acontece é quando marco alguns itens e depois desmarco todos
image

No bean, nos valores seleionados fica vazio, mas visualmente não limpa a seleção

Buttons with icons have too much right padding

Issue Overview

Tell us briefly what the problem is about.

Current Behaviour

image

image

Expected Behaviour

Less padding

How to reproduce

https://github.com/adminfaces/admin-starter/blob/master/src/main/webapp/car-form.xhtml#L25

                        <p:commandButton value="Save" action="#{carFormMB.save}" update="@form"
                                         icon="fa fa-check" styleClass="btn-primary"/>
                        <p:spacer width="5" rendered="#{carFormMB.isNew()}"/>
                        <p:commandButton value="Clear" action="#{carFormMB.clear}" process="@this"
                                         icon="fa fa-refresh" styleClass="btn-success"
update="@form" rendered="#{carFormMB.isNew()}" resetValues="true"/>```

Side menu must be fixed when user scrolls page down

Issue Overview

When user scrolls page down and slides left menu out then menu items become inaccessible because its position is relative.

Current Behaviour

sidebar-before

Expected Behaviour

sidebar-after

Additional Information
  • Affected version: 1.0.0-RC7
  • Browser version: any

Mojarra 2.3.4 issues

Issue Overview

Admin Boot does not work with mojarra 2.3.4.
Please look discussion here about how to solve it.

Current Behaviour
Submitting button does not work. Ajax fails.
Expected Behaviour
Ajax does not work.
How to reproduce
  • run project with java -jar target/admin-boot-3.1.2-SNAPSHOT.jar
  • access http://localhost:8080
  • type your name and press button
Additional Information
  • AdminFaces version: 1.0.0-RC13
  • PrimeFaces version: 6.2
  • JoinFaces version: 3.2.0-SNAPSHOT

Wrong footer size when going to 403 in ajax call

Issue Overview

When going to access denied page using ajax, e.g:

<p:commandButton value="Ajax Submit" id="ajax" update="growl" ignoreAutoUpdate="true"
                                         actionListener="#{buttonMB.buttonAction}" styleClass="btn-default btn-block"/>

Bean call:

 public void buttonAction(ActionEvent actionEvent) {
        if(1==1) {
            throw new AccessDeniedException("access denied");
        }
        addMessage("Welcome to AdminFaces!!");
    }

Then page footer is bigger than usual:

access-denied-bug

Additional Information
  • Affected version: 1.0.0-RC11

OneMenu hover seems tot be not working

Issue Overview

Mouse hover over oneMenu items not visually shown.

Current Behaviour

When hover with your mouse over an oneMenu the entry is not highlighted.

Expected Behaviour

When hover with your mouse over an oneMenu the entry should be highlighted.

reference https://www.primefaces.org/showcase/ui/input/oneMenu.xhtml

How to reproduce

https://adminfaces-rpestano.rhcloud.com/showcase/pages/form/forms.xhtml

see https://webmshare.com/1MoqV

Additional Information
  • Affected version: 1.0.0-RC9
  • Browser version: Tested with Chrome 60.0.3112.78 and Firefox 54.0.1

Make it possible to disable slideMenu per page

Issue Overview

Currently we can only disable slideout integration for the whole application, make it possible to disable via ui:param, example:

<ui:define name="head-end">
        <ui:param name="enableSlideMenu" value="false"/>
</ui:define>

Make template skin configurable

Issue Overview

Currently the template skin is fixed as blue and changing it involves setting a property in a bean on application startup.

Expected Behaviour

Default skin should be confugured via properties files.

Additional Information
  • Affected version
    1.0.0-RC6
  • Browser version
    Any

Wrong redirect after Session expired

Issue Overview

Hi!

I have opened the following page.
https://localhost:8443/gebaeude/pages/gebaeude_list. xhtml
If the session dropped, I will be redirected to the login page. The last current page is saved to be redirected after login. Unfortunately, the URL is stored incorrectly if there is a subfolder
I will be redirected to the following URL.

URL at login.
https://localhost:8443/gebaeude/login.xhtml?page=%2Fpages_list. xhtml

URL after login.
https://localhost:8443/gebaeude/pages_list. xhtml

Expected Behaviour

Redirect to the correct page after a login.
https://localhost:8443/gebaeude/pages/gebaeude_list.xhtml

Additional Information
  • Affected version: I am using com.github.adminfaces:admin-theme:1.0.0-RC9
  • Browser version: N/A

directory

Warning about p:autoUpdate being deprecated

Issue Overview

Since the PrimeFaces Update to Version 6.2 the autoUpdate attributes of components are deprecated. The new tag <p:autoUpdate> should be used.

Current Behaviour

Annoying warnings in the logs on each partial update:

INFO  [org.primefaces.component.messages.MessagesRenderer] (default task-50) autoUpdate attribute is deprecated and will be removed in a future version, use p:autoUpdate component instead.
Expected Behaviour

Correct usage of <p:autoUpdate> tag without info message.

How to reproduce

Fire any kind of partial update to the page, resulting in the <p:messages> tag inside admin.xhtml or admin-top.xhtml being executed.

A sample project or code may help. Can it be reproduced in admin-starter?

Additional Information
  • Affected version: 1.0.0.RC13-SNAPSHOT

Working with shiro filter

I am trying the template. It seems to be a promising thing. I am stuck on how to make it work with shiro filter which is already configured. I want authorisation with roles. If it can work without shiro its okay as long as I can allow designated pages according to roles without configuring anything on the sever

Side menu disappears when resize window to minimum

Moved issue from starter project:

Hello, first of all, nice job! It's really useful!

Side menu items simply disappears when browser is resized to minimum width:

image

You can test it resizing browser until menu gets in hiden state.

Additional Information
  • Affected version: 1.0.0-RC6
  • Browser version: any

Support rendering breadcrumb title from page title

Issue Overview

It would be great to minimize the effort for creating breadcrumbs if the title of the page equals the title of the breadcrumb and the title is not a complex mixture of HTML elements.

Current Behaviour

Specify the title of the page using <ui:define name="title">My title</ui:define> and specify the title of the breadcrumb via <adm:breadcrumb title="My title" />.

Expected Behaviour

Specify the title of the page using a generic param <ui:param name="title" value="My title" /> that is both used for the page title and the breadcrumb title.

This should be configurable using an admin configuration.

Breadcrumb navigation breaks extensionless URLs when not using link attribute

Issue Overview

Using extensionless URLs results in the suffix .xhtml being appended to links generated by the breadcrumb navigation when the link attribute is not used. This is due to the usage of the viewId from JSFs view root.

Current Behaviour

When using extensionless URLs (using OmniFaces or OCPSoft Rewrite) the Breadcrumb navigation will use the viewId (before it has been rewritten) including the configured extension (such as .xhtml). For example, if the URL /dashboard was accessed, and after that the url /otherDashboard the breadcrumb navigation will contain a link to dashboard.xhtml.

Expected Behaviour

The suffix .xhtml is not automatically appended when using the Breadcrumb navigation and no link attribute is given (for example using a new config property automatically removing the .xhtml extension).

How to reproduce

Configure extensionless URLs using OmniFaces or OCPSoft Rewrite rules, so that the JSF pages are reachable without .jsf or .xhtml extensions.

A sample project or code may help. Can it be reproduced in admin-starter?

Additional Information
  • Affected version: 1.0.0.RC12 / 1.0.0.RC13-SNAPSHOT
Workaround

Provide explicit links using the link attribute.

Add support for spring boot

I have tried running the project from a Spring boot application using JoinFaces and I am getting:

java.lang.ExceptionInInitializerError: null
at org.omnifaces.application.OmniApplication.(OmniApplication.java:69) ~[omnifaces-2.1.jar:2.1]
at org.omnifaces.application.OmniApplicationFactory.createOmniApplication(OmniApplicationFactory.java:89) ~[omnifaces-2.1.jar:2.1]
at org.omnifaces.application.OmniApplicationFactory.getApplication(OmniApplicationFactory.java:54) ~[omnifaces-2.1.jar:2.1]
at com.sun.faces.application.InjectionApplicationFactory.getApplication(InjectionApplicationFactory.java:93) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:142) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.lifecycle.ClientWindowFactoryImpl.(ClientWindowFactoryImpl.java:62) ~[javax.faces-2.2.14.jar:2.2.14]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_112]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_112]
at java.lang.Class.newInstance(Class.java:442) ~[na:1.8.0_112]
at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:405) ~[javax.faces-2.2.14.jar:2.2.14]
at javax.faces.FactoryFinderInstance.getImplementationInstance(FactoryFinderInstance.java:251) ~[javax.faces-2.2.14.jar:2.2.14]
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:543) ~[javax.faces-2.2.14.jar:2.2.14]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:328) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:236) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:439) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227) ~[javax.faces-2.2.14.jar:2.2.14]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4743) [tomcat-embed-core-8.5.14.jar:8.5.14]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) [tomcat-embed-core-8.5.14.jar:8.5.14]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.14.jar:8.5.14]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) [tomcat-embed-core-8.5.14.jar:8.5.14]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.5.14.jar:8.5.14]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
Caused by: java.lang.IllegalStateException: CDI BeanManager instance is not available in JNDI.
at org.omnifaces.config.BeanManager.(BeanManager.java:99) ~[omnifaces-2.1.jar:2.1]
at org.omnifaces.config.BeanManager.(BeanManager.java:49) ~[omnifaces-2.1.jar:2.1]
... 28 common frames omitted
Caused by: java.lang.IllegalStateException: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at org.omnifaces.util.JNDI.lookup(JNDI.java:92) ~[omnifaces-2.1.jar:2.1]
at org.omnifaces.config.BeanManager.(BeanManager.java:92) ~[omnifaces-2.1.jar:2.1]
... 29 common frames omitted
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662) ~[na:1.8.0_112]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313) ~[na:1.8.0_112]
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:350) ~[na:1.8.0_112]
at javax.naming.InitialContext.lookup(InitialContext.java:417) ~[na:1.8.0_112]
at org.omnifaces.util.JNDI.lookup(JNDI.java:88) ~[omnifaces-2.1.jar:2.1]
... 30 common frames omitted

Page title should not be rendered on error page

Issue Overview

With the addition of title ui:param to automatically render breadCrumb and page title (see #50) now the title is being rendered on error page

Current Behaviour

error-page-title

Expected Behaviour

No title in error page.

How to reproduce

Create a page with title param:

  <ui:define name="body-begin">
        <ui:param name="title" value="Car listing"/> <!-- Automatic create breadCrumb and page title when param 'title' is provided. --> 
    </ui:define>

And throw an unexpected exception (a non catched exception) on this page.

Additional Information
  • AdminFaces version: RC13
  • PrimeFaces version: 6.2

DateFormat config should take JVM format by default

Users can set date format in admin-config which sets the format for error page, by default it uses US format:

admin.dateFormat=MM/dd/yyyy HH:mm:ss

change default to blank:

admin.dateFormat=

and when no format is provided then use JVM defaults.

  • Affected version:

RC12

Parametrize loading image

Users may specify loading image in admin-config.properties:

admin.loadingImage=ajaxloadingbar.gif
  • Affected version: RC12

The menus keep auto closing after a Ajax call in Glassfish 5

##### Issue Overview

The expanded menus in the left side keep auto closing after using an ajax call from Primefaces.

Current Behaviour

Everytime I call an Ajax from PrimeFaces the Menus in the left side start to close everytime I try to open then. (The command p:ajax and p:poll are causing the problem.)

Version: RC9

Allow "public" pages

Issue Overview

In some cases a user don't need to be logged in to access a page, e.g a registration page.

Current Behaviour

Currently to achieve such behavior we need to detect which pages user is accessing and then tell AdminSession that user is logged in, example:

@Named
@SessionScoped
@Specializes
public class LogonMB extends AdminSession implements Serializable {

   @Override
    public boolean isLoggedIn() {
        return currentUser != null || Faces.getViewId().endsWith("registration.xhtml");
    }

Note that when isLoggedIn is true adminfaces will NOT redirect user to logon page.

Expected Behaviour

When a pages is under APP-CONTEXT/public/ directory AdminFilter will NOT try to redirect user to logon page.

Additional Information
  • Affected version: 1.0.0-RC9

Collapsed left menu not showing on hover

Currently the left menu is not showing on hover when colapsed, see gif:

menu-hover

The expected behavior is to show menu itens on hover:

colapsed-menu

The below css rule works as a workaround:

body ul.sidebar-menu>li {
overflow:visible;
} 

It was changed to overflow hidden in newer versions because of ripple/waves effect integration.

Slidout menu stop working after clicking page content

Issue Overview

When on mobile device/small screen and side menu is open and user clicks on page body the menu is collapsed. After that menu slideout stop working.

Additional Information
  • Affected version: 1.0.0-RC7
  • Browser version: Any

Allow customize header and sidebar using admin-template

Issue Overview

I need customize header and sidebar or remove that in same pages.

Current Behaviour

Today admin-template let insert code before and after but not replace all code of menu and sidebar.

Expected Behaviour

I expected remove thats parts and insert any other code to customize.

Additional Information
  • Affected version: 1.0.0-RC11

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.