first commit

This commit is contained in:
Kris
2024-02-03 08:34:36 -05:00
commit 2f398caa90
102 changed files with 2717 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>Suggest</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
</head>
<body>
<%= yield %>
</body>
</html>

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
/* Email styles need to be inline */
</style>
</head>
<body>
<%= yield %>
</body>
</html>

View File

@@ -0,0 +1 @@
<%= yield %>

View File

@@ -0,0 +1,32 @@
<%= form_with(model: suggestion) do |form| %>
<% if suggestion.errors.any? %>
<div style="color: red">
<h2><%= pluralize(suggestion.errors.count, "error") %> prohibited this suggestion from being saved:</h2>
<ul>
<% suggestion.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div>
<%= form.label :subject, style: "display: block" %>
<%= form.text_field :subject %>
</div>
<div>
<%= form.label :body, style: "display: block" %>
<%= form.text_area :body %>
</div>
<div>
<%= form.label :sent, style: "display: block" %>
<%= form.check_box :sent %>
</div>
<div>
<%= form.submit %>
</div>
<% end %>

View File

@@ -0,0 +1,17 @@
<div id="<%= dom_id suggestion %>">
<p>
<strong>Subject:</strong>
<%= suggestion.subject %>
</p>
<p>
<strong>Body:</strong>
<%= suggestion.body %>
</p>
<p>
<strong>Sent:</strong>
<%= suggestion.sent %>
</p>
</div>

View File

@@ -0,0 +1,2 @@
json.extract! suggestion, :id, :subject, :body, :sent, :created_at, :updated_at
json.url suggestion_url(suggestion, format: :json)

View File

@@ -0,0 +1,10 @@
<h1>Editing suggestion</h1>
<%= render "form", suggestion: @suggestion %>
<br>
<div>
<%= link_to "Show this suggestion", @suggestion %> |
<%= link_to "Back to suggestions", suggestions_path %>
</div>

View File

@@ -0,0 +1,14 @@
<p style="color: green"><%= notice %></p>
<h1>Suggestions</h1>
<div id="suggestions">
<% @suggestions.each do |suggestion| %>
<%= render suggestion %>
<p>
<%= link_to "Show this suggestion", suggestion %>
</p>
<% end %>
</div>
<%= link_to "New suggestion", new_suggestion_path %>

View File

@@ -0,0 +1 @@
json.array! @suggestions, partial: "suggestions/suggestion", as: :suggestion

View File

@@ -0,0 +1,9 @@
<h1>New suggestion</h1>
<%= render "form", suggestion: @suggestion %>
<br>
<div>
<%= link_to "Back to suggestions", suggestions_path %>
</div>

View File

@@ -0,0 +1,10 @@
<p style="color: green"><%= notice %></p>
<%= render @suggestion %>
<div>
<%= link_to "Edit this suggestion", edit_suggestion_path(@suggestion) %> |
<%= link_to "Back to suggestions", suggestions_path %>
<%= button_to "Destroy this suggestion", @suggestion, method: :delete %>
</div>

View File

@@ -0,0 +1 @@
json.partial! "suggestions/suggestion", suggestion: @suggestion