Compare commits

..

No commits in common. "4efddc271d173b8af2b519d9b4197a91c123afee" and "7cece6bec47711d211d70e2c43de42f696a11ead" have entirely different histories.

35 changed files with 129 additions and 286 deletions

View File

@ -16,7 +16,7 @@ require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/postgresql'
#require 'capistrano/bower'
# TODO enable job scheduler require 'capistrano/delayed_job'
require 'capistrano/delayed_job'
# Includes tasks from other gems included in your Gemfile

10
Gemfile
View File

@ -38,7 +38,7 @@ group :development do
gem 'capistrano-nginx', github: 'koenpunt/capistrano-nginx'
gem "capistrano-db-tasks", require: false
gem "capistrano-postgresql" #, '~> 4.2.0'
# TODO enable job scheduler gem 'capistrano3-delayed-job', '~> 1.0'
gem 'capistrano3-delayed-job', '~> 1.0'
# required for ecdsa key
gem "bcrypt_pbkdf", require: false
gem "net-ssh", ">= 4.0.0", require: false
@ -84,8 +84,8 @@ gem 'importmap-rails'
gem 'turbo-rails'
gem 'stimulus-rails'
gem 'will_paginate'
# TODO enable telegram bots with job scheduler gem 'telegram-bot-ruby', '~> 1.0'
# TODO enable job scheduler gem 'delayed_job_active_record'
# TODO enable job scheduler gem 'daemons'
gem 'telegram-bot-ruby', '~> 1.0'
gem 'delayed_job_active_record'
gem 'daemons'
# TODO enable job scheduler gem "activejob-status", "~> 1.0"
gem "activejob-status", "~> 1.0"

View File

@ -60,6 +60,9 @@ GEM
activejob (7.1.2)
activesupport (= 7.1.2)
globalid (>= 0.3.6)
activejob-status (1.0.0)
activejob (>= 6.0)
activesupport (>= 6.0)
activemodel (7.1.2)
activesupport (= 7.1.2)
activerecord (7.1.2)
@ -123,6 +126,9 @@ GEM
capistrano-rbenv (2.2.0)
capistrano (~> 3.1)
sshkit (~> 1.3)
capistrano3-delayed-job (1.7.6)
capistrano (~> 3.0, >= 3.0.0)
daemons (~> 1.3)
capistrano3-puma (6.0.0.beta.1)
capistrano (~> 3.7)
capistrano-bundler
@ -156,6 +162,7 @@ GEM
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crass (1.0.6)
daemons (1.4.1)
database_cleaner (2.0.2)
database_cleaner-active_record (>= 2, < 3)
database_cleaner-active_record (2.1.0)
@ -164,6 +171,11 @@ GEM
database_cleaner-core (2.0.1)
date (3.3.4)
debug_inspector (1.1.0)
delayed_job (4.1.11)
activesupport (>= 3.0, < 8.0)
delayed_job_active_record (4.1.8)
activerecord (>= 3.0, < 8.0)
delayed_job (>= 3.0, < 5)
devise (4.9.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
@ -181,6 +193,25 @@ GEM
railties (>= 3.2)
drb (2.2.0)
ruby2_keywords
dry-core (1.0.1)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.0.0)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-struct (1.6.0)
dry-core (~> 1.0, < 2)
dry-types (>= 1.7, < 2)
ice_nine (~> 0.11)
zeitwerk (~> 2.6)
dry-types (1.7.1)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
ed25519 (1.3.0)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
@ -196,6 +227,13 @@ GEM
railties (>= 3.0.0)
faker (3.2.2)
i18n (>= 1.8.11, < 2)
faraday (2.7.12)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (3.0.2)
ffi (1.16.3)
formatador (1.1.0)
friendly_id (5.4.2)
@ -250,6 +288,7 @@ GEM
hub (1.12.4)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
importmap-rails (1.2.3)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
@ -294,6 +333,7 @@ GEM
mini_portile2 (2.8.5)
minitest (5.20.0)
multi_json (1.15.0)
multipart-post (2.3.0)
mutex_m (0.2.0)
nenv (0.3.0)
net-imap (0.4.7)
@ -493,6 +533,11 @@ GEM
stimulus-rails (1.3.0)
railties (>= 6.0.0)
stringio (3.1.0)
telegram-bot-ruby (1.0.0)
dry-struct (~> 1.6)
faraday (~> 2.0)
faraday-multipart (~> 1.0)
zeitwerk (~> 2.6)
temple (0.10.3)
thor (1.3.0)
tilt (2.3.0)
@ -525,6 +570,7 @@ PLATFORMS
x86_64-linux
DEPENDENCIES
activejob-status (~> 1.0)
bcrypt_pbkdf
better_errors
binding_of_caller
@ -536,12 +582,15 @@ DEPENDENCIES
capistrano-rails
capistrano-rails-console
capistrano-rbenv
capistrano3-delayed-job (~> 1.0)
capistrano3-puma (~> 6.0.beta)
capybara
capybara-screenshot
ci_reporter_rspec
coffee-rails
daemons
database_cleaner
delayed_job_active_record
devise
devise_invitable
dotenv-rails
@ -592,6 +641,7 @@ DEPENDENCIES
spring-commands-rspec
sprockets
stimulus-rails
telegram-bot-ruby (~> 1.0)
turbo-rails
webdrivers
will_paginate

View File

@ -1,6 +1,5 @@
//= link gems.js
//= link jquery.js
//= link libraries/swiped.min.js
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js

View File

@ -1 +0,0 @@
!function(){function t(t,e){document.addEventListener(t,function(t){a._elems.forEach(function(i){for(var n=t.target;n;){if(n===i.elem)return i[e](t),!1;n=n.parentNode}return!1})})}function e(){var t=[].shift.call(arguments),e=arguments[0];for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}var i=window.navigator.msPointerEnabled,n={start:i?"MSPointerDown":"touchstart",move:i?"MSPointerMove":"touchmove",end:i?"MSPointerUp":"touchend"},o=function(){var t=window.getComputedStyle(document.documentElement,""),e=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1];return"-"+e+"-"}(),s=function(){var t,e=document.createElement("fakeelement"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in i)if(void 0!==e.style[t])return i[t]}(),r={transition:o+"transition",transform:o+"transform"},h=function(){},a=function(t){var i={duration:200,tolerance:50,time:200,dir:1,right:0,left:0};t=e(i,t||{}),this.duration=t.duration,this.tolerance=t.tolerance,this.time=t.time,this.width=t.left||t.right,this.elem=t.elem,this.list=t.list,this.dir=t.dir,this.group=t.group,this.id=a.elemId++,this.onOpen="function"==typeof t.onOpen?t.onOpen:h,this.onClose="function"==typeof t.onClose?t.onClose:h,this.right=t.right,this.left=t.left,(t.right>0&&t.tolerance>t.right||t.left>0&&t.tolerance>t.left)&&console.warn("tolerance must be less then left and right")};a._elems=[],a.groupCounter=0,a.elemId=0,a.init=function(t){a.groupCounter++;var i=document.querySelectorAll(t.query),n=[];return delete t.query,[].forEach.call(i,function(i){var o=e({elem:i,group:a.groupCounter},t);n.push(new a(o))}),a._bindEvents(),a._elems=a._elems.concat(n),1===n.length?n[0]:n},a._closeAll=function(t){a._elems.forEach(function(e){e.group===t&&e.close(!0)})},a.prototype.transitionEnd=function(t,e){function i(){e.call(n),t.removeEventListener(s,i)}var n=this;t.addEventListener(s,i)},a.prototype.touchStart=function(t){var e=t.changedTouches[0];1===t.touches.length&&(this.touchId=e.identifier,this.x=e.pageX,this.y=e.pageY,this.startTime=new Date,this.resetValue(),this.list?a._closeAll(this.group):this.close(!0))},a.prototype.touchMove=function(t){var e=t.changedTouches[0];this.isValidTouch(t)&&(this.delta=e.pageX-this.x,this.dir=this.delta<0?-1:1,this.width=this.delta<0?this.right:this.left,this.defineUserAction(e),this.startSwipe&&(this.move(),t.preventDefault()))},a.prototype.touchEnd=function(t){this.isValidTouch(t,!0)&&this.startSwipe&&(this.dir*this.delta>this.tolerance||new Date-this.startTime<this.time?this.open():this.close(),t.stopPropagation(),t.preventDefault())},a.prototype.open=function(t){this.animation(this.dir*this.width),this.swiped=!0,t||this.transitionEnd(this.elem,this.onOpen),this.resetValue()},a.prototype.close=function(t){this.animation(0),this.swiped=!1,t||this.transitionEnd(this.elem,this.onClose),this.resetValue()},a.prototype.toggle=function(){this.swiped?this.close():this.open()},a.prototype.resetValue=function(){this.startSwipe=!1,this.startScroll=!1,this.delta=0},a._bindEvents=function(){return a.eventBinded?!1:(t(n.move,"touchMove"),t(n.end,"touchEnd"),t(n.start,"touchStart"),void(a.eventBinded=!0))},a.prototype.defineUserAction=function(t){var e=10,i=10;Math.abs(this.y-t.pageY)>i&&!this.startSwipe?this.startScroll=!0:Math.abs(this.delta)>e&&!this.startScroll&&(this.startSwipe=!0)},a.prototype.isValidTouch=function(t,e){var i=e?"changedTouches":"targetTouches";return t[i][0].identifier===this.touchId},a.prototype.move=function(){if(this.dir>0&&(this.delta<0||0===this.left)||this.dir<0&&(this.delta>0||0===this.right))return!1;var t=Math.abs(this.delta);t>this.width&&(this.delta=this.dir*(this.width+(t-this.width)/8)),this.animation(this.delta,0)},a.prototype.animation=function(t,e){e=void 0===e?this.duration:e,this.elem.style.cssText=r.transition+":"+r.transform+" "+e+"ms; "+r.transform+":translate3d("+t+"px, 0px, 0px)"},a.prototype.destroy=function(t){var e=this.id;a._elems.forEach(function(t,i){t.id===e&&a._elems.splice(i,1)}),t&&this.elem.parentNode.removeChild(this.elem)},window.Swiped=a}();

View File

@ -23,8 +23,7 @@ class BotsController < ApplicationController
def telegram_listen
authorize @bot
# TODO enable bots with job scheduler
# @bot.delay.telegram_listen
@bot.delay.telegram_listen
redirect_to request.referrer
end

View File

@ -1,5 +0,0 @@
class PagesController < ApplicationController
before_action :skip_authorization
def czechers
end
end

View File

@ -1,2 +0,0 @@
module PagesHelper
end

View File

@ -1 +1,2 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
import 'controllers'
import "@hotwired/turbo-rails"

View File

@ -21,7 +21,9 @@ class Play < ActiveRecord::Base
# TODO Pay out crypto
# pay icypees rewards
if !self.player.principal.nil?
player_wallet_balance = `dfx --identity 13rewards canister --network ic call es3he-kyaaa-aaaah-abzna-cai transfer '(principal "#{self.player.principal.strip}", 100000000:nat)'`
`dfx identity use 13rewards`
player_wallet_balance = `dfx canister --network ic call es3he-kyaaa-aaaah-abzna-cai transfer '(principal "#{self.player.principal.strip}", 100000000:nat)'`
`dfx identity use anonymous`
end
self.game.save

View File

@ -15,9 +15,11 @@ class Player < ActiveRecord::Base
if stp.principal.nil?
#TODO use principal
if !soft_token.nil?
if `dfx --identity #{soft_token} identity whoami; echo $?`.to_i == 255
if `dfx identity use #{soft_token}; echo $?`.to_i == 255
`dfx identity new #{soft_token} --disable-encryption`
@principal = `dfx --identity #{soft_token} identity get-principal`
`dfx identity use #{soft_token}`
@principal = `dfx identity get-principal`
`dfx identity use anonymous`
stp.principal = @principal
stp.save
end

View File

@ -3,21 +3,26 @@ class TelegramWallet < ActiveRecord::Base
return self.icp_principal if self.icp_principal
if self.icp_id.nil?
if !self.telegram_id.nil?
if `dfx --identity #{self.telegram_id} identity whoami; echo $?`.to_i == 255
if `dfx identity use #{self.telegram_id}; echo $?`.to_i == 255
`dfx identity new #{self.telegram_id} --storage-mode=plaintext`
self.icp_principal = `dfx --identity #{self.telegram_id} identity get-principal`.strip
self.icp_id = `dfx --identity #{self.telegram_id} ledger account-id`.strip
`dfx identity use #{self.telegram_id}`
self.icp_principal = `dfx identity get-principal`.strip
self.icp_id = `dfx ledger account-id`.strip
`dfx identity use anonymous`
self.save
else
# Identity already exist
self.icp_id = `dfx --identity #{self.telegram_id} ledger account-id`.strip
self.icp_principal = `dfx --identity #{self.telegram_id} identity get-principal`.strip
self.icp_id = `dfx ledger account-id`.strip
self.icp_principal = `dfx identity get-principal`.strip
`dfx identity use anonymous`
self.save
end
end
elsif
self.icp_id = `dfx --identity #{self.telegram_id} ledger account-id`.strip
self.icp_principal = `dfx --identity #{self.telegram_id} identity get-principal`.strip
`dfx identity use #{self.telegram_id}`
self.icp_id = `dfx ledger account-id`.strip
self.icp_principal = `dfx identity get-principal`.strip
`dfx identity use anonymous`
self.save
end
return self.icp_principal
@ -26,21 +31,26 @@ class TelegramWallet < ActiveRecord::Base
return self.icp_id if self.icp_id
if self.icp_principal.nil?
if !self.telegram_id.nil?
if `dfx --identity #{self.telegram_id} identity whoami; echo $?`.to_i == 255
if `dfx identity use #{self.telegram_id}; echo $?`.to_i == 255
`dfx identity new #{self.telegram_id} --storage-mode=plaintext`
self.icp_principal = `dfx --identity #{self.telegram_id} identity get-principal`.strip
self.icp_id = `dfx --identity #{self.telegram_id} ledger account-id`.strip
`dfx identity use #{self.telegram_id}`
self.icp_principal = `dfx identity get-principal`.strip
self.icp_id = `dfx ledger account-id`.strip
`dfx identity use anonymous`
self.save
else
# Identity already exist
self.icp_id = `dfx --identity #{self.telegram_id} ledger account-id`.strip
self.icp_principal = `dfx --identity #{self.telegram_id} identity get-principal`.strip
self.icp_id = `dfx ledger account-id`.strip
self.icp_principal = `dfx identity get-principal`.strip
`dfx identity use anonymous`
self.save
end
end
elsif
self.icp_id = `dfx --identity #{self.telegram_id} ledger account-id`.strip
self.icp_principal = `dfx --identity #{self.telegram_id} identity get-principal`.strip
`dfx identity use #{self.telegram_id}`
self.icp_id = `dfx ledger account-id`.strip
self.icp_principal = `dfx identity get-principal`.strip
`dfx identity use anonymous`
self.save
end
return self.icp_id

View File

@ -23,16 +23,20 @@ class User < ActiveRecord::Base
if stp.principal.nil?
#TODO use principal
if !soft_token.nil?
if `dfx --identity #{soft_token} identity whoami; echo $?`.to_i == 255
if `dfx identity use #{soft_token}; echo $?`.to_i == 255
`dfx identity new #{soft_token} --disable-encryption`
@principal = `dfx --identity #{soft_token} identity get-principal`
@icid = `dfx --identity #{soft_token} ledger account-id`
`dfx identity use #{soft_token}`
@principal = `dfx identity get-principal`
@icid = `dfx ledger account-id`
`dfx identity use anonymous`
stp.principal = @principal
stp.save
end
end
elsif
@icid = `dfx --identity #{soft_token} ledger account-id`
`dfx identity use #{soft_token}`
@icid = `dfx ledger account-id`
`dfx identity use anonymous`
end
return @icid.strip
end
@ -42,9 +46,11 @@ class User < ActiveRecord::Base
if stp.principal.nil?
#TODO use principal
if !soft_token.nil?
if `dfx --identity #{soft_token} identity whoami; echo $?`.to_i == 255
if `dfx identity use #{soft_token}; echo $?`.to_i == 255
`dfx identity new #{soft_token} --disable-encryption`
@principal = `dfx --identity #{soft_token} identity get-principal`
`dfx identity use #{soft_token}`
@principal = `dfx identity get-principal`
`dfx identity use anonymous`
stp.principal = @principal
stp.save
end
@ -54,7 +60,9 @@ class User < ActiveRecord::Base
end
def icp_balance
balance = `dfx --identity #{soft_token} ledger --network ic balance`
`dfx identity use #{soft_token}`
balance = `dfx ledger --network ic balance`
`dfx identity use anonymous`
return balance.strip
end

View File

@ -31,11 +31,11 @@ class MetapursePolicy
end
def show?
@user.admin? || @metapurse.user == @user || @metapurse.user == nil || @metapurse.is_private == false
true
end
def data?
@user.admin? || @metapurse.user == @user || @metapurse.user == nil || @metapurse.is_private == false
true
end
def create?
@ -55,7 +55,7 @@ class MetapursePolicy
end
def destroy?
@user.admin? || @metapurse.user == @user || @metapurse.user == nil
@user.admin? || @metapurse.user == @user
end
end

View File

@ -34,11 +34,11 @@ class TokenPolicy
end
def create?
@user.admin? || @user.signed_in?
@user.admin? || true
end
def new?
@user.admin? || @user.signed_in?
@user.admin? || true
end
def add_existing?

View File

@ -1,5 +1,5 @@
- if policy(doodad).show?
.doodad{class: "doodad-#{doodad.id}"}
.doodad
= doodad.body.html_safe
- if policy(doodad).edit?
= link_to 'Edit', edit_doodad_path(doodad)

View File

@ -1,7 +1,7 @@
.original_flash_message_code
- flash.each do |key, value|
%div{class: "alert alert-#{key}"}
= value.to_s.html_safe
= value.html_safe
.react_flash_messages
%div#flash_messages

View File

@ -7,27 +7,3 @@
.global-doodads
%h1 Global Doodads
= render collection: @global_doodads, partial: "doodads/doodad"
:javascript
function destroyDoodad(doodad_id) {
return fetch("/doodads/" + doodad_id, {
method: 'DELETE',
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
}
})
.then(response => response)
};
// var s2 = Swiped.init({ query: '.bar li', list: true, left: 200, right: 200 });
var global_doodad_swiped = Swiped.init({ query: '.global-doodads .doodad',
list: true,
left: 200,
right: 200,
onOpen: function() {
var doodad_id = this.elem.className.split("-")[1];
destroyDoodad(doodad_id)
.then(results => console.log(results));
this.destroy(true)
}
});

View File

@ -10,7 +10,6 @@
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'gems', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'libraries/swiped.min.js', 'data-turbolinks-track' => true %>
<%= javascript_importmap_tags %>
<%= csrf_meta_tags %>
<%= yield :head %>

View File

@ -15,7 +15,7 @@
%tr
%td
= link_to metapurse.name, metapurse
-# = "#{number_to_currency metapurse.total_usd} USD"
= "#{number_to_currency metapurse.total_usd} USD"
-# %td= metapurse.data
- if policy(metapurse).update?
-# %td= link_to 'Show', metapurse

View File

@ -31,7 +31,7 @@
$#{number_with_delimiter(value_amount)} USD
- total_value += value_amount rescue 0
- else
- value = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[-1].scan(/token0Price = [+-]?([1-9]\d*|0)(\.\d+)?/).join.to_f rescue nil
- value = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0].scan(/token0Price = [+-]?([1-9]\d*|0)(\.\d+)?/).join.to_f rescue nil
*
= "$#{value.round(2)}"
= icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0].scan(/token0Symbol = \"(.*)\"; /)[0][0] rescue nil

View File

@ -1,142 +0,0 @@
%h1{style: "padding-left: 0.5em;"} Czechers
:css
.board {
position: relative;
margin-top: 1em;
margin-bottom: 1em;
display: grid;
grid-template-columns: repeat(8, 80px);
grid-template-rows: repeat(8, 80px);
gap: 1px;
}
.cell {
width: 80px;
height: 80px;
background-color: white;
}
.cell:nth-child(2n+1):nth-child(-n+8),
.cell:nth-child(2n):nth-child(n+9):nth-child(-n+16),
.cell:nth-child(2n+1):nth-child(n+17):nth-child(-n+24),
.cell:nth-child(2n):nth-child(n+25):nth-child(-n+32),
.cell:nth-child(2n+1):nth-child(n+33):nth-child(-n+40),
.cell:nth-child(2n):nth-child(n+41):nth-child(-n+48),
.cell:nth-child(2n+1):nth-child(n+49):nth-child(-n+56),
.cell:nth-child(2n):nth-child(n+57):nth-child(-n+64) {
background-color: black;
}
.czecher-piece {
border-radius: 5em;
width: 50px;
outline: 2px #cccccc solid;
position: absolute;
z-index: 100;
}
.czecher-piece:active {
outline: 2px #00ffff solid;
}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 182px; top: 912px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 262px; top: 912px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 343px; top: 912px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 424px; top: 912px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 505px; top: 912px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 586px; top: 912px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 667px; top: 912px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 748px; top: 912px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 182px; top: 993px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 262px; top: 993px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 343px; top: 993px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 424px; top: 993px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 505px; top: 993px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 586px; top: 993px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 667px; top: 993px;"}
%img.czecher-piece{src:"/czech-logo-dip20.png", style: "left: 748px; top: 993px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 181px; top: 1480px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 261px; top: 1480px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 342px; top: 1480px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 423px; top: 1480px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 504px; top: 1480px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 585px; top: 1480px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 666px; top: 1480px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 747px; top: 1480px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 181px; top: 1399px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 261px; top: 1399px; outline: 2px #00ffff solid;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 342px; top: 1399px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 423px; top: 1399px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 504px; top: 1399px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 585px; top: 1399px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 666px; top: 1399px;"}
%img.czecher-piece{src:"/tendy-logo-icrc1.jpg", style: "left: 747px; top: 1399px;"}
.board
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell{style: "background: #EFFA8D;"}
.cell
.cell{style: "background: #EFFA8D;"}
.cell
.cell
.cell
.cell
.cell
.cell
.cell{style: "background: #B5FFFF;"}
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell
.cell

View File

@ -15,30 +15,6 @@
%p= link_to '+ New Doodad', new_doodad_path
= render @doodads
:javascript
function destroyDoodad(doodad_id) {
return fetch("/doodads/" + doodad_id, {
method: 'DELETE',
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
}
})
.then(response => response)
};
// var s2 = Swiped.init({ query: '.bar li', list: true, left: 200, right: 200 });
var index_doodad_swiped = Swiped.init({ query: '#doodads .doodad',
list: true,
left: 200,
right: 200,
onOpen: function() {
var doodad_id = this.elem.className.split("-")[1];
destroyDoodad(doodad_id)
.then(results => console.log(results));
this.destroy(true)
}
});
-# #canisters
= render @canisters
- if current_user.signed_in?

View File

@ -1,4 +0,0 @@
#!/usr/bin/env ruby
require_relative "../config/application"
require "importmap/commands"

View File

@ -1,7 +1,7 @@
require_relative "boot"
require "rails/all"
# TODO enable telegram bots with job scheduler require 'telegram/bot'
require 'telegram/bot'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
@ -20,6 +20,6 @@ module MyTendyZone
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
# TODO enable job scheduler config.active_job.queue_adapter = :delayed_job
config.active_job.queue_adapter = :delayed_job
end
end

View File

@ -1,5 +1,5 @@
set :application, "thirteen_tien_len_#{fetch(:stage)}"
set :repo_url, 'git@git.tendy.zone:Bort/thirteen-tien-len.git'
set :repo_url, 'git@pineapple.punked.us:Bort/thirteen-tien-len.git'
# If you want to import assets, you can change default asset dir (default = system)
# This directory must be in your shared directory on the server

View File

@ -1,3 +1,9 @@
# Pin npm packages by running ./bin/importmap
pin "application", preload: true
pin 'application', preload: true
pin 'jquery'
pin '@hotwired/turbo-rails', to: "turbo.js"
pin '@hotwired/stimulus', to: 'stimulus.min.js', preload: true
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js', preload: true
pin_all_from 'app/javascript/models', under: 'models'
pin_all_from 'app/javascript/controllers', under: 'controllers'
pin_all_from 'app/javascript/subscriptions', under: 'subscriptions'
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true

View File

@ -2,4 +2,4 @@
# Available options are: :status, :serialized_job, :exception
# Default is [:status]
#
# TODO enable job scheduler ActiveJob::Status.options = { includes: %i[status exception] }
ActiveJob::Status.options = { includes: %i[status exception] }

View File

@ -1,5 +1,4 @@
Rails.application.routes.draw do
get 'pages/czechers'
resources :metapurses do
member do
get 'data'

View File

@ -79,7 +79,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_25_142502) do
t.integer "sluggable_id", null: false
t.string "sluggable_type", limit: 50
t.string "scope"
t.datetime "created_at", precision: nil
t.datetime "created_at"
t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
t.index ["sluggable_type", "sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_type_and_sluggable_id"
@ -295,6 +295,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_25_142502) do
t.integer "invitations_count", default: 0
t.string "soft_token"
t.integer "win_count", default: 0
t.integer "points"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["invitation_token"], name: "index_users_on_invitation_token", unique: true
t.index ["invitations_count"], name: "index_users_on_invitations_count"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

View File

@ -1,15 +0,0 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the PagesHelper. For example:
#
# describe PagesHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe PagesHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@ -1,11 +0,0 @@
require 'rails_helper'
RSpec.describe "Pages", type: :request do
describe "GET /czechers" do
it "returns http success" do
get "/pages/czechers"
expect(response).to have_http_status(:success)
end
end
end

View File

@ -1,5 +0,0 @@
require 'rails_helper'
RSpec.describe "pages/czechers.html.haml", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end