diff --git a/admin/app/admin/news.rb b/admin/app/admin/news.rb new file mode 100644 index 000000000..996783c7a --- /dev/null +++ b/admin/app/admin/news.rb @@ -0,0 +1,6 @@ +ActiveAdmin.register JamRuby::News, :as => 'News' do + + menu :parent => 'Misc' + + +end diff --git a/db/manifest b/db/manifest index 4b8e8d681..d44b89a14 100755 --- a/db/manifest +++ b/db/manifest @@ -320,4 +320,5 @@ jam_tracks_bpm.sql jam_track_sessions.sql jam_track_sessions_v2.sql email_screening.sql -bounced_email_cleanup.sql \ No newline at end of file +bounced_email_cleanup.sql +news.sql \ No newline at end of file diff --git a/db/up/news.sql b/db/up/news.sql new file mode 100644 index 000000000..2eb981de8 --- /dev/null +++ b/db/up/news.sql @@ -0,0 +1,8 @@ +CREATE TABLE news ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + title VARCHAR NOT NULL, + body VARCHAR NOT NULL, + position INTEGER NOT NULL UNIQUE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file diff --git a/ruby/lib/jam_ruby.rb b/ruby/lib/jam_ruby.rb index fd91562ab..c9eb23ed4 100755 --- a/ruby/lib/jam_ruby.rb +++ b/ruby/lib/jam_ruby.rb @@ -236,6 +236,7 @@ require "jam_ruby/models/user_sync" require "jam_ruby/models/payment_history" require "jam_ruby/models/video_source" require "jam_ruby/models/text_message" +require "jam_ruby/models/news" require "jam_ruby/models/sale" require "jam_ruby/models/sale_line_item" require "jam_ruby/models/recurly_transaction_web_hook" diff --git a/ruby/lib/jam_ruby/models/news.rb b/ruby/lib/jam_ruby/models/news.rb new file mode 100644 index 000000000..0d126ad38 --- /dev/null +++ b/ruby/lib/jam_ruby/models/news.rb @@ -0,0 +1,14 @@ + +module JamRuby + class News < ActiveRecord::Base + + self.table_name = 'news' + + attr_accessible :title, :body, :position, as: :admin + default_scope { order('position') } + validates :title, presence: true + validates :body, presence: true + validates :position, presence: true, numericality: {only_integer: true}, uniqueness: true + + end +end diff --git a/web/app/assets/javascripts/react-components/landing/HomePage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/HomePage.js.jsx.coffee index 4f5c3e3da..03a886376 100644 --- a/web/app/assets/javascripts/react-components/landing/HomePage.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/landing/HomePage.js.jsx.coffee @@ -17,6 +17,17 @@ context = window alertify.alert("COMING SOON!"); render: () -> + + items = [] + + for item in gon.news + items.push(`
For technical support and help using our products and services, - please visit the JamKazam - Support Center.
- Partnerships - -For partnering inquiries, please contact us at: partners@jamkazam.com. -
- Media - -For inquiries from traditional media, bloggers, and others - interested in sharing news and information - about us with others, please visit the JamKazam Media - Center, and you may also contact us at pr@jamkazam.com. -
- Infringement - -To report content hosted on the JamKazam platform that that - infringes your copyright or the copyright of - a third party on whose behalf you are entitled to act, please - see the Reporting Infringements section of - the JamKazam Terms of Service.
- General - -For general inquiries, please contact us at: info@jamkazam.com. -
+ {news}