wontomedia 0.2.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  ---
2
- :major: 0
3
- :minor: 2
4
- :patch: 1
2
+ :major: 1
3
+ :minor: 0
4
+ :patch: 0
@@ -165,4 +165,57 @@ class AdminController < ApplicationController
165
165
  end
166
166
  redirect_to :action => 'index'
167
167
  end
168
+
169
+ def search
170
+ @title_text = 'Search Results'
171
+ @search_query = params[:q].sub( /\+/, ' ')
172
+ render :layout => "search"
173
+ end
174
+
175
+ def sitemap
176
+ result_text = <<PLAIN_XML
177
+ <?xml version="1.0" encoding="UTF-8"?>
178
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
179
+ <url>
180
+ <loc>#{root_url}</loc>
181
+ <changefreq>monthly</changefreq>
182
+ <priority>0.25</priority>
183
+ </url>
184
+ <url>
185
+ <loc>#{items_url}</loc>
186
+ <changefreq>monthly</changefreq>
187
+ <priority>0.4</priority>
188
+ </url>
189
+ <url>
190
+ <loc>#{connections_url}</loc>
191
+ <changefreq>monthly</changefreq>
192
+ <priority>0.35</priority>
193
+ </url>
194
+ PLAIN_XML
195
+
196
+ Item.all.each do |item|
197
+ result_text += " <url>\n"
198
+ result_text += " <loc>#{item_by_name_url(item.name)}</loc>\n"
199
+ result_text += " <lastmod>#{item.updated_at.to_s(:db)}</lastmod>\n"
200
+ result_text += " <changefreq>monthly</changefreq>\n"
201
+ priority = (item.flags & Item::DATA_IS_UNALTERABLE)==0 ? '1.0' : '0.1'
202
+ result_text += " <priority>#{priority}</priority>\n"
203
+ result_text += " </url>\n"
204
+ end
205
+
206
+ Connection.all.each do |connection|
207
+ result_text += " <url>\n"
208
+ result_text += " <loc>#{connection_url(connection)}</loc>\n"
209
+ result_text += " <lastmod>" +
210
+ "#{connection.updated_at.to_s(:db)}</lastmod>\n"
211
+ result_text += " <changefreq>monthly</changefreq>\n"
212
+ priority = (connection.flags & Connection::DATA_IS_UNALTERABLE)==0 ?
213
+ '0.5' : '0.1'
214
+ result_text += " <priority>#{priority}</priority>\n"
215
+ result_text += " </url>\n"
216
+ end
217
+
218
+ result_text += "</urlset>\n"
219
+ render :text => result_text
220
+ end
168
221
  end
@@ -0,0 +1,34 @@
1
+ <%
2
+ # WontoMedia - a wontology web application
3
+ # Copyright (C) 2010 - Glen E. Ivey
4
+ # www.wontology.com
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License version
8
+ # 3 as published by the Free Software Foundation.
9
+ #
10
+ # This program is distributed in the hope that it will be useful, but
11
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Affero General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Affero General Public License
16
+ # along with this program in the file COPYING and/or LICENSE. If not,
17
+ # see "http://www.gnu.org/licenses/".
18
+ %>
19
+
20
+
21
+ <% content_for :head do %>
22
+ <meta name="robots" content="noindex" />
23
+ <meta name="googlebot" content="noindex" />
24
+ <% end %>
25
+
26
+ <div id="cse-search-results"></div>
27
+ <script type="text/javascript">
28
+ var googleSearchIframeName = "cse-search-results";
29
+ var googleSearchFormName = "cse-search-box";
30
+ var googleSearchFrameWidth = 800;
31
+ var googleSearchDomain = "www.google.com";
32
+ var googleSearchPath = "/cse";
33
+ </script>
34
+ <script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
@@ -143,7 +143,7 @@
143
143
  </div><% end %>
144
144
 
145
145
 
146
- <h3 class="subheading">This Class' Relationships</h3>
146
+ <h3 class="subheading">This Item's Relationships</h3>
147
147
 
148
148
  <% # populate bottom (connections referencing this item) section of page
149
149
  unless @connection_list.empty? %>
@@ -0,0 +1,32 @@
1
+ <%
2
+ # WontoMedia - a wontology web application
3
+ # Copyright (C) 2010 - Glen E. Ivey
4
+ # www.wontology.com
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License version
8
+ # 3 as published by the Free Software Foundation.
9
+ #
10
+ # This program is distributed in the hope that it will be useful, but
11
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Affero General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Affero General Public License
16
+ # along with this program in the file COPYING and/or LICENSE. If not,
17
+ # see "http://www.gnu.org/licenses/".
18
+ %>
19
+
20
+
21
+ <div id="block-footer" style="width: 100%; clear: both">
22
+ <p class="fine-print">
23
+ Copyright &copy; 2010, Glen E. Ivey &mdash;
24
+ Powered by <%= link_to 'WontoMedia',
25
+ 'http://wontomedia.rubyforge.org/' %>
26
+ &mdash; Software and page templates licensed under
27
+ <%= link_to 'GNU AGPL v3',
28
+ 'http://www.gnu.org/licenses/agpl-3.0.html' %>
29
+ &mdash; Page content licensed under <%= link_to 'GNU FDL v1.3',
30
+ 'http://www.gnu.org/licenses/fdl-1.3.html' %>
31
+ </p>
32
+ </div>
@@ -17,11 +17,25 @@
17
17
  # see "http://www.gnu.org/licenses/".
18
18
  %>
19
19
 
20
- <% if @display_unimplemented %>
21
- <div>
22
- <p class="unimplemented" style="text-align: right;">
23
- [search box] <br />
24
- [controls]
25
- </p>
26
- </div>
20
+
21
+ <% if WontoMedia.search.google_site_search and
22
+ WontoMedia.search.publisher_id and
23
+ WontoMedia.search.search_engine %>
24
+ <div id="block-search">
25
+ <form action="/w/search" id="cse-search-box">
26
+ <div>
27
+ <input type="hidden" name="cx"
28
+ value="<%=
29
+ WontoMedia.search.publisher_id + ':' +
30
+ WontoMedia.search.search_engine -%>" />
31
+ <input type="hidden" name="cof" value="FORID:10" />
32
+ <input type="hidden" name="ie" value="ISO-8859-1" />
33
+ <input type="text" name="q" size="20" />
34
+ <input type="submit" name="sa" value="Search" />
35
+ </div>
36
+ </form>
37
+ <script type="text/javascript"
38
+ src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"
39
+ ></script>
40
+ </div>
27
41
  <% end %>
@@ -44,8 +44,8 @@
44
44
 
45
45
  <div id="float-left" style="float: left; width: 14.4%;">
46
46
  <div id="container-absolutes">
47
- <div id="block-search"
48
- style="width: 19%; position: absolute; top: 0; right: 0;">
47
+ <div id="block-search-container"
48
+ style="width: 15%; position: absolute; top: 0; right: 0;">
49
49
  <%= render :partial => "layouts/search_box" %>
50
50
  </div>
51
51
  <div id="page-top-controls"
@@ -55,8 +55,10 @@
55
55
  <%= render :partial => "layouts/login_controls" %>
56
56
  </div>
57
57
  </div>
58
- <div id="column-left">
59
- <%= link_to( logo_image, root_url ) %>
58
+ <div id="column-left" style="text-align: center;">
59
+ <%= link_to logo_image, root_url %>
60
+ <%= link_to 'Home', root_url,
61
+ :style => 'position: relative; bottom: 1.2ex;' %>
60
62
  <%= allpages_alert %>
61
63
  <%= render :partial => "layouts/amazon_ads" %>
62
64
  </div>
@@ -57,19 +57,7 @@
57
57
  <body style="margin-top: 0">
58
58
  <div id="whole-page">
59
59
  <%= yield(:page_body) or yield %>
60
-
61
- <div id="block-footer" style="width: 100%; clear: both">
62
- <p class="fine-print">
63
- Copyright &copy; 2010, Glen E. Ivey &mdash;
64
- Powered by <%= link_to 'WontoMedia',
65
- 'http://wontomedia.rubyforge.org/' %>
66
- &mdash; Software and page templates licensed under
67
- <%= link_to 'GNU AGPL v3',
68
- 'http://www.gnu.org/licenses/agpl-3.0.html' %>
69
- &mdash; Page content licensed under <%= link_to 'GNU FDL v1.3',
70
- 'http://www.gnu.org/licenses/fdl-1.3.html' %>
71
- </p>
72
- </div>
60
+ <%= render :partial => "layouts/footer" %>
73
61
  </div>
74
62
  <%= yield(:first_bottom_page_js) %>
75
63
  <%= javascript_include_merged :bottomJS %>
@@ -45,8 +45,8 @@
45
45
 
46
46
  <div id="float-left" style="float: left; width: 14.4%;">
47
47
  <div id="container-absolutes">
48
- <div id="block-search"
49
- style="width: 19%; position: absolute; top: 0; right: 0;">
48
+ <div id="block-search-container"
49
+ style="width: 15%; position: absolute; top: 0; right: 0;">
50
50
  <%= render :partial => "layouts/search_box" %>
51
51
  </div>
52
52
  <div id="page-top-controls"
@@ -0,0 +1,79 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <%
5
+ # WontoMedia - a wontology web application
6
+ # Copyright (C) 2010 - Glen E. Ivey
7
+ # www.wontology.com
8
+ #
9
+ # This program is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Affero General Public License version
11
+ # 3 as published by the Free Software Foundation.
12
+ #
13
+ # This program is distributed in the hope that it will be useful, but
14
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
+ # Affero General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU Affero General Public License
19
+ # along with this program in the file COPYING and/or LICENSE. If not,
20
+ # see "http://www.gnu.org/licenses/".
21
+ %>
22
+
23
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
24
+ <head>
25
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
26
+ <% if @title_text %>
27
+ <title><%= @title_text +
28
+ (@window_title_addendum.nil? ? '' : @window_title_addendum) +
29
+ " &mdash; " + WontoMedia.site_title -%></title>
30
+ <% else %>
31
+ <title><%= WontoMedia.site_title -%></title>
32
+ <% end %>
33
+ <%= stylesheet_link_merged :base %>
34
+ <%= yield :head %>
35
+ </head>
36
+ <body style="margin-top: 0">
37
+ <div id="tag-line" class="page-title-text">
38
+ <h1>
39
+ Search Results:
40
+ <span style="font-size: 80%; text-decoration: underline;">
41
+ <%= @search_query -%></span>
42
+ </h1>
43
+ </div>
44
+
45
+ <div id="float-center-right"
46
+ style="float: right; width: 85%; margin-top: 8ex;">
47
+ <div id="column-content">
48
+
49
+ <%= render :partial => "layouts/status_msgs" %>
50
+ <%= yield(:page_body) or yield %>
51
+
52
+ </div>
53
+ </div>
54
+
55
+ <div id="float-left" style="float: left; width: 14.4%;">
56
+ <div id="container-absolutes">
57
+ <div id="block-search-container"
58
+ style="width: 15%; position: absolute; top: 0; right: 0;">
59
+ <%= render :partial => "layouts/search_box" %>
60
+ </div>
61
+ <div id="page-top-controls"
62
+ style="position: absolute; top: 0; right: 15.6%;">
63
+ <%= render :partial => "layouts/master_help" %>
64
+ <%= render :partial => "layouts/language_select" %>
65
+ <%= render :partial => "layouts/login_controls" %>
66
+ </div>
67
+ </div>
68
+ <div id="column-left">
69
+ <%= link_to( logo_image, root_url ) %>
70
+ <%= link_to 'Home', root_url,
71
+ :style => 'position: relative; bottom: 1.2ex;' %>
72
+ <%= allpages_alert %>
73
+ <%= yield( :left_column ) %>
74
+ </div>
75
+ </div>
76
+
77
+ <%= render :partial => "layouts/footer" %>
78
+ </body>
79
+ </html>
@@ -31,6 +31,12 @@ WontoMedia = OpenStruct.new({
31
31
  "http://wiki.wontology.org/wiki/help.php?title=Wontology:",
32
32
  :site_content_url_postfix => '',
33
33
 
34
+ :search => OpenStruct.new({
35
+ # :google_site_search => true, # flag indicating kind of search
36
+ # :publisher_id => "partner-pub-2447626445162341",
37
+ # :search_engine => "pcrhs4-9v0t",
38
+ }),
39
+
34
40
  :ads => OpenStruct.new({
35
41
  # :amazon => OpenStruct.new({
36
42
  # # the color scheme of Amazon ads is controlled from JS constants
@@ -23,6 +23,7 @@ ActionController::Routing::Routes.draw do |map|
23
23
  :permanent => true
24
24
 
25
25
  # more specific routes that override...
26
+ map.sitemap '/sitemap.xml', :controller => :admin, :action => :sitemap
26
27
  map.items_lookup '/items/lookup', :controller => :items, :action => :lookup,
27
28
  :path_prefix => '/w'
28
29
  map.itemCreatePopup '/items/new-pop', :controller => :items,
@@ -39,6 +40,7 @@ ActionController::Routing::Routes.draw do |map|
39
40
  :action => 'item_up'
40
41
  map.admin_connection_up '/w/admin/connection_up', :controller => 'admin',
41
42
  :action => 'connection_up'
43
+ map.search '/w/search', :controller => 'admin', :action => 'search'
42
44
 
43
45
  # pretty URLs for items (match against all the "/w/" paths first)
44
46
  map.item_by_name '/:name', :controller => :items, :action => 'show',
@@ -69,7 +69,7 @@ div#fancybox-outer {
69
69
  top: 0;
70
70
  left: 15.5%;
71
71
  height: 8ex;
72
- width: 69.7%;
72
+ width: 84.5%
73
73
  overflow: hidden;
74
74
  }
75
75
  .content {
@@ -232,6 +232,27 @@ p + table { margin-bottom: 1.5em; }
232
232
  letter-spacing: -0.3em;
233
233
  }
234
234
 
235
+ #block-search {
236
+ border-width: 2px;
237
+ border-color: #e8e8ff;
238
+ border-style: none none solid solid;
239
+ background: url("/images/transparent_ltblue_background.png") repeat;
240
+ height: 5.8ex;
241
+ }
242
+
243
+ #block-search input[type=text] {
244
+ width: 98.5%;
245
+ border: solid 1px #b0b0ff;
246
+ }
247
+ #block-search input[type=submit] {
248
+ border: solid 1px #b0b0ff;
249
+ background: #e8e8ff;
250
+ font-size: 10px;
251
+ font-weight: bold;
252
+ padding: 0;
253
+ margin: 2px 0 0 3px;
254
+ }
255
+
235
256
  #block-help {
236
257
  float: right;
237
258
  border-width: 2px;
@@ -67,7 +67,7 @@ function plumbEventHandlersToItemCreationElements(customizationSelector){
67
67
  var newItemId;
68
68
  for (var c=0; c < arrayOfForms.length; c++){
69
69
  newItemId = arrayOfForms[c].id;
70
- var mtch = newItemId.match(/item$/);
70
+ var mtch = newItemId.match(/item/);
71
71
  if (mtch != null)
72
72
  break;
73
73
  }
metadata CHANGED
@@ -3,10 +3,10 @@ name: wontomedia
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
- - 0
7
- - 2
8
6
  - 1
9
- version: 0.2.1
7
+ - 0
8
+ - 0
9
+ version: 1.0.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Glen E. Ivey
@@ -59,6 +59,7 @@ files:
59
59
  - app/models/property_item.rb
60
60
  - app/models/qualified_item.rb
61
61
  - app/views/admin/index.html.erb
62
+ - app/views/admin/search.html.erb
62
63
  - app/views/connections/_index_outbound_links.html.erb
63
64
  - app/views/connections/_spo_select_controls.html.erb
64
65
  - app/views/connections/edit.html.erb
@@ -86,6 +87,7 @@ files:
86
87
  - app/views/items/show.html.erb
87
88
  - app/views/layouts/_amazon_ads.html.erb
88
89
  - app/views/layouts/_dynamic_alert_framework.html.erb
90
+ - app/views/layouts/_footer.html.erb
89
91
  - app/views/layouts/_glossary_help_box.html.erb
90
92
  - app/views/layouts/_google_ads.html.erb
91
93
  - app/views/layouts/_language_select.html.erb
@@ -98,6 +100,7 @@ files:
98
100
  - app/views/layouts/base.html.erb
99
101
  - app/views/layouts/home.html.erb
100
102
  - app/views/layouts/popup.html.erb
103
+ - app/views/layouts/search.html.erb
101
104
  - assets/wontomedia-sample.rb
102
105
  - config/asset_packages.yml
103
106
  - config/boot.rb