appdoc 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/documents_controller.rb +14 -3
- data/app/models/document.rb +0 -2
- data/app/views/documents/_documents.html.haml +7 -3
- data/lib/appdoc.rb +0 -2
- data/lib/appdoc/version.rb +1 -1
- metadata +98 -70
@@ -11,9 +11,20 @@ class DocumentsController < ApplicationController
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def index
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
|
15
|
+
if params[:search].blank?
|
16
|
+
@documents = Document.scoped
|
17
|
+
else
|
18
|
+
@documents = Document.named(params[:search])
|
19
|
+
@documents = @documents.tagged_with(params[:tag]) unless params[:tag].blank?
|
20
|
+
end
|
21
|
+
|
22
|
+
# First check if using kaminari for pagination, else check for will_paginate
|
23
|
+
begin
|
24
|
+
@documents = @documents.page(params[:page])
|
25
|
+
rescue NoMethodError
|
26
|
+
@documents = @documents.try(:paginate, :page => params[:page])
|
27
|
+
end
|
17
28
|
|
18
29
|
respond_with(@documents) do |format|
|
19
30
|
format.html { flash.now[:alert] = "No documents were found" if @documents.empty? }
|
data/app/models/document.rb
CHANGED
@@ -13,8 +13,6 @@ class Document < ActiveRecord::Base
|
|
13
13
|
joins("LEFT OUTER JOIN tags ON taggings.tag_id = tags.id").
|
14
14
|
where("#{table_name}.name LIKE ? OR #{table_name}.slug LIKE ? OR tags.name LIKE ?", "%#{name}%", "%#{name}%", "%#{name}%") }
|
15
15
|
|
16
|
-
search_methods :named
|
17
|
-
|
18
16
|
acts_as_taggable
|
19
17
|
|
20
18
|
def self.find_by_id_or_slug(id_or_slug)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
-if respond_to? :page_entries_info
|
2
|
-
.search.summary
|
2
|
+
.search.summary=raw page_entries_info(@documents, :entry_name=>'document')
|
3
3
|
|
4
4
|
%table
|
5
5
|
%tr
|
@@ -15,5 +15,9 @@
|
|
15
15
|
%ul.tags
|
16
16
|
-document.tags.each do |tag|
|
17
17
|
%li!=link_to(tag, {:controller=>'documents', :tag=>tag.name})
|
18
|
-
|
19
|
-
|
18
|
+
|
19
|
+
|
20
|
+
-if respond_to? :paginate
|
21
|
+
=paginate(@documents)
|
22
|
+
-elsif respond_to? :will_paginate
|
23
|
+
=will_paginate(@documents)
|
data/lib/appdoc.rb
CHANGED
data/lib/appdoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,119 +1,147 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: appdoc
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Ryan Hall
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.1.0
|
22
|
-
type: :runtime
|
17
|
+
|
18
|
+
date: 2012-04-19 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rails
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: acts-as-taggable-on
|
27
|
-
requirement: &74346480 !ruby/object:Gem::Requirement
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
28
24
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 7
|
29
|
+
segments:
|
30
|
+
- 3
|
31
|
+
- 0
|
32
|
+
- 0
|
33
|
+
version: 3.0.0
|
33
34
|
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: action_links
|
34
38
|
prerelease: false
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: haml
|
38
|
-
requirement: &74345730 !ruby/object:Gem::Requirement
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 27
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 1
|
48
|
+
- 0
|
49
|
+
version: 0.1.0
|
44
50
|
type: :runtime
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: acts-as-taggable-on
|
45
54
|
prerelease: false
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: kaminari
|
49
|
-
requirement: &74345190 !ruby/object:Gem::Requirement
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
50
56
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 15
|
61
|
+
segments:
|
62
|
+
- 2
|
63
|
+
- 0
|
64
|
+
- 0
|
65
|
+
version: 2.0.0
|
55
66
|
type: :runtime
|
67
|
+
version_requirements: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: haml
|
56
70
|
prerelease: false
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: meta_search
|
60
|
-
requirement: &74344730 !ruby/object:Gem::Requirement
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 7
|
77
|
+
segments:
|
78
|
+
- 3
|
79
|
+
- 0
|
80
|
+
- 0
|
81
|
+
version: 3.0.0
|
66
82
|
type: :runtime
|
67
|
-
|
68
|
-
version_requirements: *74344730
|
83
|
+
version_requirements: *id004
|
69
84
|
description: Allows you to add documents and documentation to your app
|
70
|
-
email:
|
85
|
+
email:
|
71
86
|
- ryan.e.hall@biola.edu
|
72
87
|
executables: []
|
88
|
+
|
73
89
|
extensions: []
|
90
|
+
|
74
91
|
extra_rdoc_files: []
|
75
|
-
|
92
|
+
|
93
|
+
files:
|
76
94
|
- app/models/document.rb
|
77
|
-
- app/views/documents/new.html.haml
|
78
|
-
- app/views/documents/edit.html.haml
|
79
95
|
- app/views/documents/show.html.haml
|
80
|
-
- app/views/documents/
|
96
|
+
- app/views/documents/new.html.haml
|
81
97
|
- app/views/documents/_documents.html.haml
|
82
98
|
- app/views/documents/_form.html.haml
|
99
|
+
- app/views/documents/index.html.haml
|
83
100
|
- app/views/documents/_index_aside.html.haml
|
101
|
+
- app/views/documents/edit.html.haml
|
84
102
|
- app/controllers/documents_controller.rb
|
85
|
-
- lib/appdoc/
|
86
|
-
- lib/appdoc/engine.rb
|
87
|
-
- lib/generators/appdoc/appdoc_generator.rb
|
103
|
+
- lib/generators/appdoc/templates/public/javascripts/SmartTextBox.js
|
88
104
|
- lib/generators/appdoc/templates/public/stylesheets/jquery/smart_text_box/imgs/close.gif
|
89
105
|
- lib/generators/appdoc/templates/public/stylesheets/jquery/smart_text_box/SmartTextBox.css
|
90
|
-
- lib/generators/appdoc/templates/public/javascripts/SmartTextBox.js
|
91
106
|
- lib/generators/appdoc/templates/migration.rb
|
92
107
|
- lib/generators/appdoc/templates/appdoc_config.rb
|
108
|
+
- lib/generators/appdoc/appdoc_generator.rb
|
93
109
|
- lib/appdoc.rb
|
110
|
+
- lib/appdoc/version.rb
|
111
|
+
- lib/appdoc/engine.rb
|
94
112
|
- config/routes.rb
|
95
113
|
homepage: https://github.com/biola/appdoc
|
96
114
|
licenses: []
|
115
|
+
|
97
116
|
post_install_message:
|
98
117
|
rdoc_options: []
|
99
|
-
|
118
|
+
|
119
|
+
require_paths:
|
100
120
|
- lib
|
101
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
122
|
none: false
|
103
|
-
requirements:
|
104
|
-
- -
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
|
107
|
-
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
131
|
none: false
|
109
|
-
requirements:
|
110
|
-
- -
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 3
|
136
|
+
segments:
|
137
|
+
- 0
|
138
|
+
version: "0"
|
113
139
|
requirements: []
|
140
|
+
|
114
141
|
rubyforge_project: appdoc
|
115
|
-
rubygems_version: 1.8.
|
142
|
+
rubygems_version: 1.8.16
|
116
143
|
signing_key:
|
117
144
|
specification_version: 3
|
118
145
|
summary: Documentation for your app
|
119
146
|
test_files: []
|
147
|
+
|