scriptorium 0.0.3 → 0.6.1
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/README.lt3 +324 -0
- data/README.md +3155 -1
- data/assets/.DS_Store +0 -0
- data/assets/README.md +44 -0
- data/assets/back-icon.png +0 -0
- data/assets/icons/facebook.svg +1 -0
- data/assets/icons/github.svg +1 -0
- data/assets/icons/instagram.svg +1 -0
- data/assets/icons/reddit.svg +1 -0
- data/assets/icons/ui/.DS_Store +0 -0
- data/assets/icons/ui/back.png +0 -0
- data/assets/icons/ui/copy.png +0 -0
- data/assets/icons/ui/down.png +0 -0
- data/assets/icons/ui/end.png +0 -0
- data/assets/icons/ui/exit.png +0 -0
- data/assets/icons/ui/foo +10 -0
- data/assets/icons/ui/home.png +0 -0
- data/assets/icons/ui/left.png +0 -0
- data/assets/icons/ui/next.png +0 -0
- data/assets/icons/ui/right.png +0 -0
- data/assets/icons/ui/start.png +0 -0
- data/assets/icons/ui/up.png +0 -0
- data/assets/icons/x.svg +1 -0
- data/assets/icons/youtube.svg +1 -0
- data/assets/samples/placeholder.svg +9 -0
- data/assets/themes/standard/favicon.svg +6 -0
- data/bin/scriptorium +1511 -0
- data/doc/README.txt +6 -0
- data/doc/anti-amnesia/20250727-054000-scriptorium-overview.md +95 -0
- data/doc/anti-amnesia/20250727-060000-api-design-tui-planning.md +34 -0
- data/doc/anti-amnesia/20250727-061000-runeblog-tui-analysis.md +50 -0
- data/doc/anti-amnesia/20250727-123000-anti-amnesia-conventions.md +31 -0
- data/doc/anti-amnesia/20250727-154000-livetext-plugin-file-stats.md +73 -0
- data/doc/anti-amnesia/20250727-172600-cursor-rbenv-ruby-version-mystery.md +64 -0
- data/doc/anti-amnesia/20250727-172600-unified-minitest-framework.md +70 -0
- data/doc/anti-amnesia/20250727-172900-ai-cognitive-assessment-capabilities.md +40 -0
- data/doc/anti-amnesia/20250727-173000-widget-testing-achievement.md +110 -0
- data/doc/anti-amnesia/20250727-180000-post-id-num-refactoring.md +73 -0
- data/doc/anti-amnesia/20250728-124243-aaa-syntax-clarification.md +46 -0
- data/doc/anti-amnesia/20250728-124421-conversation-summary-concise.md +124 -0
- data/doc/anti-amnesia/20250729-190000-scriptorium-tui-testing-complete.md +46 -0
- data/doc/anti-amnesia/20250729-200000-scriptorium-tui-testing-edit-file-workflow.md +97 -0
- data/doc/anti-amnesia/20250729-210000-reddit-autopost-integration-complete.md +158 -0
- data/doc/anti-amnesia/20250729-211500-dependency-management-system.md +211 -0
- data/doc/anti-amnesia/20250729-213000-python-virtual-environment-setup.md +141 -0
- data/doc/anti-amnesia/20250729-214500-theme-management-commands.md +211 -0
- data/doc/anti-amnesia/20250729-215000-version-update-to-0.6.0.md +134 -0
- data/doc/anti-amnesia/20250729-220000-user-guide-complete.md +41 -0
- data/doc/anti-amnesia/20250804-190500-cognitive-loop-bug.md +45 -0
- data/doc/anti-amnesia/20250804-190700-anti-amnesia-timestamping-fix.md +30 -0
- data/doc/anti-amnesia/20250804-213700-publishing-test-fix.md +49 -0
- data/doc/anti-amnesia/20250804-214400-additional-test-fixes.md +46 -0
- data/doc/anti-amnesia/20250804-220000-asset-function-logic-clarification.md +41 -0
- data/doc/anti-amnesia/20250806-202032-asset-function-logic-clarification.md +41 -0
- data/doc/anti-amnesia/20250807-213025.md +116 -0
- data/doc/anti-amnesia/20250813-082428-syntax-highlighting-and-navigation-improvements.md +256 -0
- data/doc/banner_svg_config.md +114 -0
- data/doc/contrib.lt3 +8 -0
- data/doc/dependencies.md +281 -0
- data/doc/hacker.lt3 +5 -0
- data/doc/reddit_credentials_template.json +8 -0
- data/doc/reddit_integration.md +207 -0
- data/doc/user.lt3 +38 -0
- data/doc/user_guide_section_1.md +137 -0
- data/doc/user_guide_section_10.md +515 -0
- data/doc/user_guide_section_11.md +708 -0
- data/doc/user_guide_section_2.md +233 -0
- data/doc/user_guide_section_3.md +5 -0
- data/doc/user_guide_section_4.md +221 -0
- data/doc/user_guide_section_5.md +243 -0
- data/doc/user_guide_section_6.md +147 -0
- data/doc/user_guide_section_7.md +311 -0
- data/doc/user_guide_section_8.md +224 -0
- data/doc/user_guide_section_9.md +375 -0
- data/doc/userdoc-toc.txt +88 -0
- data/lib/rouge/lexers/livetext.rb +74 -0
- data/lib/scriptorium/api.rb +640 -0
- data/lib/scriptorium/banner_svg.rb +742 -0
- data/lib/scriptorium/contract.rb +33 -0
- data/lib/scriptorium/exceptions.rb +170 -1
- data/lib/scriptorium/helpers.rb +475 -0
- data/lib/scriptorium/post.rb +195 -0
- data/lib/scriptorium/reddit.rb +83 -0
- data/lib/scriptorium/repo.rb +624 -0
- data/lib/scriptorium/standard_files.rb +515 -0
- data/lib/scriptorium/syntax_highlighter.rb +234 -0
- data/lib/scriptorium/theme.rb +179 -0
- data/lib/scriptorium/version.rb +2 -2
- data/lib/scriptorium/view.rb +976 -0
- data/lib/scriptorium/widgets/featured_posts.rb +149 -0
- data/lib/scriptorium/widgets/links.rb +112 -0
- data/lib/scriptorium/widgets/pages.rb +133 -0
- data/lib/scriptorium/widgets/widget.rb +133 -0
- data/lib/scriptorium.rb +21 -40
- data/lib/skeleton.rb +8 -2
- data/scriptorium.gemspec +15 -4
- data/test/README.md +69 -0
- data/test/all +43 -0
- data/test/api_demo.rb +99 -0
- data/test/assets/imagenotfound.jpg +0 -0
- data/test/assets/images/.DS_Store +0 -0
- data/test/assets/images/README.md +27 -0
- data/test/assets/images/odd_aspect.png +0 -0
- data/test/assets/images/perfect.png +0 -0
- data/test/assets/images/small.png +0 -0
- data/test/assets/images/tall.png +0 -0
- data/test/assets/images/very_tall.png +0 -0
- data/test/assets/images/very_wide.png +0 -0
- data/test/assets/images/wide.png +0 -0
- data/test/assets/testbanner.jpg +0 -0
- data/test/banner_svg/simple_helpers.rb +13 -0
- data/test/banner_svg/unit.rb +768 -0
- data/test/ed_test.rb +204 -0
- data/test/integration/cursor_banner_combinations.rb +193 -0
- data/test/integration/cursor_banner_features.rb +374 -0
- data/test/integration/integration_test.rb +326 -0
- data/test/livetext_plugin_test.rb +229 -0
- data/test/manual/asset_mgmt.rb +67 -0
- data/test/manual/banner-tests/config.txt +3 -0
- data/test/manual/banner-tests/index.html +45 -0
- data/test/manual/banner-tests/test01.html +58 -0
- data/test/manual/banner-tests/test02.html +58 -0
- data/test/manual/banner-tests/test03.html +58 -0
- data/test/manual/banner-tests/test04.html +65 -0
- data/test/manual/banner-tests/test05.html +65 -0
- data/test/manual/banner-tests/test06.html +65 -0
- data/test/manual/banner-tests/test07.html +65 -0
- data/test/manual/banner-tests/test08.html +59 -0
- data/test/manual/banner-tests/test09.html +59 -0
- data/test/manual/banner-tests/test10.html +59 -0
- data/test/manual/banner-tests/test11.html +59 -0
- data/test/manual/banner-tests/test12.html +59 -0
- data/test/manual/banner-tests/test13.html +59 -0
- data/test/manual/banner-tests/test14.html +59 -0
- data/test/manual/banner-tests/test15.html +58 -0
- data/test/manual/banner-tests/test16.html +58 -0
- data/test/manual/banner-tests/test17.html +58 -0
- data/test/manual/banner-tests/test18.html +68 -0
- data/test/manual/banner-tests/test19.html +68 -0
- data/test/manual/banner-tests/test20.html +68 -0
- data/test/manual/banner-tests/test21.html +68 -0
- data/test/manual/banner-tests/test22.html +68 -0
- data/test/manual/banner-tests/test23.html +68 -0
- data/test/manual/banner-tests/test24.html +68 -0
- data/test/manual/banner-tests/test25.html +67 -0
- data/test/manual/banner_environment.rb +192 -0
- data/test/manual/deploy_symlink_demo.rb +142 -0
- data/test/manual/environment.rb +67 -0
- data/test/manual/make_banner.rb +153 -0
- data/test/manual/sample_banner_config.txt +12 -0
- data/test/manual/symlink_demo.rb +117 -0
- data/test/manual/test1.rb +47 -0
- data/test/manual/test2.rb +12 -0
- data/test/manual/test3.rb +38 -0
- data/test/manual/test4.rb +40 -0
- data/test/manual/test5.rb +24 -0
- data/test/manual/test6.rb +73 -0
- data/test/manual/test_banner_combinations.rb +120 -0
- data/test/manual/test_banner_features.rb +306 -0
- data/test/manual/test_banner_from_file.rb +150 -0
- data/test/manual/test_banner_in_header.rb +35 -0
- data/test/manual/test_code_highlighting.rb +68 -0
- data/test/manual/test_complex_header.rb +74 -0
- data/test/manual/test_empty_header.rb +32 -0
- data/test/manual/test_radial_custom.rb +58 -0
- data/test/manual/test_radial_large_radius.rb +52 -0
- data/test/manual/test_svg_debug.rb +47 -0
- data/test/manual/test_syntax_highlighting.rb +147 -0
- data/test/pages-demo/config/currentview.txt +1 -0
- data/test/pages-demo/views/demo/config/bootstrap_css.txt +5 -0
- data/test/pages-demo/views/demo/config/bootstrap_js.txt +4 -0
- data/test/pages-demo/views/demo/config/common.js +57 -0
- data/test/pages-demo/views/demo/config/footer.txt +1 -0
- data/test/pages-demo/views/demo/config/global-head.txt +8 -0
- data/test/pages-demo/views/demo/config/header.txt +1 -0
- data/test/pages-demo/views/demo/config/layout.txt +1 -0
- data/test/pages-demo/views/demo/config/left.txt +1 -0
- data/test/pages-demo/views/demo/config/main.txt +1 -0
- data/test/pages-demo/views/demo/config/right.txt +1 -0
- data/test/pages-demo/views/demo/config.txt +3 -0
- data/test/pages-demo/views/demo/output/panes/footer.html +1 -0
- data/test/pages-demo/views/demo/output/panes/header.html +1 -0
- data/test/pages-demo/views/demo/output/panes/left.html +1 -0
- data/test/pages-demo/views/demo/output/panes/main.html +1 -0
- data/test/pages-demo/views/demo/output/panes/right.html +1 -0
- data/test/rubytext/rubytext_comprehensive_test.rb +307 -0
- data/test/rubytext/rubytext_demo_test.rb +42 -0
- data/test/rubytext/rubytext_testing_guide.md +277 -0
- data/test/run_automated_tests.rb +45 -0
- data/test/scriptorium-TEST-1754622690-146/config/bootstrap_css.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/config/bootstrap_js.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/config/common.js +57 -0
- data/test/scriptorium-TEST-1754622690-146/config/currentview.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/config/global-head.txt +9 -0
- data/test/scriptorium-TEST-1754622690-146/config/last_post_num.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/config/os_helpers.rb +4 -0
- data/test/scriptorium-TEST-1754622690-146/config/widgets.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/posts/0001/meta.txt +8 -0
- data/test/scriptorium-TEST-1754622690-146/posts/0001/source.lt3 +6 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/README.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/config.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/initial/post.lt3 +12 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/footer.txt +2 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/header.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/left.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/main.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/right.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/gen/text.css +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/layout.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index.lt3 +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index_entry.lt3 +14 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/post.lt3 +13 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/widget.lt3 +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_css.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_js.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/common.js +57 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/deploy.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/footer.txt +2 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/global-head.txt +9 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/header.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/layout.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/left.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/main.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/reddit.txt +10 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/right.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/social.txt +7 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/status.txt +7 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/footer.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/header.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/left.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/main.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/right.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/footer.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/header.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/left.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/main.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/right.html +1 -0
- data/test/staging/.DS_Store +0 -0
- data/test/syntax_highlighting_test.lt3 +124 -0
- data/test/test_helpers.rb +230 -0
- data/test/tui_editor_integration_test.rb +296 -0
- data/test/tui_integration_test.rb +637 -0
- data/test/unit/api.rb +1056 -0
- data/test/unit/asset_management.rb +245 -0
- data/test/unit/clipboard_test.rb +60 -0
- data/test/unit/contract_test.rb +91 -0
- data/test/unit/core.rb +857 -0
- data/test/unit/deploy_test.rb +187 -0
- data/test/unit/gem_asset_management.rb +189 -0
- data/test/unit/livetext_basic.rb +69 -0
- data/test/unit/livetext_compatibility.rb +89 -0
- data/test/unit/post.rb +244 -0
- data/test/unit/read_commented_file_test.rb +276 -0
- data/test/unit/reddit_test.rb +235 -0
- data/test/unit/repo.rb +548 -0
- data/test/unit/social_test.rb +369 -0
- data/test/unit/symlink_test.rb +213 -0
- data/test/unit/view.rb +431 -0
- data/test/unit/widgets.rb +669 -0
- data/test/wizard_test.rb +123 -0
- data/ui/README.md +67 -0
- data/ui/common/lib/ui_common.rb +8 -0
- data/ui/rubytext/README.md +191 -0
- data/ui/rubytext/bin/scriptorium-rubytext +402 -0
- data/ui/rubytext/lib/rubytext_ui.rb +300 -0
- data/ui/tui/bin/scriptorium +1420 -0
- data/ui/tui/test/tui_test.rb +23 -0
- data/ui/web/app/app.rb +1378 -0
- data/ui/web/app/error_helpers.rb +150 -0
- data/ui/web/app/views/advanced_config.erb +190 -0
- data/ui/web/app/views/asset_management.erb +589 -0
- data/ui/web/app/views/banner_config.erb +200 -0
- data/ui/web/app/views/configure_view.erb +401 -0
- data/ui/web/app/views/dashboard.erb +162 -0
- data/ui/web/app/views/deploy_config.erb +146 -0
- data/ui/web/app/views/edit_pages.erb +195 -0
- data/ui/web/app/views/edit_post.erb +54 -0
- data/ui/web/app/views/error_page.erb +29 -0
- data/ui/web/app/views/header_config.erb +155 -0
- data/ui/web/app/views/layout_config.erb +147 -0
- data/ui/web/app/views/navbar_config.erb +411 -0
- data/ui/web/app/views/view_dashboard.erb +138 -0
- data/ui/web/bin/scriptorium-web +153 -0
- data/ui/web/test/web_basic_test.rb +38 -0
- data/ui/web/test_navbar.txt +7 -0
- data/ui/web/tmp/web_server.log +5 -0
- data/ui/web/tmp/web_server.pid +1 -0
- metadata +359 -7
- data/lib/scriptorium/engine.rb +0 -22
- data/test/engine/unit.rb +0 -44
@@ -0,0 +1,162 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Scriptorium Web UI</title>
|
5
|
+
<style>
|
6
|
+
body { font-family: Arial, sans-serif; margin: 20px; }
|
7
|
+
.error { color: red; background: #ffe6e6; padding: 10px; margin: 10px 0; }
|
8
|
+
.message { color: green; background: #e6ffe6; padding: 10px; margin: 10px 0; }
|
9
|
+
.suggestion { color: #666; font-style: italic; }
|
10
|
+
table { border-collapse: collapse; width: 100%; margin: 10px 0; }
|
11
|
+
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
|
12
|
+
th { background-color: #f2f2f2; }
|
13
|
+
.button { background: #007cba; color: white; padding: 5px 10px; text-decoration: none; border-radius: 3px; }
|
14
|
+
.button:hover { background: #005a87; }
|
15
|
+
.section { margin: 20px 0; }
|
16
|
+
.section h3 { margin-bottom: 10px; }
|
17
|
+
.posts-table { border-collapse: collapse; width: 100%; margin: 10px 0; }
|
18
|
+
.posts-table th, .posts-table td { padding: 4px 8px; text-align: left; border: none; }
|
19
|
+
.posts-table th { background-color: #f2f2f2; }
|
20
|
+
.posts-table .post-id { text-align: right !important; font-family: monospace; min-width: 40px; }
|
21
|
+
</style>
|
22
|
+
<script>
|
23
|
+
function previewView(viewName) {
|
24
|
+
// Create a form to submit the POST request
|
25
|
+
var form = document.createElement('form');
|
26
|
+
form.method = 'POST';
|
27
|
+
form.action = '/preview_view';
|
28
|
+
form.target = '_blank'; // Open in new tab/window
|
29
|
+
|
30
|
+
// Add the view_name parameter
|
31
|
+
var input = document.createElement('input');
|
32
|
+
input.type = 'hidden';
|
33
|
+
input.name = 'view_name';
|
34
|
+
input.value = viewName;
|
35
|
+
form.appendChild(input);
|
36
|
+
|
37
|
+
// Submit the form
|
38
|
+
document.body.appendChild(form);
|
39
|
+
form.submit();
|
40
|
+
document.body.removeChild(form);
|
41
|
+
}
|
42
|
+
</script>
|
43
|
+
</head>
|
44
|
+
<body>
|
45
|
+
<h1>Scriptorium Web UI</h1>
|
46
|
+
|
47
|
+
<% if @error %>
|
48
|
+
<div class="error">
|
49
|
+
<strong>Error:</strong> <%= @error %>
|
50
|
+
<% if @suggestion %>
|
51
|
+
<div class="suggestion"><%= @suggestion %></div>
|
52
|
+
<% end %>
|
53
|
+
</div>
|
54
|
+
<% end %>
|
55
|
+
|
56
|
+
<% if @message %>
|
57
|
+
<div class="message"><%= @message %></div>
|
58
|
+
<% end %>
|
59
|
+
|
60
|
+
<% if @api && @api.repo %>
|
61
|
+
<div class="section">
|
62
|
+
<h3>Repository loaded: <%= @api.repo.root %></h3>
|
63
|
+
|
64
|
+
<div class="section">
|
65
|
+
<h3>Views</h3>
|
66
|
+
<% if @views && !@views.empty? %>
|
67
|
+
<table>
|
68
|
+
<tr>
|
69
|
+
<th>Name <em style="font-size: 0.8em; font-weight: normal;">(Click to switch views)</em></th>
|
70
|
+
<th>Title <em style="font-size: 0.8em; font-weight: normal;">(Click to configure)</em></th>
|
71
|
+
</tr>
|
72
|
+
<% @views.each do |view| %>
|
73
|
+
<tr style="<%= 'background-color: #e3f2fd;' if @current_view && view.name == @current_view.name %>">
|
74
|
+
<td>
|
75
|
+
<form method="post" action="/change_view" style="display: inline;">
|
76
|
+
<input type="hidden" name="view_name" value="<%= view.name %>">
|
77
|
+
<button type="submit" style="background: none; border: none; color: #007cba; cursor: pointer; font-family: monospace; font-size: inherit;" title="Change to <%= view.name %>">
|
78
|
+
<%= view.name %>
|
79
|
+
</button>
|
80
|
+
</form>
|
81
|
+
</td>
|
82
|
+
<td>
|
83
|
+
<a href="/configure_view/<%= view.name %>" style="color: #007cba; text-decoration: none; cursor: pointer;" title="Configure <%= view.name %>">
|
84
|
+
<%= view.title %><%= ' (Current)' if @current_view && view.name == @current_view.name %>
|
85
|
+
</a>
|
86
|
+
</td>
|
87
|
+
</tr>
|
88
|
+
<% end %>
|
89
|
+
</table>
|
90
|
+
|
91
|
+
<% if @current_view %>
|
92
|
+
<div style="margin-top: 15px; padding: 10px; background-color: #f0f8ff; border: 1px solid #b0d4f1; border-radius: 3px;">
|
93
|
+
<strong>Current view:</strong> <%= @current_view.name %>
|
94
|
+
<form method="post" action="/generate_view" style="display: inline; margin-left: 10px;">
|
95
|
+
<input type="hidden" name="view_name" value="<%= @current_view.name %>">
|
96
|
+
<button type="submit" class="button">Generate</button>
|
97
|
+
</form>
|
98
|
+
<button type="button" class="button" onclick="previewView('<%= @current_view.name %>')" style="margin-left: 5px;">Preview</button>
|
99
|
+
<a href="/banner_config" class="button" style="margin-left: 5px; text-decoration: none;">Banner Config</a>
|
100
|
+
<a href="/navbar_config" class="button" style="margin-left: 5px; text-decoration: none;">Navbar Config</a>
|
101
|
+
<a href="/asset_management" class="button" style="margin-left: 5px; text-decoration: none;">Asset Management</a>
|
102
|
+
<a href="/view/<%= @current_view.name %>" class="button" style="margin-left: 5px; text-decoration: none;">View Dashboard</a>
|
103
|
+
</div>
|
104
|
+
<% end %>
|
105
|
+
<% else %>
|
106
|
+
<p>No views found</p>
|
107
|
+
<% end %>
|
108
|
+
|
109
|
+
<form method="post" action="/create_view" style="margin-top: 10px;">
|
110
|
+
<input type="text" name="name" placeholder="View name" required>
|
111
|
+
<input type="text" name="title" placeholder="View title" required>
|
112
|
+
<input type="text" name="subtitle" placeholder="View subtitle" required>
|
113
|
+
<button type="submit" class="button">Create new view</button>
|
114
|
+
</form>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<% if @current_view %>
|
118
|
+
<div class="section">
|
119
|
+
<h3>Create new post in <%= @current_view.name %></h3>
|
120
|
+
<form method="post" action="/create_post">
|
121
|
+
<input type="text" name="title" placeholder="Post title" required>
|
122
|
+
<button type="submit" class="button">Create new post</button>
|
123
|
+
</form>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<% if @posts && !@posts.empty? %>
|
127
|
+
<div class="section">
|
128
|
+
<table class="posts-table">
|
129
|
+
<tr>
|
130
|
+
<th>ID</th>
|
131
|
+
<th>Date</th>
|
132
|
+
<th>Title <em style="font-size: 0.8em; font-weight: normal;">(Click to edit)</em></th>
|
133
|
+
<th>Views</th>
|
134
|
+
</tr>
|
135
|
+
<% @posts.each do |post| %>
|
136
|
+
<tr>
|
137
|
+
<td class="post-id"><%= post.id %></td>
|
138
|
+
<td><%= post.pubdate&.split(' ')&.first %></td>
|
139
|
+
<td>
|
140
|
+
<a href="/edit_post/<%= post.id %>" style="color: #007cba; text-decoration: none; cursor: pointer;" title="Edit <%= post.title %>">
|
141
|
+
<%= post.title %>
|
142
|
+
</a>
|
143
|
+
</td>
|
144
|
+
<td><%= post.views_array.join(', ') %></td>
|
145
|
+
</tr>
|
146
|
+
<% end %>
|
147
|
+
</table>
|
148
|
+
</div>
|
149
|
+
<% end %>
|
150
|
+
<% end %>
|
151
|
+
</div>
|
152
|
+
<% else %>
|
153
|
+
<div class="section">
|
154
|
+
<h3>No repository loaded</h3>
|
155
|
+
<form method="post" action="/create_repo">
|
156
|
+
<input type="text" name="name" placeholder="Repository name" value="scriptorium-TEST" required>
|
157
|
+
<button type="submit" class="button">Create Repository</button>
|
158
|
+
</form>
|
159
|
+
</div>
|
160
|
+
<% end %>
|
161
|
+
</body>
|
162
|
+
</html>
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Configure Deployment - <%= @current_view.name %> - Scriptorium</title>
|
5
|
+
<style>
|
6
|
+
body {
|
7
|
+
font-family: Arial, sans-serif;
|
8
|
+
margin: 0;
|
9
|
+
padding: 20px;
|
10
|
+
background-color: #f5f5f5;
|
11
|
+
}
|
12
|
+
.container {
|
13
|
+
max-width: 800px;
|
14
|
+
margin: 0 auto;
|
15
|
+
background: white;
|
16
|
+
border-radius: 8px;
|
17
|
+
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
18
|
+
overflow: hidden;
|
19
|
+
}
|
20
|
+
.header {
|
21
|
+
background: #007bff;
|
22
|
+
color: white;
|
23
|
+
padding: 20px;
|
24
|
+
text-align: center;
|
25
|
+
}
|
26
|
+
.header h1 {
|
27
|
+
margin: 0;
|
28
|
+
font-size: 24px;
|
29
|
+
}
|
30
|
+
.content {
|
31
|
+
padding: 30px;
|
32
|
+
}
|
33
|
+
.form-group {
|
34
|
+
margin-bottom: 25px;
|
35
|
+
}
|
36
|
+
.form-group label {
|
37
|
+
display: block;
|
38
|
+
margin-bottom: 8px;
|
39
|
+
font-weight: bold;
|
40
|
+
color: #333;
|
41
|
+
}
|
42
|
+
.form-group textarea {
|
43
|
+
width: 100%;
|
44
|
+
height: 200px;
|
45
|
+
padding: 12px;
|
46
|
+
border: 1px solid #ddd;
|
47
|
+
border-radius: 4px;
|
48
|
+
font-family: monospace;
|
49
|
+
font-size: 14px;
|
50
|
+
line-height: 1.4;
|
51
|
+
resize: vertical;
|
52
|
+
}
|
53
|
+
.form-group textarea:focus {
|
54
|
+
outline: none;
|
55
|
+
border-color: #007bff;
|
56
|
+
box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
|
57
|
+
}
|
58
|
+
.help-text {
|
59
|
+
background: #f8f9fa;
|
60
|
+
padding: 15px;
|
61
|
+
border-radius: 4px;
|
62
|
+
margin-bottom: 20px;
|
63
|
+
font-size: 14px;
|
64
|
+
line-height: 1.5;
|
65
|
+
}
|
66
|
+
.help-text h3 {
|
67
|
+
margin: 0 0 10px 0;
|
68
|
+
color: #333;
|
69
|
+
font-size: 16px;
|
70
|
+
}
|
71
|
+
.help-text ul {
|
72
|
+
margin: 0;
|
73
|
+
padding-left: 20px;
|
74
|
+
}
|
75
|
+
.help-text li {
|
76
|
+
margin-bottom: 5px;
|
77
|
+
}
|
78
|
+
.btn {
|
79
|
+
display: inline-block;
|
80
|
+
padding: 10px 20px;
|
81
|
+
background: #007bff;
|
82
|
+
color: white;
|
83
|
+
text-decoration: none;
|
84
|
+
border-radius: 4px;
|
85
|
+
border: none;
|
86
|
+
font-size: 16px;
|
87
|
+
cursor: pointer;
|
88
|
+
transition: background 0.2s;
|
89
|
+
}
|
90
|
+
.btn:hover {
|
91
|
+
background: #0056b3;
|
92
|
+
}
|
93
|
+
.btn-secondary {
|
94
|
+
background: #6c757d;
|
95
|
+
}
|
96
|
+
.btn-secondary:hover {
|
97
|
+
background: #545b62;
|
98
|
+
}
|
99
|
+
.button-group {
|
100
|
+
display: flex;
|
101
|
+
gap: 10px;
|
102
|
+
justify-content: center;
|
103
|
+
margin-top: 30px;
|
104
|
+
}
|
105
|
+
</style>
|
106
|
+
</head>
|
107
|
+
<body>
|
108
|
+
<div class="container">
|
109
|
+
<div class="header">
|
110
|
+
<h1>Configure Deployment</h1>
|
111
|
+
<p>Set up deployment settings for <%= @current_view.name %></p>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
<div class="content">
|
115
|
+
<div class="help-text">
|
116
|
+
<h3>Deployment Configuration Format</h3>
|
117
|
+
<p>Configure how this view will be deployed to your web server:</p>
|
118
|
+
<ul>
|
119
|
+
<li><strong>user</strong> - SSH username for server access</li>
|
120
|
+
<li><strong>server</strong> - Domain name or IP address of your server</li>
|
121
|
+
<li><strong>docroot</strong> - Web server document root directory</li>
|
122
|
+
<li><strong>path</strong> - Subdirectory path for this view (auto-filled)</li>
|
123
|
+
<li><strong>proto</strong> - Protocol (http or https)</li>
|
124
|
+
</ul>
|
125
|
+
<p><em>Note: The path field is automatically set to your view name and should not be changed unless you have a specific reason.</em></p>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<form method="post" action="/deploy_config">
|
129
|
+
<div class="form-group">
|
130
|
+
<label for="deploy_config">Deployment Configuration:</label>
|
131
|
+
<textarea id="deploy_config" name="deploy_config" placeholder="user root
|
132
|
+
server %{domain}
|
133
|
+
docroot /var/www/html
|
134
|
+
path <%= @current_view.name %>
|
135
|
+
proto https"><%= @deploy_config %></textarea>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div class="button-group">
|
139
|
+
<button type="submit" class="btn">Save Configuration</button>
|
140
|
+
<a href="/advanced_config" class="btn btn-secondary">Cancel</a>
|
141
|
+
</div>
|
142
|
+
</form>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
</body>
|
146
|
+
</html>
|
@@ -0,0 +1,195 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Edit Pages - Scriptorium</title>
|
5
|
+
<style>
|
6
|
+
body {
|
7
|
+
font-family: Arial, sans-serif;
|
8
|
+
margin: 0;
|
9
|
+
padding: 20px;
|
10
|
+
background-color: #f5f5f5;
|
11
|
+
}
|
12
|
+
.container {
|
13
|
+
max-width: 1200px;
|
14
|
+
margin: 0 auto;
|
15
|
+
background: white;
|
16
|
+
border-radius: 8px;
|
17
|
+
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
18
|
+
overflow: hidden;
|
19
|
+
}
|
20
|
+
.header {
|
21
|
+
background: #007bff;
|
22
|
+
color: white;
|
23
|
+
padding: 20px;
|
24
|
+
}
|
25
|
+
.header h1 {
|
26
|
+
margin: 0;
|
27
|
+
font-size: 24px;
|
28
|
+
}
|
29
|
+
.content {
|
30
|
+
padding: 20px;
|
31
|
+
}
|
32
|
+
.message {
|
33
|
+
padding: 10px;
|
34
|
+
border-radius: 4px;
|
35
|
+
margin-bottom: 20px;
|
36
|
+
}
|
37
|
+
.message.success {
|
38
|
+
background: #d4edda;
|
39
|
+
color: #155724;
|
40
|
+
border: 1px solid #c3e6cb;
|
41
|
+
}
|
42
|
+
.message.error {
|
43
|
+
background: #f8d7da;
|
44
|
+
color: #721c24;
|
45
|
+
border: 1px solid #f5c6cb;
|
46
|
+
}
|
47
|
+
.pages-list {
|
48
|
+
margin-bottom: 20px;
|
49
|
+
}
|
50
|
+
.page-item {
|
51
|
+
padding: 4px 0;
|
52
|
+
margin-bottom: 4px;
|
53
|
+
cursor: pointer;
|
54
|
+
transition: all 0.2s;
|
55
|
+
font-family: monospace;
|
56
|
+
}
|
57
|
+
.page-item:hover {
|
58
|
+
color: #007bff;
|
59
|
+
}
|
60
|
+
.page-item.empty {
|
61
|
+
font-weight: bold;
|
62
|
+
}
|
63
|
+
.edit-form {
|
64
|
+
display: none;
|
65
|
+
margin-top: 20px;
|
66
|
+
padding: 20px;
|
67
|
+
background: #f8f9fa;
|
68
|
+
border-radius: 6px;
|
69
|
+
border: 1px solid #ddd;
|
70
|
+
}
|
71
|
+
.edit-form.active {
|
72
|
+
display: block;
|
73
|
+
}
|
74
|
+
.edit-form textarea {
|
75
|
+
width: 100%;
|
76
|
+
min-height: 300px;
|
77
|
+
font-family: monospace;
|
78
|
+
padding: 10px;
|
79
|
+
border: 1px solid #ddd;
|
80
|
+
border-radius: 4px;
|
81
|
+
resize: vertical;
|
82
|
+
}
|
83
|
+
.edit-form .buttons {
|
84
|
+
margin-top: 15px;
|
85
|
+
}
|
86
|
+
.btn {
|
87
|
+
padding: 8px 16px;
|
88
|
+
border: none;
|
89
|
+
border-radius: 4px;
|
90
|
+
cursor: pointer;
|
91
|
+
font-size: 14px;
|
92
|
+
margin-right: 10px;
|
93
|
+
}
|
94
|
+
.btn-primary {
|
95
|
+
background: #007bff;
|
96
|
+
color: white;
|
97
|
+
}
|
98
|
+
.btn-primary:hover {
|
99
|
+
background: #0056b3;
|
100
|
+
}
|
101
|
+
.btn-secondary {
|
102
|
+
background: #6c757d;
|
103
|
+
color: white;
|
104
|
+
}
|
105
|
+
.btn-secondary:hover {
|
106
|
+
background: #545b62;
|
107
|
+
}
|
108
|
+
.button-group {
|
109
|
+
margin-top: 20px;
|
110
|
+
}
|
111
|
+
</style>
|
112
|
+
</head>
|
113
|
+
<body>
|
114
|
+
<div class="container">
|
115
|
+
<div class="header">
|
116
|
+
<h1>Edit Pages</h1>
|
117
|
+
<p>View: <strong><%= @current_view.name %></strong></p>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<div class="content">
|
121
|
+
<% if params[:message] %>
|
122
|
+
<div class="message success">
|
123
|
+
<%= params[:message] %>
|
124
|
+
</div>
|
125
|
+
<% end %>
|
126
|
+
|
127
|
+
<% if params[:error] %>
|
128
|
+
<div class="message error">
|
129
|
+
<%= params[:error] %>
|
130
|
+
</div>
|
131
|
+
<% end %>
|
132
|
+
|
133
|
+
<% if @pages.empty? %>
|
134
|
+
<p style="color: #666; font-style: italic;">No pages found in this view.</p>
|
135
|
+
<% else %>
|
136
|
+
<h3>Pages</h3>
|
137
|
+
<p><strong>Click to edit...</strong> <strong>boldface</strong> = empty</p>
|
138
|
+
<table class="pages-list" style="width: 100%; border-collapse: collapse;">
|
139
|
+
<thead>
|
140
|
+
<tr>
|
141
|
+
<th style="text-align: left; padding: 8px; border-bottom: 1px solid #ddd;">File</th>
|
142
|
+
<th style="text-align: left; padding: 8px; border-bottom: 1px solid #ddd;">Title</th>
|
143
|
+
</tr>
|
144
|
+
</thead>
|
145
|
+
<tbody>
|
146
|
+
<% @pages.each do |page| %>
|
147
|
+
<tr class="page-item <%= 'empty' if page[:empty] %>" onclick="editPage('<%= page[:filename] %>', `<%= page[:content].gsub('`', '\\`').gsub('\\', '\\\\') %>`)" style="cursor: pointer; transition: all 0.2s;">
|
148
|
+
<td style="padding: 8px; border-bottom: 1px solid #eee;">
|
149
|
+
📄 <%= page[:filename].sub(/\.lt3$/, '') %>
|
150
|
+
</td>
|
151
|
+
<td style="padding: 8px; border-bottom: 1px solid #eee; color: #666;">
|
152
|
+
<%= page[:title] || '' %>
|
153
|
+
</td>
|
154
|
+
</tr>
|
155
|
+
<% end %>
|
156
|
+
</tbody>
|
157
|
+
</table>
|
158
|
+
|
159
|
+
<div id="edit-form" class="edit-form">
|
160
|
+
<h4 id="edit-filename"></h4>
|
161
|
+
<form method="post" action="/edit_pages/save">
|
162
|
+
<input type="hidden" name="filename" id="edit-filename-input">
|
163
|
+
<textarea name="content" id="edit-content" placeholder="Enter page content..."></textarea>
|
164
|
+
<div class="buttons">
|
165
|
+
<button type="submit" class="btn btn-primary">Save Page</button>
|
166
|
+
<button type="button" class="btn btn-secondary" onclick="hideEditForm()">Cancel</button>
|
167
|
+
</div>
|
168
|
+
</form>
|
169
|
+
</div>
|
170
|
+
<% end %>
|
171
|
+
|
172
|
+
<div class="button-group">
|
173
|
+
<a href="/navbar_config" class="btn btn-secondary">Navbar Config</a>
|
174
|
+
<a href="/" class="btn btn-secondary">Back to Dashboard</a>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<script>
|
180
|
+
function editPage(filename, content) {
|
181
|
+
document.getElementById('edit-filename').textContent = filename;
|
182
|
+
document.getElementById('edit-filename-input').value = filename;
|
183
|
+
document.getElementById('edit-content').value = content;
|
184
|
+
document.getElementById('edit-form').classList.add('active');
|
185
|
+
|
186
|
+
// Scroll to edit form
|
187
|
+
document.getElementById('edit-form').scrollIntoView({ behavior: 'smooth' });
|
188
|
+
}
|
189
|
+
|
190
|
+
function hideEditForm() {
|
191
|
+
document.getElementById('edit-form').classList.remove('active');
|
192
|
+
}
|
193
|
+
</script>
|
194
|
+
</body>
|
195
|
+
</html>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Edit Post - Scriptorium Web UI</title>
|
5
|
+
<style>
|
6
|
+
body { font-family: Arial, sans-serif; margin: 20px; }
|
7
|
+
.header { border-bottom: 1px solid #ccc; padding-bottom: 10px; margin-bottom: 20px; }
|
8
|
+
.status { padding: 8px; margin: 8px 0; border-radius: 3px; }
|
9
|
+
.error { background-color: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
|
10
|
+
.success { background-color: #e8f5e8; color: #2e7d32; border: 1px solid #c8e6c9; }
|
11
|
+
.button { background: #007cba; color: white; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; margin-right: 10px; }
|
12
|
+
.button:hover { background: #005a87; }
|
13
|
+
.button.secondary { background: #6c757d; }
|
14
|
+
.button.secondary:hover { background: #545b62; }
|
15
|
+
.content-area { margin: 20px 0; }
|
16
|
+
textarea { width: 100%; height: 500px; font-family: 'Courier New', monospace; font-size: 14px; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
|
17
|
+
.post-info { background: #f8f9fa; padding: 15px; border-radius: 4px; margin-bottom: 20px; }
|
18
|
+
.post-info h2 { margin: 0 0 10px 0; }
|
19
|
+
.post-info p { margin: 5px 0; }
|
20
|
+
</style>
|
21
|
+
</head>
|
22
|
+
<body>
|
23
|
+
<div class="header">
|
24
|
+
<h1>Edit Post</h1>
|
25
|
+
<p>Editing post content for Scriptorium</p>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<% if params[:error] %>
|
29
|
+
<div class="status error">
|
30
|
+
<strong>Error:</strong> <%= params[:error] %>
|
31
|
+
</div>
|
32
|
+
<% end %>
|
33
|
+
|
34
|
+
<div class="post-info">
|
35
|
+
<h2><%= @post.title %></h2>
|
36
|
+
<p><strong>ID:</strong> #<%= @post.id %></p>
|
37
|
+
<p><strong>View:</strong> <%= @post.views_array.join(', ') || 'none' %></p>
|
38
|
+
<p><strong>Tags:</strong> <%= @post.tags&.join(', ') || 'none' %></p>
|
39
|
+
<p><strong>File:</strong> posts/<%= @post.num %>/source.lt3</p>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<form method="post" action="/save_post/<%= @post.id %>">
|
43
|
+
<div class="content-area">
|
44
|
+
<label for="content"><strong>Post Content:</strong></label>
|
45
|
+
<textarea name="content" id="content" placeholder="Enter your post content here..."><%= @content %></textarea>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<div>
|
49
|
+
<button type="submit" class="button">Save Post</button>
|
50
|
+
<a href="/" class="button secondary" style="text-decoration: none;">Cancel</a>
|
51
|
+
</div>
|
52
|
+
</form>
|
53
|
+
</body>
|
54
|
+
</html>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Error - Scriptorium Web UI</title>
|
5
|
+
<style>
|
6
|
+
body { font-family: Arial, sans-serif; margin: 20px; }
|
7
|
+
.header { border-bottom: 1px solid #ccc; padding-bottom: 10px; margin-bottom: 20px; }
|
8
|
+
.error { background-color: #ffebee; color: #c62828; border: 1px solid #ffcdd2; padding: 15px; border-radius: 4px; }
|
9
|
+
.button { background: #007cba; color: white; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; }
|
10
|
+
.button:hover { background: #005a87; }
|
11
|
+
</style>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<div class="header">
|
15
|
+
<h1>Oops! Something went wrong</h1>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="error">
|
19
|
+
<h2><%= @error %></h2>
|
20
|
+
<% if @suggestion %>
|
21
|
+
<p><em><%= @suggestion %></em></p>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<p>
|
26
|
+
<a href="/" class="button">Return to Dashboard</a>
|
27
|
+
</p>
|
28
|
+
</body>
|
29
|
+
</html>
|