Files
hub/check_blade.js
Kelly 32fd2b0ab8 feat: migrate product edit page to new top header layout
- Replace sidebar layout with top header design
- Add product image thumbnail, badges (Active/Featured), and action buttons
- Implement real-time badge toggling with inline JavaScript
- Add one-active-product-per-brand validation with force-activate option
- Standardize checkbox styling with DaisyUI components
- Update terminology from "Default" to "Primary" for images
- Add new models: ProductLine, ProductPackaging, Unit
- Add product line management and image sorting
- Add styling rules to CLAUDE.md for consistency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 23:41:37 -07:00

57 lines
1.7 KiB
JavaScript

const fs = require('fs');
const content = fs.readFileSync('resources/views/seller/products/edit11.blade.php', 'utf8');
const lines = content.split('\n');
let depth = 0;
const stack = [];
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const lineNum = i + 1;
// Skip lines that are Alpine.js @error handlers
if (line.includes('@error') && line.includes('$event')) {
continue;
}
// Check for @if (but not in @endif, @error, @enderror)
if (/@if\s*\(/.test(line) && !/@endif/.test(line)) {
depth++;
stack.push({ line: lineNum, type: 'if', content: line.trim().substring(0, 80) });
console.log(`${lineNum}: [depth +${depth}] @if`);
}
// Check for @elseif
if (/@elseif\s*\(/.test(line)) {
console.log(`${lineNum}: [depth =${depth}] @elseif`);
}
// Check for @else (but not @elseif, @endforelse, @enderror)
if (/@else\b/.test(line) && !/@elseif/.test(line) && !/@endforelse/.test(line) && !/@enderror/.test(line)) {
console.log(`${lineNum}: [depth =${depth}] @else`);
}
// Check for @endif
if (/@endif\b/.test(line)) {
console.log(`${lineNum}: [depth -${depth}] @endif`);
if (depth > 0) {
depth--;
stack.pop();
} else {
console.log(`ERROR: Extra @endif at line ${lineNum}`);
}
}
}
console.log(`\nFinal depth: ${depth}`);
if (depth > 0) {
console.log(`\nUNBALANCED: Missing ${depth} @endif statement(s)`);
console.log('\nUnclosed @if statements:');
stack.forEach(item => {
console.log(` Line ${item.line}: ${item.content}`);
});
} else {
console.log('\nAll @if/@endif pairs are balanced!');
}