= AdminAnnouncement
It helps admin to announce anything including pasrsed html in a form a notice.It consists two types of announcements:
- Session Based: Only for logged in users.(Application Layout)
- Cookie Based: For all users visting the website.(Public Layout)
== Installation
Add this line to your application's Gemfile:
gem 'admin_announcement'
And then execute:
$ bundle install
Install migrations:
$ rake admin_announcement:install:migrations
Migrate:
$ rake db:migrate
== Usage
To use this gem you just need to mount it in your route file config/routes.rb
mount AdminAnnouncement::Engine => '/announcement'
Place the helper method according to your requirement in any layout or any view page where you want to place your announcement.
=== Session Based Announcements
For session based announcements place this helper method in the layout which is not publicly accessible.
example: place this in app/views/layouts/application.html.erb file.
<%= user_announcements %>
=== Cookie Based Announcements
For cookie based announcements place this helper method in the layout which is publicly accessible.
example: place this in app/views/layouts/public.html.erb file.
<%= public_announcements %>
== Features
=== Admin Panel
You can access AdminAnnouncement Admin Panel.
Please ensure that only admin can access this admin_announcement panel to do that you can use http_basic_authenticate_with or some other methods to prevent that url.
=== Configuration
You can configure background_color, font_color, font_size, text_alignment, z_index and even cross_button_color of that announcement.
Admin also can disable the announcement when it is no longer required.
=== Disable
You can disable the announcement from the admin panel when you don't want your users to see that announcement anymore.
=== Html Parsing
You can even put your complete html in the text field and the output would be html parsed announcement.
=== Hide
==== Session
When a user clicks on the cross button it hides the template for that session and will not show till the session expires or disabled by admin.
==== Cookie
When a user clicks on the cross button it hides the template and user will not be able to see that annoucement again on that broswer because cookies are permanent and also the expiry date of cookies are 1 year.
== Note
There may be the situations that you want to play with the CSS of annoucements so you can play with it.
Structure of it is like Notices is parent class for all the annoucements.