Skip to content

Commit

Permalink
Fix dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadser committed Aug 21, 2024
1 parent b7ca446 commit dd6ce4d
Show file tree
Hide file tree
Showing 32 changed files with 84 additions and 83 deletions.
6 changes: 3 additions & 3 deletions app/views/assertions/_assertion.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div id="<%= dom_id assertion %>">
<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Name:</strong>
<%= assertion.name %>
</p>

<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Assertion type:</strong>
<%= assertion.assertion_type.humanize %>
</p>

<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="block font-medium mb-1">Value:</strong>
<%= assertion.value %>
</p>
Expand Down
8 changes: 4 additions & 4 deletions app/views/assertions/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
<% end %>

<div class="my-5">
<%= form.label :name %>
<%= form.label :name, class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_field :name, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= form.label :assertion_type %>
<%= form.label :assertion_type, class: "text-gray-900 dark:text-gray-100" %>
<%= form.select :assertion_type, Assertion.assertion_types.keys.map { |w| [w.humanize, w] }, { include_blank: false }, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full", data: { action: "change->assertion#toggleModelVersion" } %>
</div>

<div id="model_version_selector" data-assertion-target="modelVersionSelector" class="my-5" style="<%= form.object.assertion_type == 'model_version' ? '' : 'display:none;' %>">
<%= form.label 'Select model version' %>
<%= form.label 'Select model version', class: "text-gray-900 dark:text-gray-100" %>
<%= form.collection_select :model_version_id, @model_versions, :id, :full_name, { include_blank: true }, class: "mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" %>
</div>

<div class="my-5">
<%= form.label :value, "Write each expression on a separate row", 'data-assertion-target' => "valueLabel" %>
<%= form.label :value, "Write each expression on a separate row", 'data-assertion-target' => "valueLabel", class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_area :value, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/assertions/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% content_for :title, "Assertions" %>

<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Assertions</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Assertions</h1>
<div class="flex space-x-4">
<%= link_to "New assertion", new_assertion_path, class: "px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/assertions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container px-6 mx-auto mt-10 md:w-2/3 w-full">
<h1 class="font-bold text-4xl">New assertion</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">New assertion</h1>

<%= render "form", assertion: @assertion %>

Expand Down
18 changes: 9 additions & 9 deletions app/views/compare/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,43 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if @prompts.empty? || @model_versions.empty? %>
<div class="flex items-center justify-center h-full">
<p class="text-gray-500 text-center">No prompts or model versions available. <br> Please create prompts and model versions to perform this action.</p>
<p class="text-gray-500 text-center text-gray-900 dark:text-gray-100">No prompts or model versions available. <br> Please create prompts and model versions to perform this action.</p>
</div>
<% else %>
<div>
<label for="prompt-id-select" class="block text-sm font-medium text-gray-700">Select Prompt:</label>
<label for="prompt-id-select" class="block text-sm font-medium text-gray-700 text-gray-900 dark:text-gray-100">Select Prompt:</label>
<%= select_tag 'prompt-id-select', grouped_options_for_select(options_with_versions(@prompts, @ancestor_prompts)),
class: 'form-control w-full px-3 py-2 border border-gray-300 rounded-md mb-4', id: 'prompt-id-select' %>
</div>
<div>
<label for="test-run-select" class="block text-sm font-medium text-gray-700">Select Test Run:</label>
<label for="test-run-select" class="block text-sm font-medium text-gray-700 text-gray-900 dark:text-gray-100">Select Test Run:</label>
<%= select_tag 'test-run-select', '',
class: 'form-control w-full px-3 py-2 border border-gray-300 rounded-md mb-4', id: 'test-run-select' %>
</div>
<div class="flex w-full">
<div class="p-4 border-r border-gray-300 panel-half">
<h3 class="text-lg font-semibold mb-4">Select Model Version for Left Panel</h3>
<h3 class="text-lg font-semibold mb-4 text-gray-900 dark:text-gray-100">Select Model Version for Left Panel</h3>
<% if @model_versions.any? %>
<%= select_tag 'left-panel-model', options_from_collection_for_select(@model_versions, 'id', 'full_name'),
prompt: 'Select a model version', class: 'form-control w-full px-3 py-2 border border-gray-300 rounded-md' %>
<div id="left-panel-result" class="mt-4">
<div id="left-panel-result" class="mt-4 text-gray-900 dark:text-gray-100">
</div>
<% else %>
<div class="flex items-center justify-center h-full">
<p class="text-gray-500 text-center">No model versions available. <br> Please create model versions to perform this action.</p>
<p class="text-gray-500 text-center text-gray-900 dark:text-gray-100">No model versions available. <br> Please create model versions to perform this action.</p>
</div>
<% end %>
</div>
<div class="p-4 panel-half">
<h3 class="text-lg font-semibold mb-4">Select Model Version for Right Panel</h3>
<h3 class="text-lg font-semibold mb-4 text-gray-900 dark:text-gray-100">Select Model Version for Right Panel</h3>
<% if @model_versions.any? %>
<%= select_tag 'right-panel-model', options_from_collection_for_select(@model_versions, 'id', 'full_name'),
prompt: 'Select a model version', class: 'form-control w-full px-3 py-2 border border-gray-300 rounded-md' %>
<div id="right-panel-result" class="mt-4">
<div id="right-panel-result" class="mt-4 text-gray-900 dark:text-gray-100">
</div>
<% else %>
<div class="flex items-center justify-center h-full">
<p class="text-gray-500 text-center">No model versions available. <br> Please create model versions to perform this action.</p>
<p class="text-gray-500 text-center text-gray-900 dark:text-gray-100">No model versions available. <br> Please create model versions to perform this action.</p>
</div>
<% end %>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/views/model_versions/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
<% end %>

<div class="my-5">
<%= form.label :configuration %>
<%= form.label :configuration, class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_field :configuration, value: model_version&.configuration ? JSON::dump(model_version&.configuration) : default_configuration(@model.executor_type), class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= form.label :description %>
<%= form.label :description, class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_area :description, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= form.label :built_on %>
<%= form.label :built_on, class: "text-gray-900 dark:text-gray-100" %>
<%= form.date_field :built_on, value: model_version&.built_on || Date.today, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= form.label :build_name %>
<%= form.label :build_name, class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_field :build_name, value: model_version&.build_name || "Version #{ @model.model_versions.count + 1 }", class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

Expand Down
12 changes: 6 additions & 6 deletions app/views/model_versions/_model_version.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<div id="<%= dom_id model_version %>">
<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Model:</strong>
<%= @model&.name %>
</p>

<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Configuration:</strong>
<pre id="json-display"></pre>
<pre id="json-display" class="ext-gray-900 dark:text-gray-100"></pre>
</p>

<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Description:</strong>
<%= model_version.description %>
</p>

<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Built on:</strong>
<%= model_version.built_on&.to_date || 'not specified' %>
</p>

<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Build name:</strong>
<%= model_version.build_name %>
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/model_versions/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<h1 class="font-bold text-4xl">Editing model version</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Editing model version</h1>

<%= render "form", model_version: @model_version %>
</div>
2 changes: 1 addition & 1 deletion app/views/model_versions/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% content_for :title, "Model versions" %>

<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Model versions</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Model versions</h1>
<%= link_to "New model version", new_model_model_version_path(@model), class: "px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/model_versions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<h1 class="font-bold text-4xl">New model version</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">New model version</h1>

<%= render "form", model_version: @model_version %>
</div>
16 changes: 8 additions & 8 deletions app/views/models/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,44 @@
<% end %>

<div class="my-5">
<%= form.label :name %>
<%= form.label :name, class: "block text-gray-700 text-sm font-bold mb-2 text-gray-900 dark:text-gray-100" %>
<%= form.text_field :name, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= form.label :url %>
<%= form.label :url, class: "block text-gray-700 text-sm font-bold mb-2 text-gray-900 dark:text-gray-100" %>
<%= form.text_field :url, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="mb-4">
<%= form.label :executor_type, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.label :executor_type, class: "block text-gray-700 text-sm font-bold mb-2 text-gray-900 dark:text-gray-100 block" %>
<%= form.select :executor_type, Model.executor_types.keys.map { |w| [I18n.t("activerecord.attributes.model.executor_types.#{w}"), w] }, {}, class: "block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-2 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500", id: "executor_type_selector", data: { action: "change->model#toggleConfiguration" } %>
</div>

<div id="api_key_field" data-model-target="apiKeyField" class="my-5" style="<%= model.executor_type == 'openai' ? '' : 'display:none;' %>">
<%= form.label :api_key %>
<%= form.label :api_key, class: "block text-gray-700 text-sm font-bold mb-2 block text-gray-700 text-sm font-bold mb-2 text-gray-900 dark:text-gray-100" %>
<%= form.text_field :api_key, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<% if model.new_record? %>
<%= form.fields_for :model_versions, @model_version do |model_version_fields| %>
<div class="my-5">
<%= model_version_fields.label :configuration %>
<%= model_version_fields.label :configuration, class: "block text-gray-700 text-sm font-bold mb-2 text-gray-900 dark:text-gray-100" %>
<%= model_version_fields.text_field :configuration, value: default_configuration(model.executor_type), 'data-model-target' => "configurationField", class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= model_version_fields.label :description %>
<%= model_version_fields.label :description, class: "block text-gray-700 text-sm font-bold mb-2 text-gray-900 dark:text-gray-100" %>
<%= model_version_fields.text_area :description, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= model_version_fields.label :built_on %>
<%= model_version_fields.label :built_on, class: "block text-gray-700 text-sm font-bold mb-2 text-gray-900 dark:text-gray-100" %>
<%= model_version_fields.date_field :built_on, value: Date.today, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= model_version_fields.label :build_name %>
<%= model_version_fields.label :build_name, class: "block text-gray-700 text-sm font-bold mb-2 text-gray-900 dark:text-gray-100" %>
<%= model_version_fields.text_field :build_name, value: 'Version 1', class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/models/_model.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div id="<%= dom_id model %>">
<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Name:</strong>
<%= model.name %>
</p>

<% if model.url.present? %>
<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Url:</strong>
<%= model.url %>
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/models/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<h1 class="font-bold text-4xl">Editing model</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Editing model</h1>

<%= render "form", model: @model %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/models/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% content_for :title, "Models" %>

<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Models</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Models</h1>
<%= link_to "New model", new_model_path, class: "px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/models/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<h1 class="font-bold text-4xl">New model</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">New model</h1>

<%= render "form", model: @model %>
</div>
4 changes: 2 additions & 2 deletions app/views/prompts/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<% end %>

<div class="my-5">
<%= form.label :name %>
<%= form.label :name, class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_field :name, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= form.label :value %>
<%= form.label :value, class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_area :value, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/prompts/_prompt.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div id="<%= dom_id prompt %>">
<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Name:</strong>
<%= prompt.name %>
</p>

<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="font-medium mb-1">Value:</strong>
<%= prompt.value %>
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/prompts/diff.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container px-6 mx-auto mt-10 grid">
<div id="<%= dom_id @prompt %>">
<p class="my-5">
<p class="my-5 text-gray-900 dark:text-gray-100">
<strong class="block font-medium mb-1">Value:</strong>
<%= Diffy::Diff.new(@previous_prompt_version.value, @prompt.value).to_s(:html).html_safe %>
</p>
Expand Down
6 changes: 3 additions & 3 deletions app/views/prompts/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<h1 class="font-bold text-4xl">Edit prompt</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Edit prompt</h1>

<%= form_with(url: prompt_path(@parent_prompt), method: :patch, class: "contents") do |form| %>
<% if @prompt.errors.any? %>
Expand All @@ -15,12 +15,12 @@
<% end %>

<div class="my-5">
<%= form.label :name %>
<%= form.label :name, class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_field 'prompt[name]', value: "#{@parent_prompt.name.gsub(/ Version \d+/, '')} Version #{@parent_prompt.ancestor_ids.size + 2}", class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

<div class="my-5">
<%= form.label :value %>
<%= form.label :value, class: "text-gray-900 dark:text-gray-100" %>
<%= form.text_area 'prompt[value]', value: @parent_prompt.value, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/prompts/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<% content_for :title, "Prompts" %>

<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Prompts</h1>
<div class="flex space-x-4">
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Prompts</h1>
<div class="flex space-x-4">
<%= link_to "New prompt", new_prompt_path, class: "px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/prompts/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<h1 class="font-bold text-4xl">New prompt</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">New prompt</h1>

<%= render "form", prompt: @prompt %>
</div>
4 changes: 2 additions & 2 deletions app/views/prompts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>

<div class="w-full w-full mx-auto mt-10 overflow-hidden rounded-lg shadow-xs">
<h1 class="font-bold text-4xl">Test Runs</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Test Runs</h1>
<div class="w-full overflow-x-auto">
<table class="w-full whitespace-no-wrap">
<thead>
Expand Down Expand Up @@ -68,7 +68,7 @@

<% if @previous_versions.present? %>
<div class="w-full overflow-hidden rounded-lg shadow-xs mx-auto mt-10 w-full">
<h1 class="font-bold text-4xl">Previous Versions</h1>
<h1 class="font-bold text-4xl text-gray-900 dark:text-gray-100">Previous Versions</h1>
<div class="w-full overflow-x-auto">
<table class="w-full whitespace-no-wrap">
<thead>
Expand Down
Loading

0 comments on commit dd6ce4d

Please sign in to comment.