├── extensions ├── shop │ ├── static │ │ ├── p1.jpg │ │ ├── p2.jpg │ │ ├── p3.jpg │ │ ├── p4.jpg │ │ ├── p5.jpg │ │ ├── p6.jpg │ │ ├── logo.png │ │ ├── bg_flag.gif │ │ ├── favicon.ico │ │ ├── stars-5.png │ │ ├── uk_flag.gif │ │ └── style.css │ └── src │ │ ├── widget │ │ ├── checkout │ │ │ ├── Cart.css │ │ │ ├── PaymentMethodForm.js │ │ │ └── DeliveryMethodForm.js │ │ ├── header │ │ │ ├── RegBackgroundWithPicture.css │ │ │ ├── Logo.js │ │ │ ├── CallUs.js │ │ │ ├── Search.js │ │ │ ├── Error.js │ │ │ ├── Background.js │ │ │ ├── MiniCart.js │ │ │ └── ShopHeader.js │ │ ├── catalog │ │ │ ├── HorizontalNavigation.css │ │ │ ├── HorizontalNavigation.js │ │ │ ├── ProductAttributeFilter.js │ │ │ ├── ProductsGrid.js │ │ │ └── ProductDetail.js │ │ └── account │ │ │ ├── AccountOptions.js │ │ │ ├── Orders.js │ │ │ ├── RegisterForm.js │ │ │ ├── Addresses.js │ │ │ ├── Order.js │ │ │ └── AddressForm.js │ │ ├── controller │ │ ├── ChangeCountryController.lua │ │ ├── ChangeLanguageController.lua │ │ ├── checkout │ │ │ ├── AddToCartController.lua │ │ │ ├── UpdateProductEntryController.lua │ │ │ ├── CheckoutPageController.lua │ │ │ ├── CheckoutSetAddressController.lua │ │ │ ├── CheckoutSetPaymentMethodController.lua │ │ │ ├── CheckoutSetDeliveryMethodController.lua │ │ │ ├── CheckoutAddAddressController.lua │ │ │ ├── CheckoutConfirmationPageController.lua │ │ │ ├── CheckoutPlaceOrderController.lua │ │ │ └── CartPageController.lua │ │ ├── account │ │ │ ├── AccountRemoveAddressController.lua │ │ │ ├── AccountAddUpdateAddressController.lua │ │ │ ├── AccountPageController.lua │ │ │ ├── RegisterPageController.lua │ │ │ ├── LoginPageController.lua │ │ │ └── AccountOrderPageController.lua │ │ └── catalog │ │ │ └── ProductPageController.lua │ │ ├── filter │ │ ├── ShopThrowErrorOnSessionTimeoutFilter.lua │ │ └── ShopRedirectOnSessionTimeoutFilter.lua │ │ └── module │ │ ├── LocaleService.lua │ │ └── CountryService.lua ├── demo │ ├── static │ │ ├── box.jpg │ │ └── stars-5.png │ ├── src │ │ ├── widget │ │ │ ├── DemoFooter.js │ │ │ ├── DemoTemplate1.lua │ │ │ ├── DemoError.js │ │ │ ├── DemoTemplate2.lua │ │ │ ├── DemoHeader.js │ │ │ └── DemoProductDetail.js │ │ ├── controller │ │ │ ├── HelloWorldController.lua │ │ │ ├── IndexController.lua │ │ │ └── ProductDetailController.lua │ │ └── module │ │ │ └── DemoProductService.lua │ └── config.lua ├── editor │ ├── static │ │ ├── editor-favicon.ico │ │ └── search-favicon.ico │ └── src │ │ ├── widget │ │ ├── EditorHeader.css │ │ ├── CompareEditor.js │ │ ├── UploadResult.js │ │ ├── EditorNavigation.css │ │ ├── EditorSearchResult.js │ │ ├── CompareTabs.js │ │ ├── CompareHeader.js │ │ └── EditorSearchPopup.js │ │ ├── controller │ │ ├── EditorTemplate.css │ │ ├── operation │ │ │ ├── SaveController.lua │ │ │ ├── DirectoryController.lua │ │ │ ├── CreateFileController.lua │ │ │ ├── CreateDirectoryController.lua │ │ │ ├── RenameController.lua │ │ │ ├── RemoveController.lua │ │ │ └── FileContentController.lua │ │ ├── EditorDownloadFileController.lua │ │ ├── EditorSearchTemplate.js │ │ ├── EditorTemplate.js │ │ ├── EditorEditFileController.lua │ │ ├── EditorController.lua │ │ └── CompareController.lua │ │ ├── filter │ │ ├── EditorThrowErrorOnSessionTimeoutFilter.lua │ │ └── EditorRedirectOnSessionTimeoutFilter.lua │ │ └── module │ │ └── Directory.lua ├── database │ ├── src │ │ ├── widget │ │ │ ├── DatabaseHeader.css │ │ │ ├── DatabaseNavigation.css │ │ │ ├── DatabaseTabs.js │ │ │ ├── DatabaseEditor.js │ │ │ ├── DatabaseResult.js │ │ │ └── DatabaseNavigation.js │ │ ├── controller │ │ │ ├── DatabaseTemplate.css │ │ │ ├── DatabaseAddController.lua │ │ │ ├── DatabaseDeleteController.lua │ │ │ ├── DatabaseSaveController.lua │ │ │ ├── DatabaseTemplate.js │ │ │ ├── DatabaseExecuteController.lua │ │ │ ├── DatabaseDeleteAllReferencesController.lua │ │ │ ├── DatabaseEditController.lua │ │ │ ├── DatabaseDeleteReferenceController.lua │ │ │ ├── DatabaseController.lua │ │ │ └── DatabaseAddReferenceController.lua │ │ └── filter │ │ │ ├── DatabaseThrowErrorOnSessionTimeoutFilter.lua │ │ │ └── DatabaseRedirectOnSessionTimeoutFilter.lua │ └── static │ │ └── database-favicon.ico ├── baseline │ ├── static │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ └── js │ │ │ ├── init-shop.js │ │ │ ├── init-baseline.js │ │ │ ├── html5shiv.js │ │ │ └── jquery.pretty-text-diff.js │ ├── src │ │ ├── widget │ │ │ ├── popup │ │ │ │ ├── InfoPopup.js │ │ │ │ ├── Popup.js │ │ │ │ ├── QuestionPopup.js │ │ │ │ ├── Popup.css │ │ │ │ ├── OneFieldPopup.js │ │ │ │ ├── TwoFieldsPopup.js │ │ │ │ └── ThreeFieldsPopup.js │ │ │ └── nav.css │ │ └── BaselineHtmlTemplate.lua │ └── config.lua ├── repository │ ├── static │ │ └── repository-favicon.ico │ └── src │ │ ├── controller │ │ ├── RepositoryTemplate.js │ │ ├── operation │ │ │ ├── UpdateController.lua │ │ │ ├── AddController.lua │ │ │ ├── DeleteController.lua │ │ │ ├── RefreshController.lua │ │ │ ├── MergeController.lua │ │ │ ├── RevertController.lua │ │ │ ├── FileRevisionContentController.lua │ │ │ ├── FileDiffController.lua │ │ │ └── CommitController.lua │ │ ├── RepositoryTemplate.css │ │ └── RepositoryLogHistoryController.lua │ │ └── widget │ │ ├── RepositoryLog.js │ │ ├── RepositoryPatch.js │ │ ├── RepositoryDiff.js │ │ ├── RepositoryFileHistoryNavigation.js │ │ └── RepositoryStatusNavigation.js ├── core │ ├── src │ │ ├── exit.lua │ │ ├── database.lua │ │ ├── resty │ │ │ ├── sha.lua │ │ │ ├── README.md │ │ │ ├── sha1.lua │ │ │ ├── resty.sh │ │ │ ├── sha256.lua │ │ │ └── md5.lua │ │ ├── param.lua │ │ ├── stacktrace.lua │ │ ├── rocky │ │ │ └── typedef.lua │ │ ├── exception.lua │ │ ├── eval.lua │ │ ├── template.lua │ │ └── http_headers.lua │ └── config.lua ├── orm │ └── config.lua ├── security │ ├── src │ │ ├── controller │ │ │ ├── SecurityRegisterPageController.lua │ │ │ ├── SecurityLoginUserController.lua │ │ │ ├── SecurityLoginPageController.lua │ │ │ └── SecurityRegisterUserController.lua │ │ ├── widget │ │ │ ├── LoginForm.js │ │ │ └── RegisterForm.js │ │ ├── types.lua │ │ └── import.lua │ └── config.lua └── config.lua ├── .gitignore ├── bin ├── unix │ ├── octopus.service │ └── ssl_certificate │ │ ├── server.crt │ │ └── server.key └── autowire.lua ├── LICENSE.txt └── CREDITS.txt /extensions/shop/static/p1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/p1.jpg -------------------------------------------------------------------------------- /extensions/shop/static/p2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/p2.jpg -------------------------------------------------------------------------------- /extensions/shop/static/p3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/p3.jpg -------------------------------------------------------------------------------- /extensions/shop/static/p4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/p4.jpg -------------------------------------------------------------------------------- /extensions/shop/static/p5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/p5.jpg -------------------------------------------------------------------------------- /extensions/shop/static/p6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/p6.jpg -------------------------------------------------------------------------------- /extensions/demo/static/box.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/demo/static/box.jpg -------------------------------------------------------------------------------- /extensions/shop/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/logo.png -------------------------------------------------------------------------------- /extensions/demo/static/stars-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/demo/static/stars-5.png -------------------------------------------------------------------------------- /extensions/shop/static/bg_flag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/bg_flag.gif -------------------------------------------------------------------------------- /extensions/shop/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/favicon.ico -------------------------------------------------------------------------------- /extensions/shop/static/stars-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/stars-5.png -------------------------------------------------------------------------------- /extensions/shop/static/uk_flag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/shop/static/uk_flag.gif -------------------------------------------------------------------------------- /extensions/editor/static/editor-favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/editor/static/editor-favicon.ico -------------------------------------------------------------------------------- /extensions/editor/static/search-favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/editor/static/search-favicon.ico -------------------------------------------------------------------------------- /extensions/database/src/widget/DatabaseHeader.css: -------------------------------------------------------------------------------- 1 | #dbmenu { 2 | color: {{baseline_color2}}; 3 | } 4 | 5 | .hand { 6 | cursor: pointer; 7 | } -------------------------------------------------------------------------------- /extensions/database/static/database-favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/database/static/database-favicon.ico -------------------------------------------------------------------------------- /extensions/baseline/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/baseline/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /extensions/repository/static/repository-favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/repository/static/repository-favicon.ico -------------------------------------------------------------------------------- /extensions/baseline/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/baseline/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /extensions/baseline/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/baseline/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /extensions/baseline/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/baseline/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /extensions/baseline/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strumasoft/octopus/HEAD/extensions/baseline/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /extensions/shop/src/widget/checkout/Cart.css: -------------------------------------------------------------------------------- 1 | input.quantity { display: inline; width: 60px !important; text-align: center; } .inline { display: inline; } -------------------------------------------------------------------------------- /extensions/shop/src/controller/ChangeCountryController.lua: -------------------------------------------------------------------------------- 1 | local param = require "param" 2 | local countryService = require "countryService" 3 | 4 | 5 | countryService.setCountry(param.country) -------------------------------------------------------------------------------- /extensions/shop/src/controller/ChangeLanguageController.lua: -------------------------------------------------------------------------------- 1 | local param = require "param" 2 | local localeService = require "localeService" 3 | 4 | 5 | localeService.setLocale(param.locale) -------------------------------------------------------------------------------- /extensions/editor/src/widget/EditorHeader.css: -------------------------------------------------------------------------------- 1 | #menu { 2 | color: {{baseline_color2}}; 3 | } 4 | 5 | #menu.dark { 6 | color: {{baseline_color1}}; 7 | } 8 | 9 | .hand { 10 | cursor: pointer; 11 | } -------------------------------------------------------------------------------- /extensions/database/src/widget/DatabaseNavigation.css: -------------------------------------------------------------------------------- 1 | .database { 2 | color: {{baseline_color2}}; 3 | cursor: pointer; 4 | } 5 | 6 | ul.no-bullets 7 | { 8 | list-style-type: none; 9 | padding-left: 0em; 10 | margin: 0em; 11 | } 12 | 13 | .nowrap { 14 | white-space: nowrap; 15 | } -------------------------------------------------------------------------------- /extensions/editor/src/controller/EditorTemplate.css: -------------------------------------------------------------------------------- 1 | #main { 2 | padding: 1em 0; 3 | } 4 | 5 | #directoryNavigation { 6 | overflow-x: scroll; 7 | margin-right: 8px; 8 | } 9 | 10 | #editorArea { 11 | padding: 0; 12 | } 13 | 14 | #editorSearchArea.editorSearchWrapper { 15 | padding: 0; 16 | } -------------------------------------------------------------------------------- /extensions/core/src/exit.lua: -------------------------------------------------------------------------------- 1 | return function (err, status) 2 | ngx.status = status or ngx.HTTP_INTERNAL_SERVER_ERROR 3 | 4 | if type(err) == "table" then 5 | local json = require "json" 6 | ngx.say(json.encode(err)) 7 | elseif err then 8 | ngx.say(err) 9 | end 10 | 11 | return ngx.exit(ngx.HTTP_OK) 12 | end -------------------------------------------------------------------------------- /extensions/shop/src/widget/header/RegBackgroundWithPicture.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #d50911; 3 | background-image: none; 4 | background-position: center 0px; 5 | padding-top: 0px; 6 | } 7 | body { 8 | background: #d50911 url(http://s1emagst.akamaized.net/layout/bg/images/db/5/7619.jpg) center 0px no-repeat; 9 | } -------------------------------------------------------------------------------- /extensions/core/src/database.lua: -------------------------------------------------------------------------------- 1 | local property = require "property" 2 | local luaorm = require "rocky.luaorm" 3 | local types = require "type" 4 | 5 | local opts = {types = types} 6 | for k,v in pairs(property.databaseConnection) do opts[k] = v end 7 | 8 | return { 9 | connect = function () 10 | return luaorm.connect(opts) 11 | end 12 | } 13 | -------------------------------------------------------------------------------- /extensions/core/src/resty/sha.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) by Yichun Zhang (agentzh) 2 | 3 | 4 | local ffi = require "ffi" 5 | 6 | 7 | local _M = { _VERSION = '0.14' } 8 | 9 | 10 | ffi.cdef[[ 11 | typedef unsigned long SHA_LONG; 12 | typedef unsigned long long SHA_LONG64; 13 | 14 | enum { 15 | SHA_LBLOCK = 16 16 | }; 17 | ]]; 18 | 19 | return _M 20 | -------------------------------------------------------------------------------- /extensions/shop/src/widget/catalog/HorizontalNavigation.css: -------------------------------------------------------------------------------- 1 | /* menu */ ul.menu2 { list-style-type: none; margin: 0px 0px 19px 0px; padding: 0; } li.menu2 { display: inline; background: #36c2b9; padding: 13px 13px 13px 13px; margin: 0px -3px 0px 0px; } a.menu2 { text-decoration: none !important; color: white; /* border: 4px solid red; */ } -------------------------------------------------------------------------------- /extensions/core/src/param.lua: -------------------------------------------------------------------------------- 1 | local util = require "util" 2 | 3 | 4 | local m = {} -- module 5 | 6 | setmetatable(m, { 7 | __index = function (table, key) 8 | local x = ngx.var["arg_" .. key] 9 | if x then 10 | return util.unescape(x) 11 | else 12 | return nil 13 | end 14 | end 15 | } 16 | ) 17 | 18 | return m -- return module -------------------------------------------------------------------------------- /extensions/editor/src/widget/CompareEditor.js: -------------------------------------------------------------------------------- 1 | Widget.CompareEditor = function (data) { 2 | var editor = new Widget.Editor(data) 3 | 4 | editor.html = parse(function(){/*! 5 |
9 |
10 | free call orders 24/24h
13 |
16 | db:dropAllTables()
17 | db:createAllTables()
18 | db:import("shopImport")
19 |
20 | use the following credentials - username 'test@test.com' and password 'test'
21 |
22 | ]])
--------------------------------------------------------------------------------
/extensions/editor/src/controller/EditorDownloadFileController.lua:
--------------------------------------------------------------------------------
1 | local param = require "param"
2 | local exit = require "exit"
3 | local util = require "util"
4 | local editor = require "Editor"
5 |
6 |
7 |
8 | ngx.header.content_type = 'application/octet-stream'
9 |
10 |
11 | local function process ()
12 | local fileName = param.f
13 |
14 | local paths = util.split(fileName, "/")
15 | local name = paths[#paths]
16 | ngx.header["Content-Disposition"] = 'attachment; filename="' .. name .. '"'
17 |
18 | return editor.fileContent(fileName)
19 | end
20 |
21 |
22 | local ok, res = pcall(process)
23 | if ok then
24 | if res then ngx.say(res) end
25 | else
26 | exit(res)
27 | end
--------------------------------------------------------------------------------
/extensions/database/src/controller/DatabaseDeleteController.lua:
--------------------------------------------------------------------------------
1 | local json = require "json"
2 | local param = require "param"
3 | local exit = require "exit"
4 | local database = require "database"
5 |
6 |
7 | local instancesToDelete = json.decode(ngx.req.get_body_data())
8 |
9 |
10 | local db = database.connect()
11 | local op = db:operators()
12 |
13 | local function f ()
14 | for i=1,#instancesToDelete do
15 | db:delete({[instancesToDelete[i].type] = {id = instancesToDelete[i].id}})
16 | end
17 | end
18 |
19 | local ok, res = pcall(db.transaction, db, f)
20 | db:close()
21 |
22 |
23 | if ok then
24 | ngx.say("Delete done!")
25 | else
26 | exit(res)
27 | end
--------------------------------------------------------------------------------
/extensions/repository/src/widget/RepositoryLog.js:
--------------------------------------------------------------------------------
1 | Widget.RepositoryLog = function () {
2 | var data = {}
3 | if (localStorage.getItem("isDark") === "true") {
4 | data.clazz = "dark";
5 | }
6 |
7 | this.data = data
8 | this.html = parse(function(){/*!
9 | ' 24 | + Widget.decoratePatch(Widget.createHTML(contents[i])) 25 | + "
| 25 | 31 | 32 | | 33 |
17 |
18 | 1 Reviews |
19 | Write a review
20 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit
50 || Picture | 19 |Name | 20 |Unit Price | 21 |Quantity | 22 |Total Price | 23 |
|---|---|---|---|---|
|
29 |
30 | |
33 | {{cart.productEntries[i].product.name[0].content}} | 34 |35 | {{cart.productEntries[i].unitPrice}} 36 | | 37 |38 | {{cart.productEntries[i].quantity}} 39 | | 40 |41 | {{cart.productEntries[i].totalPrice}} 42 | | 43 |
| 49 | | 50 | Net Price: {{cart.totalNetPrice}} 51 | | 52 ||||
| 55 | | 56 | VAT: {{cart.totalVAT}} 57 | | 58 ||||
| 61 | | 62 | Gross Price: {{cart.totalGrossPrice}} 63 | | 64 ||||
20 |
21 | 1 Reviews |
22 | Write a review
23 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit
53 |