-
Notifications
You must be signed in to change notification settings - Fork 6
Language model 16 #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
16adceb
add language model
dmitrytrager 62ba59d
add views for managing languages
dmitrytrager ffe799e
add request specs
dmitrytrager 0508941
Merge branch 'main' into language-model-16
dmitrytrager 19cec14
replace schema with sql structure
dmitrytrager 1d4ac7e
Merge branch 'main' into language-model-16
dmitrytrager 2bb0dac
fix code style
dmitrytrager fd153ee
replace slim templates with erb, remove slim-rails
dmitrytrager 1000347
Revert "replace schema with sql structure"
dmitrytrager 3ca5b16
do not use sql structure
dmitrytrager 20df7e2
Merge branch 'main' into language-model-16
dmitrytrager File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,39 @@ | ||
| class LanguagesController < ApplicationController | ||
| before_action :set_language, only: [ :edit, :update ] | ||
|
|
||
| def index | ||
| @languages = Language.all | ||
| end | ||
|
|
||
| def new | ||
| @language = Language.new | ||
| end | ||
|
|
||
| def create | ||
| @language = Language.new(language_params) | ||
|
|
||
| if @language.save | ||
| redirect_to languages_path | ||
| else | ||
| render :new | ||
| end | ||
| end | ||
|
|
||
| def edit | ||
| end | ||
|
|
||
| def update | ||
| @language.update(language_params) | ||
| redirect_to languages_path | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def language_params | ||
| params.require(:language).permit(:name, :file_share_folder) | ||
| end | ||
|
|
||
| def set_language | ||
| @language = Language.find(params[:id]) | ||
| end | ||
| end |
This file contains hidden or 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,3 @@ | ||
| class Language < ApplicationRecord | ||
| validates :name, :file_share_folder, presence: true, uniqueness: true | ||
| end |
This file contains hidden or 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,15 @@ | ||
|
|
||
| = form_for language do |f| | ||
| .form-body | ||
| .row | ||
| = render "shared/errors", resource: language | ||
| .col-12 | ||
| .form-group | ||
| = f.label :name | ||
| = f.text_field :name, class: "form-control", placeholder: "Name" | ||
| .form-group | ||
| = f.label :file_share_folder | ||
| = f.text_field :file_share_folder, class: "form-control", placeholder: "Folder" | ||
| .col-12.d-flex.justify-content-end | ||
| = f.submit "Save", class: "btn btn-primary me-1 mb-1" | ||
| = link_to "Cancel", languages_path, class: "btn btn-light-secondary me-1 mb-1" |
This file contains hidden or 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,11 @@ | ||
| content_for :title, "Editing language" | ||
|
|
||
| section#basic-vertical-layouts | ||
| .row.match-height | ||
| .col-md-6.col-12 | ||
| .card | ||
| .card-header | ||
| h2.card-title Edit language | ||
| .card-content | ||
| .card-body | ||
| = render "form", language: @language |
This file contains hidden or 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,30 @@ | ||
| content_for :title, "Languages" | ||
|
|
||
| section.section | ||
| .row#table-striped | ||
| .col-12.cold-md-12 | ||
| .card | ||
| .card-header.d-flex.justify-content-between.align-items-center | ||
| h2.card-title Languages | ||
| = link_to new_language_path, class: "btn btn-primary" do | ||
| i.bi.bi-plus | ||
| | Add New Language | ||
| .card-content | ||
| .card-body | ||
| p.card-text Some important information or instruction can be placed here. | ||
| .table-responsive | ||
| table.table.table-lg.table-striped.mb-0 | ||
| thead | ||
| tr | ||
| th Name | ||
| th File share folder | ||
| th.text-end Actions | ||
| tbody | ||
| - @languages.each do |language| | ||
| tr | ||
| td.text-bold-500 = language.name | ||
| td.text-bold-500 = language.file_share_folder | ||
| td.text-end | ||
| = link_to edit_language_path(language), class: "btn btn-secondary btn-sm" do | ||
| i.bi.bi-pencil | ||
| | Edit |
This file contains hidden or 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,11 @@ | ||
| content_for :title, "New language" | ||
|
|
||
| section#basic-vertical-layouts | ||
| .row.match-height | ||
| .col-md-6.col-12 | ||
| .card | ||
| .card-header | ||
| h2.card-title New language | ||
| .card-content | ||
| .card-body | ||
| = render "form", language: @language |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,53 @@ | ||
| #sidebar | ||
| .sidebar-wrapper.active | ||
| .sidebar-header.position-relative | ||
| .d-flex.justify-content-between.align-items-center | ||
| .logo | ||
| a href="index.html" | ||
| | Logo | ||
| .theme-toggle.d-flex.gap-2.align-items-center.mt-2 | ||
| svg.iconify.iconify--system-uicons[xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="20" height="20" preserveaspectratio="xMidYMid meet" viewbox="0 0 21 21"] | ||
| g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" | ||
| path d="M10.5 14.5c2.219 0 4-1.763 4-3.982a4.003 4.003 0 0 0-4-4.018c-2.219 0-4 1.781-4 4c0 2.219 1.781 4 4 4zM4.136 4.136L5.55 5.55m9.9 9.9l1.414 1.414M1.5 10.5h2m14 0h2M4.135 16.863L5.55 15.45m9.899-9.9l1.414-1.415M10.5 19.5v-2m0-14v-2" opacity=".3" | ||
| g transform="translate(-210 -1)" | ||
| path d="M220.5 2.5v2m6.5.5l-1.5 1.5" | ||
| circle cx="220.5" cy="11.5" r="4" | ||
| path d="m214 5l1.5 1.5m5 14v-2m6.5-.5l-1.5-1.5M214 18l1.5-1.5m-4-5h2m14 0h2" | ||
| .form-check.form-switch.fs-6 | ||
| input#toggle-dark.form-check-input.me-0[type="checkbox" style="cursor: pointer"] | ||
| label.form-check-label | ||
| svg.iconify.iconify--mdi[xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="20" height="20" preserveaspectratio="xMidYMid meet" viewbox="0 0 24 24"] | ||
| path fill="currentColor" d="m17.75 4.09l-2.53 1.94l.91 3.06l-2.63-1.81l-2.63 1.81l.91-3.06l-2.53-1.94L12.44 4l1.06-3l1.06 3l3.19.09m3.5 6.91l-1.64 1.25l.59 1.98l-1.7-1.17l-1.7 1.17l.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95l2.06.05m-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85c-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14c.4-.4.82-.76 1.27-1.08c.75-.53 1.93.36 1.85 1.19c-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82c-2.81 3.14-2.7 7.96.31 10.98c3.02 3.01 7.84 3.12 10.98.31Z" | ||
|
|
||
| .sidebar-toggler.x | ||
| a.sidebar-hide.d-xl-none.d-block[href="#"] | ||
| i.bi.bi-x.bi-middle | ||
| .sidebar-menu | ||
| ul.menu | ||
| li.sidebar-title | ||
| | Administration | ||
| li.sidebar-item | ||
| a.sidebar-link[href="#{regions_path}"] | ||
| i.bi.bi-globe | ||
| span | ||
| | Regions | ||
| li.sidebar-item | ||
| a.sidebar-link[href="table.html"] | ||
| i.bi.bi-hospital-fill | ||
| span | ||
| | Providers | ||
| li.sidebar-item | ||
| a.sidebar-link[href="ui-file-uploader.html"] | ||
| i.bi.bi-tags-fill | ||
| span | ||
| | Topics | ||
| li.sidebar-item | ||
| a.sidebar-link[href="#{languages_path}"] | ||
| i.bi.bi-translate | ||
| span | ||
| | Languages | ||
| li.sidebar-item | ||
| a.sidebar-link[href="application-chat.html"] | ||
| i.bi.bi-people | ||
| span | ||
| | Users |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should add this gem -- It adds additional complexity for new people/designers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gem does not disable using erb for us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know but having slim in the app makes it harder for newbies to contribute since they may not be familiar with slim/haml syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add some words into Readme saying that people can use what they best contribute with?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with not adding more complexity. We should keep just one template DSL or format; it will avoid confusion or divergent styles for later markup implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was that there is no complexity in CRUD application markup which Skillrx really is.
At the same time Erb template can be twice bigger and that makes things a bit slow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanmarcia @hernanvicente I've removed slim