help_popups 0.1.0
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/help_popups/application.js +15 -0
- data/app/assets/javascripts/help_popups/topics.js +2 -0
- data/app/assets/stylesheets/help_popups/application.css +118 -0
- data/app/assets/stylesheets/help_popups/topics.css +4 -0
- data/app/controllers/help_popups/application_controller.rb +7 -0
- data/app/controllers/help_popups/topics_controller.rb +44 -0
- data/app/helpers/help_popups/application_helper.rb +19 -0
- data/app/helpers/help_popups/topics_helper.rb +4 -0
- data/app/models/help_popups/topic.rb +9 -0
- data/app/views/help_popups/topics/_fields.html.erb +6 -0
- data/app/views/help_popups/topics/create.html.erb +2 -0
- data/app/views/help_popups/topics/edit.html.erb +18 -0
- data/app/views/help_popups/topics/index.html.erb +21 -0
- data/app/views/help_popups/topics/new.html.erb +7 -0
- data/app/views/help_popups/topics/update.html.erb +2 -0
- data/app/views/layouts/help_popups/application.html.erb +20 -0
- data/app/views/shared/_error_messages.html.erb +16 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20120723215704_create_help_popups_topics.rb +12 -0
- data/lib/help_popups.rb +5 -0
- data/lib/help_popups/engine.rb +5 -0
- data/lib/help_popups/version.rb +3 -0
- data/lib/tasks/help_popups_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/images/help_popup.gif +0 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/javascripts/pages.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +32 -0
- data/test/dummy/app/assets/stylesheets/pages.css +4 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/pages_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/pages_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/pages/test_popup.html.erb +3 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +6 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20120723220037_create_help_popups_topics.help_popups.rb +13 -0
- data/test/dummy/db/schema.rb +24 -0
- data/test/dummy/log/development.log +20206 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/functional/pages_controller_test.rb +7 -0
- data/test/dummy/test/unit/helpers/pages_helper_test.rb +4 -0
- data/test/dummy/tmp/cache/assets/BD9/A40/sprockets%2F8e900f061336c3827405212522a900a5 +0 -0
- data/test/dummy/tmp/cache/assets/C77/CD0/sprockets%2F38184fc0616ddd2221008a78d1541d87 +0 -0
- data/test/dummy/tmp/cache/assets/C78/D50/sprockets%2F6f9a447fc4535059c630c429a420f130 +0 -0
- data/test/dummy/tmp/cache/assets/C80/9A0/sprockets%2F574775a5e25504b59cf50eac33454444 +0 -0
- data/test/dummy/tmp/cache/assets/C9B/950/sprockets%2F1da2d09572227c31c0580f245f4a19b2 +0 -0
- data/test/dummy/tmp/cache/assets/C9D/280/sprockets%2F6fc85a549958e3997c3885c2a543b327 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CE1/4E0/sprockets%2F590098c179b26e2d041c42c6cbfd7934 +0 -0
- data/test/dummy/tmp/cache/assets/CF1/BC0/sprockets%2F07e3b61f967322698ef50f8851fbdc08 +0 -0
- data/test/dummy/tmp/cache/assets/CFE/D30/sprockets%2F1d89f06014250c36c27acc6b922d01fe +0 -0
- data/test/dummy/tmp/cache/assets/D0A/540/sprockets%2Fc0b233a75bdfc63f5324426663ce4d67 +0 -0
- data/test/dummy/tmp/cache/assets/D1E/2A0/sprockets%2F8d5d60255600aa010a32e1d1a9bc6db6 +0 -0
- data/test/dummy/tmp/cache/assets/D28/690/sprockets%2Fc457860ec1c19942e128d0340bcaba1a +0 -0
- data/test/dummy/tmp/cache/assets/D2A/450/sprockets%2F58e369b37e5157ea746a485eea17e9f7 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D39/9F0/sprockets%2F381d3623c411f2daf86b5f5e6a4f62a4 +0 -0
- data/test/dummy/tmp/cache/assets/D3D/600/sprockets%2Fef755eb9fa30652001fb26da6930d94e +0 -0
- data/test/dummy/tmp/cache/assets/D46/030/sprockets%2Fdd4b48bb0179349de8ee704139ac1c88 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D4F/610/sprockets%2F5e77831098fed6be282efdbc895c3501 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D63/E40/sprockets%2F57fe313a29742ea0aecf0202e636f7db +0 -0
- data/test/dummy/tmp/cache/assets/D67/F20/sprockets%2F35817f5b4cb7eaa4f9653ac033d07a4d +0 -0
- data/test/dummy/tmp/cache/assets/DA7/230/sprockets%2F7ae10239eda2588a95fdcc7d871bef52 +0 -0
- data/test/dummy/tmp/cache/assets/DCB/C20/sprockets%2F8668cc43bae0fbfa023eb81c98329afa +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DFB/380/sprockets%2F4abd1d90b9906bded34cff29ad5b0a87 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E04/8A0/sprockets%2Fe10b5f7ad33fe219e2dd459f71ccfbf9 +0 -0
- data/test/dummy/tmp/cache/assets/E05/F10/sprockets%2Fb3d9b0e88cdded276ebdce333e338a85 +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/fixtures/help_popups/topics.yml +13 -0
- data/test/functional/help_popups/topics_controller_test.rb +31 -0
- data/test/help_popups_test.rb +7 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/help_popups/topic_test.rb +9 -0
- data/test/unit/helpers/help_popups/topics_helper_test.rb +6 -0
- metadata +275 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2012 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'HelpPopups'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
Bundler::GemHelper.install_tasks
|
29
|
+
|
30
|
+
require 'rake/testtask'
|
31
|
+
|
32
|
+
Rake::TestTask.new(:test) do |t|
|
33
|
+
t.libs << 'lib'
|
34
|
+
t.libs << 'test'
|
35
|
+
t.pattern = 'test/**/*_test.rb'
|
36
|
+
t.verbose = false
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
task :default => :test
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require_tree .
|
@@ -0,0 +1,118 @@
|
|
1
|
+
/* Core HTML Tag Styles */
|
2
|
+
html, body{
|
3
|
+
font:13px 'ProximaNovaRgRegular', sans-serif !important;
|
4
|
+
color:#333;
|
5
|
+
height:92%; min-height:92%;
|
6
|
+
}
|
7
|
+
|
8
|
+
h1 {
|
9
|
+
color:#0000FF;
|
10
|
+
}
|
11
|
+
|
12
|
+
h2 {
|
13
|
+
font-size:20px;
|
14
|
+
text-decoration:underline;
|
15
|
+
}
|
16
|
+
|
17
|
+
label {
|
18
|
+
font-weight:bold;
|
19
|
+
vertical-align:top;
|
20
|
+
}
|
21
|
+
|
22
|
+
|
23
|
+
/* Core Custom Class Styles */
|
24
|
+
.main {
|
25
|
+
padding-left:20px;
|
26
|
+
}
|
27
|
+
|
28
|
+
.holderGray {
|
29
|
+
background:#e7e7e7;
|
30
|
+
border:1px solid #c6c6c6;
|
31
|
+
padding:10px;
|
32
|
+
border-radius:5px;
|
33
|
+
-moz-border-radius:5px;
|
34
|
+
-webkit-border-radius:5px;
|
35
|
+
box-shadow:0px 0px 5px rgba(0, 0, 0, 0.15) inset;
|
36
|
+
margin:5px 0;
|
37
|
+
}
|
38
|
+
|
39
|
+
.warning {
|
40
|
+
padding-left:10px;
|
41
|
+
border:1px solid #d4d4d4;
|
42
|
+
background:#FFDDDD;
|
43
|
+
border-radius:3px;
|
44
|
+
-moz-border-radius:3px;
|
45
|
+
-webkit-border-radius:3px;
|
46
|
+
color:#000;
|
47
|
+
box-shadow:0 0 3px rgba(0, 0, 0, 0.15) inner;
|
48
|
+
width:400px;
|
49
|
+
}
|
50
|
+
.warning .bullet, .warning ul li {
|
51
|
+
color:#f53a3a;
|
52
|
+
}
|
53
|
+
.field_with_errors {
|
54
|
+
display:inline;
|
55
|
+
color:#FF0000;
|
56
|
+
}
|
57
|
+
.redButton {
|
58
|
+
background: -moz-linear-gradient(top, #ff0000 0%, #DD0000 100%);
|
59
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff0000), color-stop(100%,#DD0000));
|
60
|
+
background: -webkit-linear-gradient(top, #ff0000 0%,#DD0000 100%);
|
61
|
+
background: -o-linear-gradient(top, #ff0000 0%,#DD0000 100%);
|
62
|
+
background: -ms-linear-gradient(top, #ff0000 0%,#DD0000 100%);
|
63
|
+
background: linear-gradient(top, #ff0000 0%,#DD0000 100%);
|
64
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff0000', endColorstr='#DD0000',GradientType=0 );
|
65
|
+
color:#FFFFFF;
|
66
|
+
border-radius:5px;
|
67
|
+
-moz-border-radius:5px;
|
68
|
+
-webkit-border-radius:5px;
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
/* Table styles */
|
73
|
+
table {
|
74
|
+
border:1px solid #C6C6C6;
|
75
|
+
border-right:none;
|
76
|
+
background:#FFF;
|
77
|
+
}
|
78
|
+
thead {
|
79
|
+
font-weight:bold;
|
80
|
+
box-shadow:1px 1px 5px rgba(255, 255, 255, 0.5) inset;
|
81
|
+
background: -moz-linear-gradient(top, #f1f1f1 0%, #e3e3e3 100%);
|
82
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f1f1f1), color-stop(100%,#e3e3e3));
|
83
|
+
background: -webkit-linear-gradient(top, #f1f1f1 0%,#e3e3e3 100%);
|
84
|
+
background: -o-linear-gradient(top, #f1f1f1 0%,#e3e3e3 100%);
|
85
|
+
background: -ms-linear-gradient(top, #f1f1f1 0%,#e3e3e3 100%);
|
86
|
+
background: linear-gradient(top, #f1f1f1 0%,#e3e3e3 100%);
|
87
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1', endColorstr='#e3e3e3',GradientType=0 );
|
88
|
+
|
89
|
+
|
90
|
+
}
|
91
|
+
thead tr td {
|
92
|
+
vertical-align:middle !important;
|
93
|
+
padding:4px;
|
94
|
+
border-bottom:1px solid #C6C6C6;
|
95
|
+
}
|
96
|
+
tr.odd {
|
97
|
+
background:#ffffee !important;
|
98
|
+
}
|
99
|
+
td {
|
100
|
+
border-right:1px solid #C6C6C6;
|
101
|
+
font-size:13px;
|
102
|
+
padding:4px;
|
103
|
+
border-bottom:1px solid #C6C6C6;
|
104
|
+
}
|
105
|
+
.clearfix:after {
|
106
|
+
content: ".";
|
107
|
+
display: block;
|
108
|
+
height: 0;
|
109
|
+
clear: both;
|
110
|
+
visibility: hidden;
|
111
|
+
}
|
112
|
+
.clearfix h3 {display:inline-block}
|
113
|
+
.fRight {
|
114
|
+
float:right;
|
115
|
+
}
|
116
|
+
.fLeft {
|
117
|
+
float:left;
|
118
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require_dependency "help_popups/application_controller"
|
2
|
+
|
3
|
+
module HelpPopups
|
4
|
+
class TopicsController < ApplicationController
|
5
|
+
def index
|
6
|
+
@topics = Topic.order(:title)
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@topic = Topic.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def create
|
14
|
+
@topic = Topic.new(params[:topic])
|
15
|
+
@topic.parent_id = -1
|
16
|
+
|
17
|
+
if (@topic.save)
|
18
|
+
redirect_to topics_path
|
19
|
+
else
|
20
|
+
render :new
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def edit
|
25
|
+
@topic = Topic.find(params[:id])
|
26
|
+
end
|
27
|
+
|
28
|
+
def update
|
29
|
+
@topic = Topic.find(params[:id])
|
30
|
+
|
31
|
+
if (@topic.update_attributes(params[:topic]))
|
32
|
+
redirect_to topics_path
|
33
|
+
else
|
34
|
+
render :edit
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def destroy
|
39
|
+
@topic = Topic.find(params[:id])
|
40
|
+
@topic.destroy
|
41
|
+
redirect_to topics_path
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module HelpPopups
|
2
|
+
module ApplicationHelper
|
3
|
+
def help_popup(topic_code)
|
4
|
+
@topic = Topic.where(:code => topic_code).first
|
5
|
+
return_html = "<div id='help_popup_" + topic_code + "' class='help_popup' style='display:none'>"
|
6
|
+
return_html = return_html + " <div style='border-bottom:1px solid #333333'>"
|
7
|
+
return_html = return_html + " <div style='float:left' class='help_popup_title'>" + @topic.title + "</div>"
|
8
|
+
return_html = return_html + " <div style='float:right'>"
|
9
|
+
return_html = return_html + " <a href='#' style='color:#FF0000;font-weight:bold;text-decoration:none' onclick='document.getElementById(\"help_popup_" + topic_code + "\").style.display=\"none\";'>X</a>"
|
10
|
+
return_html = return_html + " </div>"
|
11
|
+
return_html = return_html + " <div style='clear:both'></div>"
|
12
|
+
return_html = return_html + " </div>"
|
13
|
+
return_html = return_html + " <div class='help_popup_body'>" + @topic.body.html_safe + "</div>"
|
14
|
+
return_html = return_html + "</div>"
|
15
|
+
return_html = return_html + image_tag("help_popup.gif", :title => @topic.title, :style => "cursor:pointer", :onclick => "document.getElementById(\"help_popup_" + topic_code + "\").style.display=\"inline\";")
|
16
|
+
return_html.html_safe
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
|
2
|
+
<script type="text/javascript">bkLib.onDomLoaded(function () {nicEditors.allTextAreas()});</script>
|
3
|
+
|
4
|
+
<%= f.label :code, "Code:" %> <%= f.text_field :code, :size => 10 %><br/>
|
5
|
+
<%= f.label :title, "Title:" %> <%= f.text_field :title, :size => 30 %><br/>
|
6
|
+
<%= f.text_area :body, :rows => 7, :cols => 80 %><br/>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<script>
|
2
|
+
function deleteTopic(topic_id){
|
3
|
+
if (confirm("Are you sure you want to delete this help topic?")){
|
4
|
+
formObj = document.getElementById("deleteForm");
|
5
|
+
formObj.submit();
|
6
|
+
}
|
7
|
+
}
|
8
|
+
</script>
|
9
|
+
|
10
|
+
<%= form_for @topic do |f| %>
|
11
|
+
<h2>Editing Topic</h2>
|
12
|
+
<%= render 'shared/error_messages', :object => f.object %><br/>
|
13
|
+
<%= render 'fields', :f => f %>
|
14
|
+
<br/>
|
15
|
+
<%= f.submit "Edit Topic" %> <input type="button" class="redButton" value="Delete" onclick="deleteTopic(<%= @topic.id %>)"> <input type="button" value="Cancel" onclick="document.location='<%= topics_path %>'">
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= form_tag(topic_path, :method => :delete, :id => "deleteForm") %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% if @topics.count == 0 %>
|
2
|
+
<b>No Help Topics Defined!<b><br/>
|
3
|
+
Please click the link below to add one...<br/>
|
4
|
+
<% else %>
|
5
|
+
<table cellpadding=0 cellspacing=0 width="600">
|
6
|
+
<thead>
|
7
|
+
<td>Code</td>
|
8
|
+
<td>Title</td>
|
9
|
+
</thead>
|
10
|
+
<% trClass = "odd" %>
|
11
|
+
<% @topics.each do |topic| %>
|
12
|
+
<% if (trClass == "even") then trClass = "odd" else trClass = "even" end %>
|
13
|
+
<tr class="<%= trClass %>">
|
14
|
+
<td><%= link_to topic.code, edit_topic_path(topic) %></td>
|
15
|
+
<td><%= topic.title %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</table>
|
19
|
+
<% end %>
|
20
|
+
<br/>
|
21
|
+
<%= link_to "Add New Help Topic", new_topic_path %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%= form_for @topic do |f| %>
|
2
|
+
<h2>Adding New Topic</h2>
|
3
|
+
<%= render 'shared/error_messages', :object => f.object %><br/>
|
4
|
+
<%= render 'fields', :f => f %>
|
5
|
+
<br/>
|
6
|
+
<%= f.submit "Add Topic" %> <input type="button" value="Cancel" onclick="document.location='<%= topics_path %>'">
|
7
|
+
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Help Popups Admin</title>
|
5
|
+
<%= stylesheet_link_tag "help_popups/application", :media => "all" %>
|
6
|
+
<%= javascript_include_tag "help_popups/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<div class="holderGray">
|
12
|
+
<h1>Help Popups</h1>
|
13
|
+
</div>
|
14
|
+
<br/>
|
15
|
+
<div class="main">
|
16
|
+
<%= yield %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% if object.errors.any? %>
|
2
|
+
<div class="warning">
|
3
|
+
<h3>The following errors occurred:</h3>
|
4
|
+
<ul>
|
5
|
+
<% object.errors.full_messages.each do |msg| %>
|
6
|
+
<% if (msg == "Janrain can't be blank") then %>
|
7
|
+
<li>You must log in with Facebook, Twitter, or Google</li>
|
8
|
+
<% elsif (msg == "Janrain has already been taken") then %>
|
9
|
+
<li>You have already created an account associated with that social network. Please Sign in.</li>
|
10
|
+
<% else %>
|
11
|
+
<li><%= msg %></li>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
</ul>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
data/config/routes.rb
ADDED
data/lib/help_popups.rb
ADDED