Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontend/templates/undo_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ <h2 class="text-lg font-bold">{{ heading }}</h2>

<table class="table table-pin-rows table-xs mt-2">
<tbody>
{% for vv in undo_report %}
{% for operation in vv.1 %}
{% for kv, vv in undo_report %}
{% for operation in vv %}
{% if loop.first %}
<tr class="bg-base-200 text-lg">
<td colspan="3">{{ vv.0 }}</td>
<td colspan="3">{{ kv }}</td>
</tr>
<tr class="bg-base-300">
<th></th>
Expand Down
6 changes: 3 additions & 3 deletions src/backend/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ impl TryFrom<&str> for TaskProperties {
}
}

pub fn convert_task_status(task_status: String) -> taskchampion::Status {
match task_status.as_str() {
pub fn convert_task_status(task_status: &str) -> taskchampion::Status {
match task_status {
"pending" => taskchampion::Status::Pending,
"completed" => taskchampion::Status::Completed,
"deleted" => taskchampion::Status::Deleted,
"recurring" => taskchampion::Status::Recurring,
&_ => taskchampion::Status::Unknown(task_status),
&_ => taskchampion::Status::Unknown(task_status.into()),
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/core/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ impl FormValidation {
}
}

/// Check if any validation errors occured or if no errors were recognized.
/// If everything went fine, `is_success` returns `true`.
pub fn is_success(&self) -> bool {
self.success
}
Expand All @@ -121,6 +123,9 @@ impl FormValidation {
self
}

/// Checks whether errors occured for given `field`.
/// If at least one error to the given `field`, a `true`
/// is returned.
pub fn has_error(&self, field: &str) -> bool {
self.fields.contains_key(field)
}
Expand Down
Loading
Loading