gubbara 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +11 -9
- data/app/controllers/gubbara/application_controller.rb +1 -0
- data/app/controllers/gubbara/notices_controller.rb +1 -1
- data/app/helpers/gubbara/application_helper.rb +0 -1
- data/app/views/gubbara/application/_notice.html.erb +3 -2
- data/app/views/gubbara/notices/_form.html.erb +6 -0
- data/app/views/gubbara/notices/index.html.erb +6 -3
- data/app/views/layouts/gubbara/application.html.erb +1 -1
- data/db/migrate/20151103123233_create_gubbara_notices.rb +1 -0
- data/lib/gubbara/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b180c17e9b04468098b457d14fd4e89f00029c16
|
4
|
+
data.tar.gz: dcff530806919bf0d2f0fb01a9faabf58d1890e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e92ce7ae929ef14cf95d7b566c2861a262428108cd68cdc84bc2cc4ee48627aab477e9981b04cf5bd5fe2f7434b3418cbf2adfab5585024db38b4cc33fdcf4fa
|
7
|
+
data.tar.gz: c3c8b4fea8306dd177f597eaa621290477be82752e61beab311405da0c3d8679fbacc7c90a5ae630572be7bbf76b5cadc34f1156c219b0788ff04c5b256588d3
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Gubbara
|
2
2
|
|
3
|
-
|
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>$
|
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
|
-
|
35
|
+
== Hide
|
36
36
|
|
37
|
-
|
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
|
-
|
41
|
+
You can access 'Gubbara Admin Panel'.
|
41
42
|
|
42
|
-
|
43
|
+
Please ensure that only admin can access this gubbara panel to do that you can use *http_basic_authenticate_with*.
|
43
44
|
|
44
|
-
==
|
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
|
-
|
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.
|
@@ -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
|
-
|
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
|
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
|
-
|
33
|
+
<%= link_to 'Delete', notice, action: :delete, method: :delete %></td>
|
31
34
|
</tr>
|
32
35
|
<% end %>
|
33
36
|
</tbody>
|
data/lib/gubbara/version.rb
CHANGED
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.
|
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-
|
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
|
28
|
-
|
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: []
|