refinerycms-masthead 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ class OnlineServicesController < ApplicationController
2
+ def show
3
+ base_url = RefinerySetting.get(:masthead_base_url)
4
+ app_name = params[:id]
5
+ @content_url = "#{base_url}servlet/DSFCentralServlet?appName=#{app_name}"
6
+ render :layout => false
7
+ end
8
+
9
+ def header
10
+ @base_url = RefinerySetting.get(:masthead_base_url)
11
+ render :layout => false
12
+ end
13
+ end
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <title>Home</title>
6
+ <%= stylesheet_link_tag 'cat_frame.css' %>
7
+ <script type="text/javascript">
8
+ function getBaseURL(){
9
+ return "<%= @base_url %>";
10
+ }
11
+ </script>
12
+ <%= javascript_include_tag 'cat_frame.js' %>
13
+ </head>
14
+
15
+ <body>
16
+ <div id="bodydivframes" >
17
+
18
+ <div class="header">
19
+ <form name="headerFrm">
20
+
21
+ <table border="0" width="100%" cellspacing="0" cellpadding="0" style=" margin-top:0%;">
22
+ <tr>
23
+ <td><a href="javascript:top.location.href='home_frames.htm'"><img src="/images/dealername-lockup_sm.jpg" border="0" alt=""/></a></td>
24
+ <td id="appName"></td>
25
+ <td align="right" valign="bottom">
26
+ <span>Quick Access:</span>
27
+ <select id="QuickAccess" name="QuickAccess" onchange="javascript:loadSelectBoxChanges(this);">
28
+ <option value=''>Applications...</option>
29
+ <option value="myprofile.do">Edit Profile</option>
30
+ <option value="servlet/DSFCentralServlet?appName=PartStore">PartStore&trade;</option>
31
+ <option value="servlet/DSFCentralServlet?appName=Equipment Manager">EquipmentManager</option>
32
+ <option value="servlet/DSFCentralServlet?appName=Equipment Data">Equipment Data</option>
33
+ <!--
34
+ You will only need one SOS Services link. SOS Services Online is the old application. SOS Services Web is the new application.
35
+ -->
36
+ <option value="servlet/DSFCentralServlet?appName=SOS Services Web">S&middot;O&middot;S&#8480; Services</option>
37
+
38
+ <option value="servlet/DSFCentralServlet?appName=Document Review">Document Review</option>
39
+ <option value="servlet/DSFCentralServlet?appName=Build Your Own and Get a Quote">Build and Quote</option>
40
+ <!--
41
+ You will only need one CatUsed link. Use the link that you are currently using on your site.
42
+ -->
43
+ <option value="servlet/DSFCentralServlet?appName=Used Equipment">CatUsed</option>
44
+ <!--
45
+ Engine Spec Sheet Wizard links.
46
+ -->
47
+ <option value="Electric Power Wizard">Electric Power Wizard</option>
48
+ <option value="Industrial Wizard">Industrial Wizard</option>
49
+ <option value="Marine Spec Sheet Wizard">Marine Spec Sheet Wizard</option>
50
+
51
+ </select>
52
+ </td>
53
+ </tr>
54
+ </table>
55
+ </form>
56
+
57
+ </div>
58
+
59
+ </div>
60
+ </body>
61
+ </html>
@@ -0,0 +1,8 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <frameset rows= "76,*" border="0" border=0 frameborder=0 framespacing=0>
5
+ <frame src ="<%= header_online_services_path %>" name="topFrame" scrolling="no" />
6
+ <frame src ="<%= @content_url %>" name="bottomFrame" />
7
+ </frameset>
8
+ </html>
@@ -0,0 +1,19 @@
1
+ en:
2
+ plugins:
3
+ mastheads:
4
+ title: Mastheads
5
+ admin:
6
+ mastheads:
7
+ index:
8
+ create_new: Create a new Masthead
9
+ reorder: Reorder Mastheads
10
+ reorder_done: Done Reordering Mastheads
11
+ sorry_no_results: Sorry! There are no results found.
12
+ no_items_yet: There are no Mastheads yet. Click "Create a new Masthead" to add your first masthead.
13
+ masthead:
14
+ view_live: View this masthead live <br/><em>(opens in a new window)</em>
15
+ edit: Edit this masthead
16
+ delete: Remove this masthead forever
17
+ mastheads:
18
+ show:
19
+ other: Other Mastheads
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ Refinery::Application.routes.draw do
2
+ match "/online-services/header" => "online_services#header", :as => :header_online_services
3
+ match "/online-services/:id" => "online_services#show", :as => :online_service
4
+ end
data/lib/gemspec.rb ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../masthead.rb', __FILE__)
3
+ version = ::Refinery::Masthead.version
4
+ raise "Could not get version so gemspec can not be built" if version.nil?
5
+ files = Dir.glob("**/*").flatten.reject do |file|
6
+ file =~ /\.gem(spec)?$/
7
+ end
8
+
9
+ gemspec = <<EOF
10
+ Gem::Specification.new do |s|
11
+ s.name = %q{refinerycms-masthead}
12
+ s.version = %q{#{version}}
13
+ s.description = %q{CAT Mastheads engine for Refinery CMS}
14
+ s.date = %q{#{Time.now.strftime('%Y-%m-%d')}}
15
+ s.summary = %q{CAT Mastheads engine for Refinery CMS}
16
+ s.email = %q{lab@envylabs.com}
17
+ s.homepage = %q{http://github.com/envylabs/refinerycms-masthead}
18
+ s.authors = %w(Envy\\ Labs)
19
+ s.require_paths = %w(lib)
20
+
21
+ s.files = [
22
+ '#{files.join("',\n '")}'
23
+ ]
24
+ #{"s.test_files = [
25
+ '#{Dir.glob("test/**/*.rb").join("',\n '")}'
26
+ ]" if File.directory?("test")}
27
+ end
28
+ EOF
29
+
30
+ File.open(File.expand_path("../../refinerycms-masthead.gemspec", __FILE__), 'w').puts(gemspec)
@@ -0,0 +1,15 @@
1
+ class InitializeRefinerycmsMasthead < ActiveRecord::Migration
2
+
3
+ def self.up
4
+ say_with_time('Adding masthead_base_url refinery setting') do
5
+ RefinerySetting.find_or_set(:masthead_base_url, 'https://qademodealer.rd.cat.com/')
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ say_with_time('Removing masthead_base_url refinery setting') do
11
+ RefinerySetting.find_by_name('masthead_base_url').destroy
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,65 @@
1
+ /*
2
+ Base URL is specific to each dealer. Each dealer needs to change this URL to their dealer specific URL.
3
+ */
4
+ function getURLBasedOnAppName(appName) {
5
+
6
+ if (appName == 'Industrial Wizard')
7
+ return 'http://industrialwizard.catmms.com/catwizards/industrialWizard/jsp/dealerStoreFront.jsp';
8
+ else if (appName == 'Marine Spec Sheet Wizard' )
9
+ return 'http://marinewizard.catmms.com/catwizards/marineWizard/jsp/dealerStoreFront.jsp';
10
+ else if (appName == 'Electric Power Wizard')
11
+ return 'http://vidswizard.catmms.com/catwizards/vidswizard/jsp/dealerStoreFront.jsp';
12
+ else if (appName == 'Blanchard')
13
+ return "http://dsfunbundledt3.ecorp.cat.com/blanchard";
14
+ else if (appName == 'Portal Lite' )
15
+ return "http://dsfunbundledt3.ecorp.cat.com/portal-lite";
16
+ else if (appName == 'newbuildnquote')
17
+ return "http://buildnquote-rp.cat.com";
18
+ else
19
+ return ' ';
20
+ }
21
+
22
+ /*
23
+ this the method is calling when user select speicifc application from
24
+ Quick Access link from select box.
25
+ */
26
+ function loadSelectBoxChanges(selectBox){
27
+ var selValue;
28
+ var tmpValue;
29
+ var partialURL;
30
+ var endOfUrl;
31
+ var selIndex = selectBox.selectedIndex;
32
+ if (selIndex != -1) {
33
+ selValue = selectBox.options[selIndex].value;
34
+ if (selValue.length == 0 ){
35
+ return;
36
+ }
37
+ tmpValue = getURLBasedOnAppName(selValue);
38
+ if (tmpValue != ' '){
39
+ selValue = tmpValue;
40
+ }else{
41
+ partialURL = selValue.substring(0, selValue.indexOf('=')+1);
42
+ endOfUrl = selValue.substr(selValue.indexOf('=')+1);
43
+ selValue = getBaseURL()+partialURL + endOfUrl;
44
+ }
45
+ var tdElement=document.getElementById("appName");
46
+ if(tdElement){
47
+ tdElement.innerHTML ="<span class='frameTitle'>" +selectBox.options[selIndex].text+"</span>"
48
+ }
49
+ }
50
+ selectBox.selectedIndex = 0;
51
+ if (selValue != "" ){
52
+ if(parent.frames[1] !=null) {
53
+ parent.frames[1].location.href=selValue;
54
+ }else{
55
+ window.location.href=selValue;
56
+ }
57
+ }
58
+ }
59
+
60
+ //close popup window if it exists
61
+ function logoff() {
62
+ if (window.popupWindow) {
63
+ popupWindow.close();
64
+ }
65
+ }
@@ -0,0 +1,313 @@
1
+ /* global element mods */
2
+ * {
3
+ padding: 0;
4
+ margin: 0;
5
+
6
+ }
7
+
8
+ body {
9
+
10
+ font-family: arial;
11
+ font-size: 11px;
12
+ }
13
+
14
+ body.pop {
15
+ background: none;
16
+ }
17
+
18
+ a {
19
+ text-decoration: none;
20
+ }
21
+
22
+ a:hover {
23
+ text-decoration: underline;
24
+ }
25
+
26
+ #bodydiv {
27
+ width: 755px;
28
+ background-color: #ffffff;
29
+ margin: 0 auto 0 auto;
30
+ }
31
+
32
+ #bodydivframes {
33
+ width: 100%;
34
+ background-color: #ffffff;
35
+ margin: 0 auto 0 auto;
36
+
37
+ }
38
+
39
+ /* header */
40
+ div.header, div.popheader {
41
+ margin: 0 auto 0 auto;
42
+ border: 15px solid #ffffff; /* changed boarder around dealer logo lockup to 15 pixels per new look and feel standards.*/
43
+ /* border: 3px solid #ffffff; */
44
+ }
45
+
46
+ .divHeaderA {
47
+ color: #333333;
48
+ padding-left: 15px;
49
+ }
50
+
51
+ .frameTitle{
52
+ font-family: arial;
53
+ font-size: 30px;
54
+ font-weight: bold;
55
+ }
56
+
57
+ div.popheader {
58
+ background-color: #666666;
59
+ padding: 15px;
60
+ }
61
+
62
+ div.header input {
63
+ color: #333333;
64
+ border: 1px solid #333333;
65
+ width: 140px;
66
+ height: 18px;
67
+ font-family: arial;
68
+ font-size: 11px;
69
+ }
70
+
71
+ /* main navigation */
72
+ div.mainnav {
73
+ height: 30px; */
74
+ background-image: url(images/nav_bgnd.gif);
75
+ border-bottom: 1px solid #cccccc;
76
+ }
77
+
78
+ div.mainnav img {
79
+ float: left;
80
+ }
81
+
82
+ /* footer */
83
+ div.footer {
84
+ clear: both;
85
+ }
86
+
87
+ div.botgrad {
88
+ height: 80px;
89
+ background-image:url(images/bgnd_grad_grey.gif);
90
+ background-repeat: repeat-x;
91
+ }
92
+
93
+ div.botspc {
94
+ height: 100px;
95
+ }
96
+
97
+ div.footer span, div.footer a {
98
+ color: #999999;
99
+ padding-left: 10px;
100
+ }
101
+
102
+ /* content */
103
+ div.homefeat {
104
+ background-image:url(images/bgnd_grad_black.gif);
105
+ background-repeat: repeat-x;
106
+ background-color: #454545;
107
+ padding: 25px 15px 25px 15px;
108
+ }
109
+
110
+ div.pagefeat {
111
+ background-image:url(images/bgnd_grad_black2.gif);
112
+ background-repeat: repeat-x;
113
+ background-color: #000000;
114
+ color: #ffffff;
115
+ }
116
+
117
+ div.homesubfeat {
118
+ padding: 20px 15px 0 15px;
119
+ }
120
+
121
+ div.homesubfeat a.blue, div.homesubfeat span.grey, div.homesubfeat span.black, td.rightcol a.blue, table.prodgrid a.blue {
122
+ font-family: arial narrow;
123
+ font-size: 11px;
124
+ font-weight: bold;
125
+ }
126
+
127
+ div.homesubfeat select, div.contentarea select {
128
+ font-family: arial;
129
+ font-size: 11px;
130
+ width: 100%;
131
+ }
132
+
133
+ div.homesubfeat div, td.rightcol div, table.prodgrid div {
134
+ padding: 5px 5px 15px 0;
135
+ }
136
+
137
+ td.rightcol {
138
+ padding-top: 15px;
139
+ }
140
+
141
+ td.leftcol div.evn {
142
+ background-color: #eeeeee;
143
+ }
144
+
145
+ td.leftcol div.end {
146
+ border-bottom: 1px solid #cccccc;
147
+ }
148
+
149
+ td.leftcol div.evn, td.leftcol div.odd {
150
+ border-top: 1px solid #cccccc;
151
+ padding: 5px 0 5px 15px;
152
+ }
153
+
154
+ td.leftcol div.an12, td.leftcol div.an12 {
155
+ border: 0;
156
+ padding: 15px 0 15px 15px;
157
+ }
158
+
159
+ div.gridhead {
160
+ padding: 15px 0 5px 0;
161
+ }
162
+
163
+ div.gridhead div {
164
+ font-weight: bold;
165
+ padding: 2px 0 2px 15px;
166
+ background-color: #999999;
167
+ }
168
+
169
+ table.prodgrid img {
170
+ display: block;
171
+ padding-bottom: 15px;
172
+ }
173
+
174
+ div.contentarea {
175
+ width: 565px;
176
+ padding: 5px 0 5px 0;
177
+ float: left;
178
+ }
179
+
180
+ div.breadcrumb {
181
+ background-color: #000000;
182
+ position: relative;
183
+ }
184
+
185
+ div.breadcrumbb {
186
+ background-color: #eeeeee;
187
+ position: relative;
188
+ }
189
+
190
+ div.breadcrumb div, div.breadcrumbb div {
191
+ width: 425px;
192
+ padding: 5px 5px 5px 15px;
193
+ }
194
+
195
+ a.printlink {
196
+ display: block;
197
+ position: absolute;
198
+ top: 5px;
199
+ right: 5px;
200
+ }
201
+
202
+ div.specnav {
203
+ background-color: #999999;
204
+ height: 45px;
205
+ }
206
+
207
+ div.specnav a {
208
+ /* display: block; */
209
+ /* float: left; */
210
+ /* height: 45px; */
211
+ /* width: 112px; */
212
+ /* font-family: arial narrow; */
213
+ /* background-color: #999999; */
214
+ /* color: #ffffff; */
215
+ /* font-weight: bold; */
216
+ }
217
+
218
+ div.specnav a.active {
219
+ background-color: #ffffff;
220
+ color: #000000;
221
+ }
222
+
223
+ div.specnav span {
224
+ display: block;
225
+ padding: 10px 10px 0 15px;
226
+ }
227
+
228
+ .a14 {
229
+ font-size: 14px;
230
+ }
231
+
232
+ .an11 {
233
+ font-family: arial narrow;
234
+ font-size: 11px;
235
+ }
236
+
237
+ .an12 {
238
+ font-family: arial narrow;
239
+ font-size: 12px;
240
+ }
241
+
242
+ .an16 {
243
+ font-family: arial narrow;
244
+ font-size: 16px;
245
+ font-weight: bold;
246
+ }
247
+
248
+ .an20 {
249
+ font-family: arial narrow;
250
+ font-size: 20px;
251
+ }
252
+
253
+ .pt15 {
254
+ padding-top: 15px;
255
+ }
256
+
257
+ .yellow {
258
+ color: #ffcc00;
259
+ }
260
+
261
+ .white {
262
+ color: #ffffff;
263
+ }
264
+
265
+ .blue {
266
+ color: #006699;
267
+ }
268
+
269
+
270
+ .grey {
271
+ color: #cbcbcb;
272
+ }
273
+
274
+ .dkgrey {
275
+ color: #999999;
276
+ }
277
+
278
+ .dkgreyb {
279
+ color: #666666;
280
+ }
281
+
282
+
283
+ /* left navigation */
284
+ div.leftnav {
285
+ padding: 5px;
286
+ float: left;
287
+ }
288
+
289
+ div.leftnav a {
290
+ color: #333333;
291
+ padding: 5px 0 5px 0;
292
+ display: block;
293
+ border-bottom: 1px solid #cccccc;
294
+ }
295
+
296
+ div.leftnav a.sub {
297
+ padding-left: 15px;
298
+ }
299
+
300
+ div.navbgnd {
301
+ width: 175px;
302
+ background-image:url(images/bgnd_grad_nav.gif);
303
+ background-repeat: repeat-x;
304
+ }
305
+
306
+ div.navbgnd div {
307
+ padding-left: 5px;
308
+ width: 160px;
309
+ }
310
+
311
+ SPAN.large {
312
+ font-size: 22pt;
313
+ }
@@ -0,0 +1,48 @@
1
+ require 'rails/generators/migration'
2
+
3
+ class RefinerycmsMastheadGenerator < Rails::Generators::Base
4
+ include Rails::Generators::Migration
5
+
6
+ source_root File.expand_path('../refinerycms_masthead/templates/', __FILE__)
7
+
8
+ def generate
9
+ next_migration_number = ActiveRecord::Generators::Base.next_migration_number(File.dirname(__FILE__))
10
+ copy_file('db/migrate/migration.rb', Rails.root.join("db/migrate/#{next_migration_number}_initialize_refinerycms_masthead.rb"))
11
+ copy_file('public/javascripts/cat_frame.js', Rails.root.join("public/javascripts/cat_frame.js"))
12
+ copy_file('public/stylesheets/cat_frame.css', Rails.root.join("public/stylesheets/cat_frame.css"))
13
+ copy_file('public/images/dealername-lockup_sm.jpg', Rails.root.join("public/images/dealername-lockup_sm.jpg"))
14
+ copy_file('public/images/arrow_wht.gif', Rails.root.join("public/images/arrow_wht.gif"))
15
+
16
+ puts "------------------------"
17
+ puts "Now run:"
18
+ puts "rake db:migrate"
19
+ puts "------------------------"
20
+ end
21
+ end
22
+
23
+ # Below is a hack until this issue:
24
+ # https://rails.lighthouseapp.com/projects/8994/tickets/3820-make-railsgeneratorsmigrationnext_migration_number-method-a-class-method-so-it-possible-to-use-it-in-custom-generators
25
+ # is fixed on the Rails project.
26
+
27
+ require 'rails/generators/named_base'
28
+ require 'rails/generators/migration'
29
+ require 'rails/generators/active_model'
30
+ require 'active_record'
31
+
32
+ module ActiveRecord
33
+ module Generators
34
+ class Base < Rails::Generators::NamedBase #:nodoc:
35
+ include Rails::Generators::Migration
36
+
37
+ # Implement the required interface for Rails::Generators::Migration.
38
+ def self.next_migration_number(dirname) #:nodoc:
39
+ next_migration_number = current_migration_number(dirname) + 1
40
+ if ActiveRecord::Base.timestamped_migrations
41
+ [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
42
+ else
43
+ "%.3d" % next_migration_number
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
data/lib/masthead.rb ADDED
@@ -0,0 +1,9 @@
1
+ $:.unshift File.expand_path(File.dirname(__FILE__))
2
+
3
+ module Refinery
4
+ module Masthead
5
+ def self.version
6
+ %q{0.0.1}
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ require 'refinery'
2
+
3
+ module Refinery
4
+ module Mastheads
5
+ class Engine < Rails::Engine
6
+ config.after_initialize do
7
+ Refinery::Plugin.register do |plugin|
8
+ plugin.name = "mastheads"
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: refinerycms-masthead
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Envy Labs
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-10-26 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: CAT Mastheads engine for Refinery CMS
23
+ email: lab@envylabs.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - app/controllers/online_services_controller.rb
32
+ - app/views/online_services/header.html.erb
33
+ - app/views/online_services/show.html.erb
34
+ - config/locales/en.yml
35
+ - config/routes.rb
36
+ - lib/gemspec.rb
37
+ - lib/generators/refinerycms_masthead/templates/db/migrate/migration.rb
38
+ - lib/generators/refinerycms_masthead/templates/public/images/arrow_wht.gif
39
+ - lib/generators/refinerycms_masthead/templates/public/images/dealername-lockup_sm.jpg
40
+ - lib/generators/refinerycms_masthead/templates/public/javascripts/cat_frame.js
41
+ - lib/generators/refinerycms_masthead/templates/public/stylesheets/cat_frame.css
42
+ - lib/generators/refinerycms_masthead_generator.rb
43
+ - lib/masthead.rb
44
+ - lib/refinerycms-masthead.rb
45
+ has_rdoc: true
46
+ homepage: http://github.com/envylabs/refinerycms-masthead
47
+ licenses: []
48
+
49
+ post_install_message:
50
+ rdoc_options: []
51
+
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 3
60
+ segments:
61
+ - 0
62
+ version: "0"
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ hash: 3
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ requirements: []
73
+
74
+ rubyforge_project:
75
+ rubygems_version: 1.3.7
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: CAT Mastheads engine for Refinery CMS
79
+ test_files: []
80
+