gubbara 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44bc4d56aca56736e06884c391e4e40c079d3983
4
- data.tar.gz: 4eca0d8cb209b5728bfdea2530dcd335e66e69fc
3
+ metadata.gz: b180c17e9b04468098b457d14fd4e89f00029c16
4
+ data.tar.gz: dcff530806919bf0d2f0fb01a9faabf58d1890e7
5
5
  SHA512:
6
- metadata.gz: b414361af2cd7cb1672c8ef07b9cdac20530fbdb68b36161e0d87bd78bf9d0a973f6daa38a001f4fa180e9b2dd9cf85615a08179e89a49b6a686a2b069c50657
7
- data.tar.gz: f3e60ac903cdee29b72cfecd830a1ac2d7c6d41b08f885c498115a608018f62fc4fbae71b48465732e8ec7779428569ce64e74e407abf65f4cadb71b4ba21276
6
+ metadata.gz: e92ce7ae929ef14cf95d7b566c2861a262428108cd68cdc84bc2cc4ee48627aab477e9981b04cf5bd5fe2f7434b3418cbf2adfab5585024db38b4cc33fdcf4fa
7
+ data.tar.gz: c3c8b4fea8306dd177f597eaa621290477be82752e61beab311405da0c3d8679fbacc7c90a5ae630572be7bbf76b5cadc34f1156c219b0788ff04c5b256588d3
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Gubbara
2
2
 
3
- Gubbara is a gem for providing notice on board for all the users who visits the site. It has all the configuration for the particular notice you can provide 'background color' and 'font color'.
3
+ It helps admin to announce anything to every user in the system in a form of a notice which is configurable also every user has an option to hide it and will not appear till session expires or disabled by admin.
4
4
 
5
5
  == Installation
6
6
 
@@ -18,7 +18,7 @@ Install migrations:
18
18
 
19
19
  Migrate:
20
20
 
21
- <tt>$ rails db:migrate</tt>
21
+ <tt>$ rake db:migrate</tt>
22
22
 
23
23
  == Usage
24
24
 
@@ -32,17 +32,19 @@ example: place this in *app/views/layouts/application.html.erb* file
32
32
 
33
33
  <tt><%= list_notices %></tt>
34
34
 
35
- Then to go to the dashboard hit the url as:
35
+ == Hide
36
36
 
37
- your_application_url */gubbara/notices/new*
37
+ 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.
38
38
 
39
+ == Admin Accesss
39
40
 
40
- == Hide
41
+ You can access 'Gubbara Admin Panel'.
41
42
 
42
- When a user clicks on the cross button it hides the template for that session and will not show until the session will not expire.
43
+ Please ensure that only admin can access this gubbara panel to do that you can use *http_basic_authenticate_with*.
43
44
 
44
- == Admin Accesss
45
+ == Configuration
46
+
47
+ You can configure *background_color*, *font_color*, *font_size*, *text_alignment*, *z_index* and even *cross_button_color* of that notice.
45
48
 
46
- The admin who will create the notice for all the users will be able to configure *background_color*, *font_color*, *font_size*, *text_alignment* and even *cross_button_color* for a particulare notice.
49
+ It also can disable the notice when notice will not be needed any more.
47
50
 
48
- It also can disable the notice when notice will not be needed any more.
@@ -1,4 +1,5 @@
1
1
  module Gubbara
2
2
  class ApplicationController < ::ApplicationController
3
+ layout 'layouts/gubbara/application'
3
4
  end
4
5
  end
@@ -43,7 +43,7 @@ module Gubbara
43
43
  end
44
44
 
45
45
  def notice_params
46
- params.require(:notice).permit(:message, :active, :background_color, :font_color, :font_size, :text_align, :cross_button_color)
46
+ params.require(:notice).permit(:message, :active, :background_color, :font_color, :font_size, :text_align, :cross_button_color, :z_index)
47
47
  end
48
48
  end
49
49
  end
@@ -2,7 +2,6 @@ module Gubbara
2
2
  module ApplicationHelper
3
3
  def list_notices
4
4
  session[:hidden_notices] ? @notices = Gubbara::Notice.where("gubbara_notices.id not in (?) and gubbara_notices.active not in (?)", session[:hidden_notices], false) : @notices = Gubbara::Notice.where("gubbara_notices.active not in (?)", false)
5
- logger.info "------------#{@notices.inspect}"
6
5
  render(:partial => 'gubbara/application/fetch_notices', locale: {notices: @notices})
7
6
  end
8
7
  end
@@ -1,5 +1,6 @@
1
- <div class="notice_panel notice_<%= user_notice.id %>" style="background: <%= user_notice.background_color %>; width: 100%; position: relative; float: left; clear: both; padding: 10px 10px; text-align: <%= user_notice.text_align %>; font-size: <%= user_notice.font_size %>; line-height: normal;">
1
+ <div class="notice_panel notice_<%= user_notice.id %>" style="background: <%= user_notice.background_color %>; width: 100%; position: relative; float: left; clear: both; padding: 10px 10px; text-align: <%= user_notice.text_align %>; font-size: <%= user_notice.font_size %>; z-index: <%= user_notice.z_index %>; line-height: normal;">
2
2
  <p style="margin: 0px; padding: 0px; line-height: normal; color: <%= user_notice.font_color%>;"><%= user_notice.message %></p>
3
- <div style="position: absolute; top: 8px; color: #ffffff; font-size: 14px; right: 15px; z-index: 101;"><%= link_to 'X', gubbara.hide_notice_path(user_notice), method: :post, remote: true, title: 'X', class: 'cross_button', style: "color: #{user_notice.cross_button_color};" %></div>
3
+
4
+ <div style="position: absolute; top: 8px; color: #ffffff; font-size: 14px; right: 15px; z-index: 101;"><%= link_to 'X', gubbara.hide_notice_path(user_notice), method: :post, remote: true, title: 'X', class: 'cross_button', style: "color: #{user_notice.cross_button_color};" %></div>
4
5
  </div>
5
6
 
@@ -35,6 +35,12 @@
35
35
  <%= f.text_field :cross_button_color, class: 'form-control' %>
36
36
  </div>
37
37
  </div>
38
+ <div class="form-group">
39
+ <%= f.label :z_index, class: 'control-label col-sm-4' %>
40
+ <div class="col-sm-4">
41
+ <%= f.text_field :z_index, class: 'form-control' %>
42
+ </div>
43
+ </div>
38
44
  <div class="form-group">
39
45
  <%= f.label :active, class: 'control-label col-sm-4' %>
40
46
  <div class="col-sm-4">
@@ -1,5 +1,7 @@
1
1
  <div class="panel panel-default">
2
- <div class="panel-heading text-center"> <%= link_to 'New Notice', new_notice_path , class: 'pull-right'%> All Notices</div>
2
+ <div class="panel-heading text-center"> <%= link_to 'New Notice', new_notice_path, class: 'pull-right' %> All
3
+ Notices
4
+ </div>
3
5
  <table class="table">
4
6
  <thead>
5
7
  <tr>
@@ -11,11 +13,11 @@
11
13
  <th>font_size</th>
12
14
  <th>text_align</th>
13
15
  <th>cross_button_color</th>
16
+ <th>z_index</th>
14
17
  <th>Actions</th>
15
18
  </tr>
16
19
  </thead>
17
20
  <tbody>
18
-
19
21
  <% @notices.all.each do |notice| %>
20
22
  <tr>
21
23
  <td><%= notice.id %></td>
@@ -26,8 +28,9 @@
26
28
  <td><%= notice.font_size %></td>
27
29
  <td><%= notice.text_align %></td>
28
30
  <td><%= notice.cross_button_color %></td>
31
+ <td><%= notice.z_index %></td>
29
32
  <td><%= link_to 'Edit', edit_notice_path(notice) %>
30
- <%= link_to 'Delete', notice, action: :delete, method: :delete %></td>
33
+ <%= link_to 'Delete', notice, action: :delete, method: :delete %></td>
31
34
  </tr>
32
35
  <% end %>
33
36
  </tbody>
@@ -7,7 +7,7 @@
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
10
- <%= render partial: 'notices', locale: {user_notices: @user_notices} if @user_notices %>
10
+ <%= render partial: 'layouts/gubbara/notices', locale: {user_notices: @user_notices} if @user_notices %>
11
11
 
12
12
  <%= yield %>
13
13
 
@@ -8,6 +8,7 @@ class CreateGubbaraNotices < ActiveRecord::Migration
8
8
  t.string :font_size, default: '20px'
9
9
  t.string :text_align, default: 'center'
10
10
  t.string :cross_button_color, default: '#ffffff'
11
+ t.string :z_index, default: '9999'
11
12
 
12
13
  t.timestamps
13
14
  end
@@ -1,3 +1,3 @@
1
1
  module Gubbara
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gubbara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nitanshu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-24 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,8 +24,9 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: It shows the placed notice from admin and if cross button clicked then
28
- it will not appear until the session expires.
27
+ description: It helps admin to announce anything to every user in the system in a
28
+ form of a notice which is configurable also every user has an option to hide it
29
+ and will not appear till session expires or disabled by admin.
29
30
  email:
30
31
  - nitanshu1991@gmail.com
31
32
  executables: []