tawork 0.0.31 → 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDYzZmQzOWVhYjQwMjU5ZTE4ZDZjNTFjNjc3MmUyMGRkZmI0OGY2Mg==
4
+ MTI1MWUwYTliNTRiNzAxMTY5YjMxYWY4ZGFkM2EwOTdjNjk5OTFkNg==
5
5
  data.tar.gz: !binary |-
6
- MDQ4Yjg2NjFkYmNhODRiNDJhM2M4Mjc1MjFiMjFiZGM1ZTc0OTJjNA==
6
+ ZmE4NjNjODAxYjJiNjZlYmM4OTAxYWY3YmY1YjQ2MjQ1MDdhZDY1ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MThiYTMzMmE3YjAxYWEyMWJiNmIzYTFjM2Q3YjY0ZDg3MWJhNzQ5NzhiM2Jm
10
- ZmNlMTc0YmE0ZTUxODlmNzdiMzEyODJiNzI3OTdkNGUwZTJjYTBjNTAwZTFi
11
- MzRlMzE5NmRlYmVkNGFiYzk4Y2IwOWFkZmViMmI1NzI2MDk0OTk=
9
+ NjdjNWVkZDM5YmY2NDNkYjZmZjYzOGNmYThkMzNkMzliMzYzMDkwYmVjZDE1
10
+ MDJhMzZjNzU1NmQxNjJmYjE3ZDZiZWM3MjQ3N2I0ZGQwNTQyMTM5MjQwNmM0
11
+ NmZmNTM4MjIzZTkxMGQ4NGVmMzY3ZTc5NjYwZDI4NTk1YzIxYzM=
12
12
  data.tar.gz: !binary |-
13
- MDVkZjMzNTcxN2I4MmZlYjBhNDNlZjYyNjIyMDAzOGZkYWJiNmNhZTQ2OTIw
14
- OTQzOTMwOTM0ODE4ZWYyM2I5NTY4YWNjZGQyZDBiMTQyNjcxYWUxOWZmNzcx
15
- NjM0ZTdhNzcxZmYzNmNkNTFmNDcyZTRlZjg1MWI3OWE5ZTZiZDM=
13
+ MzJlNWRiNTkyMjI2YjFlMmIyZWMyMTlkMGU0Zjg3MmM3ZmJiNTRiZjA5OTQw
14
+ Mzk3ODcxYWE3NDA0MjEzYzExNDEwMzkzOGI4ZDk4Y2EzZmJlYzYwMDc0MTJi
15
+ YjRjNmQ1NGJiZTgyNTczZThkM2Y0NWQ1OTc4ZTM1OTgyNGRhMzc=
data/.gitignore CHANGED
@@ -16,3 +16,4 @@
16
16
  /tmp
17
17
  tawork.git
18
18
  vendor/bundle
19
+ bin/*
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.9.3@tawork
data/Gemfile CHANGED
@@ -85,7 +85,7 @@ group :development do
85
85
  gem 'jazz_hands'
86
86
  end
87
87
 
88
-
88
+ gem "spring", group: :development
89
89
 
90
90
  # Use ActiveModel has_secure_password
91
91
  # gem 'bcrypt-ruby', '~> 3.1.2'
data/Gemfile.lock CHANGED
@@ -290,6 +290,7 @@ GEM
290
290
  actionpack (>= 4.0.0, < 4.1)
291
291
  activemodel (>= 4.0.0, < 4.1)
292
292
  slop (3.5.0)
293
+ spring (1.1.2)
293
294
  sprockets (2.11.0)
294
295
  hike (~> 1.2)
295
296
  multi_json (~> 1.0)
@@ -369,6 +370,7 @@ DEPENDENCIES
369
370
  sass-rails (~> 4.0.0.rc1)
370
371
  sdoc
371
372
  simple_form
373
+ spring
372
374
  thin
373
375
  tinymce-rails!
374
376
  turbolinks
@@ -17,4 +17,19 @@ module ApplicationHelper
17
17
  )
18
18
  end
19
19
  end
20
+
21
+ def title(page_title)
22
+ content_for(:title) { page_title }
23
+ end
24
+
25
+ def icon_for(thing)
26
+ case thing
27
+ when Space
28
+ icon = "bullseye"
29
+ when Page
30
+ icon = "file"
31
+ end
32
+
33
+ tag(:i, class: "fa fa-#{icon}")
34
+ end
20
35
  end
@@ -6,6 +6,7 @@ class Attachment < ActiveRecord::Base
6
6
  belongs_to :attachable, :polymorphic => true
7
7
  validates_presence_of :attachable
8
8
  after_update :update_version_count
9
+ before_save :set_extracted_text
9
10
 
10
11
  settings analysis: {
11
12
  filter: {
@@ -104,7 +105,7 @@ class Attachment < ActiveRecord::Base
104
105
  json
105
106
  end
106
107
 
107
- def extracted_text
108
+ def set_extracted_text
108
109
  tmp_dir = File.join Rails.root, "tmp", "#{id}_#{Time.now.to_i}"
109
110
  text_dir = File.join tmp_dir, "text_dump"
110
111
  tmp_filename = File.join tmp_dir, filename
@@ -131,7 +132,7 @@ class Attachment < ActiveRecord::Base
131
132
  :replace => '', # Use a blank for those replacements
132
133
  :universal_newline => true # Always break lines with \n
133
134
  }
134
- text.encode(Encoding.find('ASCII'), encoding_options)
135
+ self.extracted_text = text.encode(Encoding.find('ASCII'), encoding_options)
135
136
  rescue
136
137
  Rails.logger.info "document not extractable."
137
138
  end
@@ -1,7 +1,7 @@
1
1
  !!!
2
2
  %html
3
3
  %head
4
- %title tawork
4
+ %title #{yield(:title)} || tawork
5
5
  %meta{content: "width=device-width, initial-scale=1.0", name: "viewport"}/
6
6
 
7
7
  = stylesheet_link_tag "application", media: "all"
@@ -1,6 +1,8 @@
1
1
  = link_to wiki_page_path(result.attachable) do
2
- %i.fa.fa-paperclip
2
+ = icon_for ancestor
3
3
  = result.filename
4
+ = render 'search_trail', node: result.attachable, with_node: true
5
+
4
6
  .search-trail
5
7
  - if !result.attachable.is_a?(Space)
6
8
  || &nbsp;
@@ -1,12 +1,5 @@
1
1
  -# %pre= result.to_yaml
2
2
  = link_to wiki_page_path(result) do
3
- %i.fa.fa-file
3
+ = icon_for result
4
4
  = result.title
5
- .search-trail
6
- - if result.parent.present? && !result.parent.is_a?(Space)
7
- || &nbsp;
8
- %i.fa.fa-file
9
- = result.parent.title
10
- || &nbsp;
11
- %i.fa.fa-bullseye
12
- = result.root.title
5
+ = render 'search_trail', node: result
@@ -0,0 +1,5 @@
1
+ .search-trail
2
+ - node.ancestors.each do |ancestor|
3
+ || &nbsp;
4
+ = icon_for ancestor
5
+ = ancestor.title
@@ -1,4 +1,4 @@
1
1
  -# %pre= hit.to_yaml
2
2
  = link_to wiki_page_path(result) do
3
- %i.fa.fa-bullseye
3
+ = icon_for result
4
4
  = result.title
@@ -1,3 +1,4 @@
1
+ - title "History for #{@page.title}"
1
2
  = render 'breadcrumb', link_last: true
2
3
 
3
4
  %h2 History
@@ -1,5 +1,6 @@
1
+ - title "Spaces Listing"
1
2
  .col-md-9
2
- %h3 Wiki Sitemap (Two levels)
3
+ %h3 Spaces Listing
3
4
 
4
5
  = link_to "New Space", new_wiki_space_path, class: "btn btn-primary"
5
6
 
@@ -1,3 +1,4 @@
1
+ - title "New Page"
1
2
  = render 'breadcrumb', link_last: true, page: Page.find(params[:parent_id])
2
3
 
3
4
  .navbar.navbar-default
@@ -1,3 +1,4 @@
1
+ - title @page.title
1
2
  .page{id: "page_#{@page.id}", data: {page_id: @page.id}}
2
3
  = render 'breadcrumb'
3
4
  .row
@@ -1,3 +1,4 @@
1
+ - title "New Space"
1
2
  %h2 New Space
2
3
 
3
4
  = simple_form_for [:wiki, @space] do |f|
@@ -0,0 +1,5 @@
1
+ class IncreaseBodyOnPages < ActiveRecord::Migration
2
+ def change
3
+ change_column :pages, :body, :text, :limit => 4294967295
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddExtractedTextToAttachments < ActiveRecord::Migration
2
+ def change
3
+ add_column :attachments, :extracted_text, :text, :limit => 4294967295
4
+ end
5
+ end
data/db/schema.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20140319052313) do
14
+ ActiveRecord::Schema.define(version: 20140324124211) do
15
15
 
16
16
  create_table "activities", force: true do |t|
17
17
  t.integer "trackable_id"
@@ -51,7 +51,8 @@ ActiveRecord::Schema.define(version: 20140319052313) do
51
51
  t.integer "attachable_id"
52
52
  t.datetime "created_at"
53
53
  t.datetime "updated_at"
54
- t.integer "version_count", default: 1
54
+ t.integer "version_count", default: 1
55
+ t.text "extracted_text", limit: 2147483647
55
56
  end
56
57
 
57
58
  create_table "comments", force: true do |t|
@@ -79,9 +80,9 @@ ActiveRecord::Schema.define(version: 20140319052313) do
79
80
  t.string "type"
80
81
  t.string "ancestry"
81
82
  t.string "title"
82
- t.text "body"
83
+ t.text "body", limit: 2147483647
83
84
  t.integer "creator_id"
84
- t.integer "position", default: 1000
85
+ t.integer "position", default: 1000
85
86
  t.datetime "created_at"
86
87
  t.datetime "updated_at"
87
88
  end
@@ -1,3 +1,3 @@
1
1
  module Tawork
2
- VERSION = '0.0.31'
2
+ VERSION = '0.0.33'
3
3
  end
data/tawork.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.description = "Wiki and Tickets"
15
15
  s.license = "MIT"
16
16
 
17
- s.files = `git ls-files`.split($/)
17
+ s.files = `git ls-files`.split($/).reject{|x| x =~ /^bin/ }
18
18
  s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
19
19
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
20
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tawork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adnan Ali
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-20 00:00:00.000000000 Z
11
+ date: 2014-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -33,6 +33,7 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - .DS_Store
35
35
  - .gitignore
36
+ - .rvmrc
36
37
  - Gemfile
37
38
  - Gemfile.lock
38
39
  - MIT-LICENSE
@@ -129,6 +130,7 @@ files:
129
130
  - app/views/public_activity/ticket/_update_details.html.haml
130
131
  - app/views/search/_attachment.html.haml
131
132
  - app/views/search/_page.html.haml
133
+ - app/views/search/_search_trail.html.haml
132
134
  - app/views/search/_space.html.haml
133
135
  - app/views/search/index.html.haml
134
136
  - app/views/tickets/_activity.html.haml
@@ -221,6 +223,8 @@ files:
221
223
  - db/migrate/20140314014649_add_missing_unique_indices.acts_as_taggable_on_engine.rb
222
224
  - db/migrate/20140319050456_add_version_count_to_attachment.rb
223
225
  - db/migrate/20140319052313_create_deleted_items.rb
226
+ - db/migrate/20140324123647_increase_body_on_pages.rb
227
+ - db/migrate/20140324124211_add_extracted_text_to_attachments.rb
224
228
  - db/schema.rb
225
229
  - db/seeds.rb
226
230
  - init.rb