helpdesk 0.0.2 → 0.0.3
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/app/assets/javascripts/helpdesk/admin/tickets.js +1 -13
- data/app/assets/javascripts/helpdesk/application.js +0 -1
- data/app/assets/stylesheets/helpdesk/admin.css +0 -2
- data/app/assets/stylesheets/helpdesk/imports.css.scss +34 -0
- data/app/controllers/helpdesk/admin/base_controller.rb +2 -2
- data/app/controllers/helpdesk/admin/faqs_controller.rb +2 -7
- data/app/controllers/helpdesk/admin/subscribers_controller.rb +2 -8
- data/app/controllers/helpdesk/admin/ticket_types_controller.rb +3 -9
- data/app/controllers/helpdesk/admin/tickets_controller.rb +9 -21
- data/app/controllers/helpdesk/application_controller.rb +9 -4
- data/app/controllers/helpdesk/dashboard_controller.rb +2 -2
- data/app/controllers/helpdesk/faqs_controller.rb +80 -2
- data/app/controllers/helpdesk/subscribers_controller.rb +41 -18
- data/app/controllers/helpdesk/tickets_controller.rb +15 -20
- data/app/helpers/helpdesk/admin/tickets_helper.rb +0 -9
- data/app/helpers/helpdesk/helpdesk_helper.rb +6 -30
- data/app/helpers/helpdesk/tickets_helper.rb +0 -3
- data/app/mailers/helpdesk/comment_by_requester_confirmation +38 -0
- data/app/mailers/helpdesk/notifications_mailer.rb +1 -2
- data/app/models/helpdesk/comment.rb +5 -11
- data/app/models/helpdesk/faq.rb +1 -1
- data/app/models/helpdesk/ticket.rb +24 -27
- data/app/models/helpdesk/ticket_type.rb +4 -4
- data/app/views/helpdesk/admin/faqs/_form.html.haml +2 -2
- data/app/views/helpdesk/admin/faqs/edit.html.haml +9 -6
- data/app/views/helpdesk/admin/faqs/index.html.haml +2 -2
- data/app/views/helpdesk/admin/faqs/new.html.haml +1 -2
- data/app/views/helpdesk/admin/faqs/show.html.haml +1 -1
- data/app/views/helpdesk/admin/subscribers/edit.html.haml +1 -2
- data/app/views/helpdesk/admin/subscribers/index.html.haml +2 -3
- data/app/views/helpdesk/admin/subscribers/new.html.haml +1 -2
- data/app/views/helpdesk/admin/ticket_types/edit.html.haml +1 -2
- data/app/views/helpdesk/admin/ticket_types/index.html.haml +1 -1
- data/app/views/helpdesk/admin/ticket_types/new.html.haml +1 -2
- data/app/views/helpdesk/admin/tickets/_form.html.haml +9 -9
- data/app/views/helpdesk/admin/tickets/_ticket.html.haml +16 -15
- data/app/views/helpdesk/admin/tickets/edit.html.haml +5 -5
- data/app/views/helpdesk/admin/tickets/index.html.haml +5 -7
- data/app/views/helpdesk/admin/tickets/list.html.haml +2 -3
- data/app/views/helpdesk/admin/tickets/new.html.haml +2 -2
- data/app/views/helpdesk/admin/tickets/show.html.haml +9 -9
- data/app/views/helpdesk/faqs/_form.html.erb +33 -0
- data/app/views/helpdesk/faqs/edit.html.erb +6 -0
- data/app/views/helpdesk/faqs/index.html.erb +29 -0
- data/app/views/helpdesk/faqs/new.html.erb +5 -0
- data/app/views/helpdesk/faqs/show.html.erb +25 -0
- data/app/views/helpdesk/notifications_mailer/comment_by_helpdesk_confirmation.pl.html.haml +32 -0
- data/app/views/helpdesk/notifications_mailer/comment_by_helpdesk_notification.pl.html.haml +28 -0
- data/app/views/helpdesk/notifications_mailer/comment_by_requester_confirmation.pl.html.haml +32 -0
- data/app/views/helpdesk/notifications_mailer/comment_by_requester_notification.pl.html.haml +42 -0
- data/app/views/helpdesk/notifications_mailer/ticket_created_confirmation.pl.html.haml +34 -0
- data/app/views/helpdesk/notifications_mailer/ticket_created_notification.pl.html.haml +42 -0
- data/app/views/helpdesk/tickets/_form.html.haml +11 -11
- data/app/views/helpdesk/tickets/_ticket.html.haml +10 -10
- data/app/views/helpdesk/tickets/index.html.haml +2 -3
- data/app/views/helpdesk/tickets/new.html.haml +2 -2
- data/app/views/helpdesk/tickets/show.html.haml +12 -16
- data/app/views/layouts/helpdesk/_topmenu.html.haml +21 -27
- data/app/views/layouts/helpdesk/_topuser.html.haml +9 -32
- data/app/views/layouts/helpdesk/admin.html.haml +6 -14
- data/app/views/layouts/helpdesk/user.html.haml +6 -14
- data/config/initializers/simple_form.rb +144 -85
- data/config/locales/helpdesk.en.yml +3 -107
- data/config/locales/helpdesk.pl.yml +7 -46
- data/config/routes.rb +5 -6
- data/db/migrate/20130521105605_create_helpdesk_ticket_types.rb +1 -21
- data/db/migrate/20130521132216_add_tr_class_to_ticket_type.rb +5 -0
- data/lib/generators/helpdesk/install_generator.rb +0 -11
- data/lib/generators/helpdesk/templates/README +9 -17
- data/lib/generators/helpdesk/templates/helpdesk.rb +6 -9
- data/lib/helpdesk.rb +4 -4
- data/lib/helpdesk/engine.rb +0 -8
- data/lib/helpdesk/version.rb +1 -1
- metadata +28 -137
- data/app/assets/stylesheets/helpdesk/imports.css.sass +0 -0
- data/app/views/helpdesk/faqs/index.html.haml +0 -20
- data/app/views/helpdesk/notifications_mailer/comment_by_helpdesk_confirmation.html.haml +0 -15
- data/app/views/helpdesk/notifications_mailer/comment_by_helpdesk_notification.html.haml +0 -19
- data/app/views/helpdesk/notifications_mailer/comment_by_requester_confirmation.html.haml +0 -16
- data/app/views/helpdesk/notifications_mailer/comment_by_requester_notification.html.haml +0 -27
- data/app/views/helpdesk/notifications_mailer/ticket_created_confirmation.html.haml +0 -16
- data/app/views/helpdesk/notifications_mailer/ticket_created_notification.html.haml +0 -21
- data/app/views/layouts/mailer_layout.html.haml +0 -20
- data/config/initializers/globalize.rb +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a31fb0b8d00ad49071082b158b4b60831cda1b7d
|
|
4
|
+
data.tar.gz: 21fd5fd39176a65e7e8fc0d36e4ffdb60feaac30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3835a5b84681a7d485a592f12b3815c0a224c485bae239e58b2192e805bdb16ddb2b2d2e9d74cc9913454b6576fe239bc9675020a29e0652ac47b35838f3ad70
|
|
7
|
+
data.tar.gz: 55fc013767346701c35c4dd11bc992ff546aed55fc61a3d1dcceb6539f23b23ed74729fee8566ca9fb792d3372dc6c642f3b43e7c496e91072ab33e83f5e5fe2
|
|
@@ -5,16 +5,4 @@ $(document).ready(function(){
|
|
|
5
5
|
$('a[href*="#"]').click(function(){
|
|
6
6
|
$($(this).attr("href")).effect("highlight", {}, 1500);
|
|
7
7
|
});
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
(function() {
|
|
11
|
-
$(function() {
|
|
12
|
-
return $('.chosen-select').chosen({
|
|
13
|
-
allow_single_deselect: true,
|
|
14
|
-
placeholder_text: 'Wybierz',
|
|
15
|
-
no_results_text: 'Nie znaleziono pasujÄ
cych',
|
|
16
|
-
width: '220px'
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
}).call(this)
|
|
8
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import "bootstrap/variables";
|
|
2
|
+
@import "bootstrap/mixins";
|
|
3
|
+
|
|
4
|
+
@import "bootstrap/scaffolding";
|
|
5
|
+
@import "bootstrap/grid";
|
|
6
|
+
@import "bootstrap/layouts";
|
|
7
|
+
@import "bootstrap/type";
|
|
8
|
+
@import "bootstrap/code";
|
|
9
|
+
@import "bootstrap/forms";
|
|
10
|
+
@import "bootstrap/tables";
|
|
11
|
+
@import "bootstrap/sprites";
|
|
12
|
+
@import "bootstrap/dropdowns";
|
|
13
|
+
@import "bootstrap/wells";
|
|
14
|
+
@import "bootstrap/component-animations";
|
|
15
|
+
@import "bootstrap/close";
|
|
16
|
+
@import "bootstrap/buttons";
|
|
17
|
+
@import "bootstrap/button-groups";
|
|
18
|
+
@import "bootstrap/alerts";
|
|
19
|
+
@import "bootstrap/navs";
|
|
20
|
+
@import "bootstrap/navbar";
|
|
21
|
+
@import "bootstrap/breadcrumbs";
|
|
22
|
+
@import "bootstrap/pagination";
|
|
23
|
+
@import "bootstrap/pager";
|
|
24
|
+
@import "bootstrap/modals";
|
|
25
|
+
@import "bootstrap/tooltip";
|
|
26
|
+
@import "bootstrap/popovers";
|
|
27
|
+
@import "bootstrap/thumbnails";
|
|
28
|
+
@import "bootstrap/labels-badges";
|
|
29
|
+
@import "bootstrap/progress-bars";
|
|
30
|
+
@import "bootstrap/accordion";
|
|
31
|
+
@import "bootstrap/carousel";
|
|
32
|
+
@import "bootstrap/hero-unit";
|
|
33
|
+
@import "bootstrap/utilities";
|
|
34
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Helpdesk
|
|
2
2
|
module Admin
|
|
3
|
-
class BaseController <
|
|
3
|
+
class BaseController < ::ApplicationController
|
|
4
4
|
|
|
5
5
|
helper Helpdesk::Engine.helpers
|
|
6
6
|
# helper Helpdesk::ApplicationHelper
|
|
@@ -14,7 +14,7 @@ module Helpdesk
|
|
|
14
14
|
|
|
15
15
|
def authenticate_helpdesk_admin
|
|
16
16
|
unless helpdesk_admin?
|
|
17
|
-
redirect_to main_app.root_url
|
|
17
|
+
redirect_to main_app.root_url
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
@@ -52,7 +52,7 @@ class Helpdesk::Admin::FaqsController < Helpdesk::Admin::BaseController
|
|
|
52
52
|
# POST /faqs
|
|
53
53
|
# POST /faqs.json
|
|
54
54
|
def create
|
|
55
|
-
@faq = Helpdesk::Faq.new(
|
|
55
|
+
@faq = Helpdesk::Faq.new(params[:faq])
|
|
56
56
|
|
|
57
57
|
respond_to do |format|
|
|
58
58
|
if @faq.save
|
|
@@ -71,7 +71,7 @@ class Helpdesk::Admin::FaqsController < Helpdesk::Admin::BaseController
|
|
|
71
71
|
@faq = Helpdesk::Faq.find(params[:id])
|
|
72
72
|
|
|
73
73
|
respond_to do |format|
|
|
74
|
-
if @faq.update_attributes(
|
|
74
|
+
if @faq.update_attributes(params[:faq])
|
|
75
75
|
format.html { redirect_to admin_faqs_url, notice: 'Faq was successfully updated.' }
|
|
76
76
|
format.json { head :no_content }
|
|
77
77
|
else
|
|
@@ -92,9 +92,4 @@ class Helpdesk::Admin::FaqsController < Helpdesk::Admin::BaseController
|
|
|
92
92
|
format.json { head :no_content }
|
|
93
93
|
end
|
|
94
94
|
end
|
|
95
|
-
|
|
96
|
-
private
|
|
97
|
-
def faq_params
|
|
98
|
-
params.require(:faq).permit(:active, :position, :title, :text, translations_attributes:[:id,:locale,:title,:text])
|
|
99
|
-
end
|
|
100
95
|
end
|
|
@@ -9,7 +9,7 @@ class Helpdesk::Admin::SubscribersController < Helpdesk::Admin::BaseController
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def create
|
|
12
|
-
@subscriber = Helpdesk::Subscriber.new(
|
|
12
|
+
@subscriber = Helpdesk::Subscriber.new(params[:subscriber])
|
|
13
13
|
if @subscriber.save
|
|
14
14
|
redirect_to admin_subscribers_path, notice: t('subscribers.created')
|
|
15
15
|
else
|
|
@@ -26,7 +26,7 @@ class Helpdesk::Admin::SubscribersController < Helpdesk::Admin::BaseController
|
|
|
26
26
|
def update
|
|
27
27
|
@subscriber = Helpdesk::Subscriber.find(params[:id])
|
|
28
28
|
|
|
29
|
-
if @subscriber.update_attributes(
|
|
29
|
+
if @subscriber.update_attributes(params[:subscriber])
|
|
30
30
|
redirect_to admin_subscribers_path, notice: 'Subscriber was successfully updated.'
|
|
31
31
|
else
|
|
32
32
|
render action: "edit"
|
|
@@ -40,10 +40,4 @@ class Helpdesk::Admin::SubscribersController < Helpdesk::Admin::BaseController
|
|
|
40
40
|
@subscriber.destroy
|
|
41
41
|
redirect_to root_path
|
|
42
42
|
end
|
|
43
|
-
|
|
44
|
-
private
|
|
45
|
-
|
|
46
|
-
def subscriber_params
|
|
47
|
-
params.require(:subscriber).permit(:confirmed, :email, :hashcode, :lang, :name)
|
|
48
|
-
end
|
|
49
43
|
end
|
|
@@ -17,7 +17,7 @@ class Helpdesk::Admin::TicketTypesController < Helpdesk::Admin::BaseController
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def create
|
|
20
|
-
@ticket_type = Helpdesk::TicketType.new(
|
|
20
|
+
@ticket_type = Helpdesk::TicketType.new(params[:ticket_type])
|
|
21
21
|
if @ticket_type.save
|
|
22
22
|
redirect_to admin_ticket_types_url, notice: 'Ticket type was successfully created.'
|
|
23
23
|
else
|
|
@@ -27,7 +27,7 @@ class Helpdesk::Admin::TicketTypesController < Helpdesk::Admin::BaseController
|
|
|
27
27
|
|
|
28
28
|
def update
|
|
29
29
|
@ticket_type = Helpdesk::TicketType.find(params[:id])
|
|
30
|
-
if @ticket_type.update_attributes(
|
|
30
|
+
if @ticket_type.update_attributes(params[:ticket_type])
|
|
31
31
|
redirect_to admin_ticket_types_url, notice: 'Ticket type was successfully updated.'
|
|
32
32
|
else
|
|
33
33
|
render action: "edit"
|
|
@@ -43,10 +43,4 @@ class Helpdesk::Admin::TicketTypesController < Helpdesk::Admin::BaseController
|
|
|
43
43
|
format.json { head :no_content }
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
|
-
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
def ticket_type_params
|
|
50
|
-
params.require(:ticket_type).permit(:active,:position,:title,:tr_class. translations_attributes:[:title])
|
|
51
|
-
end
|
|
52
|
-
end
|
|
46
|
+
end
|
|
@@ -2,21 +2,16 @@ class Helpdesk::Admin::TicketsController < Helpdesk::Admin::BaseController
|
|
|
2
2
|
|
|
3
3
|
def index
|
|
4
4
|
if params[:tickets] == 'unassigned'
|
|
5
|
-
@tickets = Helpdesk::Ticket.unassigned
|
|
5
|
+
@tickets = Helpdesk::Ticket.unassigned
|
|
6
6
|
elsif params[:tickets] == 'closed'
|
|
7
|
-
@tickets = Helpdesk::Ticket.closed
|
|
7
|
+
@tickets = Helpdesk::Ticket.closed
|
|
8
8
|
elsif params[:tickets] == 'active'
|
|
9
|
-
@tickets = Helpdesk::Ticket.active
|
|
9
|
+
@tickets = Helpdesk::Ticket.active
|
|
10
10
|
elsif params[:tickets] == 'all'
|
|
11
|
-
@tickets = Helpdesk::Ticket.
|
|
11
|
+
@tickets = Helpdesk::Ticket.all
|
|
12
12
|
else
|
|
13
13
|
@tickets = my_tickets.active
|
|
14
14
|
end
|
|
15
|
-
@tickets = @tickets.includes(:requester)
|
|
16
|
-
.includes(:assignee)
|
|
17
|
-
.includes(:ticket_type)
|
|
18
|
-
.page(params[:page])
|
|
19
|
-
|
|
20
15
|
render 'list'
|
|
21
16
|
end
|
|
22
17
|
|
|
@@ -37,18 +32,18 @@ class Helpdesk::Admin::TicketsController < Helpdesk::Admin::BaseController
|
|
|
37
32
|
|
|
38
33
|
def edit
|
|
39
34
|
@ticket = Helpdesk::Ticket.find(params[:id])
|
|
40
|
-
|
|
35
|
+
|
|
41
36
|
end
|
|
42
37
|
|
|
43
38
|
def show
|
|
44
39
|
@ticket = Helpdesk::Ticket.find(params[:id])
|
|
45
|
-
|
|
40
|
+
|
|
46
41
|
end
|
|
47
42
|
|
|
48
43
|
def create
|
|
49
|
-
@ticket = Helpdesk::Ticket.new(
|
|
44
|
+
@ticket = Helpdesk::Ticket.new(params[:ticket])
|
|
50
45
|
if @ticket.save
|
|
51
|
-
redirect_to admin_ticket_path
|
|
46
|
+
redirect_to admin_ticket_path
|
|
52
47
|
else
|
|
53
48
|
render action: "new"
|
|
54
49
|
end
|
|
@@ -56,7 +51,7 @@ class Helpdesk::Admin::TicketsController < Helpdesk::Admin::BaseController
|
|
|
56
51
|
|
|
57
52
|
def update
|
|
58
53
|
@ticket = Helpdesk::Ticket.find(params[:id])
|
|
59
|
-
if @ticket.update_attributes(
|
|
54
|
+
if @ticket.update_attributes(params[:ticket])
|
|
60
55
|
unless @ticket.assignee
|
|
61
56
|
@ticket.update_column(:assignee_id, helpdesk_user)
|
|
62
57
|
end
|
|
@@ -66,11 +61,4 @@ class Helpdesk::Admin::TicketsController < Helpdesk::Admin::BaseController
|
|
|
66
61
|
end
|
|
67
62
|
end
|
|
68
63
|
|
|
69
|
-
|
|
70
|
-
private
|
|
71
|
-
|
|
72
|
-
def ticket_params
|
|
73
|
-
params.require(:ticket).permit(:status, :assignee_id,:ticket_type_id, :subject, :description,comments_attributes:[:author_id, :comment, :public])
|
|
74
|
-
end
|
|
75
|
-
|
|
76
64
|
end
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
module Helpdesk
|
|
2
2
|
class ApplicationController < ::ApplicationController
|
|
3
3
|
before_filter :ensure_user, :if => Proc.new { Helpdesk.require_user }
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
helper Helpdesk::Engine.helpers
|
|
6
|
+
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
layout 'helpdesk/user'
|
|
8
10
|
|
|
9
11
|
def ensure_user
|
|
10
|
-
|
|
12
|
+
if !helpdesk_user
|
|
11
13
|
redirect_to main_app.send(Helpdesk.sign_in_url)
|
|
12
14
|
end
|
|
13
15
|
end
|
|
14
16
|
|
|
15
|
-
def
|
|
16
|
-
|
|
17
|
+
def helpdesk_admin?
|
|
18
|
+
helpdesk_user && (can? :manage, 'helpdesk')
|
|
17
19
|
end
|
|
20
|
+
helper_method :helpdesk_admin?
|
|
21
|
+
|
|
22
|
+
|
|
18
23
|
|
|
19
24
|
end
|
|
20
25
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module Helpdesk
|
|
2
|
-
class DashboardController <
|
|
2
|
+
class DashboardController < ApplicationController
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
before_filter :my_tickets
|
|
@@ -13,7 +13,7 @@ module Helpdesk
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def my_tickets
|
|
16
|
-
@my_tickets =
|
|
16
|
+
@my_tickets = Ticket
|
|
17
17
|
.includes(:comments=>[:author])
|
|
18
18
|
.includes(:requester)
|
|
19
19
|
.includes(:assignee)
|
|
@@ -1,7 +1,85 @@
|
|
|
1
1
|
module Helpdesk
|
|
2
|
-
class FaqsController <
|
|
2
|
+
class FaqsController < ApplicationController
|
|
3
|
+
# GET /faqs
|
|
4
|
+
# GET /faqs.json
|
|
3
5
|
def index
|
|
4
|
-
@faqs =
|
|
6
|
+
@faqs = Faq.all
|
|
7
|
+
|
|
8
|
+
respond_to do |format|
|
|
9
|
+
format.html # index.html.erb
|
|
10
|
+
format.json { render json: @faqs }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# GET /faqs/1
|
|
15
|
+
# GET /faqs/1.json
|
|
16
|
+
def show
|
|
17
|
+
@faq = Faq.find(params[:id])
|
|
18
|
+
|
|
19
|
+
respond_to do |format|
|
|
20
|
+
format.html # show.html.erb
|
|
21
|
+
format.json { render json: @faq }
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# GET /faqs/new
|
|
26
|
+
# GET /faqs/new.json
|
|
27
|
+
def new
|
|
28
|
+
@faq = Faq.new
|
|
29
|
+
|
|
30
|
+
respond_to do |format|
|
|
31
|
+
format.html # new.html.erb
|
|
32
|
+
format.json { render json: @faq }
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# GET /faqs/1/edit
|
|
37
|
+
def edit
|
|
38
|
+
@faq = Faq.find(params[:id])
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# POST /faqs
|
|
42
|
+
# POST /faqs.json
|
|
43
|
+
def create
|
|
44
|
+
@faq = Faq.new(params[:faq])
|
|
45
|
+
|
|
46
|
+
respond_to do |format|
|
|
47
|
+
if @faq.save
|
|
48
|
+
format.html { redirect_to @faq, notice: 'Faq was successfully created.' }
|
|
49
|
+
format.json { render json: @faq, status: :created, location: @faq }
|
|
50
|
+
else
|
|
51
|
+
format.html { render action: "new" }
|
|
52
|
+
format.json { render json: @faq.errors, status: :unprocessable_entity }
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# PUT /faqs/1
|
|
58
|
+
# PUT /faqs/1.json
|
|
59
|
+
def update
|
|
60
|
+
@faq = Faq.find(params[:id])
|
|
61
|
+
|
|
62
|
+
respond_to do |format|
|
|
63
|
+
if @faq.update_attributes(params[:faq])
|
|
64
|
+
format.html { redirect_to @faq, notice: 'Faq was successfully updated.' }
|
|
65
|
+
format.json { head :no_content }
|
|
66
|
+
else
|
|
67
|
+
format.html { render action: "edit" }
|
|
68
|
+
format.json { render json: @faq.errors, status: :unprocessable_entity }
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# DELETE /faqs/1
|
|
74
|
+
# DELETE /faqs/1.json
|
|
75
|
+
def destroy
|
|
76
|
+
@faq = Faq.find(params[:id])
|
|
77
|
+
@faq.destroy
|
|
78
|
+
|
|
79
|
+
respond_to do |format|
|
|
80
|
+
format.html { redirect_to faqs_url }
|
|
81
|
+
format.json { head :no_content }
|
|
82
|
+
end
|
|
5
83
|
end
|
|
6
84
|
end
|
|
7
85
|
end
|
|
@@ -1,19 +1,48 @@
|
|
|
1
1
|
module Helpdesk
|
|
2
|
-
class SubscribersController <
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
class SubscribersController < ApplicationController
|
|
3
|
+
# GET /subscribers
|
|
4
|
+
# GET /subscribers.json
|
|
5
|
+
def index
|
|
6
|
+
@subscribers = Subscriber.all
|
|
7
|
+
|
|
8
|
+
respond_to do |format|
|
|
9
|
+
format.html # index.html.erb
|
|
10
|
+
format.json { render json: @subscribers }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# GET /subscribers/1
|
|
15
|
+
# GET /subscribers/1.json
|
|
16
|
+
def show
|
|
17
|
+
@subscriber = Subscriber.find(params[:id])
|
|
18
|
+
|
|
19
|
+
respond_to do |format|
|
|
20
|
+
format.html # show.html.erb
|
|
21
|
+
format.json { render json: @subscriber }
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# GET /subscribers/new
|
|
26
|
+
# GET /subscribers/new.json
|
|
5
27
|
def new
|
|
6
28
|
@subscriber = Subscriber.new
|
|
7
|
-
|
|
29
|
+
|
|
8
30
|
respond_to do |format|
|
|
9
31
|
format.html # new.html.erb
|
|
10
32
|
format.json { render json: @subscriber }
|
|
11
33
|
end
|
|
12
34
|
end
|
|
13
|
-
|
|
35
|
+
|
|
36
|
+
# GET /subscribers/1/edit
|
|
37
|
+
def edit
|
|
38
|
+
@subscriber = Subscriber.find(params[:id])
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# POST /subscribers
|
|
42
|
+
# POST /subscribers.json
|
|
14
43
|
def create
|
|
15
|
-
@subscriber = Subscriber.new(
|
|
16
|
-
|
|
44
|
+
@subscriber = Subscriber.new(params[:subscriber])
|
|
45
|
+
|
|
17
46
|
respond_to do |format|
|
|
18
47
|
if @subscriber.save
|
|
19
48
|
format.html { redirect_to @subscriber, notice: 'Subscriber was successfully created.' }
|
|
@@ -24,14 +53,14 @@ module Helpdesk
|
|
|
24
53
|
end
|
|
25
54
|
end
|
|
26
55
|
end
|
|
27
|
-
|
|
56
|
+
|
|
28
57
|
# PUT /subscribers/1
|
|
29
58
|
# PUT /subscribers/1.json
|
|
30
59
|
def update
|
|
31
60
|
@subscriber = Subscriber.find(params[:id])
|
|
32
|
-
|
|
61
|
+
|
|
33
62
|
respond_to do |format|
|
|
34
|
-
if @subscriber.update_attributes(
|
|
63
|
+
if @subscriber.update_attributes(params[:subscriber])
|
|
35
64
|
format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }
|
|
36
65
|
format.json { head :no_content }
|
|
37
66
|
else
|
|
@@ -40,23 +69,17 @@ module Helpdesk
|
|
|
40
69
|
end
|
|
41
70
|
end
|
|
42
71
|
end
|
|
43
|
-
|
|
72
|
+
|
|
44
73
|
# DELETE /subscribers/1
|
|
45
74
|
# DELETE /subscribers/1.json
|
|
46
75
|
def destroy
|
|
47
76
|
@subscriber = Subscriber.find(params[:id])
|
|
48
77
|
@subscriber.destroy
|
|
49
|
-
|
|
78
|
+
|
|
50
79
|
respond_to do |format|
|
|
51
80
|
format.html { redirect_to subscribers_url }
|
|
52
81
|
format.json { head :no_content }
|
|
53
82
|
end
|
|
54
83
|
end
|
|
55
|
-
|
|
56
|
-
private
|
|
57
|
-
|
|
58
|
-
def subscriber_params
|
|
59
|
-
params.require(:subscriber).permit(:email,:lang, :name)
|
|
60
|
-
end
|
|
61
84
|
end
|
|
62
85
|
end
|