helpdesk 0.0.33 → 0.0.35
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 +6 -0
- data/app/assets/javascripts/helpdesk/ckeditor.js +61 -11
- data/app/assets/stylesheets/helpdesk/admin.css.scss +1 -0
- data/app/assets/stylesheets/helpdesk/admin/tickets.css +0 -8
- data/app/assets/stylesheets/helpdesk/{subscribers.css.scss → custom.css} +0 -0
- data/app/assets/stylesheets/helpdesk/tickets.css.sass +4 -0
- data/app/controllers/helpdesk/admin/base_controller.rb +1 -0
- data/app/controllers/helpdesk/admin/faqs_controller.rb +4 -1
- data/app/controllers/helpdesk/tickets_controller.rb +1 -0
- data/app/models/helpdesk/faq.rb +9 -1
- data/app/views/helpdesk/admin/faqs/_faq.html.haml +1 -0
- data/app/views/helpdesk/admin/faqs/_form.html.haml +19 -19
- data/app/views/helpdesk/admin/faqs/edit.html.haml +0 -5
- data/app/views/helpdesk/admin/faqs/new.html.haml +0 -1
- data/app/views/helpdesk/faqs/_faq.html.haml +2 -2
- data/app/views/helpdesk/faqs/index.html.haml +2 -2
- data/app/views/layouts/helpdesk/_topuser.html.haml +25 -19
- data/config/initializers/simple_form.rb +8 -11
- data/config/locales/helpdesk.pl.yml +1 -1
- data/lib/generators/helpdesk/templates/helpdesk.rb +3 -0
- data/lib/helpdesk.rb +3 -0
- data/lib/helpdesk/engine.rb +1 -1
- data/lib/helpdesk/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12c0e66f13ed7814e3f3566881e301eee568ce6e
|
4
|
+
data.tar.gz: 4de4f2e1c8f6075ffccb749f4e051a36a95f7ce6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2e885773eed59eda943a75aeefe988047304b14bbe08b59b4e041f7fe4920145443abbd84eea865516e9f134a6af8ec749122fd81a7348b0be169d6e7c82de1
|
7
|
+
data.tar.gz: 84c9e330b42748d87b5714c3017a2aa4577079c5cd729366141f7a1d2295b4579bc7e68f207cc3f79f59abe5675886bcafb651ad1f8a7e4335952b8795dc4b47
|
@@ -1,6 +1,12 @@
|
|
1
1
|
// Place all the behaviors and hooks related to the matching controller here.
|
2
|
+
|
2
3
|
// All this logic will automatically be available in application.js.
|
3
4
|
|
5
|
+
$(document).ready(function(){
|
6
|
+
$('a[href*="#"]').click(function(){
|
7
|
+
$($(this).attr("href")).effect("highlight", {}, 1500);
|
8
|
+
});
|
9
|
+
});
|
4
10
|
|
5
11
|
|
6
12
|
(function() {
|
@@ -1,11 +1,61 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
|
2
|
+
CKEDITOR.config.toolbar = [
|
3
|
+
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] },
|
4
|
+
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
|
5
|
+
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
|
6
|
+
{ name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
|
7
|
+
'/',
|
8
|
+
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
|
9
|
+
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] },
|
10
|
+
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
|
11
|
+
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
|
12
|
+
'/',
|
13
|
+
{ name: 'styles', items: [ 'Format', 'Font', 'FontSize' ] },
|
14
|
+
{ name: 'colors', items: [ 'TextColor'] },
|
15
|
+
{ name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },
|
16
|
+
{ name: 'others', items: [ '-' ] },
|
17
|
+
{ name: 'about', items: [ 'About' ] }
|
18
|
+
];
|
19
|
+
|
20
|
+
CKEDITOR.config.allowedContent = true;
|
21
|
+
|
22
|
+
/* Filebrowser routes */
|
23
|
+
// The location of an external file browser, that should be launched when "Browse Server" button is pressed.
|
24
|
+
CKEDITOR.config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
|
25
|
+
|
26
|
+
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog.
|
27
|
+
CKEDITOR.config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
|
28
|
+
|
29
|
+
// The location of a script that handles file uploads in the Flash dialog.
|
30
|
+
CKEDITOR.config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
|
31
|
+
|
32
|
+
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog
|
33
|
+
CKEDITOR.config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
|
34
|
+
|
35
|
+
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog.
|
36
|
+
CKEDITOR.config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
|
37
|
+
|
38
|
+
// The location of a script that handles file uploads in the Image dialog.
|
39
|
+
CKEDITOR.config.filebrowserImageUploadUrl = "/ckeditor/pictures";
|
40
|
+
|
41
|
+
// The location of a script that handles file uploads.
|
42
|
+
CKEDITOR.config.filebrowserUploadUrl = "/ckeditor/attachment_files";
|
43
|
+
|
44
|
+
CKEDITOR.config.toolbarGroups = [
|
45
|
+
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
|
46
|
+
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
47
|
+
//{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
|
48
|
+
{ name: 'tools' },
|
49
|
+
{ name: 'about' },
|
50
|
+
'/',
|
51
|
+
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
52
|
+
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] }, // , 'bidi'
|
53
|
+
//{ name: 'forms' },
|
54
|
+
'/',
|
55
|
+
{ name: 'styles' },
|
56
|
+
{ name: 'colors' },
|
57
|
+
{ name: 'links' },
|
58
|
+
{ name: 'insert' },
|
59
|
+
{ name: 'others' }
|
60
|
+
];
|
61
|
+
|
@@ -17,14 +17,6 @@
|
|
17
17
|
margin-left: 100px;
|
18
18
|
}
|
19
19
|
|
20
|
-
:target {
|
21
|
-
background-color: #ffa;
|
22
|
-
-webkit-transition: background-color 1s linear;
|
23
|
-
-moz-transition: background-color 1s linear;
|
24
|
-
-o-transition: background-color 1s linear;
|
25
|
-
transition: background-color 1s linear;
|
26
|
-
}
|
27
|
-
|
28
20
|
a.anchor{
|
29
21
|
opacity: 0;
|
30
22
|
-moz-transition: opacity .25s linear, visibility .1s linear .5s;
|
File without changes
|
@@ -47,7 +47,10 @@ class Helpdesk::Admin::FaqsController < Helpdesk::Admin::BaseController
|
|
47
47
|
# GET /faqs/new
|
48
48
|
# GET /faqs/new.json
|
49
49
|
def new
|
50
|
-
@faq = Helpdesk::Faq.new
|
50
|
+
@faq = Helpdesk::Faq.active.new
|
51
|
+
if params[:faq] && params[:faq][:parent_id]
|
52
|
+
@faq.parent_id = params[:faq][:parent_id]
|
53
|
+
end
|
51
54
|
|
52
55
|
respond_to do |format|
|
53
56
|
format.html # new.html.erb
|
data/app/models/helpdesk/faq.rb
CHANGED
@@ -15,7 +15,15 @@ module Helpdesk
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def to_param
|
18
|
-
id ? "#{id}-#{
|
18
|
+
id ? "#{id}-#{nname}" : nil
|
19
|
+
end
|
20
|
+
|
21
|
+
def nname
|
22
|
+
if parent
|
23
|
+
"#{parent.nname}--#{title.parameterize}"
|
24
|
+
else
|
25
|
+
"#{title.parameterize}"
|
26
|
+
end
|
19
27
|
end
|
20
28
|
|
21
29
|
def self.search(query, page=1)
|
@@ -4,6 +4,7 @@
|
|
4
4
|
%div
|
5
5
|
= link_to t('helpdesk.show'), faqs_path(anchor:faq.to_param), class: 'btn btn-info btn-xs', target: :faq_preview
|
6
6
|
= link_to t('helpdesk.edit'), edit_admin_faq_path(faq),class: 'btn btn-primary btn-xs'
|
7
|
+
= link_to t('helpdesk.add'), new_admin_faq_path(faq:{parent_id:faq.id}),class: 'btn btn-success btn-xs'
|
7
8
|
= link_to t('helpdesk.destroy'), admin_faq_path(faq), method: :delete, data: { confirm: 'Are you sure?' },class: 'btn btn-danger btn-xs'
|
8
9
|
- if faq.children.present?
|
9
10
|
%ol
|
@@ -1,21 +1,21 @@
|
|
1
|
-
= simple_form_for [:admin,@faq]
|
2
|
-
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
= simple_form_for [:admin,@faq],html: {novalidate: true} do |f|
|
2
|
+
.form-inputs
|
3
|
+
- if @faq.errors.any?
|
4
|
+
#error_explanation
|
5
|
+
%h2= "#{pluralize(@faq.errors.count, "error")} prohibited this faq from being saved:"
|
6
|
+
%ul
|
7
|
+
- @faq.errors.full_messages.each do |msg|
|
8
|
+
%li= msg
|
9
|
+
= f.input :active, wrapper: :inline_checkbox
|
10
|
+
= f.input :parent_id, collection: Helpdesk::Faq.collection,label_method: :name_with_depth
|
10
11
|
|
12
|
+
- I18n.available_locales.each do |locale|
|
13
|
+
%h1
|
14
|
+
= locale
|
15
|
+
= f.globalize_fields_for locale do |g|
|
16
|
+
= g.input :title
|
17
|
+
= g.input :text, :as => :ckeditor, :input_html => { :ckeditor => {:width=>'100%',:height => 200,:toolbar => 'Full'} }
|
11
18
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
= locale
|
16
|
-
= f.globalize_fields_for locale do |g|
|
17
|
-
= g.input :title
|
18
|
-
= g.input :text, :as => :ckeditor, :input_html => { :ckeditor => {:width=>'100%',:height => 200,:toolbar => 'Full'} }
|
19
|
-
|
20
|
-
|
21
|
-
= f.submit 'Save', :class=>'btn btn-primary'
|
19
|
+
.form-actions
|
20
|
+
= f.submit 'Save', class:'btn btn-primary'
|
21
|
+
= link_to 'Back', admin_faqs_path,class: 'btn btn-default'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
- faqs.each do |faq|
|
2
2
|
%li{:id=>faq.to_param}
|
3
3
|
%h3
|
4
|
-
= link_to faq.title, faqs_path(anchor:faq)
|
4
|
+
= link_to faq.title, link_type=='anchor' ? faq.anchor : faqs_path(anchor:faq)
|
5
5
|
= raw faq.text
|
6
6
|
- if faq.children.present?
|
7
7
|
%ul
|
8
|
-
= render partial:'/helpdesk/faqs/faq', locals:{ faqs:faq.children
|
8
|
+
= render partial:'/helpdesk/faqs/faq', locals:{ faqs:faq.children,link_type:link_type}
|
@@ -4,8 +4,8 @@
|
|
4
4
|
= render partial: 'menu', locals:{faqs:@faqs,link_type:'anchor'}
|
5
5
|
|
6
6
|
%div.content
|
7
|
-
%div
|
7
|
+
%div#pageContainer
|
8
8
|
%h2
|
9
9
|
= t('helpdesk.faqs.title_s')
|
10
10
|
%ul#faq
|
11
|
-
= render partial:'/helpdesk/faqs/faq', locals:{faqs:@faqs}
|
11
|
+
= render partial:'/helpdesk/faqs/faq', locals:{faqs:@faqs,link_type:'anchor'}
|
@@ -6,28 +6,34 @@
|
|
6
6
|
%span.icon-bar
|
7
7
|
%span.icon-bar
|
8
8
|
=link_to Helpdesk.site_address, main_app.root_path, :class=>'navbar-brand', :title => Helpdesk.site_address
|
9
|
-
=link_to Helpdesk.
|
9
|
+
=link_to Helpdesk.helpdesk_name, root_path, :class=>'navbar-brand', :title => Helpdesk.helpdesk_name
|
10
10
|
#bs-navbar-collapse-1.collapse.navbar-collapse.in
|
11
11
|
%ul.nav.navbar-nav
|
12
|
-
= menu_li t('helpdesk.tickets.title'),tickets_path
|
13
|
-
= menu_li t('helpdesk.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
= menu_li t('helpdesk.tickets.title'),tickets_path if Helpdesk.menu_items.include?('ticekts')
|
13
|
+
= menu_li t('helpdesk.faqs.title'),faqs_path if Helpdesk.menu_items.include?('faqs')
|
14
|
+
= menu_li t('helpdesk.subscribers.title'),subscribers_path if Helpdesk.menu_items.include?('subscribers')
|
15
|
+
- if Helpdesk.menu_items.include?('search')
|
16
|
+
%form.navbar-form.navbar-left{role:'search',action:search_faqs_url}
|
17
|
+
.form-group
|
18
|
+
%input.form-control{type:'text', placeholder:t('helpdesk.faqs.search_in_faqs'),name:'search',value:params[:search]}
|
19
|
+
%button.btn.btn-default{type:"submit"}
|
20
|
+
= t('helpdesk.faqs.search')
|
21
|
+
|
19
22
|
%ul.nav.navbar-nav.navbar-right
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
- if Helpdesk.menu_items.include?('user')
|
24
|
+
- if helpdesk_user
|
25
|
+
%li.dropdown.user
|
26
|
+
= link_to helpdesk_user.send(Helpdesk.display_user.to_sym), "#",:class=>"dropdown-toggle",data:{toggle:"dropdown"}
|
27
|
+
%ul.dropdown-menu
|
28
|
+
%li=link_to 'Home',main_app.root_path
|
29
|
+
%li=link_to t('users.sign_out'),main_app.destroy_user_session_path, :method => :delete, :class => 'icon exit blue'
|
30
|
+
|
31
|
+
- if Helpdesk.menu_items.include?('language')
|
32
|
+
%li.dropdown
|
33
|
+
= link_to t('helpdesk.lang'),"#",:class=>"dropdown-toggle",data:{toggle:"dropdown"}
|
34
|
+
%ul.dropdown-menu
|
35
|
+
%li= link_to "English", params.merge({:locale => :en})
|
36
|
+
%li= link_to "Polski", params.merge({:locale => :pl})
|
31
37
|
|
32
38
|
|
33
39
|
|
@@ -94,19 +94,16 @@ SimpleForm.setup do |config|
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
config.wrappers :
|
98
|
-
|
99
|
-
# Form extensions
|
97
|
+
config.wrappers :inline_checkbox, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
|
100
98
|
b.use :html5
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
99
|
+
b.wrapper :tag => 'div', :class => 'controls' do |ba|
|
100
|
+
ba.wrapper :tag => 'label', :class => 'checkbox' do |bb|
|
101
|
+
bb.use :label_text
|
102
|
+
bb.use :input
|
103
|
+
end
|
104
|
+
ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
|
105
|
+
ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
|
106
106
|
end
|
107
|
-
|
108
|
-
b.use :hint, wrap_with: { tag: :p, class: "help-block" }
|
109
|
-
b.use :error, wrap_with: { tag: :span, class: "help-block text-danger" }
|
110
107
|
end
|
111
108
|
|
112
109
|
# Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
|
@@ -34,4 +34,7 @@ require 'helpdesk'
|
|
34
34
|
# Helpdesk root controller for users: faqs or tickets
|
35
35
|
config.root_controller = 'faqs'
|
36
36
|
|
37
|
+
# Helpdesk user top menu item
|
38
|
+
config.menu_items = ['app_root','helpdesk_root','tickets','faqs','subscribers','search','user','language']
|
39
|
+
|
37
40
|
end
|
data/lib/helpdesk.rb
CHANGED
@@ -29,6 +29,9 @@ module Helpdesk
|
|
29
29
|
mattr_accessor :root_controller
|
30
30
|
@@root_controller = "faqs"
|
31
31
|
|
32
|
+
mattr_accessor :menu_items
|
33
|
+
@@menu_items = ['app_root','helpdesk_root','tickets','faqs','subscribers','search','user','language']
|
34
|
+
|
32
35
|
def self.setup
|
33
36
|
yield self
|
34
37
|
end
|
data/lib/helpdesk/engine.rb
CHANGED
@@ -17,7 +17,7 @@ module Helpdesk
|
|
17
17
|
isolate_namespace Helpdesk
|
18
18
|
|
19
19
|
initializer "Helpdesk precompile hook" do |app|
|
20
|
-
app.config.assets.precompile += ['helpdesk/admin.css','helpdesk/application.css','helpdesk/application.js']
|
20
|
+
app.config.assets.precompile += ['helpdesk/admin.css','helpdesk/application.css','helpdesk/custom.css','helpdesk/application.js']
|
21
21
|
end
|
22
22
|
|
23
23
|
config.to_prepare do
|
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.35
|
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-11-
|
11
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: launchy
|
@@ -395,9 +395,9 @@ files:
|
|
395
395
|
- app/assets/stylesheets/helpdesk/admin/dashboard.css
|
396
396
|
- app/assets/stylesheets/helpdesk/admin/tickets.css
|
397
397
|
- app/assets/stylesheets/helpdesk/application.css
|
398
|
+
- app/assets/stylesheets/helpdesk/custom.css
|
398
399
|
- app/assets/stylesheets/helpdesk/dashboard.css
|
399
400
|
- app/assets/stylesheets/helpdesk/faqs.css.scss
|
400
|
-
- app/assets/stylesheets/helpdesk/subscribers.css.scss
|
401
401
|
- app/assets/stylesheets/helpdesk/tickets.css.sass
|
402
402
|
- app/controllers/helpdesk/admin/base_controller.rb
|
403
403
|
- app/controllers/helpdesk/admin/dashboard_controller.rb
|