Station Logbooks Multilang

这个提交包含在:
HB9HIL 2023-10-17 15:34:17 +02:00
父节点 eda0d3cf3c
当前提交 ab6f4adeff
共有 3 个文件被更改,包括 42 次插入40 次删除

查看文件

@ -25,12 +25,12 @@
<form method="post" action="<?php echo site_url('logbooks/create'); ?>" name="create_profile"> <form method="post" action="<?php echo site_url('logbooks/create'); ?>" name="create_profile">
<div class="form-group"> <div class="form-group">
<label for="stationLogbookNameInput">Station Logbook Name</label> <label for="stationLogbookNameInput"><?php echo lang('station_logbooks_create_name');?></label>
<input type="text" class="form-control" name="stationLogbook_Name" id="stationLogbookNameInput" aria-describedby="stationLogbookNameHelp" placeholder="Home QTH" required> <input type="text" class="form-control" name="stationLogbook_Name" id="stationLogbookNameInput" aria-describedby="stationLogbookNameHelp" placeholder="Home QTH" required>
<small id="stationLogbookNameHelp" class="form-text text-muted">You can call a station logbook anything.</small> <small id="stationLogbookNameHelp" class="form-text text-muted"><?php echo lang('station_logbooks_create_name_hint');?></small>
</div> </div>
<button type="submit" class="btn btn-primary"><i class="fas fa-plus-square"></i> Create Station Logbook</button> <button type="submit" class="btn btn-primary"><i class="fas fa-plus-square"></i> <?php echo lang('station_logbooks_create');?></button>
</form> </form>
</div> </div>

查看文件

@ -21,20 +21,20 @@
<div class="row"> <div class="row">
<div class="col-md"> <div class="col-md">
<div class="card"> <div class="card">
<div class="card-header"><?php echo $page_title; ?>: <?php echo $station_logbook_details->logbook_name; ?></div> <div class="card-header"><?php echo lang('station_logbooks_edit_logbook'); ?>: <?php echo $station_logbook_details->logbook_name; ?></div>
<div class="card-body"> <div class="card-body">
<form method="post" action="<?php echo site_url('logbooks/edit/'); ?><?php echo $station_logbook_details->logbook_id; ?>" name="create_profile"> <form method="post" action="<?php echo site_url('logbooks/edit/'); ?><?php echo $station_logbook_details->logbook_id; ?>" name="create_profile">
<input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>"> <input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>">
<div class="form-group"> <div class="form-group">
<label for="stationLogbookNameInput">Station Logbook Name</label> <label for="stationLogbookNameInput"><?php echo lang('station_logbooks_create_name'); ?></label>
<input type="text" class="form-control" name="station_logbook_name" id="stationLogbookNameInput" aria-describedby="stationLogbookNameInputHelp" value="<?php if(set_value('station_logbook_name') != "") { echo set_value('station_logbook_name'); } else { echo $station_logbook_details->logbook_name; } ?>" required> <input type="text" class="form-control" name="station_logbook_name" id="stationLogbookNameInput" aria-describedby="stationLogbookNameInputHelp" value="<?php if(set_value('station_logbook_name') != "") { echo set_value('station_logbook_name'); } else { echo $station_logbook_details->logbook_name; } ?>" required>
<small id="stationLogbookNameInputHelp" class="form-text text-muted">Shortname for the station location. For example: Home (IO87IP)</small> <small id="stationLogbookNameInputHelp" class="form-text text-muted"><?php echo lang('station_logbooks_edit_name_hint'); ?></small>
</div> </div>
<input type="hidden" class="form-control" name="station_logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>" required> <input type="hidden" class="form-control" name="station_logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>" required>
<button type="submit" class="btn btn-primary"><i class="fas fa-plus-square"></i> Update Station Logbook Name</button> <button type="submit" class="btn btn-primary"><i class="fas fa-plus-square"></i> <?php echo lang('station_logbooks_edit_name_update'); ?></button>
</form> </form>
</div> </div>
</div> </div>
@ -42,36 +42,38 @@
<div class="col-md"> <div class="col-md">
<div class="card"> <div class="card">
<div class="card-header">Public Slug</div> <div class="card-header"><?php echo lang('station_logbooks_public_slug'); ?></div>
<div class="card-body"> <div class="card-body">
<p>Setting a public slug allows you to share your logbook with anyone via a custom website address, this slug can contain letters & numbers only.</p> <p><?php echo lang('station_logbooks_public_slug_hint'); ?></p>
<p><?php echo lang('station_logbooks_public_slug_format1')?><br>
<?php echo site_url('visitor'); ?>/<?php echo lang('station_logbooks_public_slug_format2'); ?></p>
<form hx-post="<?php echo site_url('logbooks/save_publicslug/'); ?>" hx-target="#publicSlugForm" style="display: inline;"> <form hx-post="<?php echo site_url('logbooks/save_publicslug/'); ?>" hx-target="#publicSlugForm" style="display: inline;">
<div id="publicSlugForm"> <div id="publicSlugForm">
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>"> <input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>">
<label for="publicSlugInput">Type in Public Slug choice</label> <label for="publicSlugInput"><?php echo lang('station_logbooks_public_slug_input'); ?></label>
<div hx-target="this" hx-swap="outerHTML"> <div hx-target="this" hx-swap="outerHTML">
<input class="form-control" name="public_slug" id="publicSlugInput" pattern="[a-zA-Z0-9-]+" value="<?php echo $station_logbook_details->public_slug; ?>" hx-post="<?php echo site_url('logbooks/publicslug_validate/'); ?>" hx-trigger="keyup changed delay:500ms" required> <input class="form-control" name="public_slug" id="publicSlugInput" pattern="[a-zA-Z0-9-]+" value="<?php echo $station_logbook_details->public_slug; ?>" hx-post="<?php echo site_url('logbooks/publicslug_validate/'); ?>" hx-trigger="keyup changed delay:500ms" required>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary" style="display:inline-block;"><i class="fas fa-plus-square"></i> Save</button> <button type="submit" class="btn btn-primary" style="display:inline-block;"><i class="fas fa-plus-square"></i> <?php echo lang('admin_save'); ?></button>
</form> </form>
<form hx-post="<?php echo site_url('logbooks/remove_publicslug/'); ?>" hx-target="#publicSlugForm" style="display: inline; margin-left: 5px;"> <form hx-post="<?php echo site_url('logbooks/remove_publicslug/'); ?>" hx-target="#publicSlugForm" style="display: inline; margin-left: 5px;">
<input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>"> <input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>">
<button type="submit" class="btn btn-primary" style="display:inline-block;" onclick="removeSlug()"><i class="fas fa-minus-square"></i> Remove</button> <button type="submit" class="btn btn-primary" style="display:inline-block;" onclick="removeSlug()"><i class="fas fa-minus-square"></i> <?php echo lang('admin_remove'); ?></button>
</form> </form>
<?php if($station_logbook_details->public_slug != "") { ?> <?php if($station_logbook_details->public_slug != "") { ?>
<div id="slugLink" class="alert alert-info" role="alert" style="margin-top: 20px;"> <div id="slugLink" class="alert alert-info" role="alert" style="margin-top: 20px;">
Visit Public Page <a href="<?php echo site_url('visitor'); ?>/<?php echo $station_logbook_details->public_slug; ?>" target="_blank"><?php echo site_url('visitor'); ?>/<?php echo $station_logbook_details->public_slug; ?></a> <p><?php echo lang('station_logbooks_public_slug_visit') . " "; ?></p>
<p><a href="<?php echo site_url('visitor'); ?>/<?php echo $station_logbook_details->public_slug; ?>" target="_blank"><?php echo site_url('visitor'); ?>/<?php echo $station_logbook_details->public_slug; ?></a></p>
</div> </div>
<?php } ?> <?php } ?>
<form style="display: inline;"> <form style="display: inline;">
<input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>"> <input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>">
<p>Enabling public search function offers a search input box on the public logbook page accessed via public slug. Search only covers this logbook.</p> <p style="margin-top: 15px;"><?php echo lang('station_logbooks_public_search_hint'); ?></p>
<label for="public_search">Public search enabled</label> <label for="public_search"><?php echo lang('station_logbooks_public_search_enabled'); ?></label>
<select class="custom-select" id="public_search" name="public_search" hx-post="<?php echo site_url('logbooks/save_publicsearch/'); ?>" hx-target="#publicSearchForm" hx-trigger="change"> <select class="custom-select" id="public_search" name="public_search" hx-post="<?php echo site_url('logbooks/save_publicsearch/'); ?>" hx-target="#publicSearchForm" hx-trigger="change">
<option value="1" <?php if ($station_logbook_details->public_search == 1) { echo " selected =\"selected\""; } ?>><?php echo lang('general_word_yes'); ?></option> <option value="1" <?php if ($station_logbook_details->public_search == 1) { echo " selected =\"selected\""; } ?>><?php echo lang('general_word_yes'); ?></option>
<option value="0" <?php if ($station_logbook_details->public_search == 0) { echo " selected =\"selected\""; } ?>><?php echo lang('general_word_no'); ?></option> <option value="0" <?php if ($station_logbook_details->public_search == 0) { echo " selected =\"selected\""; } ?>><?php echo lang('general_word_no'); ?></option>
@ -88,7 +90,7 @@
<div class="row"> <div class="row">
<div class="col-md"> <div class="col-md">
<div class="card"> <div class="card">
<div class="card-header">Station Locations</div> <div class="card-header"><?php echo lang('station_loc_plural'); ?></div>
<div class="card-body"> <div class="card-body">
<form method="post" action="<?php echo site_url('logbooks/edit/'); ?><?php echo $station_logbook_details->logbook_id; ?>" name="create_profile"> <form method="post" action="<?php echo site_url('logbooks/edit/'); ?><?php echo $station_logbook_details->logbook_id; ?>" name="create_profile">
<input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>"> <input type="hidden" name="logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>">
@ -103,11 +105,11 @@
?> ?>
<div class="form-group"> <div class="form-group">
<label for="StationLocationsSelect">Select Available Station Locations</label> <label for="StationLocationsSelect"><?php echo lang('station_logbooks_select_avail_loc'); ?></label>
<select name="SelectedStationLocation" class="form-control" id="StationLocationSelect" aria-describedby="StationLocationSelectHelp"> <select name="SelectedStationLocation" class="form-control" id="StationLocationSelect" aria-describedby="StationLocationSelectHelp">
<?php foreach ($station_locations_list->result() as $row) { <?php foreach ($station_locations_list->result() as $row) {
if (!in_array($row->station_id, $linked_stations)) { ?> if (!in_array($row->station_id, $linked_stations)) { ?>
<option value="<?php echo $row->station_id;?>"><?php echo $row->station_profile_name;?> (Callsign: <?php echo $row->station_callsign;?> DXCC: <?php echo $row->station_country; if ($row->dxcc_end != NULL) { echo ' ('.lang('gen_hamradio_deleted_dxcc').')'; } ?>)</option> <option value="<?php echo $row->station_id;?>"><?php echo $row->station_profile_name;?> (<?php echo lang('gen_hamradio_callsign'); ?>: <?php echo $row->station_callsign;?> <?php echo lang('gen_hamradio_dxcc'); ?>: <?php echo $row->station_country; if ($row->dxcc_end != NULL) { echo ' ('.lang('gen_hamradio_deleted_dxcc').')'; } ?>)</option>
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
</select> </select>
@ -115,7 +117,7 @@
<input type="hidden" class="form-control" name="station_logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>" required> <input type="hidden" class="form-control" name="station_logbook_id" value="<?php echo $station_logbook_details->logbook_id; ?>" required>
<button type="submit" class="btn btn-primary"><i class="fas fa-plus-square"></i> Link Location</button> <button type="submit" class="btn btn-primary"><i class="fas fa-plus-square"></i> <?php echo lang('station_logbooks_link_loc'); ?></button>
</form> </form>
</div> </div>
</div> </div>
@ -124,14 +126,14 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
Linked Locations <?php echo lang('station_logbooks_linked_loc'); ?>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<table id="station_logbooks_linked_table" class="table table-hover"> <table id="station_logbooks_linked_table" class="table table-hover">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th scope="col">Location Name</th> <th scope="col"><?php echo lang('station_loc_name'); ?></th>
<th scope="col"></th> <th scope="col"></th>
</tr> </tr>
</thead> </thead>
@ -141,7 +143,7 @@
foreach ($station_locations_linked->result() as $row) { foreach ($station_locations_linked->result() as $row) {
?> ?>
<tr> <tr>
<td><?php echo $row->station_profile_name;?> (Callsign: <?php echo $row->station_callsign;?> DXCC: <?php echo $row->station_country; if ($row->end != NULL) { echo ' <span class="badge badge-danger">'.lang('gen_hamradio_deleted_dxcc').'</span>'; } ?>)</td> <td><?php echo $row->station_profile_name;?> (<?php echo lang('gen_hamradio_callsign'); ?>: <?php echo $row->station_callsign;?> <?php echo lang('gen_hamradio_dxcc'); ?>: <?php echo $row->station_country; if ($row->end != NULL) { echo ' <span class="badge badge-danger">'.lang('gen_hamradio_deleted_dxcc').'</span>'; } ?>)</td>
<td><a href="<?php echo site_url('logbooks/delete_relationship/'); ?><?php echo $station_logbook_details->logbook_id; ?>/<?php echo $row->station_id;?>" class="btn btn-danger"><i class="fas fa-trash-alt"></i></a></td> <td><a href="<?php echo site_url('logbooks/delete_relationship/'); ?><?php echo $station_logbook_details->logbook_id; ?>/<?php echo $row->station_id;?>" class="btn btn-danger"><i class="fas fa-trash-alt"></i></a></td>
</tr> </tr>
<?php <?php
@ -149,7 +151,7 @@
} else { } else {
?> ?>
<tr> <tr>
<td colspan="2">No linked locations</td> <td colspan="2"><?php echo lang('station_logbooks_no_linked_loc'); ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>

查看文件

@ -12,16 +12,16 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
What are Station Logbooks <?php echo lang('station_logbooks_description_header')?>
</div> </div>
<div class="card-body"> <div class="card-body">
<p class="card-text">Station Logbooks allow you to group Station Locations, this allows you to see all the locations across one session from the logbook areas to the analytics. Great for when your operating in multiple locations but they are part of the same DXCC or VUCC Circle.</p> <p class="card-text"><?php echo lang('station_logbooks_description_text')?></p>
</div> </div>
</div> </div>
<div class="card" style="margin-top: 20px;"> <div class="card" style="margin-top: 20px;">
<div class="card-header"> <div class="card-header">
Station Logbooks <a class="btn btn-primary float-right" href="<?php echo site_url('logbooks/create'); ?>"><i class="fas fa-plus"></i> Create a Station Logbook</a> <?php echo lang('station_logbooks')?> <a class="btn btn-primary float-right" href="<?php echo site_url('logbooks/create'); ?>"><i class="fas fa-plus"></i> <?php echo lang('station_logbooks_create')?></a>
</div> </div>
<div class="card-body"> <div class="card-body">
<div id="station_logbooks"> <div id="station_logbooks">
@ -31,12 +31,12 @@
<table id="station_logbooks_table" class="table table-sm table-striped"> <table id="station_logbooks_table" class="table table-sm table-striped">
<thead> <thead>
<tr> <tr>
<th scope="col">Name</th> <th scope="col"><?php echo lang('general_word_name')?></th>
<th scope="col">Status</th> <th scope="col"><?php echo lang('station_logbooks_status')?></th>
<th scope="col">Edit</th> <th scope="col"><?php echo lang('admin_edit')?></th>
<th scope="col">Delete</th> <th scope="col"><?php echo lang('admin_delete')?></th>
<th scope="col">Link</th> <th scope="col"><?php echo lang('station_logbooks_link')?></th>
<th scope="col">Public Search</th> <th scope="col"><?php echo lang('station_logbooks_public_search')?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -48,29 +48,29 @@
<td> <td>
<?php if($this->session->userdata('active_station_logbook') != $row->logbook_id) { ?> <?php if($this->session->userdata('active_station_logbook') != $row->logbook_id) { ?>
<a href="<?php echo site_url('logbooks/set_active')."/".$row->logbook_id; ?>" class="btn btn-outline-primary btn-sm">Set as Active Logbook</a> <a href="<?php echo site_url('logbooks/set_active')."/".$row->logbook_id; ?>" class="btn btn-outline-primary btn-sm"><?php echo lang('station_logbooks_set_active')?></a>
<?php } else { <?php } else {
echo '<span class="badge badge-success">Active Logbook</span>'; echo "<span class='badge badge-success'>" . lang('station_logbooks_active_logbook') . "</span>";
}?> }?>
</td> </td>
<td> <td>
<a href="<?php echo site_url('logbooks/edit')."/".$row->logbook_id; ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit" title="Edit <?php echo $row->logbook_name;?>"></i> </a> <a href="<?php echo site_url('logbooks/edit')."/".$row->logbook_id; ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit" title="<?php echo lang('station_logbooks_edit_logbook') . ': ' . $row->logbook_name;?>"></i> </a>
</td> </td>
<td> <td>
<?php if($this->session->userdata('active_station_logbook') != $row->logbook_id) { ?> <?php if($this->session->userdata('active_station_logbook') != $row->logbook_id) { ?>
<a href="<?php echo site_url('Logbooks/delete')."/".$row->logbook_id; ?>" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want delete station logbook <?php echo $row->logbook_name; ?>? You must re-link any locations linked here to another logbook.');"><i class="fas fa-trash-alt"></i></a> <a href="<?php echo site_url('Logbooks/delete')."/".$row->logbook_id; ?>" class="btn btn-danger btn-sm" onclick="return confirm('<?php echo lang('station_logbooks_confirm_delete') . $row->logbook_name; ?>');"><i class="fas fa-trash-alt"></i></a>
<?php } ?> <?php } ?>
</td> </td>
<td> <td>
<?php if($row->public_slug != '') { ?> <?php if($row->public_slug != '') { ?>
<a target="_blank" href="<?php echo site_url('visitor')."/".$row->public_slug; ?>" class="btn btn-outline-primary btn-sm" ><i class="fas fa-globe" title="View Public Page for <?php echo $row->logbook_name;?> Logbook"></i> </a> <a target="_blank" href="<?php echo site_url('visitor')."/".$row->public_slug; ?>" class="btn btn-outline-primary btn-sm" ><i class="fas fa-globe" title="<?php echo lang('station_logbooks_view_public') . $row->logbook_name;?>"></i> </a>
<?php } ?> <?php } ?>
</td> </td>
<td> <td>
<?php if ($row->public_search == 1) { <?php if ($row->public_search == 1) {
echo "<span class=\"badge badge-success\">Enabled</span>"; echo "<span class='badge badge-success'>" . lang('general_word_enabled') . "</span>";
} else { } else {
echo "<span class=\"badge badge-dark\">Disabled</span>"; echo "<span class='badge badge-dark'>" . lang('general_word_disabled') . "</span>";
} ?> } ?>
</td> </td>
</tr> </tr>