watchtower 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/watchtower/application.js +15 -0
- data/app/assets/javascripts/watchtower/contacts.js +11 -0
- data/app/assets/javascripts/watchtower/jquery.jqmodal.js +69 -0
- data/app/assets/stylesheets/watchtower/application.css +13 -0
- data/app/assets/stylesheets/watchtower/bootstrap.css +610 -0
- data/app/assets/stylesheets/watchtower/contacts.css +156 -0
- data/app/controllers/watchtower/application_controller.rb +4 -0
- data/app/controllers/watchtower/contacts_controller.rb +101 -0
- data/app/controllers/watchtower/notes_controller.rb +15 -0
- data/app/controllers/watchtower/tags_controller.rb +11 -0
- data/app/helpers/watchtower/application_helper.rb +4 -0
- data/app/helpers/watchtower/contacts_helper.rb +4 -0
- data/app/models/watchtower/address.rb +17 -0
- data/app/models/watchtower/contact.rb +54 -0
- data/app/models/watchtower/custom_data.rb +4 -0
- data/app/models/watchtower/data.rb +15 -0
- data/app/models/watchtower/email.rb +4 -0
- data/app/models/watchtower/note.rb +13 -0
- data/app/models/watchtower/phone.rb +4 -0
- data/app/models/watchtower/tag.rb +14 -0
- data/app/models/watchtower/tagging.rb +9 -0
- data/app/views/layouts/watchtower/application.html.erb +27 -0
- data/app/views/watchtower/addresses/_address.html.erb +2 -0
- data/app/views/watchtower/contacts/_contact.html.erb +9 -0
- data/app/views/watchtower/contacts/_form.html.erb +33 -0
- data/app/views/watchtower/contacts/edit.html.erb +6 -0
- data/app/views/watchtower/contacts/index.html.erb +23 -0
- data/app/views/watchtower/contacts/new.html.erb +5 -0
- data/app/views/watchtower/contacts/show.html.erb +77 -0
- data/app/views/watchtower/emails/_email.html.erb +1 -0
- data/app/views/watchtower/notes/_note.html.erb +1 -0
- data/app/views/watchtower/phones/_phone.html.erb +1 -0
- data/app/views/watchtower/tags/_tag.html.erb +4 -0
- data/app/views/watchtower/tags/index.html.erb +12 -0
- data/app/views/watchtower/tags/show.html.erb +23 -0
- data/config/routes.rb +10 -0
- data/db/migrate/20120616233432_create_watchtower_contacts.rb +12 -0
- data/db/migrate/20120616235440_create_watchtower_data.rb +13 -0
- data/db/migrate/20120617010925_create_watchtower_addresses.rb +18 -0
- data/db/migrate/20120617055914_create_watchtower_notes.rb +13 -0
- data/db/migrate/20120617073423_create_watchtower_taggings.rb +12 -0
- data/db/migrate/20120617073438_create_watchtower_tags.rb +9 -0
- data/lib/tasks/watchtower_tasks.rake +4 -0
- data/lib/watchtower.rb +4 -0
- data/lib/watchtower/engine.rb +11 -0
- data/lib/watchtower/version.rb +3 -0
- metadata +164 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Watchtower</title>
|
5
|
+
<%= stylesheet_link_tag "watchtower/application", :media => "all" %>
|
6
|
+
<%= javascript_include_tag "watchtower/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div class="navbar navbar-fixed-top">
|
11
|
+
<div class="navbar-inner">
|
12
|
+
<a class="brand" href="<%= contacts_path %>">Watchtower Demo</a>
|
13
|
+
<div class="nav-collapse">
|
14
|
+
<ul class="nav">
|
15
|
+
<li class="active"><a href="<%= contacts_path %>">Home</a></li>
|
16
|
+
<li><a href="<%= contacts_path %>">Contacts</a></li>
|
17
|
+
<li><a href="<%= tags_path %>">Categories</a></li>
|
18
|
+
<!-- <li><a href="#about">About</a></li>
|
19
|
+
<li><a href="#contact">Contact</a></li> -->
|
20
|
+
</ul>
|
21
|
+
</div><!--/.nav-collapse -->
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<%= yield %>
|
25
|
+
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<tr>
|
2
|
+
<td><%= contact.first_name %></td>
|
3
|
+
<td><%= contact.last_name %></td>
|
4
|
+
<td><%= contact.primary_email %></td>
|
5
|
+
<td><%= contact.primary_phone %></td>
|
6
|
+
<td><%= link_to 'Show', contact %></td>
|
7
|
+
<td><%= link_to 'Edit', edit_contact_path(contact) %></td>
|
8
|
+
<td><%= link_to 'Destroy', contact, confirm: 'Are you sure?', method: :delete %></td>
|
9
|
+
</tr>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<%= form_for(@contact) do |f| %>
|
2
|
+
<% if @contact.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@contact.errors.count, "error") %> prohibited this contact from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @contact.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 :first_name %>
|
16
|
+
<%= f.text_field :first_name %>
|
17
|
+
</div>
|
18
|
+
<div class="field">
|
19
|
+
<%= f.label :last_name %>
|
20
|
+
<%= f.text_field :last_name %>
|
21
|
+
</div>
|
22
|
+
<div class="field">
|
23
|
+
<%= f.label :primary_email %>
|
24
|
+
<%= f.text_field :primary_email %>
|
25
|
+
</div>
|
26
|
+
<div class="field">
|
27
|
+
<%= f.label :primary_phone %>
|
28
|
+
<%= f.text_field :primary_phone %>
|
29
|
+
</div>
|
30
|
+
<div class="actions">
|
31
|
+
<%= f.submit %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<h1>Contacts</h1>
|
2
|
+
|
3
|
+
<table class="table table-bordered table-striped">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th>First name</th>
|
7
|
+
<th>Last name</th>
|
8
|
+
<th>Primary email</th>
|
9
|
+
<th>Primary phone</th>
|
10
|
+
<th></th>
|
11
|
+
<th></th>
|
12
|
+
<th></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
|
16
|
+
<tbody>
|
17
|
+
<%= render @contacts %>
|
18
|
+
</thead>
|
19
|
+
</table>
|
20
|
+
|
21
|
+
<br />
|
22
|
+
|
23
|
+
<%= link_to 'New Contact', new_contact_path %>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
<% if notice %>
|
2
|
+
<p id="notice" class="alert alert-info"><%= notice %></p>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<h2><%= @contact.full_name %></h3>
|
6
|
+
<ul class="tags">
|
7
|
+
<% @contact.tags.each do |tag| %>
|
8
|
+
<li><span class="label"><%= tag.to_s %></span></li>
|
9
|
+
<% end %>
|
10
|
+
<li><%= link_to "add", "#", 'data-form' => 'tags' %></li>
|
11
|
+
</ul>
|
12
|
+
<dl>
|
13
|
+
<div>
|
14
|
+
<dt>email</dt>
|
15
|
+
<dd><%= @contact.primary_email %></dd>
|
16
|
+
</div>
|
17
|
+
<div>
|
18
|
+
<dt>phone</dt>
|
19
|
+
<dd><%= @contact.primary_phone %></dd>
|
20
|
+
</div>
|
21
|
+
<% @contact.custom_data.each do |field| %>
|
22
|
+
<div id="custom_data_<%= field.name.parameterize %>">
|
23
|
+
<dt><%= field.name %></dt>
|
24
|
+
<dd><%= field.content %></dd>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
</dl>
|
28
|
+
|
29
|
+
<div class="dialog tags" id="tags">
|
30
|
+
<h2>Add a Tag</h2>
|
31
|
+
<p>
|
32
|
+
<%= form_tag tag_contact_path(@contact) do %>
|
33
|
+
<div class="field">
|
34
|
+
<%= text_field_tag :tag_name %>
|
35
|
+
</div>
|
36
|
+
<div class="field">
|
37
|
+
<%= submit_tag "Add Tag" %>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
40
|
+
</p>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="sidebar">
|
44
|
+
<h3>Email Addresses</h3>
|
45
|
+
<ul>
|
46
|
+
<li><%= render @contact.emails %></li>
|
47
|
+
</ul>
|
48
|
+
|
49
|
+
<h3>Phone Numbers</h3>
|
50
|
+
<ul>
|
51
|
+
<li><%= render @contact.phones %></li>
|
52
|
+
</ul>
|
53
|
+
|
54
|
+
<h3>Addresses</h3>
|
55
|
+
<ul>
|
56
|
+
<li><%= render @contact.addresses %></li>
|
57
|
+
</ul>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="notes">
|
61
|
+
<h3> Notes </h3>
|
62
|
+
<ul class="notes">
|
63
|
+
<%= render @contact.notes %>
|
64
|
+
</ul>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<%= form_for [@contact, @contact.notes.new] do |f| %>
|
68
|
+
<div class="field">
|
69
|
+
<%= f.text_area :content %>
|
70
|
+
</div>
|
71
|
+
<div class="field">
|
72
|
+
<%= f.submit "Add Note" %>
|
73
|
+
</div>
|
74
|
+
<% end %>
|
75
|
+
|
76
|
+
<%= link_to 'Edit', edit_contact_path(@contact) %> |
|
77
|
+
<%= link_to 'Back', contacts_path %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= link_to email.to_s, "mailto:#{email.to_s}" %> <%= "(primary)" if email.primary? %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<li class="note"><%= note.to_s %></li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= phone.to_s %> <%= "(primary)" if phone.primary? %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<h1><%= @tag.name %> </h1>
|
2
|
+
|
3
|
+
<table class="table table-bordered table-striped">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th>First name</th>
|
7
|
+
<th>Last name</th>
|
8
|
+
<th>Primary email</th>
|
9
|
+
<th>Primary phone</th>
|
10
|
+
<th></th>
|
11
|
+
<th></th>
|
12
|
+
<th></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
|
16
|
+
<tbody>
|
17
|
+
<%= render @tag.contacts %>
|
18
|
+
</thead>
|
19
|
+
</table>
|
20
|
+
|
21
|
+
<br />
|
22
|
+
|
23
|
+
<%= link_to 'Back', tags_path %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateWatchtowerAddresses < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :watchtower_addresses do |t|
|
4
|
+
t.string :address_1
|
5
|
+
t.string :address_2
|
6
|
+
t.string :address_3
|
7
|
+
t.string :city
|
8
|
+
t.string :state
|
9
|
+
t.string :country
|
10
|
+
t.string :postcode
|
11
|
+
t.string :name
|
12
|
+
t.string :kind
|
13
|
+
t.integer :contact_id
|
14
|
+
|
15
|
+
t.timestamps
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateWatchtowerNotes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :watchtower_notes do |t|
|
4
|
+
t.text :content
|
5
|
+
t.references :user
|
6
|
+
t.references :contact
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :watchtower_notes, :user_id
|
11
|
+
add_index :watchtower_notes, :contact_id
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateWatchtowerTaggings < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :watchtower_taggings do |t|
|
4
|
+
t.references :contact
|
5
|
+
t.references :tag
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :watchtower_taggings, :contact_id
|
10
|
+
add_index :watchtower_taggings, :tag_id
|
11
|
+
end
|
12
|
+
end
|
data/lib/watchtower.rb
ADDED
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: watchtower
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jared Fraser
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.5
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.2.5
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: sqlite3
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec-rails
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: capybara
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: Rails CRM Engine
|
79
|
+
email:
|
80
|
+
- dev@jsf.io
|
81
|
+
executables: []
|
82
|
+
extensions: []
|
83
|
+
extra_rdoc_files: []
|
84
|
+
files:
|
85
|
+
- app/assets/javascripts/watchtower/application.js
|
86
|
+
- app/assets/javascripts/watchtower/contacts.js
|
87
|
+
- app/assets/javascripts/watchtower/jquery.jqmodal.js
|
88
|
+
- app/assets/stylesheets/watchtower/application.css
|
89
|
+
- app/assets/stylesheets/watchtower/bootstrap.css
|
90
|
+
- app/assets/stylesheets/watchtower/contacts.css
|
91
|
+
- app/controllers/watchtower/application_controller.rb
|
92
|
+
- app/controllers/watchtower/contacts_controller.rb
|
93
|
+
- app/controllers/watchtower/notes_controller.rb
|
94
|
+
- app/controllers/watchtower/tags_controller.rb
|
95
|
+
- app/helpers/watchtower/application_helper.rb
|
96
|
+
- app/helpers/watchtower/contacts_helper.rb
|
97
|
+
- app/models/watchtower/address.rb
|
98
|
+
- app/models/watchtower/contact.rb
|
99
|
+
- app/models/watchtower/custom_data.rb
|
100
|
+
- app/models/watchtower/data.rb
|
101
|
+
- app/models/watchtower/email.rb
|
102
|
+
- app/models/watchtower/note.rb
|
103
|
+
- app/models/watchtower/phone.rb
|
104
|
+
- app/models/watchtower/tag.rb
|
105
|
+
- app/models/watchtower/tagging.rb
|
106
|
+
- app/views/layouts/watchtower/application.html.erb
|
107
|
+
- app/views/watchtower/addresses/_address.html.erb
|
108
|
+
- app/views/watchtower/contacts/_contact.html.erb
|
109
|
+
- app/views/watchtower/contacts/_form.html.erb
|
110
|
+
- app/views/watchtower/contacts/edit.html.erb
|
111
|
+
- app/views/watchtower/contacts/index.html.erb
|
112
|
+
- app/views/watchtower/contacts/new.html.erb
|
113
|
+
- app/views/watchtower/contacts/show.html.erb
|
114
|
+
- app/views/watchtower/emails/_email.html.erb
|
115
|
+
- app/views/watchtower/notes/_note.html.erb
|
116
|
+
- app/views/watchtower/phones/_phone.html.erb
|
117
|
+
- app/views/watchtower/tags/_tag.html.erb
|
118
|
+
- app/views/watchtower/tags/index.html.erb
|
119
|
+
- app/views/watchtower/tags/show.html.erb
|
120
|
+
- config/routes.rb
|
121
|
+
- db/migrate/20120616233432_create_watchtower_contacts.rb
|
122
|
+
- db/migrate/20120616235440_create_watchtower_data.rb
|
123
|
+
- db/migrate/20120617010925_create_watchtower_addresses.rb
|
124
|
+
- db/migrate/20120617055914_create_watchtower_notes.rb
|
125
|
+
- db/migrate/20120617073423_create_watchtower_taggings.rb
|
126
|
+
- db/migrate/20120617073438_create_watchtower_tags.rb
|
127
|
+
- lib/tasks/watchtower_tasks.rake
|
128
|
+
- lib/watchtower/engine.rb
|
129
|
+
- lib/watchtower/version.rb
|
130
|
+
- lib/watchtower.rb
|
131
|
+
- MIT-LICENSE
|
132
|
+
- Rakefile
|
133
|
+
- README.rdoc
|
134
|
+
homepage: http://github.com/modsognir/watchtower
|
135
|
+
licenses: []
|
136
|
+
post_install_message:
|
137
|
+
rdoc_options: []
|
138
|
+
require_paths:
|
139
|
+
- lib
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
segments:
|
147
|
+
- 0
|
148
|
+
hash: 2711553261453973046
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
segments:
|
156
|
+
- 0
|
157
|
+
hash: 2711553261453973046
|
158
|
+
requirements: []
|
159
|
+
rubyforge_project:
|
160
|
+
rubygems_version: 1.8.24
|
161
|
+
signing_key:
|
162
|
+
specification_version: 3
|
163
|
+
summary: Rails CRM Engine
|
164
|
+
test_files: []
|