-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from tosdr/sprint/implementing-paper-trail
[WIP] Paper Trail and data history
- Loading branch information
Showing
22 changed files
with
532 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
@import "footer"; | ||
@import "button"; | ||
@import "sort_button"; | ||
@import "tabs"; | ||
@import "service_title"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.tabs-bar-container { | ||
display: flex; | ||
justify-content: center; | ||
padding: 0px; | ||
margin: 0px; | ||
|
||
} | ||
|
||
.tabs-bar { | ||
padding: 10px; | ||
margin: 5px; | ||
} | ||
|
||
.tabs-bar.active { | ||
background-color: transparent; | ||
color: black; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
class Point < ApplicationRecord | ||
belongs_to :user, optional: true | ||
belongs_to :service | ||
has_many :reasons, dependent: :destroy | ||
belongs_to :topic | ||
has_paper_trail | ||
belongs_to :user, optional: true | ||
belongs_to :service | ||
has_many :reasons, dependent: :destroy | ||
belongs_to :topic | ||
|
||
validates :title, presence: true | ||
validates :title, length: { in: 5..140 } | ||
validates :source, presence: true | ||
validates :status, inclusion: { in: ["approved", "pending", "declined", "disputed", "draft"], allow_nil: false } | ||
validates :analysis, presence: true | ||
validates :rating, presence: true | ||
validates :rating, numericality: true | ||
validates :title, presence: true | ||
validates :title, length: { in: 5..140 } | ||
validates :source, presence: true | ||
validates :status, inclusion: { in: ["approved", "pending", "declined", "disputed", "draft"], allow_nil: false } | ||
validates :analysis, presence: true | ||
validates :rating, presence: true | ||
validates :rating, numericality: true | ||
|
||
def self.search_points_by_multiple(query) | ||
Point.joins(:service).where("services.name ILIKE ? or points.status ILIKE ?", "%#{query}%", "%#{query}%") | ||
end | ||
def self.search_points_by_multiple(query) | ||
Point.joins(:service).where("services.name ILIKE ? or points.status ILIKE ?", "%#{query}%", "%#{query}%") | ||
end | ||
|
||
def self.search_points_by_topic(query) | ||
Point.joins(:topic).where("topics.title ILIKE ?", "%#{query}%") | ||
end | ||
def self.search_points_by_topic(query) | ||
Point.joins(:topic).where("topics.title ILIKE ?", "%#{query}%") | ||
end | ||
# VOTE CONTROLLER ! TODO | ||
# def has_voted(point) | ||
# Vote.where(point_id: point.id, user_id: current_user.id) | ||
# end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<div class="article-holder status-changes"> | ||
|
||
<!-- <table class="table"> | ||
<thead class="thead thead-dark"> | ||
<th scope="col">STATUS UPDATES</th> | ||
<th scope="col">REASON</th> | ||
<th scope="col">WHEN</th> | ||
</thead> | ||
<tbody> | ||
<% @point.reasons.each do |reason| %> | ||
<tr> | ||
<th scope="row"><%= reason.status %></th> | ||
<td><%= reason.content %></td> | ||
<td><%= time_ago_in_words reason.created_at %> ago</td> | ||
</tr> | ||
</tbody> | ||
<% end %> | ||
</table> --> | ||
|
||
<table class="table"> | ||
<thead class="thead thead-dark"> | ||
<th scope="col">ANALYSIS UPDATES</th> | ||
<th scope="col">TEXT CHANGES</th> | ||
<th scope="col">WHEN</th> | ||
<!-- <th scope="col">WHO</th> --> | ||
</thead> | ||
<tbody> | ||
<% @point.versions.each do |v| %> | ||
<tr> | ||
<th scope="row"><%= v.event %></th> | ||
<td> | ||
<% if v.changeset["analysis"] %> | ||
Analysis change: <%= v.changeset["analysis"] %> | ||
<% elsif v.changeset["status"] %> | ||
Status change: <%= v.changeset["status"] %> | ||
<% else %> | ||
No changes recorded | ||
<% end %> | ||
</td> | ||
<td><%= v.changeset["updated_at"] %></td> | ||
<!-- make a better view for username <td><%= v.whodunnit %></td> --> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.