2019-05-13 18:28:16 +01:00
|
|
|
<div class="container notes">
|
2026-01-09 13:17:56 +00:00
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-12 col-xl-10">
|
|
|
|
|
<?php foreach ($note->result() as $row) { ?>
|
|
|
|
|
<div class="card shadow-sm">
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
<div class="d-flex flex-wrap justify-content-between align-items-start gap-3">
|
|
|
|
|
<div class="d-flex flex-column gap-1">
|
|
|
|
|
<div class="d-flex align-items-center gap-2 flex-wrap">
|
|
|
|
|
<a class="small text-decoration-none" href="<?php echo site_url('notes'); ?>">← <?php echo lang('notes_menu_notes'); ?></a>
|
|
|
|
|
<?php if (!empty($row->cat)) { ?>
|
|
|
|
|
<span class="badge bg-secondary"><?php echo $row->cat; ?></span>
|
|
|
|
|
<?php } ?>
|
Add public Station Diary with images & RSS
Introduce public Station Diary functionality: add global config flag, routes, controller, model changes, views and DB migrations. New migrations (252-254) add is_public/include_qso_summary, diary_images table and logbook_id on notes. Notes model updated to handle public flags, diary images, qso summaries, caching (per-user cache version), and helper methods for listing/counting public diary entries. New Stationdiary controller serves paginated public pages and RSS feed with caching. Notes controller updated to handle image uploads, attach images to diary entries, and provide an AJAX endpoint to delete images. Views updated to support public visibility options, logbook selector, image upload UI and Quill editor assets; routes and migration version bumped accordingly. Includes file upload example added to uploads/diary.
2026-03-08 11:42:41 +00:00
|
|
|
<?php if (strtoupper(trim((string)$row->cat)) === 'STATION DIARY') { ?>
|
|
|
|
|
<span class="badge <?php echo ((int)($row->is_public ?? 0) === 1) ? 'bg-success' : 'bg-dark'; ?>"><?php echo ((int)($row->is_public ?? 0) === 1) ? '🌍 Public' : '🔒 Private'; ?></span>
|
|
|
|
|
<?php } ?>
|
2026-01-09 13:17:56 +00:00
|
|
|
</div>
|
|
|
|
|
<h2 class="card-title mb-0"><?php echo $row->title; ?></h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btn-group btn-group-sm" role="group" aria-label="Note actions">
|
|
|
|
|
<a href="<?php echo site_url('notes/edit/'.$row->id); ?>" class="btn btn-outline-primary">
|
|
|
|
|
<i class="fas fa-edit"></i> <?php echo lang('notes_input_btn_edit_note'); ?>
|
|
|
|
|
</a>
|
|
|
|
|
<button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#deleteNoteModal" data-note-id="<?php echo $row->id; ?>" data-note-title="<?php echo htmlspecialchars($row->title, ENT_QUOTES); ?>">
|
|
|
|
|
<i class="fas fa-trash-alt"></i> <?php echo lang('notes_input_btn_delete_note'); ?>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
Render diary images & improve diary cache
Load and render station diary images inline and separately, and make cache handling more robust. Notes controller: load diary_images for print view and invalidate public diary cache when an image caption is updated. Stationdiary controller: include a render-version token in the public diary cache key to force re-renders when markup changes. Note model: make touch_public_diary_cache_version more resilient (unique value, fallback to file_put_contents and cache clean), add invalidate_public_diary_cache_for_note helper, and enhance process_image_shortcodes to handle encoded brackets, tolerant shortcode spacing, modifiers (alignment and size) with deterministic styling, and return used image ids. Views: update station_diary_print and note view to process shortcodes, remove empty paragraph artifacts, show inline images via shortcodes, and display remaining images with captions and improved print CSS.
2026-03-08 15:11:33 +00:00
|
|
|
<?php
|
|
|
|
|
$entryImages = isset($diary_images[$row->id]) ? $diary_images[$row->id] : array();
|
|
|
|
|
|
|
|
|
|
// Process image shortcodes in the note content
|
|
|
|
|
$CI =& get_instance();
|
|
|
|
|
$CI->load->model('note');
|
|
|
|
|
$processed = $CI->note->process_image_shortcodes($row->note, $entryImages);
|
|
|
|
|
// Remove empty <p><br></p> tags and <br> tags between paragraph tags
|
|
|
|
|
$processedNote = preg_replace('/<p><br\s*\/?><\/p>/i', '', $processed['content']);
|
|
|
|
|
$processedNote = preg_replace('/<\/p>\s*<br\s*\/?>\s*<p>/i', '</p><p>', $processedNote);
|
|
|
|
|
$usedImageIds = $processed['used_image_ids'];
|
|
|
|
|
|
|
|
|
|
// Filter out images that were used inline
|
|
|
|
|
$remainingImages = array();
|
|
|
|
|
if (!empty($entryImages)) {
|
|
|
|
|
foreach ($entryImages as $image) {
|
|
|
|
|
if (!in_array((int)$image->id, $usedImageIds)) {
|
|
|
|
|
$remainingImages[] = $image;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
2026-01-09 13:17:56 +00:00
|
|
|
<div class="note-content lh-base">
|
Render diary images & improve diary cache
Load and render station diary images inline and separately, and make cache handling more robust. Notes controller: load diary_images for print view and invalidate public diary cache when an image caption is updated. Stationdiary controller: include a render-version token in the public diary cache key to force re-renders when markup changes. Note model: make touch_public_diary_cache_version more resilient (unique value, fallback to file_put_contents and cache clean), add invalidate_public_diary_cache_for_note helper, and enhance process_image_shortcodes to handle encoded brackets, tolerant shortcode spacing, modifiers (alignment and size) with deterministic styling, and return used image ids. Views: update station_diary_print and note view to process shortcodes, remove empty paragraph artifacts, show inline images via shortcodes, and display remaining images with captions and improved print CSS.
2026-03-08 15:11:33 +00:00
|
|
|
<?php echo $processedNote; ?>
|
2026-01-09 13:17:56 +00:00
|
|
|
</div>
|
Render diary images & improve diary cache
Load and render station diary images inline and separately, and make cache handling more robust. Notes controller: load diary_images for print view and invalidate public diary cache when an image caption is updated. Stationdiary controller: include a render-version token in the public diary cache key to force re-renders when markup changes. Note model: make touch_public_diary_cache_version more resilient (unique value, fallback to file_put_contents and cache clean), add invalidate_public_diary_cache_for_note helper, and enhance process_image_shortcodes to handle encoded brackets, tolerant shortcode spacing, modifiers (alignment and size) with deterministic styling, and return used image ids. Views: update station_diary_print and note view to process shortcodes, remove empty paragraph artifacts, show inline images via shortcodes, and display remaining images with captions and improved print CSS.
2026-03-08 15:11:33 +00:00
|
|
|
<?php if (!empty($remainingImages)) { ?>
|
|
|
|
|
<hr class="my-3">
|
|
|
|
|
<div class="row g-3">
|
|
|
|
|
<?php foreach ($remainingImages as $image) { ?>
|
Add public Station Diary with images & RSS
Introduce public Station Diary functionality: add global config flag, routes, controller, model changes, views and DB migrations. New migrations (252-254) add is_public/include_qso_summary, diary_images table and logbook_id on notes. Notes model updated to handle public flags, diary images, qso summaries, caching (per-user cache version), and helper methods for listing/counting public diary entries. New Stationdiary controller serves paginated public pages and RSS feed with caching. Notes controller updated to handle image uploads, attach images to diary entries, and provide an AJAX endpoint to delete images. Views updated to support public visibility options, logbook selector, image upload UI and Quill editor assets; routes and migration version bumped accordingly. Includes file upload example added to uploads/diary.
2026-03-08 11:42:41 +00:00
|
|
|
<div class="col-md-4">
|
|
|
|
|
<img src="<?php echo base_url() . ltrim($image->filename, '/'); ?>" class="img-fluid rounded border" alt="Diary image">
|
Render diary images & improve diary cache
Load and render station diary images inline and separately, and make cache handling more robust. Notes controller: load diary_images for print view and invalidate public diary cache when an image caption is updated. Stationdiary controller: include a render-version token in the public diary cache key to force re-renders when markup changes. Note model: make touch_public_diary_cache_version more resilient (unique value, fallback to file_put_contents and cache clean), add invalidate_public_diary_cache_for_note helper, and enhance process_image_shortcodes to handle encoded brackets, tolerant shortcode spacing, modifiers (alignment and size) with deterministic styling, and return used image ids. Views: update station_diary_print and note view to process shortcodes, remove empty paragraph artifacts, show inline images via shortcodes, and display remaining images with captions and improved print CSS.
2026-03-08 15:11:33 +00:00
|
|
|
<?php if (!empty($image->caption)) { ?>
|
|
|
|
|
<div class="small text-muted mt-1"><?php echo htmlspecialchars($image->caption, ENT_QUOTES); ?></div>
|
|
|
|
|
<?php } ?>
|
Add public Station Diary with images & RSS
Introduce public Station Diary functionality: add global config flag, routes, controller, model changes, views and DB migrations. New migrations (252-254) add is_public/include_qso_summary, diary_images table and logbook_id on notes. Notes model updated to handle public flags, diary images, qso summaries, caching (per-user cache version), and helper methods for listing/counting public diary entries. New Stationdiary controller serves paginated public pages and RSS feed with caching. Notes controller updated to handle image uploads, attach images to diary entries, and provide an AJAX endpoint to delete images. Views updated to support public visibility options, logbook selector, image upload UI and Quill editor assets; routes and migration version bumped accordingly. Includes file upload example added to uploads/diary.
2026-03-08 11:42:41 +00:00
|
|
|
</div>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
</div>
|
|
|
|
|
<?php } ?>
|
2026-01-09 13:17:56 +00:00
|
|
|
</div>
|
|
|
|
|
<div class="card-footer bg-transparent pt-0 border-0">
|
|
|
|
|
<div class="d-flex justify-content-between align-items-center flex-wrap gap-2">
|
|
|
|
|
<div class="d-flex flex-wrap gap-2">
|
|
|
|
|
<a href="<?php echo site_url('notes'); ?>" class="btn btn-outline-secondary btn-sm"><?php echo lang('general_word_back') ?: 'Back'; ?></a>
|
|
|
|
|
<a href="<?php echo site_url('notes/add'); ?>" class="btn btn-outline-primary btn-sm"><?php echo lang('notes_create_note'); ?></a>
|
|
|
|
|
</div>
|
2026-02-12 22:20:52 +00:00
|
|
|
<small class="text-muted">
|
|
|
|
|
<?php
|
|
|
|
|
$savedTime = (is_null($row->created_at) || $row->created_at === '' || $row->created_at === '0000-00-00 00:00:00') ? 'N/A' : date('M d, Y \a\t g:i A', strtotime($row->created_at));
|
|
|
|
|
echo 'Saved: ' . $savedTime;
|
|
|
|
|
?>
|
|
|
|
|
</small>
|
2026-01-09 13:17:56 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
<?php $this->load->view('notes/partials/delete_modal'); ?>
|
2019-10-05 21:57:44 +01:00
|
|
|
</div>
|
2026-01-09 13:17:56 +00:00
|
|
|
</div>
|
2011-11-06 23:09:51 +00:00
|
|
|
</div>
|