mirror of
https://github.com/derf/travelynx
synced 2024-12-03 09:49:09 +00:00
add privacy setting for showing history and latest arrival timestamp
This commit is contained in:
parent
6cbbc2b16f
commit
a1865fa69e
4 changed files with 64 additions and 2 deletions
|
@ -187,6 +187,9 @@ sub startup {
|
|||
status_intern => 0x01,
|
||||
status_extern => 0x02,
|
||||
status_comment => 0x04,
|
||||
history_intern => 0x10,
|
||||
history_latest => 0x20,
|
||||
history_full => 0x40,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
@ -236,6 +236,19 @@ sub privacy {
|
|||
else {
|
||||
$public_level &= ~0x04;
|
||||
}
|
||||
|
||||
if ( $self->param('history_level') eq 'intern' ) {
|
||||
$public_level |= 0x10;
|
||||
$public_level &= ~0x20;
|
||||
}
|
||||
elsif ( $self->param('history_level') eq 'extern' ) {
|
||||
$public_level |= 0x20;
|
||||
$public_level &= ~0x10;
|
||||
}
|
||||
else {
|
||||
$public_level &= ~0x30;
|
||||
}
|
||||
|
||||
$self->set_privacy( $user->{id}, $public_level );
|
||||
|
||||
$self->flash( success => 'privacy' );
|
||||
|
@ -248,6 +261,11 @@ sub privacy {
|
|||
: 'private'
|
||||
);
|
||||
$self->param( public_comment => $public_level & 0x04 ? 1 : 0 );
|
||||
$self->param(
|
||||
history_level => $public_level & 0x10 ? 'intern'
|
||||
: $public_level & 0x20 ? 'extern'
|
||||
: 'private'
|
||||
);
|
||||
$self->render( 'privacy', name => $user->{name} );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,7 +163,14 @@
|
|||
<span class="card-title"><%= $name %> ist gerade nicht eingecheckt</span>
|
||||
<p>
|
||||
% if ($journey->{arr_name}) {
|
||||
Zuletzt gesehen in <%= $journey->{arr_name} %>.
|
||||
Zuletzt gesehen
|
||||
% if ($public_level & 0x30 and $journey->{real_arrival}->epoch) {
|
||||
%= $journey->{real_arrival}->strftime('am %d.%m.%Y')
|
||||
% }
|
||||
in <b><%= $journey->{arr_name} %></b>
|
||||
% if ($public_level & 0x30 and $journey->{real_arrival}->epoch) {
|
||||
%= $journey->{real_arrival}->strftime('(Ankunft um %H:%M Uhr)')
|
||||
% }
|
||||
% }
|
||||
% else {
|
||||
Noch keine Zugfahrten geloggt.
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
</div>
|
||||
</div>
|
||||
%= form_for '/account/privacy' => (method => 'POST') => begin
|
||||
%= csrf_field
|
||||
<h2>Aktueller Status</h2>
|
||||
%= csrf_field
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
<label>
|
||||
|
@ -60,6 +60,40 @@
|
|||
hat dieses Feld keine Auswirkungen.
|
||||
</div>
|
||||
</div>
|
||||
<h2>Vergangene Zugfahrten</h2>
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
<label>
|
||||
%= radio_button history_level => 'private'
|
||||
<span>Nicht sichtbar</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
<label>
|
||||
%= radio_button history_level => 'intern'
|
||||
<span>Nur für angemeldete Accounts</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
<label>
|
||||
%= radio_button history_level => 'extern'
|
||||
<span>Öffentlich</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
Diese Einstellung bestimmt die Sichtbarkeit deiner letzten
|
||||
zehn Zugfahrten mit allen dazu bekannten Details (Abfahrt, Ankunft,
|
||||
Wagenreihung u.a.). Dies umfasst Angaben auf
|
||||
<a href="/status/<%= $name %>">/status/<%= $name %></a> sowie
|
||||
eine Liste deiner letzten Fahrten. Die Implementierung folgt noch...
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col s3 m3 l3">
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue