mvpkit 1.0.4 → 1.1.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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/mvpkit.gemspec +135 -76
- data/project/.gitignore +43 -14
- data/project/Gemfile +7 -3
- data/project/Gemfile.lock +500 -0
- data/project/Procfile +1 -1
- data/project/app/assets/javascripts/application.js +5 -1
- data/project/app/assets/javascripts/cable.js +12 -0
- data/project/app/assets/javascripts/pack-compiled.js +37394 -0
- data/project/app/assets/javascripts/pack-compiled.js.map +1 -0
- data/project/app/assets/stylesheets/application.scss +3 -1
- data/project/app/assets/stylesheets/pack-compiled.css +33946 -0
- data/project/app/assets/stylesheets/pack-compiled.css.map +1 -0
- data/project/app/controllers/application_controller.rb +13 -4
- data/project/app/engines/admin/.gitignore +7 -0
- data/project/app/engines/admin/Gemfile +14 -0
- data/project/app/engines/admin/Gemfile.lock +118 -0
- data/project/app/engines/admin/MIT-LICENSE +20 -0
- data/project/app/engines/admin/README.md +28 -0
- data/project/app/engines/admin/Rakefile +37 -0
- data/project/app/engines/admin/admin.gemspec +22 -0
- data/project/app/engines/admin/app/assets/config/admin_manifest.js +2 -0
- data/project/app/engines/admin/app/assets/images/admin/.keep +0 -0
- data/project/app/engines/admin/app/assets/javascripts/admin/application.js +13 -0
- data/project/app/engines/admin/app/assets/stylesheets/admin/application.css +15 -0
- data/project/app/engines/admin/app/controllers/admin/application_controller.rb +5 -0
- data/project/app/engines/admin/app/controllers/admin/conversions_controller.rb +64 -0
- data/project/app/engines/admin/app/controllers/admin/users_controller.rb +62 -0
- data/project/app/engines/admin/app/helpers/admin/application_helper.rb +4 -0
- data/project/app/engines/admin/app/helpers/admin/conversions_helper.rb +4 -0
- data/project/app/engines/admin/app/helpers/admin/users_helper.rb +4 -0
- data/project/app/engines/admin/app/jobs/admin/application_job.rb +4 -0
- data/project/app/engines/admin/app/mailers/admin/application_mailer.rb +6 -0
- data/project/app/engines/admin/app/models/admin/application_record.rb +5 -0
- data/project/app/engines/admin/app/views/admin/conversions/_form.html.erb +11 -0
- data/project/app/engines/admin/app/views/admin/conversions/edit.html.erb +3 -0
- data/project/app/engines/admin/app/views/admin/conversions/index.html.erb +31 -0
- data/project/app/engines/admin/app/views/admin/conversions/new.html.erb +3 -0
- data/project/app/engines/admin/app/views/admin/conversions/show.html.erb +13 -0
- data/project/app/engines/admin/app/views/admin/users/_form.html.erb +22 -0
- data/project/app/engines/admin/app/views/admin/users/edit.html.erb +6 -0
- data/project/app/engines/admin/app/views/admin/users/index.html.erb +27 -0
- data/project/app/engines/admin/app/views/admin/users/new.html.erb +5 -0
- data/project/app/engines/admin/app/views/admin/users/show.html.erb +9 -0
- data/project/app/engines/admin/app/views/layouts/admin/_header.html.erb +21 -0
- data/project/app/engines/admin/app/views/layouts/admin/application.html.erb +5 -0
- data/project/app/engines/admin/bin/rails +13 -0
- data/project/app/engines/admin/config/routes.rb +6 -0
- data/project/app/engines/admin/lib/admin/engine.rb +5 -0
- data/project/app/engines/admin/lib/admin/version.rb +3 -0
- data/project/app/engines/admin/lib/admin.rb +5 -0
- data/project/app/engines/admin/lib/tasks/admin_tasks.rake +4 -0
- data/project/app/engines/admin/test/admin_test.rb +7 -0
- data/project/app/engines/admin/test/controllers/admin/conversions_controller_test.rb +52 -0
- data/project/app/engines/admin/test/controllers/admin/users_controller_test.rb +52 -0
- data/project/app/engines/admin/test/integration/navigation_test.rb +8 -0
- data/project/app/engines/admin/test/test_helper.rb +20 -0
- data/project/app/models/application_record.rb +3 -0
- data/project/app/models/conversion.rb +1 -2
- data/project/app/models/user.rb +6 -0
- data/project/app/views/layouts/_header.html.erb +17 -20
- data/project/app/views/static/internal_server_error.html.erb +1 -0
- data/project/app/views/static/not_found.html.erb +1 -0
- data/project/app/webpack/javascripts/lib/analytics.js +22 -0
- data/project/app/webpack/javascripts/lib/controllers.js +28 -0
- data/project/app/webpack/javascripts/lib/forms.js +28 -0
- data/project/app/webpack/javascripts/pack.js +11 -8
- data/project/app/webpack/stylesheets/config/variables.scss +1 -1
- data/project/app/webpack/stylesheets/skin/tables.scss +14 -0
- data/project/config/application.rb +2 -2
- data/project/config/initializers/devise.rb +277 -0
- data/project/config/initializers/stripe.rb +0 -7
- data/project/config/locales/devise.en.yml +64 -0
- data/project/config/routes.rb +2 -0
- data/project/db/migrate/2017000000000_add_uuid_pk_by_default.rb +5 -0
- data/project/db/migrate/20170415224839_create_conversions.rb +9 -0
- data/project/db/migrate/20170415225327_devise_create_users.rb +42 -0
- data/project/db/schema.rb +20 -3
- data/project/package.json +7 -7
- metadata +64 -5
- data/project/config/initializers/rails_admin.rb +0 -49
- data/project/db/migrate/20160728235100_create_conversions.rb +0 -9
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse">
|
|
2
|
+
<div class="container">
|
|
3
|
+
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
4
|
+
<span class="navbar-toggler-icon"></span>
|
|
5
|
+
</button>
|
|
6
|
+
<a class="navbar-brand" href="/">__PROJECT_NAME__ <span class="text-danger">Admin</span></a>
|
|
7
|
+
|
|
8
|
+
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
9
|
+
<ul class="navbar-nav mr-auto">
|
|
10
|
+
</ul>
|
|
11
|
+
<ul class="navbar-nav">
|
|
12
|
+
<li class="nav-item <%= 'active' if controller_name == 'conversions' %>">
|
|
13
|
+
<%= link_to 'Conversions', conversions_path, class: "nav-link" %>
|
|
14
|
+
</li>
|
|
15
|
+
<li class="nav-item <%= 'active' if controller_name == 'users' %>">
|
|
16
|
+
<%= link_to 'Users', users_path, class: "nav-link" %>
|
|
17
|
+
</li>
|
|
18
|
+
</ul>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</nav>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
|
3
|
+
# installed from the root of your application.
|
|
4
|
+
|
|
5
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
|
6
|
+
ENGINE_PATH = File.expand_path('../../lib/admin/engine', __FILE__)
|
|
7
|
+
|
|
8
|
+
# Set up gems listed in the Gemfile.
|
|
9
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
|
10
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
|
11
|
+
|
|
12
|
+
require 'rails/all'
|
|
13
|
+
require 'rails/engine/commands'
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module Admin
|
|
4
|
+
class ConversionsControllerTest < ActionDispatch::IntegrationTest
|
|
5
|
+
include Engine.routes.url_helpers
|
|
6
|
+
|
|
7
|
+
setup do
|
|
8
|
+
@conversion = admin_conversions(:one)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
test "should get index" do
|
|
12
|
+
get conversions_url
|
|
13
|
+
assert_response :success
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
test "should get new" do
|
|
17
|
+
get new_conversion_url
|
|
18
|
+
assert_response :success
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
test "should create conversion" do
|
|
22
|
+
assert_difference('Conversion.count') do
|
|
23
|
+
post conversions_url, params: { conversion: { email: @conversion.email } }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
assert_redirected_to conversion_url(Conversion.last)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
test "should show conversion" do
|
|
30
|
+
get conversion_url(@conversion)
|
|
31
|
+
assert_response :success
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
test "should get edit" do
|
|
35
|
+
get edit_conversion_url(@conversion)
|
|
36
|
+
assert_response :success
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
test "should update conversion" do
|
|
40
|
+
patch conversion_url(@conversion), params: { conversion: { email: @conversion.email } }
|
|
41
|
+
assert_redirected_to conversion_url(@conversion)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
test "should destroy conversion" do
|
|
45
|
+
assert_difference('Conversion.count', -1) do
|
|
46
|
+
delete conversion_url(@conversion)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
assert_redirected_to conversions_url
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module Admin
|
|
4
|
+
class UsersControllerTest < ActionDispatch::IntegrationTest
|
|
5
|
+
include Engine.routes.url_helpers
|
|
6
|
+
|
|
7
|
+
setup do
|
|
8
|
+
@user = admin_users(:one)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
test "should get index" do
|
|
12
|
+
get users_url
|
|
13
|
+
assert_response :success
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
test "should get new" do
|
|
17
|
+
get new_user_url
|
|
18
|
+
assert_response :success
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
test "should create user" do
|
|
22
|
+
assert_difference('User.count') do
|
|
23
|
+
post users_url, params: { user: { email: @user.email } }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
assert_redirected_to user_url(User.last)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
test "should show user" do
|
|
30
|
+
get user_url(@user)
|
|
31
|
+
assert_response :success
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
test "should get edit" do
|
|
35
|
+
get edit_user_url(@user)
|
|
36
|
+
assert_response :success
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
test "should update user" do
|
|
40
|
+
patch user_url(@user), params: { user: { email: @user.email } }
|
|
41
|
+
assert_redirected_to user_url(@user)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
test "should destroy user" do
|
|
45
|
+
assert_difference('User.count', -1) do
|
|
46
|
+
delete user_url(@user)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
assert_redirected_to users_url
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Configure Rails Environment
|
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
|
3
|
+
|
|
4
|
+
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
|
|
5
|
+
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
|
|
6
|
+
ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
|
|
7
|
+
require "rails/test_help"
|
|
8
|
+
|
|
9
|
+
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
|
10
|
+
# to be shown.
|
|
11
|
+
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# Load fixtures from the engine
|
|
15
|
+
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
|
16
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
|
17
|
+
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
|
|
18
|
+
ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "/files"
|
|
19
|
+
ActiveSupport::TestCase.fixtures :all
|
|
20
|
+
end
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div class="container">
|
|
3
|
+
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
4
|
+
<span class="navbar-toggler-icon"></span>
|
|
5
|
+
</button>
|
|
6
|
+
<a class="navbar-brand" href="/">__PROJECT_NAME__</a>
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</
|
|
18
|
-
</
|
|
19
|
-
<form class="form-inline my-2 my-lg-0">
|
|
20
|
-
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
|
21
|
-
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
|
22
|
-
</form>
|
|
8
|
+
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
9
|
+
<ul class="navbar-nav mr-auto">
|
|
10
|
+
</ul>
|
|
11
|
+
<ul class="navbar-nav">
|
|
12
|
+
<li class="nav-item">
|
|
13
|
+
<%= link_to 'Examples', examples_path, class: 'nav-link' %>
|
|
14
|
+
</li>
|
|
15
|
+
<li class="nav-item">
|
|
16
|
+
<%= link_to 'Admin', admin_path, class: 'nav-link' %>
|
|
17
|
+
</li>
|
|
18
|
+
</ul>
|
|
19
|
+
</div>
|
|
23
20
|
</div>
|
|
24
21
|
</nav>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>500 Server Error</h1>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>404 Not Found</h1>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
window.track = function(event, attributes, fn){
|
|
2
|
+
console.log("Track: " + event + " " + JSON.stringify(attributes))
|
|
3
|
+
|
|
4
|
+
if (is.fn(attributes)) fn = attributes, attributes = null;
|
|
5
|
+
if (is.undefined(attributes)) { attributes = {} }
|
|
6
|
+
if ($.cookie('invisible') == "true") {
|
|
7
|
+
if (!is.undefined(fn)) { fn() }
|
|
8
|
+
return
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var attrs = _.extend({
|
|
12
|
+
iteration: $('body').data('iteration')
|
|
13
|
+
}, attributes)
|
|
14
|
+
|
|
15
|
+
if (typeof(analytics) != 'undefined') {
|
|
16
|
+
analytics.track(event, attrs, fn);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (typeof(amplitude) != 'undefined') {
|
|
20
|
+
amplitude.getInstance().logEvent(event, attrs, fn);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
window.controllers = {}
|
|
2
|
+
|
|
3
|
+
let handler = function(){
|
|
4
|
+
var $body = $("body");
|
|
5
|
+
var controller = $body.data("controller").replace(/\//g, "_");
|
|
6
|
+
var action = $body.data("action");
|
|
7
|
+
|
|
8
|
+
var activeController = window.controllers[controller];
|
|
9
|
+
|
|
10
|
+
if (activeController !== undefined) {
|
|
11
|
+
if (window.env == "development") {
|
|
12
|
+
console.log("[Controllers] " + controller + "." + action + "()");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if ($.isFunction(activeController.init)) {
|
|
16
|
+
activeController.init();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if ($.isFunction(activeController[action])) {
|
|
20
|
+
activeController[action]();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
$(function(){
|
|
26
|
+
document.addEventListener("turbolinks:load", handler)
|
|
27
|
+
handler()
|
|
28
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const _ = require('lodash')
|
|
2
|
+
const is = require('is')
|
|
3
|
+
|
|
4
|
+
$(function(){
|
|
5
|
+
$('form.no-enter-submit').bind("keypress", function(e) {
|
|
6
|
+
if (e.keyCode == 13) {
|
|
7
|
+
e.preventDefault();
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
$('form.disable-on-submit').on('submit', function(e){
|
|
13
|
+
$(this).find(".btn").addClass('disabled')
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
// Submit forms when you command + enter on a textarea
|
|
18
|
+
// $(function(){
|
|
19
|
+
// // submit form on command + enter if in a textarea
|
|
20
|
+
// $(document).on('keydown', 'body', function(e) {
|
|
21
|
+
// if (!(e.keyCode == 13 && e.metaKey)) return;
|
|
22
|
+
//
|
|
23
|
+
// var $target = $(e.target);
|
|
24
|
+
// if ($target.is('textarea')) {
|
|
25
|
+
// $target.closest('form').submit();
|
|
26
|
+
// }
|
|
27
|
+
// });
|
|
28
|
+
// });
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
//
|
|
2
|
-
function requireAll(
|
|
3
|
-
|
|
1
|
+
// https://webpack.github.io/docs/context.html#require-context
|
|
2
|
+
function requireAll(requireContext) {
|
|
3
|
+
return requireContext.keys().map(requireContext);
|
|
4
|
+
}
|
|
4
5
|
|
|
5
6
|
window.$ = window.jQuery = require('jquery')
|
|
6
7
|
window._ = require('lodash')
|
|
7
8
|
window.is = require('is')
|
|
8
9
|
window.Mustache = require('mustache/mustache')
|
|
9
10
|
|
|
10
|
-
require('
|
|
11
|
+
require('jquery')
|
|
12
|
+
require('jquery-ujs')
|
|
13
|
+
require('js-cookie')
|
|
11
14
|
require('bootstrap/dist/js/bootstrap')
|
|
12
15
|
require('selectize/dist/js/selectize')
|
|
13
16
|
require('mustache')
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
requireAll(require.context("./lib", true, /\.js$/));
|
|
19
|
+
requireAll(require.context("./behaviors", true, /\.js$/));
|
|
20
|
+
requireAll(require.context("./controllers", true, /\.js$/));
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
$(function(){
|
|
20
23
|
// $('*[data-toggle="popover"]').popover()
|
|
21
24
|
// $('select').selectize()
|
|
22
25
|
$('[data-toggle="tooltip"]').tooltip()
|
|
@@ -18,7 +18,7 @@ $brand-info: #fff !default;
|
|
|
18
18
|
$brand-warning: $color-yellow;
|
|
19
19
|
$brand-danger: $color-orange;
|
|
20
20
|
|
|
21
|
-
$gray-dark: #001837 !default;
|
|
21
|
+
// $gray-dark: #001837 !default;
|
|
22
22
|
$gray: #55595c !default;
|
|
23
23
|
$gray-light: #818a91 !default;
|
|
24
24
|
$gray-lighter: #eceeef !default;
|
|
@@ -8,9 +8,9 @@ Bundler.require(*Rails.groups)
|
|
|
8
8
|
|
|
9
9
|
module Project
|
|
10
10
|
class Application < Rails::Application
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
config.active_record.primary_key = :uuid
|
|
13
12
|
config.active_record.raise_in_transactional_callbacks = true
|
|
13
|
+
|
|
14
14
|
config.generators do |g|
|
|
15
15
|
g.helper false
|
|
16
16
|
g.decorator false
|