gofundme link
This commit is contained in:
parent
1ccb6c8a6e
commit
9446de49d4
|
|
@ -0,0 +1,18 @@
|
||||||
|
ActiveAdmin.register JamRuby::GenericState, :as => 'GenericState' do
|
||||||
|
menu :parent => 'Operations'
|
||||||
|
|
||||||
|
config.clear_action_items!
|
||||||
|
filter :env
|
||||||
|
permit_params :top_message
|
||||||
|
|
||||||
|
actions :all, :except => [:destroy]
|
||||||
|
|
||||||
|
index do
|
||||||
|
selectable_column
|
||||||
|
column :env
|
||||||
|
actions
|
||||||
|
end
|
||||||
|
|
||||||
|
form :partial => 'form'
|
||||||
|
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<%= semantic_form_for([:admin, resource], :url => resource.new_record? ? admin_generic_states_path : "/admin/generic_states/#{resource.id}") do |f| %>
|
||||||
|
<%= f.semantic_errors *f.object.errors.keys %>
|
||||||
|
<%= f.inputs do %>
|
||||||
|
<%= f.input(:top_message, :input_html => {:maxlength => 10000, :rows=>10, :class => 'autogrow'}) %>
|
||||||
|
<% end %>
|
||||||
|
<%= f.actions %>
|
||||||
|
<% end %>
|
||||||
|
|
@ -393,4 +393,4 @@ store_backend_details_rate_session.sql
|
||||||
invited_user_receiver.sql
|
invited_user_receiver.sql
|
||||||
live_streams.sql
|
live_streams.sql
|
||||||
live_stream_notify.sql
|
live_stream_notify.sql
|
||||||
find_sessions_2020.sql
|
find_sessions_2020.sql
|
||||||
|
|
@ -31,4 +31,8 @@ CREATE TABLE arses (
|
||||||
active BOOLEAN DEFAULT TRUE,
|
active BOOLEAN DEFAULT TRUE,
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||||
);
|
);
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
ALTER TABLE generic_state ADD COLUMN top_message VARCHAR(100000);
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
module JamRuby
|
module JamRuby
|
||||||
class GenericState < ActiveRecord::Base
|
class GenericState < ActiveRecord::Base
|
||||||
|
|
||||||
|
|
||||||
|
attr_accessible :top_message, as: :admin
|
||||||
|
|
||||||
self.table_name = 'generic_state'
|
self.table_name = 'generic_state'
|
||||||
|
|
||||||
validates :env, :inclusion => {:in => ['development', 'staging', 'production', 'test']}
|
validates :env, :inclusion => {:in => ['development', 'staging', 'production', 'test']}
|
||||||
|
|
@ -31,6 +34,10 @@ module JamRuby
|
||||||
GenericState.singleton.bounce_check_at
|
GenericState.singleton.bounce_check_at
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.top_message
|
||||||
|
GenericState.singleton.top_message
|
||||||
|
end
|
||||||
|
|
||||||
def self.singleton
|
def self.singleton
|
||||||
GenericState.find('default')
|
GenericState.find('default')
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2697,6 +2697,20 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getConfigClient(options) {
|
||||||
|
|
||||||
|
if (!options) {
|
||||||
|
options = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: "/api/config/client?" + $.param(options),
|
||||||
|
dataType: "json",
|
||||||
|
contentType: 'application/json'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function createReview(options) {
|
function createReview(options) {
|
||||||
|
|
||||||
return $.ajax({
|
return $.ajax({
|
||||||
|
|
@ -3113,6 +3127,7 @@
|
||||||
this.updateOnboarding = updateOnboarding;
|
this.updateOnboarding = updateOnboarding;
|
||||||
this.findFriendSessions = findFriendSessions;
|
this.findFriendSessions = findFriendSessions;
|
||||||
this.findPublicSessions = findPublicSessions;
|
this.findPublicSessions = findPublicSessions;
|
||||||
|
this.getConfigClient = getConfigClient;
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
})(window, jQuery);
|
})(window, jQuery);
|
||||||
|
|
|
||||||
|
|
@ -239,15 +239,25 @@
|
||||||
|
|
||||||
var broadcastWidth = findCardLayout.width + feedCardLayout.width; //+ opts.gridPadding * 2;
|
var broadcastWidth = findCardLayout.width + feedCardLayout.width; //+ opts.gridPadding * 2;
|
||||||
|
|
||||||
layoutBroadcast(broadcastWidth, findCardLayout.left);
|
//layoutBroadcast(broadcastWidth, findCardLayout.left);
|
||||||
|
layoutTopMessage(broadcastWidth, findCardLayout.left)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
function layoutBroadcast(width, left) {
|
function layoutBroadcast(width, left) {
|
||||||
var css = {
|
var css = {
|
||||||
width:width + opts.gridPadding * 2,
|
width:width + opts.gridPadding * 2,
|
||||||
left:left
|
left:left
|
||||||
}
|
}
|
||||||
$('[data-react-class="BroadcastHolder"]').animate(css, opts.animationDuration)
|
$('[data-react-class="BroadcastHolder"]').animate(css, opts.animationDuration)
|
||||||
|
}*/
|
||||||
|
|
||||||
|
function layoutTopMessage(width, left) {
|
||||||
|
var css = {
|
||||||
|
width:width + opts.gridPadding * 2,
|
||||||
|
left:left
|
||||||
|
}
|
||||||
|
$('[data-react-class="TopMessageHolder"]').animate(css, opts.animationDuration)
|
||||||
}
|
}
|
||||||
|
|
||||||
function layoutSidebar(screenWidth, screenHeight) {
|
function layoutSidebar(screenWidth, screenHeight) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
context = window
|
||||||
|
ConfigStore = context.ConfigStore
|
||||||
|
|
||||||
|
ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
|
||||||
|
|
||||||
|
@TopMessageHolder = React.createClass(
|
||||||
|
{
|
||||||
|
displayName: 'Top Message Holder',
|
||||||
|
|
||||||
|
mixins: [Reflux.listenTo(ConfigStore, "onConfig")]
|
||||||
|
|
||||||
|
getInitialState: () ->
|
||||||
|
{}
|
||||||
|
|
||||||
|
onConfig: (configs) ->
|
||||||
|
|
||||||
|
if configs.top_message
|
||||||
|
@setState({top_message: configs.top_message})
|
||||||
|
|
||||||
|
componentDidUpdate:() ->
|
||||||
|
$root = $(this.getDOMNode())
|
||||||
|
context.JK.popExternalLinks($root)
|
||||||
|
return false
|
||||||
|
|
||||||
|
render: () ->
|
||||||
|
if @state.top_message
|
||||||
|
`<div id="broadcast-notification-holder" className="broadcast-notification-holder" >
|
||||||
|
<div className="broadcast-notification config" dangerouslySetInnerHTML={{__html:this.state.top_message}}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>`
|
||||||
|
else
|
||||||
|
return null
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
$ = jQuery
|
||||||
|
context = window
|
||||||
|
logger = context.JK.logger
|
||||||
|
rest = new context.JK.Rest()
|
||||||
|
|
||||||
|
@ConfigStore = Reflux.createStore(
|
||||||
|
{
|
||||||
|
top_message: null
|
||||||
|
|
||||||
|
#listenables: @ConfigActions
|
||||||
|
|
||||||
|
init: ->
|
||||||
|
this.listenTo(context.AppStore, this.onAppInit)
|
||||||
|
|
||||||
|
onAppInit: (@app) ->
|
||||||
|
setTimeout((() =>
|
||||||
|
rest.getConfigClient()
|
||||||
|
.done((response) =>
|
||||||
|
@top_message = response.top_message
|
||||||
|
@changed()
|
||||||
|
)
|
||||||
|
.fail((jqXHR) =>
|
||||||
|
console.log("failed to fetch config")
|
||||||
|
)
|
||||||
|
), 2000)
|
||||||
|
|
||||||
|
changed:() ->
|
||||||
|
@trigger({top_message: @top_message})
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-react-class="BroadcastHolder"] {
|
[data-react-class="BroadcastHolder"], [data-react-class="TopMessageHolder"] {
|
||||||
position:relative;
|
position:relative;
|
||||||
min-height: 125px;
|
min-height: 125px;
|
||||||
bottom: 60px;
|
bottom: 60px;
|
||||||
|
|
@ -31,6 +31,10 @@
|
||||||
@include border_box_sizing;
|
@include border_box_sizing;
|
||||||
|
|
||||||
|
|
||||||
|
&.config {
|
||||||
|
border-width:0;
|
||||||
|
}
|
||||||
|
|
||||||
&.lesson {
|
&.lesson {
|
||||||
p {
|
p {
|
||||||
text-align:center;
|
text-align:center;
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,17 @@ class ApiConfigsController < ApiController
|
||||||
websocket_gateway_uri: APP_CONFIG.websocket_gateway_uri,
|
websocket_gateway_uri: APP_CONFIG.websocket_gateway_uri,
|
||||||
websocket_gateway_uri_ssl: APP_CONFIG.websocket_gateway_uri_ssl
|
websocket_gateway_uri_ssl: APP_CONFIG.websocket_gateway_uri_ssl
|
||||||
}
|
}
|
||||||
|
|
||||||
render :json => configs, :status => 200
|
render :json => configs, :status => 200
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# should be nginx cached on 5 minutes
|
||||||
|
def client
|
||||||
|
configs =
|
||||||
|
{
|
||||||
|
top_message: GenericState.top_message
|
||||||
|
}
|
||||||
|
|
||||||
|
render :json => configs, :status => 200
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
<%= render "users/user_dropdown" %>
|
<%= render "users/user_dropdown" %>
|
||||||
|
|
||||||
<%= react_component 'BroadcastHolder', {is_guitar_center: @is_guitar_center} %>
|
<!--<%= react_component 'BroadcastHolder', {is_guitar_center: @is_guitar_center} %>-->
|
||||||
|
<%= react_component 'TopMessageHolder', {is_guitar_center: @is_guitar_center} %>
|
||||||
</div>
|
</div>
|
||||||
<!-- Templates -->
|
<!-- Templates -->
|
||||||
<script type="text/template" id="template-search-section">
|
<script type="text/template" id="template-search-section">
|
||||||
|
|
|
||||||
|
|
@ -684,7 +684,9 @@ Rails.application.routes.draw do
|
||||||
get '/versioncheck' => 'artifacts#versioncheck'
|
get '/versioncheck' => 'artifacts#versioncheck'
|
||||||
|
|
||||||
# discover websocket gateway info
|
# discover websocket gateway info
|
||||||
get '/config' => 'api_configs#index'
|
get '/config' => 'api_configs#index'
|
||||||
|
match '/config/client' => 'api_configs#client', :via => :get
|
||||||
|
|
||||||
|
|
||||||
# no-op method to see if server is running
|
# no-op method to see if server is running
|
||||||
get '/healthcheck' => 'artifacts#healthcheck'
|
get '/healthcheck' => 'artifacts#healthcheck'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue