helpdesk 0.0.11 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/helpdesk/admin.css +1 -0
- data/app/assets/stylesheets/helpdesk/imports.css.sass +0 -0
- data/app/controllers/helpdesk/admin/tickets_controller.rb +5 -2
- data/app/controllers/helpdesk/tickets_controller.rb +2 -2
- data/app/helpers/helpdesk/helpdesk_helper.rb +29 -5
- data/app/views/helpdesk/admin/faqs/_form.html.haml +2 -2
- data/app/views/helpdesk/admin/faqs/edit.html.haml +6 -9
- data/app/views/helpdesk/admin/faqs/index.html.haml +2 -2
- data/app/views/helpdesk/admin/faqs/new.html.haml +2 -1
- data/app/views/helpdesk/admin/subscribers/edit.html.haml +2 -1
- data/app/views/helpdesk/admin/subscribers/index.html.haml +3 -2
- data/app/views/helpdesk/admin/subscribers/new.html.haml +2 -1
- data/app/views/helpdesk/admin/ticket_types/edit.html.haml +2 -1
- data/app/views/helpdesk/admin/ticket_types/index.html.haml +1 -1
- data/app/views/helpdesk/admin/ticket_types/new.html.haml +2 -1
- data/app/views/helpdesk/admin/tickets/_form.html.haml +3 -3
- data/app/views/helpdesk/admin/tickets/_ticket.html.haml +3 -3
- data/app/views/helpdesk/admin/tickets/edit.html.haml +4 -4
- data/app/views/helpdesk/admin/tickets/list.html.haml +1 -1
- data/app/views/helpdesk/admin/tickets/new.html.haml +2 -2
- data/app/views/helpdesk/admin/tickets/show.html.haml +8 -8
- data/app/views/helpdesk/tickets/_form.html.haml +2 -2
- data/app/views/helpdesk/tickets/_ticket.html.haml +2 -2
- data/app/views/helpdesk/tickets/index.html.haml +3 -2
- data/app/views/helpdesk/tickets/new.html.haml +2 -2
- data/app/views/helpdesk/tickets/show.html.haml +3 -3
- data/app/views/layouts/helpdesk/_topmenu.html.haml +25 -21
- data/app/views/layouts/helpdesk/_topuser.html.haml +18 -9
- data/app/views/layouts/helpdesk/admin.html.haml +14 -6
- data/app/views/layouts/helpdesk/user.html.haml +14 -6
- data/config/initializers/simple_form.rb +83 -144
- data/config/routes.rb +1 -1
- data/lib/helpdesk/version.rb +1 -1
- metadata +27 -13
- data/app/assets/stylesheets/helpdesk/imports.css.scss +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c4d9893e06be1d15b031e7f6d9173555ab769d4
|
4
|
+
data.tar.gz: b4ac33e3c1c387151fb68470a7d627d440d3adc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7161256c228129353ba48bcf13b7de5f4d5fe6e8942473f0bc56484a7b96575b62e3e0cdb5a9f59976e1b9d41062c4bc0e65c081100421c1c8e5a98eb4d0ca5
|
7
|
+
data.tar.gz: e9c027cd5ed06c939516d5f5963963573e67e10bd3729134e425195d038660b4fd128f17fce1e6caa9c60fed53ea50bd98f537c41f4b43519aace308429018e8
|
File without changes
|
@@ -8,11 +8,14 @@ class Helpdesk::Admin::TicketsController < Helpdesk::Admin::BaseController
|
|
8
8
|
elsif params[:tickets] == 'active'
|
9
9
|
@tickets = Helpdesk::Ticket.active.scoped
|
10
10
|
elsif params[:tickets] == 'all'
|
11
|
-
@tickets = Helpdesk::Ticket.
|
11
|
+
@tickets = Helpdesk::Ticket.scoped
|
12
12
|
else
|
13
13
|
@tickets = my_tickets.active.scoped
|
14
14
|
end
|
15
|
-
@tickets = @tickets.
|
15
|
+
@tickets = @tickets.includes(:requester)
|
16
|
+
.includes(:assignee)
|
17
|
+
.includes(:ticket_type)
|
18
|
+
.page(params[:page])
|
16
19
|
|
17
20
|
render 'list'
|
18
21
|
end
|
@@ -4,10 +4,10 @@ module Helpdesk
|
|
4
4
|
# GET /tickets.json
|
5
5
|
def index
|
6
6
|
if params[:tickets] == 'closed'
|
7
|
-
@tickets = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).closed
|
7
|
+
@tickets = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).closed.page(params[:page])
|
8
8
|
@tickets_count = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).active.count
|
9
9
|
else
|
10
|
-
@tickets = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).active
|
10
|
+
@tickets = Helpdesk::Ticket.where(:requester_id => helpdesk_user.id).active.page(params[:page])
|
11
11
|
@tickets_count = @tickets.size
|
12
12
|
end
|
13
13
|
|
@@ -1,11 +1,31 @@
|
|
1
1
|
module Helpdesk
|
2
2
|
module HelpdeskHelper
|
3
|
+
|
4
|
+
|
3
5
|
def menu_left(title,&block)
|
4
|
-
|
5
|
-
|
6
|
-
|
6
|
+
panel_menu(title,'default',&block)
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
def panel_menu(title,type,&block)
|
11
|
+
content_tag(:div,class: "panel panel-#{type}") do
|
12
|
+
content_tag(:div ,class: 'panel-heading') do
|
13
|
+
content_tag(:h3 ,title,class:'panel-title')
|
14
|
+
end +
|
15
|
+
content_tag( :ul, class: 'nav nav-pills nav-stacked ') do
|
7
16
|
capture(&block)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
8
21
|
|
22
|
+
def panel(title,type,&block)
|
23
|
+
content_tag(:div,class: "panel panel-#{type}") do
|
24
|
+
content_tag(:div ,class: 'panel-heading') do
|
25
|
+
content_tag(:h3 ,title,class:'panel-title')
|
26
|
+
end +
|
27
|
+
content_tag( :div, class: 'panel-body') do
|
28
|
+
capture(&block)
|
9
29
|
end
|
10
30
|
end
|
11
31
|
end
|
@@ -23,8 +43,12 @@ module Helpdesk
|
|
23
43
|
end
|
24
44
|
end
|
25
45
|
|
26
|
-
def
|
27
|
-
raw("<
|
46
|
+
def badge(num,css='pull-right')
|
47
|
+
raw("<span class=\"badge #{css}\">#{num}</span> ")
|
48
|
+
end
|
49
|
+
|
50
|
+
def ico(name)
|
51
|
+
raw("<i class=\"glyphicon glyphicon-#{name}\"></i> ")
|
28
52
|
end
|
29
53
|
|
30
54
|
def parent_layout(layout)
|
@@ -7,14 +7,14 @@
|
|
7
7
|
%li= msg
|
8
8
|
= f.input :active
|
9
9
|
|
10
|
-
|
10
|
+
|
11
11
|
|
12
12
|
- I18n.available_locales.each do |locale|
|
13
13
|
%h1
|
14
14
|
= locale
|
15
15
|
= f.globalize_fields_for locale do |g|
|
16
16
|
= g.input :title
|
17
|
-
= g.input :text, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Full'} }
|
17
|
+
= g.input :text, :as => :ckeditor, :input_html => { :ckeditor => {:width=>'100%',:height => 200,:toolbar => 'Full'} }
|
18
18
|
|
19
19
|
|
20
20
|
= f.submit 'Save', :class=>'btn btn-primary'
|
@@ -1,14 +1,11 @@
|
|
1
1
|
= render 'menu'
|
2
2
|
|
3
|
-
.row
|
4
|
-
.span3
|
5
|
-
%br
|
6
|
-
.span11
|
7
3
|
|
8
|
-
|
4
|
+
- content_for :title do
|
5
|
+
Edycja pytania
|
9
6
|
|
10
|
-
|
7
|
+
= render 'form'
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
= link_to 'Show', [:admin,@faq]
|
10
|
+
\|
|
11
|
+
= link_to 'Back', admin_faqs_path
|
@@ -1,6 +1,6 @@
|
|
1
1
|
= render 'menu'
|
2
2
|
|
3
|
-
|
3
|
+
- content_for :title do
|
4
4
|
-if params[:faqs] && params[:faqs] == 'active'
|
5
5
|
= t('helpdesk.faqs.active')
|
6
6
|
-elsif params[:faqs] && params[:faqs] == 'inactive'
|
@@ -27,7 +27,7 @@
|
|
27
27
|
= t('helpdesk.faqs.faq.inactive')
|
28
28
|
%div.span5
|
29
29
|
= faq.title
|
30
|
-
%div.span2
|
30
|
+
%div.span2
|
31
31
|
= link_to t('helpdesk.show'), admin_faq_path(faq), class: 'btn btn-info btn-mini'
|
32
32
|
= link_to t('helpdesk.edit'), edit_admin_faq_path(faq),class: 'btn btn-primary btn-mini'
|
33
33
|
= link_to t('helpdesk.destroy'), admin_faq_path(faq), method: :delete, data: { confirm: 'Are you sure?' },class: 'btn btn-danger btn-mini'
|
@@ -1,6 +1,7 @@
|
|
1
1
|
= render 'menu'
|
2
2
|
|
3
|
-
|
3
|
+
- content_for :title do
|
4
|
+
Subscribers
|
4
5
|
|
5
6
|
%table.table.table-hover
|
6
7
|
%tr
|
@@ -19,7 +20,7 @@
|
|
19
20
|
= ico('ok')
|
20
21
|
%td= subscriber.send Helpdesk.display_user.to_sym
|
21
22
|
%td= subscriber.email
|
22
|
-
|
23
|
+
|
23
24
|
%td= subscriber.lang
|
24
25
|
%td= I18n::l(subscriber.created_at, :format=>:short)
|
25
26
|
/ %td= link_to 'Show', admin_subscriber_path(subscriber)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
= simple_form_for([:admin, @ticket]
|
1
|
+
= simple_form_for([:admin, @ticket]) do |f|
|
2
2
|
- if @ticket.errors.any?
|
3
3
|
%div.error_explanation
|
4
4
|
%h2
|
@@ -13,11 +13,11 @@
|
|
13
13
|
= f.input :assignee_id, :collection => User.where('helpdesk_admin = ?', true)
|
14
14
|
= f.input :ticket_type_id, :collection => Helpdesk::TicketType.active,include_blank: false
|
15
15
|
- if @ticket.new_record?
|
16
|
-
= f.input :description
|
16
|
+
= f.input :description,input_html:{rows:4}
|
17
17
|
- else
|
18
18
|
= simple_format @ticket.description
|
19
19
|
|
20
20
|
|
21
21
|
%div.form-actions
|
22
|
-
= f.button :submit, :class => 'btn-primary'
|
22
|
+
= f.button :submit, :class => 'btn btn-primary'
|
23
23
|
= submit_tag 'Anuluj', :type => :reset, :class => "btn btn-danger"
|
@@ -20,7 +20,7 @@
|
|
20
20
|
= ticket.assignee.send Helpdesk.display_user_uniq_info.to_sym
|
21
21
|
- else
|
22
22
|
= t('helpdesk.tickets.not_assigned')
|
23
|
-
= link_to ico('star'
|
23
|
+
= link_to ico('star') + t('helpdesk.tickets.assign_me'), assign_admin_ticket_path(ticket),class: 'btn btn-mini btn-info'
|
24
24
|
%tr
|
25
25
|
%td
|
26
26
|
%span.btn.disabled
|
@@ -33,7 +33,7 @@
|
|
33
33
|
%li.comment{:id=>"comment#{comment.id}"}
|
34
34
|
%div.comment-left
|
35
35
|
- if comment.public
|
36
|
-
= status_label ico('envelope'
|
36
|
+
= status_label ico('envelope') + t('helpdesk.comments.send') ,'label-success'
|
37
37
|
- else
|
38
38
|
= status_label t('helpdesk.comments.note'),''
|
39
39
|
%br
|
@@ -41,7 +41,7 @@
|
|
41
41
|
= "#"
|
42
42
|
%div.comment-header
|
43
43
|
-if comment.author == ticket.requester
|
44
|
-
= status_label ico('user'
|
44
|
+
= status_label ico('user')+ t('helpdesk.comments.author'),'label-info'
|
45
45
|
= comment.author.send Helpdesk.display_user_uniq_info.to_sym if comment.author
|
46
46
|
%small
|
47
47
|
= time_ago_in_words(comment.created_at)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
= render 'menu'
|
2
|
-
|
2
|
+
- content_for :title do
|
3
3
|
= t('helpdesk.ticket')
|
4
4
|
= "##{@ticket.subject}"
|
5
5
|
= render 'form'
|
@@ -12,7 +12,7 @@
|
|
12
12
|
%li.comment{:id=>"comment#{comment.id}"}
|
13
13
|
%div.comment-left
|
14
14
|
- if comment.public
|
15
|
-
= status_label ico('envelope'
|
15
|
+
= status_label ico('envelope') + t('helpdesk.comments.send') ,'label-success'
|
16
16
|
- else
|
17
17
|
= status_label t('helpdesk.comments.note'),''
|
18
18
|
%br
|
@@ -20,8 +20,8 @@
|
|
20
20
|
= "#"
|
21
21
|
%div.comment-header
|
22
22
|
-if comment.author == @ticket.requester
|
23
|
-
= status_label ico('user'
|
24
|
-
|
23
|
+
= status_label ico('user')+ t('helpdesk.comments.author'),'label-info'
|
24
|
+
|
25
25
|
= comment.author.send Helpdesk.display_user.to_sym if comment.author
|
26
26
|
%small
|
27
27
|
= time_ago_in_words(comment.created_at)
|
@@ -7,11 +7,11 @@
|
|
7
7
|
%tr{:class=>@ticket.ticket_type.tr_class}
|
8
8
|
|
9
9
|
%td
|
10
|
-
|
10
|
+
|
11
11
|
- unless @ticket.open?
|
12
12
|
= t('helpdesk.tickets.ticket_closed')
|
13
13
|
-else
|
14
|
-
= simple_form_for([:admin, @ticket]
|
14
|
+
= simple_form_for([:admin, @ticket]) do |f|
|
15
15
|
- if @ticket.errors.any?
|
16
16
|
%div.error_explanation
|
17
17
|
%h2
|
@@ -21,16 +21,16 @@
|
|
21
21
|
%li
|
22
22
|
= msg
|
23
23
|
= f.input :status, :collection => Helpdesk::Ticket::STATUS_OPTIONS, include_blank: false
|
24
|
-
= f.input :assignee_id, :collection => User.where('helpdesk_admin = ?', true)
|
25
|
-
|
24
|
+
= f.input :assignee_id, :collection => User.where('helpdesk_admin = ?', true)
|
25
|
+
|
26
26
|
|
27
27
|
= f.simple_fields_for :comments,@ticket.comments.build do |tickets_form|
|
28
28
|
- unless tickets_form.object.persisted?
|
29
29
|
= tickets_form.input :comment, :input_html=>{class: 'comment-textarea'}
|
30
30
|
/ , :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'mini'},:language => I18n.locale}
|
31
31
|
|
32
|
-
= tickets_form.input :public, :hint => t('helpdesk.tickets.visible_to_autor')
|
33
|
-
= tickets_form.input :author_id, :as => :hidden, :input_html => { :value => helpdesk_user.id }
|
32
|
+
= tickets_form.input :public, :hint => t('helpdesk.tickets.visible_to_autor')
|
33
|
+
= tickets_form.input :author_id, :as => :hidden, :input_html => { :value => helpdesk_user.id }
|
34
34
|
%div.form-actions
|
35
|
-
= f.button :submit, :class => 'btn-primary'
|
36
|
-
= submit_tag 'Anuluj', :type => :reset, :class => "btn btn-danger"
|
35
|
+
= f.button :submit, :class => 'btn btn-primary'
|
36
|
+
= submit_tag 'Anuluj', :type => :reset, :class => "btn btn-danger"
|
@@ -13,7 +13,7 @@
|
|
13
13
|
%div.subject
|
14
14
|
%input{:value=>@ticket.subject,:name=>"ticket[subject]",:type => "text",:placeholder => t('helpdesk.tickets.subject')}
|
15
15
|
%select{:name=>"ticket[ticket_type_id]"}
|
16
|
-
- Helpdesk::TicketType.all.each do |type|
|
16
|
+
- Helpdesk::TicketType.includes(:translations).all.each do |type|
|
17
17
|
%option{:value=>type.id, selected: type.id == @ticket.ticket_type_id}
|
18
18
|
= type.title
|
19
19
|
|
@@ -32,5 +32,5 @@
|
|
32
32
|
%div.textRight
|
33
33
|
%a#feedbackCancel{:class=>"btn white"}
|
34
34
|
Anuluj
|
35
|
-
%input{:type => "submit",:value => 'Wyślij', :class=>"btn"}
|
35
|
+
%input{:type => "submit",:value => 'Wyślij', :class=>"btn btn-primary"}
|
36
36
|
%div.clearBoth
|
@@ -31,7 +31,7 @@
|
|
31
31
|
%li.comment{:id=>"comment#{comment.id}"}
|
32
32
|
%div.comment-left
|
33
33
|
- if comment.public
|
34
|
-
= status_label ico('envelope'
|
34
|
+
= status_label ico('envelope') + t('helpdesk.comments.send') ,'label-success'
|
35
35
|
- else
|
36
36
|
= status_label t('helpdesk.comments.note'),''
|
37
37
|
%br
|
@@ -39,7 +39,7 @@
|
|
39
39
|
= "#"
|
40
40
|
%div.comment-header
|
41
41
|
-if comment.author != ticket.requester
|
42
|
-
= status_label ico('user'
|
42
|
+
= status_label ico('user')+ t('helpdesk.comments.helpdesk'),'label-info'
|
43
43
|
|
44
44
|
= comment.author.send Helpdesk.display_user.to_sym
|
45
45
|
%small
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
- content_for :title do
|
2
2
|
-if params[:tickets] && params[:tickets] == 'closed'
|
3
3
|
= t('helpdesk.tickets.closed')
|
4
4
|
|
@@ -12,4 +12,5 @@
|
|
12
12
|
- if @tickets.size == 0
|
13
13
|
= t('helpdesk.tickets.you_have_no_tickets')
|
14
14
|
- @tickets.each do |ticket|
|
15
|
-
= render 'ticket', ticket: ticket, show_button:true
|
15
|
+
= render 'ticket', ticket: ticket, show_button:true
|
16
|
+
= paginate @tickets
|
@@ -28,11 +28,11 @@
|
|
28
28
|
|
29
29
|
= f.simple_fields_for :comments,@ticket.comments.build do |tickets_form|
|
30
30
|
- unless tickets_form.object.persisted?
|
31
|
-
= tickets_form.input :comment, :input_html=>{class: 'comment-textarea'}
|
31
|
+
= tickets_form.input :comment, :input_html=>{class: 'comment-textarea',rows: 5}
|
32
32
|
/ , :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'mini'},:language => I18n.locale}
|
33
33
|
|
34
34
|
= tickets_form.input :public, :input_html => {:value=>1},:as=>:hidden
|
35
35
|
= tickets_form.input :author_id, :as => :hidden, :input_html => { :value => helpdesk_user.id }
|
36
36
|
%div
|
37
|
-
= f.button :submit, :class => 'btn-primary'
|
38
|
-
= submit_tag 'Anuluj', :type => :reset, :class => "btn btn-
|
37
|
+
= f.button :submit, :class => 'btn btn-primary'
|
38
|
+
= submit_tag 'Anuluj', :type => :reset, :class => "btn btn-default"
|
@@ -1,22 +1,26 @@
|
|
1
|
-
.navbar
|
2
|
-
.navbar-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
%
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
%nav.navbar.navbar-default#site_topmmenu{role: 'navigation'}
|
2
|
+
.navbar-header
|
3
|
+
%button.navbar-toggle{"data-target" => "#bs-navbar-collapse-1", "data-toggle" => "collapse", type: "button"}
|
4
|
+
%span.sr-only Toggle navigation
|
5
|
+
%span.icon-bar
|
6
|
+
%span.icon-bar
|
7
|
+
%span.icon-bar
|
8
|
+
=link_to Helpdesk.site_address, main_app.root_path, :class=>'navbar-brand', :title => t('helpdesk.name')
|
9
|
+
=link_to t('helpdesk.name'), admin_root_path, :class=>'navbar-brand', :title => t('helpdesk.name')
|
10
|
+
#bs-navbar-collapse-1.collapse.navbar-collapse.in
|
11
|
+
%ul.nav.navbar-nav
|
12
|
+
-if helpdesk_admin?
|
13
|
+
= menu_li t('helpdesk.tickets.title'),admin_tickets_path
|
14
|
+
/ = menu_li t('helpdesk.ticket_types.title'),admin_ticket_types_path
|
15
|
+
= menu_li t('helpdesk.subscribers.title'),admin_subscribers_path
|
16
|
+
= menu_li t('helpdesk.faqs.title'),admin_faqs_path
|
13
17
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
%li.dropdown.user(data-dropdown="dropdown")
|
19
|
+
= link_to current_user.display_name, "#",:class=>"dropdown-toggle"
|
20
|
+
%ul.dropdown-menu
|
21
|
+
%li.signout
|
22
|
+
=link_to 'Wróć do aplikacji',main_app.root_path
|
23
|
+
=link_to t('users.sign_out'),main_app.destroy_user_session_path, :method => :delete, :class => 'icon exit blue'
|
24
|
+
-else
|
25
|
+
=menu_li t('users.sign_in'),new_user_session_path, {:class => "power"}
|
26
|
+
=menu_li t('users.sign_up'),new_user_registration_path, {:class => "signup"}
|
@@ -1,10 +1,19 @@
|
|
1
|
-
.navbar
|
2
|
-
.navbar-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
%
|
8
|
-
|
9
|
-
|
1
|
+
%nav.navbar.navbar-default#site_topmmenu{role: 'navigation'}
|
2
|
+
.navbar-header
|
3
|
+
%button.navbar-toggle{"data-target" => "#bs-navbar-collapse-1", "data-toggle" => "collapse", type: "button"}
|
4
|
+
%span.sr-only Toggle navigation
|
5
|
+
%span.icon-bar
|
6
|
+
%span.icon-bar
|
7
|
+
%span.icon-bar
|
8
|
+
=link_to Helpdesk.site_address, main_app.root_path, :class=>'navbar-brand', :title => Helpdesk.site_address
|
9
|
+
=link_to Helpdesk.name, root_path, :class=>'navbar-brand', :title => Helpdesk.name
|
10
|
+
#bs-navbar-collapse-1.collapse.navbar-collapse.in
|
11
|
+
%ul.nav.navbar-nav
|
12
|
+
= menu_li t('helpdesk.tickets.title'),tickets_path
|
13
|
+
= menu_li t('helpdesk.faq'),faqs_path
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
10
19
|
|
@@ -13,15 +13,23 @@
|
|
13
13
|
= render 'layouts/helpdesk/topmenu'
|
14
14
|
.content
|
15
15
|
.row
|
16
|
-
.
|
16
|
+
.col.col-md-3#site_leftmenu
|
17
17
|
=yield :left
|
18
|
-
.
|
18
|
+
.col.col-md-9#site_leftmenu
|
19
19
|
.flash
|
20
20
|
- flash.each do |type, message|
|
21
21
|
%div{:class => "alert alert-#{type}", "data-alert"=>"alert"}
|
22
|
-
=link_to "x",'#', :class=>'close', :'data-dismiss'=>"alert"
|
23
|
-
%p= message
|
24
|
-
|
25
|
-
|
22
|
+
=link_to "x",'#', :class=>'close', :'data-dismiss'=>"alert"
|
23
|
+
%p= message
|
24
|
+
- if content_for?(:title)
|
25
|
+
.panel.panel-default
|
26
|
+
.panel-heading
|
27
|
+
%h3.panel-title
|
28
|
+
= content_for?(:title) ? content_for(:title) : ''
|
29
|
+
.panel-body
|
30
|
+
= yield
|
31
|
+
- else
|
32
|
+
= yield
|
33
|
+
=yield :scripts
|
26
34
|
|
27
35
|
|
@@ -13,13 +13,21 @@
|
|
13
13
|
= render 'layouts/helpdesk/topuser'
|
14
14
|
.content
|
15
15
|
.row
|
16
|
-
.
|
16
|
+
.col.col-md-3#site_leftmenu
|
17
17
|
=yield :left
|
18
|
-
.
|
18
|
+
.col.col-md-9#site_leftmenu
|
19
19
|
.flash
|
20
20
|
- flash.each do |type, message|
|
21
21
|
%div{:class => "alert alert-#{type}", "data-alert"=>"alert"}
|
22
|
-
=link_to "x",'#', :class=>'close', :'data-dismiss'=>"alert"
|
23
|
-
%p= message
|
24
|
-
|
25
|
-
|
22
|
+
=link_to "x",'#', :class=>'close', :'data-dismiss'=>"alert"
|
23
|
+
%p= message
|
24
|
+
- if content_for?(:title)
|
25
|
+
.panel.panel-default
|
26
|
+
.panel-heading
|
27
|
+
%h3.panel-title
|
28
|
+
= content_for?(:title) ? content_for(:title) : ''
|
29
|
+
.panel-body
|
30
|
+
= yield
|
31
|
+
- else
|
32
|
+
= yield
|
33
|
+
=yield :scripts
|
@@ -1,176 +1,115 @@
|
|
1
|
+
inputs = %w[
|
2
|
+
CollectionSelectInput
|
3
|
+
DateTimeInput
|
4
|
+
FileInput
|
5
|
+
GroupedCollectionSelectInput
|
6
|
+
NumericInput
|
7
|
+
PasswordInput
|
8
|
+
RangeInput
|
9
|
+
StringInput
|
10
|
+
TextInput
|
11
|
+
]
|
12
|
+
|
13
|
+
|
14
|
+
# Instead of creating top-level custom input classes like TextInput, we wrap it into a module and override
|
15
|
+
# mapping in SimpleForm::FormBuilder directly
|
16
|
+
#
|
17
|
+
SimpleFormBootstrapInputs = Module.new
|
18
|
+
inputs.each do |input_type|
|
19
|
+
superclass = "SimpleForm::Inputs::#{input_type}".constantize
|
20
|
+
|
21
|
+
new_class = SimpleFormBootstrapInputs.const_set(input_type, Class.new(superclass) do
|
22
|
+
def input_html_classes
|
23
|
+
super.push('form-control')
|
24
|
+
end
|
25
|
+
end)
|
26
|
+
|
27
|
+
# Now override existing usages of superclass with new_class
|
28
|
+
SimpleForm::FormBuilder.mappings.each do |(type, target_class)|
|
29
|
+
if target_class == superclass
|
30
|
+
SimpleForm::FormBuilder.map_type(type, to: new_class)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
# inputs.each do |input_type|
|
35
|
+
# superclass = "SimpleForm::Inputs::#{input_type}".constantize
|
36
|
+
|
37
|
+
# new_class = Class.new(superclass) do
|
38
|
+
# def input_html_classes
|
39
|
+
# super.push('form-control')
|
40
|
+
# end
|
41
|
+
# end
|
42
|
+
|
43
|
+
# Object.const_set(input_type, new_class)
|
44
|
+
# end
|
45
|
+
|
1
46
|
# Use this setup block to configure all options available in SimpleForm.
|
2
47
|
SimpleForm.setup do |config|
|
3
|
-
# Wrappers are used by the form builder to generate a
|
4
|
-
# complete input. You can remove any component from the
|
5
|
-
# wrapper, change the order or even add your own to the
|
6
|
-
# stack. The options given below are used to wrap the
|
7
|
-
# whole input.
|
8
|
-
config.wrappers :default, :class => :input,
|
9
|
-
:hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
|
10
|
-
## Extensions enabled by default
|
11
|
-
# Any of these extensions can be disabled for a
|
12
|
-
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
-
# You can make any of these extensions optional by
|
14
|
-
# renaming `b.use` to `b.optional`.
|
15
|
-
|
16
|
-
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
-
# and required attributes
|
18
|
-
b.use :html5
|
19
|
-
|
20
|
-
# Calculates placeholders automatically from I18n
|
21
|
-
# You can also pass a string as f.input :placeholder => "Placeholder"
|
22
|
-
b.use :placeholder
|
23
48
|
|
24
|
-
|
25
|
-
# They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
|
26
|
-
# to the input. If so, they will retrieve the values from the model
|
27
|
-
# if any exists. If you want to enable the lookup for any of those
|
28
|
-
# extensions by default, you can change `b.optional` to `b.use`.
|
49
|
+
config.browser_validations = true
|
29
50
|
|
30
|
-
|
31
|
-
b.optional :maxlength
|
51
|
+
config.boolean_style = :nested
|
32
52
|
|
33
|
-
|
34
|
-
|
53
|
+
config.wrappers :bootstrap3, tag: 'div', class: 'form-group', error_class: 'has-error',
|
54
|
+
defaults: { input_html: { class: 'default_class' } } do |b|
|
35
55
|
|
36
|
-
|
37
|
-
b.
|
56
|
+
b.use :html5
|
57
|
+
b.use :min_max
|
58
|
+
b.use :maxlength
|
59
|
+
b.use :placeholder
|
38
60
|
|
39
|
-
|
61
|
+
b.optional :pattern
|
40
62
|
b.optional :readonly
|
41
63
|
|
42
|
-
## Inputs
|
43
64
|
b.use :label_input
|
44
|
-
b.use :hint, :
|
45
|
-
b.use :error, :
|
65
|
+
b.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
|
66
|
+
b.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
|
46
67
|
end
|
47
68
|
|
48
|
-
config.wrappers :
|
69
|
+
config.wrappers :prepend, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
49
70
|
b.use :html5
|
50
71
|
b.use :placeholder
|
51
|
-
b.
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
72
|
+
b.wrapper tag: 'div', class: 'controls' do |input|
|
73
|
+
input.wrapper tag: 'div', class: 'input-group' do |prepend|
|
74
|
+
prepend.use :label , class: 'input-group-addon' ###Please note setting class here fro the label does not currently work (let me know if you know a workaround as this is the final hurdle)
|
75
|
+
prepend.use :input
|
76
|
+
end
|
77
|
+
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
|
78
|
+
input.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
|
56
79
|
end
|
57
80
|
end
|
58
81
|
|
59
|
-
config.wrappers :
|
82
|
+
config.wrappers :append, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
60
83
|
b.use :html5
|
61
84
|
b.use :placeholder
|
62
|
-
b.
|
63
|
-
|
64
|
-
input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
|
85
|
+
b.wrapper tag: 'div', class: 'controls' do |input|
|
86
|
+
input.wrapper tag: 'div', class: 'input-group' do |prepend|
|
65
87
|
prepend.use :input
|
88
|
+
prepend.use :label , class: 'input-group-addon' ###Please note setting class here fro the label does not currently work (let me know if you know a workaround as this is the final hurdle)
|
66
89
|
end
|
67
|
-
input.use :hint, :
|
68
|
-
input.use :error, :
|
90
|
+
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
|
91
|
+
input.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
|
69
92
|
end
|
70
93
|
end
|
71
94
|
|
72
|
-
config.wrappers :
|
95
|
+
config.wrappers :checkbox, tag: :div, class: "checkbox", error_class: "has-error" do |b|
|
96
|
+
|
97
|
+
# Form extensions
|
73
98
|
b.use :html5
|
74
|
-
|
75
|
-
|
76
|
-
b.wrapper :
|
77
|
-
|
78
|
-
|
79
|
-
end
|
80
|
-
input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
|
81
|
-
input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
|
99
|
+
|
100
|
+
# Form components
|
101
|
+
b.wrapper tag: :label do |ba|
|
102
|
+
ba.use :input
|
103
|
+
ba.use :label_text
|
82
104
|
end
|
105
|
+
|
106
|
+
b.use :hint, wrap_with: { tag: :p, class: "help-block" }
|
107
|
+
b.use :error, wrap_with: { tag: :span, class: "help-block text-danger" }
|
83
108
|
end
|
84
109
|
|
85
110
|
# Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
|
86
|
-
# Check the Bootstrap docs (http://
|
111
|
+
# Check the Bootstrap docs (http://getbootstrap.com/)
|
87
112
|
# to learn about the different styles for forms and inputs,
|
88
113
|
# buttons and other elements.
|
89
|
-
config.default_wrapper = :
|
90
|
-
|
91
|
-
# Define the way to render check boxes / radio buttons with labels.
|
92
|
-
# Defaults to :nested for bootstrap config.
|
93
|
-
# :inline => input + label
|
94
|
-
# :nested => label > input
|
95
|
-
config.boolean_style = :nested
|
96
|
-
|
97
|
-
# Default class for buttons
|
98
|
-
config.button_class = 'btn'
|
99
|
-
|
100
|
-
# Method used to tidy up errors.
|
101
|
-
# config.error_method = :first
|
102
|
-
|
103
|
-
# Default tag used for error notification helper.
|
104
|
-
config.error_notification_tag = :div
|
105
|
-
|
106
|
-
# CSS class to add for error notification helper.
|
107
|
-
config.error_notification_class = 'alert alert-error'
|
108
|
-
|
109
|
-
# ID to add for error notification helper.
|
110
|
-
# config.error_notification_id = nil
|
111
|
-
|
112
|
-
# Series of attempts to detect a default label method for collection.
|
113
|
-
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
114
|
-
|
115
|
-
# Series of attempts to detect a default value method for collection.
|
116
|
-
# config.collection_value_methods = [ :id, :to_s ]
|
117
|
-
|
118
|
-
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
119
|
-
# config.collection_wrapper_tag = nil
|
120
|
-
|
121
|
-
# You can define the class to use on all collection wrappers. Defaulting to none.
|
122
|
-
# config.collection_wrapper_class = nil
|
123
|
-
|
124
|
-
# You can wrap each item in a collection of radio/check boxes with a tag,
|
125
|
-
# defaulting to :span. Please note that when using :boolean_style = :nested,
|
126
|
-
# SimpleForm will force this option to be a label.
|
127
|
-
# config.item_wrapper_tag = :span
|
128
|
-
|
129
|
-
# You can define a class to use in all item wrappers. Defaulting to none.
|
130
|
-
# config.item_wrapper_class = nil
|
131
|
-
|
132
|
-
# How the label text should be generated altogether with the required text.
|
133
|
-
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
134
|
-
|
135
|
-
# You can define the class to use on all labels. Default is nil.
|
136
|
-
config.label_class = 'control-label'
|
137
|
-
|
138
|
-
# You can define the class to use on all forms. Default is simple_form.
|
139
|
-
# config.form_class = :simple_form
|
140
|
-
|
141
|
-
# You can define which elements should obtain additional classes
|
142
|
-
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
143
|
-
|
144
|
-
# Whether attributes are required by default (or not). Default is true.
|
145
|
-
# config.required_by_default = true
|
146
|
-
|
147
|
-
# Tell browsers whether to use default HTML5 validations (novalidate option).
|
148
|
-
# Default is enabled.
|
149
|
-
config.browser_validations = false
|
150
|
-
|
151
|
-
# Collection of methods to detect if a file type was given.
|
152
|
-
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
153
|
-
|
154
|
-
# Custom mappings for input types. This should be a hash containing a regexp
|
155
|
-
# to match as key, and the input type that will be used when the field name
|
156
|
-
# matches the regexp as value.
|
157
|
-
# config.input_mappings = { /count/ => :integer }
|
158
|
-
|
159
|
-
# Default priority for time_zone inputs.
|
160
|
-
# config.time_zone_priority = nil
|
161
|
-
|
162
|
-
# Default priority for country inputs.
|
163
|
-
# config.country_priority = nil
|
164
|
-
|
165
|
-
# Default size for text inputs.
|
166
|
-
# config.default_input_size = 50
|
167
|
-
|
168
|
-
# When false, do not use translations for labels.
|
169
|
-
# config.translate_labels = true
|
170
|
-
|
171
|
-
# Automatically discover new inputs in Rails' autoload path.
|
172
|
-
# config.inputs_discovery = true
|
173
|
-
|
174
|
-
# Cache SimpleForm inputs discovery
|
175
|
-
# config.cache_discovery = !Rails.env.development?
|
114
|
+
config.default_wrapper = :bootstrap3
|
176
115
|
end
|
data/config/routes.rb
CHANGED
data/lib/helpdesk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helpdesk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Beynon Wacław Łuczak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: launchy
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: bullet
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: chosen-rails
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,16 +182,16 @@ dependencies:
|
|
168
182
|
name: bootstrap-sass
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
|
-
- -
|
185
|
+
- - ~>
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
187
|
+
version: 3.1.0
|
174
188
|
type: :runtime
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
|
-
- -
|
192
|
+
- - ~>
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
194
|
+
version: 3.1.0
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: rails
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -297,6 +311,8 @@ executables: []
|
|
297
311
|
extensions: []
|
298
312
|
extra_rdoc_files: []
|
299
313
|
files:
|
314
|
+
- MIT-LICENSE
|
315
|
+
- Rakefile
|
300
316
|
- app/assets/javascripts/helpdesk/admin/dashboard.js
|
301
317
|
- app/assets/javascripts/helpdesk/admin/tickets.js
|
302
318
|
- app/assets/javascripts/helpdesk/application.js
|
@@ -304,14 +320,14 @@ files:
|
|
304
320
|
- app/assets/javascripts/helpdesk/dashboard.js
|
305
321
|
- app/assets/javascripts/helpdesk/faqs.js
|
306
322
|
- app/assets/javascripts/helpdesk/subscribers.js
|
323
|
+
- app/assets/stylesheets/helpdesk/admin.css
|
307
324
|
- app/assets/stylesheets/helpdesk/admin/bootstrap_overrides.css
|
308
325
|
- app/assets/stylesheets/helpdesk/admin/dashboard.css
|
309
326
|
- app/assets/stylesheets/helpdesk/admin/tickets.css
|
310
|
-
- app/assets/stylesheets/helpdesk/admin.css
|
311
327
|
- app/assets/stylesheets/helpdesk/application.css
|
312
328
|
- app/assets/stylesheets/helpdesk/dashboard.css
|
313
329
|
- app/assets/stylesheets/helpdesk/faqs.css.scss
|
314
|
-
- app/assets/stylesheets/helpdesk/imports.css.
|
330
|
+
- app/assets/stylesheets/helpdesk/imports.css.sass
|
315
331
|
- app/assets/stylesheets/helpdesk/subscribers.css.scss
|
316
332
|
- app/assets/stylesheets/helpdesk/tickets.css.sass
|
317
333
|
- app/controllers/helpdesk/admin/base_controller.rb
|
@@ -402,15 +418,13 @@ files:
|
|
402
418
|
- db/migrate/20130522085614_create_helpdesk_faqs.rb
|
403
419
|
- db/migrate/20130522090420_create_helpdesk_subscribers.rb
|
404
420
|
- lib/generators/helpdesk/install_generator.rb
|
405
|
-
- lib/generators/helpdesk/templates/helpdesk.rb
|
406
421
|
- lib/generators/helpdesk/templates/README
|
422
|
+
- lib/generators/helpdesk/templates/helpdesk.rb
|
423
|
+
- lib/helpdesk.rb
|
407
424
|
- lib/helpdesk/engine.rb
|
408
425
|
- lib/helpdesk/version.rb
|
409
|
-
- lib/helpdesk.rb
|
410
426
|
- lib/tasks/prepare_ci_env.rake
|
411
427
|
- lib/templates/erb/scaffold/_form.html.erb
|
412
|
-
- MIT-LICENSE
|
413
|
-
- Rakefile
|
414
428
|
homepage: http://github.com/wacaw/helpdesk
|
415
429
|
licenses:
|
416
430
|
- MIT
|
@@ -431,7 +445,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
431
445
|
version: '0'
|
432
446
|
requirements: []
|
433
447
|
rubyforge_project:
|
434
|
-
rubygems_version: 2.1
|
448
|
+
rubygems_version: 2.2.1
|
435
449
|
signing_key:
|
436
450
|
specification_version: 4
|
437
451
|
summary: Rails mountable engine providing basic helpdesk functionality for your applications
|
@@ -1,34 +0,0 @@
|
|
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
|
-
|