insight_rails 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Kieran Johnson
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -4,27 +4,35 @@ Rails engine to access support requests and knowledge base articles stored in Fa
4
4
 
5
5
  ## Installation
6
6
 
7
- Add insight to your applications dependencies. Currently the generators only support Rails 2.
7
+ Firstly install the insight plugin within you FatFree CRM installation.
8
+
9
+ Then add insight to your applications dependencies. Currently the generators only support Rails 2.
8
10
 
9
11
  For those using bundler
10
12
 
11
13
  gem "insight_rails", :require => "insight"
12
14
 
13
- Other wise add to your environment.rb
15
+ Otherwise add to your environment.rb
14
16
 
15
17
  gem.config "insight_rails", :lib => "insight"
16
18
 
17
- Make sure your development database exists and that you have user and account models, then run the generator:
19
+ Make sure your development/production database exists and that you have a user model, then run the generator:
18
20
 
19
21
  script/generate insight
20
22
 
21
- Now run the migration to add the crm_id field to your users table.
23
+ Now run the generated migration to add the crm_id field to your users table.
24
+
25
+ An initializer is added, and in this file you need to update the details of your product api_key (from FatFree), FatFree's api url and your recaptcha keys.
26
+
27
+ Finally a rake file is added to lib/tasks. This will help migrate an existing users you have in your application to contacts within FatFree. Depending on the fields your user model has you may need to edit this to suit.
28
+
29
+ To run the rake task
22
30
 
23
- Then update the insight initializer with details of your api_key, fatfree's url and your recaptcha keys.
31
+ rake insight:generate_crm_contacts
24
32
 
25
33
  ## Usage
26
34
 
27
- You will now have a knowledge base of articles from your fat free installation available at:
35
+ You will now have a knowledge base of articles from your FatFree installation available at:
28
36
 
29
37
  /knowledge
30
38
 
@@ -36,7 +44,7 @@ Discussions can be viewed at:
36
44
 
37
45
  /help/browse
38
46
 
39
- This will pull through the issue_categories you setup in Fat Free.
47
+ This will pull through the issue_categories you setup in FatFree.
40
48
 
41
49
  ## Style
42
50
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.0
@@ -7,4 +7,4 @@ class HelpController < InsightController
7
7
  def index
8
8
  end
9
9
 
10
- end
10
+ end
@@ -0,0 +1,35 @@
1
+ <div class="yui-gc">
2
+ <div class="yui-u first">
3
+
4
+ <h1>Welcome to the <%= Insight.configuration.product_name %> support area</h1>
5
+
6
+ <h2>This is where we handle all support for <%= Insight.configuration.product_name %>.</h2>
7
+
8
+ <p>You can search our knowledge base or public discussions for answers to your questions. Alternatively
9
+ you can create a new issue and we'll help you as soon as we can.</p>
10
+
11
+ <p>Please take the time to create an account it will help you better track and follow your issues.</p>
12
+
13
+ <p>From the helpdesk you can raise public issues (everyone can see and reply to them) or private issues
14
+ which are viewable only by our support staff.</p>
15
+
16
+ </div>
17
+
18
+ <div class="yui-u support-staff">
19
+ <h3>Support Staff</h3>
20
+ <p>The following support representatives are available to discuss your requests.</p>
21
+ </div>
22
+ </div>
23
+
24
+ <div class="yui-gb big-menu">
25
+ <div class="yui-u first">
26
+ <p><a href="/help/issues/new">Start a discussion</a></p>
27
+ </div>
28
+ <div class="yui-u">
29
+ <p><a href="/knowledge/">Knowledge base</a></p>
30
+ </div>
31
+ <div class="yui-u">
32
+ <p><a href="/help/browse/">Browse discussions</a></p>
33
+ </div>
34
+ </div>
35
+
@@ -35,9 +35,9 @@
35
35
  </ol>
36
36
  </fieldset>
37
37
 
38
- <%= recaptcha_tags :public_key => Insight.configuration.recaptcha_public_key %>
38
+ <%= recaptcha_tags :display => { :theme => 'clean' }, :public_key => Insight.configuration.recaptcha_public_key %>
39
39
 
40
40
  <fieldset class="buttons">
41
- <%= submit_tag("Post Issue") %>
41
+ <%= submit_tag("Post Issue / Topic") %>
42
42
  </fieldset>
43
- <% end %>
43
+ <% end %>
@@ -1,3 +1,3 @@
1
- <h1>New Issue</h1>
1
+ <h1>Start Discussion</h1>
2
2
 
3
- <%= render :partial => "help/issues/form" %>
3
+ <%= render :partial => "help/issues/form" %>
@@ -21,11 +21,11 @@
21
21
  </li>
22
22
  <% if logged_in? %>
23
23
  <li>
24
- <%= link_to("Logout", help_logout_path) %>
24
+ <%= link_to("Logout", logout_path) %>
25
25
  </li>
26
26
  <% else %>
27
27
  <li>
28
- <%= link_to("Login", help_login_path) %>
28
+ <%= link_to("Login", login_path) %>
29
29
  </li>
30
30
  <% end %>
31
31
  </ul>
data/config/routes.rb CHANGED
@@ -8,7 +8,7 @@ ActionController::Routing::Routes.draw do |map|
8
8
  kb.resources :categories, :controller => "article_categories"
9
9
  kb.resources :articles, :only => [ :index, :show ]
10
10
  end
11
-
11
+
12
12
  map.help "/help",
13
13
  :controller => "help",
14
14
  :action => "index"
@@ -17,16 +17,6 @@ ActionController::Routing::Routes.draw do |map|
17
17
  help.browse "/browse",
18
18
  :controller => "categories",
19
19
  :action => "index"
20
-
21
- help.login "/login",
22
- :controller => "sessions",
23
- :action => "new"
24
-
25
- help.logout "/logout",
26
- :controller => "sessions",
27
- :action => "destroy"
28
-
29
- help.resource :sessions
30
20
 
31
21
  help.resources :categories do |category|
32
22
  category.resources :issues
@@ -1,7 +1,7 @@
1
1
  namespace :insight do
2
2
 
3
- desc "Generate CRM Accounts"
4
- task :generate_crm_accounts => :environment do
3
+ desc "Generate CRM Contacts"
4
+ task :generate_crm_contacts => :environment do
5
5
  Account.find_each do |account|
6
6
  name = (account.respond_to?(:name) ? account.name + " " + account.id.to_s : account.site_name + " " + account.id.to_s)
7
7
  crm_account = Insight::CRM::Models::Account.new(:name => name)
@@ -2,12 +2,13 @@ module Insight
2
2
 
3
3
  class Configuration
4
4
 
5
- attr_accessor :fat_free_url, :api_key, :layout, :recaptcha_public_key, :recaptcha_private_key
5
+ attr_accessor :fat_free_url, :api_key, :layout, :recaptcha_public_key, :recaptcha_private_key, :product_name
6
6
 
7
7
  def initialize
8
8
  @fat_free_url = "http://localhost"
9
9
  @api_key = nil
10
10
  @layout = "support_layout"
11
+ @product_name = "PRODUCT_NAME"
11
12
  @recaptcha_public_key = nil
12
13
  @recaptcha_private_key = nil
13
14
  end
@@ -25,4 +26,4 @@ module Insight
25
26
 
26
27
  end
27
28
 
28
- end
29
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insight_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kieran Johnson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-15 00:00:00 +00:00
18
+ date: 2011-02-17 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -53,15 +53,16 @@ executables: []
53
53
  extensions: []
54
54
 
55
55
  extra_rdoc_files:
56
+ - LICENSE
56
57
  - README.md
57
58
  files:
59
+ - LICENSE
58
60
  - README.md
59
61
  - Rakefile
60
62
  - VERSION
61
63
  - app/controllers/help/categories_controller.rb
62
64
  - app/controllers/help/comments_controller.rb
63
65
  - app/controllers/help/issues_controller.rb
64
- - app/controllers/help/sessions_controller.rb
65
66
  - app/controllers/help_controller.rb
66
67
  - app/controllers/insight_controller.rb
67
68
  - app/controllers/knowledge/article_categories_controller.rb
@@ -82,7 +83,6 @@ files:
82
83
  - app/views/help/issues/index.html.erb
83
84
  - app/views/help/issues/new.html.erb
84
85
  - app/views/help/issues/show.html.erb
85
- - app/views/help/sessions/new.html.erb
86
86
  - app/views/knowledge/article_categories/index.html.erb
87
87
  - app/views/knowledge/articles/show.html.erb
88
88
  - app/views/layouts/_insight_footer.html.erb
@@ -1,18 +0,0 @@
1
- class Help::SessionsController < ApplicationController
2
-
3
- layout Insight.configuration.layout
4
-
5
- skip_before_filter :login_required
6
-
7
- protected
8
-
9
- def check_existing_login
10
- if logged_in?
11
- session[:multipass] = current_user.multipass
12
- redirect_to("/help")
13
- else
14
- redirect_to(login_path(:to => "/help"))
15
- end
16
- end
17
-
18
- end
@@ -1,20 +0,0 @@
1
- <h1>Login</h1>
2
-
3
- <% form_tag(help_session_path, :class => "formtastic") do %>
4
- <fieldset class="inputs">
5
- <ol>
6
- <li class="string">
7
- <%= label_tag "user[email]", "Email" %>
8
- <%= text_field_tag "user[email]" %>
9
- </li>
10
- <li class="password">
11
- <%= label_tag "user[password]", "Password" %>
12
- <%= password_field_tag "user[password]" %>
13
- </li>
14
- </ol>
15
- </fieldset>
16
-
17
- <fieldset class="buttons">
18
- <%= submit_tag("Login") %>
19
- </fieldset>
20
- <% end %>