helpdesk 0.0.8 → 0.0.9

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: 3418e5fdd287132822da66b351f787a3ea820219
4
- data.tar.gz: d15347c9253d5983bf3700a42fcd3bd52f9c734c
3
+ metadata.gz: 62e85c661007c0b041b84eda3f4684badff4f8bf
4
+ data.tar.gz: b4f734ee1cc0ae6b2f901dada3651c49772f762b
5
5
  SHA512:
6
- metadata.gz: 514eeb29e94d7bb6d9adf804d2a92916923e80b0faf4cea6722bc5f95eb1f51db2725ada86dbee9501f75cc58934be6f996b9bcfd5515ae68e11aa449893639a
7
- data.tar.gz: 796ad30cf7ce91e79c2f71149308f3c251fdcf4fa2e1330540b1ff998135db9151f6b37bdd5a98a87a1c0bca033a9b9ce2e525eaf95d487afd43b2edec658077
6
+ metadata.gz: 9febdcbe515758f101a7605a8a017a0ba2b4738353bf9c773058217df5ad21d5ae052c3e52f3034b11c5f92119aec1a361e2361cb2874669c72cd3e028b95ba6
7
+ data.tar.gz: 48f8b2a52ef4932301367efeec8ad0f18f18f7e44778577be3dd0bd37630bddeade3a78a2f8d6239bd413465bf83fa9e0875913fa6c6408b2e0e5f47238bb6a1
@@ -1,85 +1,7 @@
1
1
  module Helpdesk
2
2
  class FaqsController < ApplicationController
3
- # GET /faqs
4
- # GET /faqs.json
5
3
  def index
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
4
+ @faqs = Helpdesk::Faq.active
83
5
  end
84
6
  end
85
7
  end
@@ -0,0 +1,20 @@
1
+ %div.content
2
+ %div.pageContainer
3
+ %h1
4
+ Często zadawane pytania
5
+ %ol#faq
6
+ - @faqs.each do |faq|
7
+ %li{:id=>"link#{faq.id}"}
8
+ %h3
9
+ = link_to faq.title, "\#link#{faq.id}"
10
+ %div{style:"display:none"}
11
+ = raw faq.text
12
+
13
+ - content_for :scripts do
14
+ :javascript
15
+ $(document).ready(function(){
16
+ $('ol#faq li h3').click(function () {
17
+ $(this).parent().find('div').slideToggle('fast');
18
+ });
19
+ $("a[href='" + window.location.hash + "']").click();
20
+ });
@@ -6,4 +6,5 @@
6
6
  %nav
7
7
  %ul.nav
8
8
  = menu_li t('helpdesk.tickets.title'),tickets_path
9
-
9
+ = menu_li t('helpdesk.faq'),faqs_path
10
+
@@ -14,8 +14,9 @@ Helpdesk::Engine.routes.draw do
14
14
  resources :subscribers
15
15
  root :to => "dashboard#index"
16
16
  end
17
+ resources :faqs, :only => [ :index ]
17
18
  resources :tickets, :except => [ :edit, :destroy ]
18
19
  root :to => "tickets#index"
19
-
20
+
20
21
  end
21
22
  end
@@ -1,3 +1,3 @@
1
1
  module Helpdesk
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
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.8
4
+ version: 0.0.9
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: 2013-10-14 00:00:00.000000000 Z
11
+ date: 2013-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: launchy
@@ -352,11 +352,7 @@ files:
352
352
  - app/views/helpdesk/admin/tickets/new.html.haml
353
353
  - app/views/helpdesk/admin/tickets/show.html.haml
354
354
  - app/views/helpdesk/dashboard/index.html.erb
355
- - app/views/helpdesk/faqs/_form.html.erb
356
- - app/views/helpdesk/faqs/edit.html.erb
357
- - app/views/helpdesk/faqs/index.html.erb
358
- - app/views/helpdesk/faqs/new.html.erb
359
- - app/views/helpdesk/faqs/show.html.erb
355
+ - app/views/helpdesk/faqs/index.html.haml
360
356
  - app/views/helpdesk/notifications_mailer/comment_by_helpdesk_confirmation.pl.html.haml
361
357
  - app/views/helpdesk/notifications_mailer/comment_by_helpdesk_notification.pl.html.haml
362
358
  - app/views/helpdesk/notifications_mailer/comment_by_requester_confirmation.pl.html.haml
@@ -402,7 +398,8 @@ files:
402
398
  - MIT-LICENSE
403
399
  - Rakefile
404
400
  homepage: http://github.com/wacaw/helpdesk
405
- licenses: []
401
+ licenses:
402
+ - MIT
406
403
  metadata: {}
407
404
  post_install_message:
408
405
  rdoc_options: []
@@ -1,33 +0,0 @@
1
- <%= form_for(@faq) do |f| %>
2
- <% if @faq.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(@faq.errors.count, "error") %> prohibited this faq from being saved:</h2>
5
-
6
- <ul>
7
- <% @faq.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="field">
15
- <%= f.label :title %><br />
16
- <%= f.text_field :title %>
17
- </div>
18
- <div class="field">
19
- <%= f.label :text %><br />
20
- <%= f.text_area :text %>
21
- </div>
22
- <div class="field">
23
- <%= f.label :position %><br />
24
- <%= f.number_field :position %>
25
- </div>
26
- <div class="field">
27
- <%= f.label :active %><br />
28
- <%= f.check_box :active %>
29
- </div>
30
- <div class="actions">
31
- <%= f.submit %>
32
- </div>
33
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing faq</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @faq %> |
6
- <%= link_to 'Back', faqs_path %>
@@ -1,29 +0,0 @@
1
- <h1>Listing faqs</h1>
2
-
3
- <table>
4
- <tr>
5
- <th>Title</th>
6
- <th>Text</th>
7
- <th>Position</th>
8
- <th>Active</th>
9
- <th></th>
10
- <th></th>
11
- <th></th>
12
- </tr>
13
-
14
- <% @faqs.each do |faq| %>
15
- <tr>
16
- <td><%= faq.title %></td>
17
- <td><%= faq.text %></td>
18
- <td><%= faq.position %></td>
19
- <td><%= faq.active %></td>
20
- <td><%= link_to 'Show', faq %></td>
21
- <td><%= link_to 'Edit', edit_faq_path(faq) %></td>
22
- <td><%= link_to 'Destroy', faq, confirm: 'Are you sure?', method: :delete %></td>
23
- </tr>
24
- <% end %>
25
- </table>
26
-
27
- <br />
28
-
29
- <%= link_to 'New Faq', new_faq_path %>
@@ -1,5 +0,0 @@
1
- <h1>New faq</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Back', faqs_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <b>Title:</b>
5
- <%= @faq.title %>
6
- </p>
7
-
8
- <p>
9
- <b>Text:</b>
10
- <%= raw @faq.text %>
11
- </p>
12
-
13
- <p>
14
- <b>Position:</b>
15
- <%= @faq.position %>
16
- </p>
17
-
18
- <p>
19
- <b>Active:</b>
20
- <%= @faq.active %>
21
- </p>
22
-
23
-
24
- <%= link_to 'Edit', edit_faq_path(@faq) %> |
25
- <%= link_to 'Back', faqs_path %>