helpdesk 0.0.33 → 0.0.35

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: 48373a459e577552fd36a0b6f2deaedfa1bdf7be
4
- data.tar.gz: 350db9f237728a1ca2558c9171fc1e1a23fc9595
3
+ metadata.gz: 12c0e66f13ed7814e3f3566881e301eee568ce6e
4
+ data.tar.gz: 4de4f2e1c8f6075ffccb749f4e051a36a95f7ce6
5
5
  SHA512:
6
- metadata.gz: 05288f0b29bab44078a9ad5b0bb9554dc9006c49cf431b1428a7699088e88650c9251dc4772f9541ca3f44c59a59a53566fa366001912b091fbedb81dfec5d31
7
- data.tar.gz: d5e44cf9927b50d8142bcc576394a0e8c8c320cb478447ad418eb9875448486ae7950eaa683de84e0dfa4f3679252c424b6fc49ef3c3b1e9484bcf5f6eb45158
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
- CKEDITOR.config.toolbar_mini =
2
- [
3
- ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
4
- ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
5
- ['NumberedList','BulletedList','-','Outdent','Indent'],
6
- ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
7
- ['Link','Unlink'],
8
- ['Image','Table','HorizontalRule'],
9
- ['Styles','Format','Font','FontSize'],
10
- ['TextColor','BGColor']
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
+
@@ -3,6 +3,7 @@
3
3
  *= require select2
4
4
  *= require helpdesk/admin/tickets
5
5
  *= require_self
6
+ *= require_tree ./admin
6
7
  */
7
8
  @import "bootstrap-sprockets";
8
9
  @import "bootstrap";
@@ -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;
@@ -1,3 +1,7 @@
1
+ form
2
+ .checkbox
3
+ input[type="checkbox"]
4
+ margin: 4px 5px 0px 0px
1
5
 
2
6
  body
3
7
  div.panel-body
@@ -4,6 +4,7 @@ module Helpdesk
4
4
 
5
5
  helper Helpdesk::Engine.helpers
6
6
  # helper Helpdesk::ApplicationHelper
7
+ before_filter :ensure_user
7
8
  before_filter :authenticate_helpdesk_admin
8
9
  before_filter :my_tickets
9
10
 
@@ -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
@@ -1,6 +1,7 @@
1
1
  module Helpdesk
2
2
  class TicketsController < Helpdesk::ApplicationController
3
3
 
4
+ before_filter :ensure_user
4
5
  helper TicketsHelper
5
6
 
6
7
  # GET /tickets
@@ -15,7 +15,15 @@ module Helpdesk
15
15
  end
16
16
 
17
17
  def to_param
18
- id ? "#{id}-#{title.parameterize}" : nil
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],:html => {:novalidate => true} do |f|
2
- - if @faq.errors.any?
3
- #error_explanation
4
- %h2= "#{pluralize(@faq.errors.count, "error")} prohibited this faq from being saved:"
5
- %ul
6
- - @faq.errors.full_messages.each do |msg|
7
- %li= msg
8
- = f.input :active
9
- = f.input :parent_id, collection: Helpdesk::Faq.collection,label_method: :name_with_depth
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
- - I18n.available_locales.each do |locale|
14
- %h1
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,11 +1,6 @@
1
1
  = render 'menu'
2
2
 
3
-
4
3
  - content_for :title do
5
4
  Edycja pytania
6
5
 
7
6
  = render 'form'
8
-
9
- = link_to 'Show', [:admin,@faq]
10
- \|
11
- = link_to 'Back', admin_faqs_path
@@ -4,4 +4,3 @@
4
4
 
5
5
  = render 'form'
6
6
 
7
- = link_to 'Back', admin_faqs_path
@@ -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.pageContainer
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.name, root_path, :class=>'navbar-brand', :title => Helpdesk.name
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.faq'),faqs_path
14
- %form.navbar-form.navbar-left{role:'search',action:search_faqs_url}
15
- .form-group
16
- %input.form-control{type:'text', placeholder:t('helpdesk.faqs.search_in_faqs'),name:'search',value:params[:search]}
17
- %button.btn.btn-default{type:"submit"}
18
- = t('helpdesk.faqs.search')
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
- %li.dropdown.user
21
- = link_to current_user.send(Helpdesk.display_user.to_sym), "#",:class=>"dropdown-toggle",data:{toggle:"dropdown"}
22
- %ul.dropdown-menu
23
- %li=link_to 'Home',main_app.root_path
24
- %li=link_to t('users.sign_out'),main_app.destroy_user_session_path, :method => :delete, :class => 'icon exit blue'
25
-
26
- %li.dropdown
27
- = link_to t('helpdesk.lang'),"#",:class=>"dropdown-toggle",data:{toggle:"dropdown"}
28
- %ul.dropdown-menu
29
- %li= link_to "English", params.merge({:locale => :en})
30
- %li= link_to "Polski", params.merge({:locale => :pl})
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 :checkbox, tag: :div, class: "checkbox", error_class: "has-error" do |b|
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
- # Form components
103
- b.wrapper tag: :label do |ba|
104
- ba.use :input
105
- ba.use :label_text
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.
@@ -55,7 +55,7 @@ pl:
55
55
  dashboard: Dashboard
56
56
 
57
57
  subscribers:
58
- title: Subskrybenci
58
+ title: Subskrybcja
59
59
  confirmed: Potwierdzeni subskrynenci
60
60
  unconfirmed: Niepotwierdzeni
61
61
  all: Wszyscy subskrybenci
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Helpdesk
2
- VERSION = "0.0.33"
2
+ VERSION = "0.0.35"
3
3
  end
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.33
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-07 00:00:00.000000000 Z
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