27 changed files with 528 additions and 42 deletions
@ -0,0 +1,35 @@ |
|||||
|
Trestle.resource(:education_entries) do |
||||
|
menu do |
||||
|
item :education_entries, icon: "fa fa-star" |
||||
|
end |
||||
|
|
||||
|
# Customize the table columns shown on the index view. |
||||
|
# |
||||
|
# table do |
||||
|
# column :name |
||||
|
# column :created_at, align: :center |
||||
|
# actions |
||||
|
# end |
||||
|
|
||||
|
# Customize the form fields shown on the new/edit views. |
||||
|
# |
||||
|
# form do |education_entry| |
||||
|
# text_field :name |
||||
|
# |
||||
|
# row do |
||||
|
# col { datetime_field :updated_at } |
||||
|
# col { datetime_field :created_at } |
||||
|
# end |
||||
|
# end |
||||
|
|
||||
|
# By default, all parameters passed to the update and create actions will be |
||||
|
# permitted. If you do not have full trust in your users, you should explicitly |
||||
|
# define the list of permitted parameters. |
||||
|
# |
||||
|
# For further information, see the Rails documentation on Strong Parameters: |
||||
|
# http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters |
||||
|
# |
||||
|
# params do |params| |
||||
|
# params.require(:education_entry).permit(:name, ...) |
||||
|
# end |
||||
|
end |
||||
@ -0,0 +1,35 @@ |
|||||
|
Trestle.resource(:skills) do |
||||
|
menu do |
||||
|
item :skills, icon: "fa fa-star" |
||||
|
end |
||||
|
|
||||
|
# Customize the table columns shown on the index view. |
||||
|
# |
||||
|
# table do |
||||
|
# column :name |
||||
|
# column :created_at, align: :center |
||||
|
# actions |
||||
|
# end |
||||
|
|
||||
|
# Customize the form fields shown on the new/edit views. |
||||
|
# |
||||
|
# form do |skill| |
||||
|
# text_field :name |
||||
|
# |
||||
|
# row do |
||||
|
# col { datetime_field :updated_at } |
||||
|
# col { datetime_field :created_at } |
||||
|
# end |
||||
|
# end |
||||
|
|
||||
|
# By default, all parameters passed to the update and create actions will be |
||||
|
# permitted. If you do not have full trust in your users, you should explicitly |
||||
|
# define the list of permitted parameters. |
||||
|
# |
||||
|
# For further information, see the Rails documentation on Strong Parameters: |
||||
|
# http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters |
||||
|
# |
||||
|
# params do |params| |
||||
|
# params.require(:skill).permit(:name, ...) |
||||
|
# end |
||||
|
end |
||||
@ -0,0 +1,35 @@ |
|||||
|
Trestle.resource(:users) do |
||||
|
menu do |
||||
|
item :users, icon: "fa fa-star" |
||||
|
end |
||||
|
|
||||
|
# Customize the table columns shown on the index view. |
||||
|
# |
||||
|
# table do |
||||
|
# column :name |
||||
|
# column :created_at, align: :center |
||||
|
# actions |
||||
|
# end |
||||
|
|
||||
|
# Customize the form fields shown on the new/edit views. |
||||
|
# |
||||
|
# form do |user| |
||||
|
# text_field :name |
||||
|
# |
||||
|
# row do |
||||
|
# col { datetime_field :updated_at } |
||||
|
# col { datetime_field :created_at } |
||||
|
# end |
||||
|
# end |
||||
|
|
||||
|
# By default, all parameters passed to the update and create actions will be |
||||
|
# permitted. If you do not have full trust in your users, you should explicitly |
||||
|
# define the list of permitted parameters. |
||||
|
# |
||||
|
# For further information, see the Rails documentation on Strong Parameters: |
||||
|
# http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters |
||||
|
# |
||||
|
# params do |params| |
||||
|
# params.require(:user).permit(:name, ...) |
||||
|
# end |
||||
|
end |
||||
@ -0,0 +1,35 @@ |
|||||
|
Trestle.resource(:work_experiences) do |
||||
|
menu do |
||||
|
item :work_experiences, icon: "fa fa-star" |
||||
|
end |
||||
|
|
||||
|
# Customize the table columns shown on the index view. |
||||
|
# |
||||
|
# table do |
||||
|
# column :name |
||||
|
# column :created_at, align: :center |
||||
|
# actions |
||||
|
# end |
||||
|
|
||||
|
# Customize the form fields shown on the new/edit views. |
||||
|
# |
||||
|
# form do |work_experience| |
||||
|
# text_field :name |
||||
|
# |
||||
|
# row do |
||||
|
# col { datetime_field :updated_at } |
||||
|
# col { datetime_field :created_at } |
||||
|
# end |
||||
|
# end |
||||
|
|
||||
|
# By default, all parameters passed to the update and create actions will be |
||||
|
# permitted. If you do not have full trust in your users, you should explicitly |
||||
|
# define the list of permitted parameters. |
||||
|
# |
||||
|
# For further information, see the Rails documentation on Strong Parameters: |
||||
|
# http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters |
||||
|
# |
||||
|
# params do |params| |
||||
|
# params.require(:work_experience).permit(:name, ...) |
||||
|
# end |
||||
|
end |
||||
@ -0,0 +1,7 @@ |
|||||
|
// This file may be used for providing additional customizations to the Trestle
|
||||
|
// admin. It will be automatically included within all admin pages.
|
||||
|
//
|
||||
|
// For organizational purposes, you may wish to define your customizations
|
||||
|
// within individual partials and `require` them here.
|
||||
|
//
|
||||
|
// e.g. //= require "trestle/custom/my_custom_js"
|
||||
@ -0,0 +1,8 @@ |
|||||
|
// This file may be used for providing additional customizations to the Trestle |
||||
|
// admin. It will be automatically included within all admin pages. |
||||
|
// |
||||
|
// For organizational purposes, you may wish to define your customizations |
||||
|
// within individual partials and `import` them here, e.g. |
||||
|
// |
||||
|
// @import "trestle/custom/my_custom_css"; |
||||
|
// |
||||
@ -0,0 +1,13 @@ |
|||||
|
// This file may be used to override the Sass variables used within the Trestle |
||||
|
// admin. It will be automatically included within all admin pages. |
||||
|
// |
||||
|
// A subset of Bootstrap and Trestle defaults can be set here. |
||||
|
// For a detailed overview of the customizable variables, see the file |
||||
|
// `frontend/theme/trestle/theme/_defaults.scss` within the Trestle source. |
||||
|
|
||||
|
// Customize admin theme colors: |
||||
|
// |
||||
|
// $theme-colors: ( |
||||
|
// "primary": #337ab7, |
||||
|
// "secondary": #719dc3 |
||||
|
// ); |
||||
@ -0,0 +1,3 @@ |
|||||
|
class EducationEntry < ApplicationRecord |
||||
|
belongs_to :user |
||||
|
end |
||||
@ -0,0 +1,3 @@ |
|||||
|
class Skill < ApplicationRecord |
||||
|
belongs_to :user |
||||
|
end |
||||
@ -0,0 +1,5 @@ |
|||||
|
class User < ApplicationRecord |
||||
|
has_many :work_experiences |
||||
|
has_many :skills |
||||
|
has_many :education_entries |
||||
|
end |
||||
@ -1,2 +1,3 @@ |
|||||
class WorkExperience < ApplicationRecord |
class WorkExperience < ApplicationRecord |
||||
|
belongs_to :user |
||||
end |
end |
||||
|
|||||
@ -0,0 +1,133 @@ |
|||||
|
Trestle.configure do |config| |
||||
|
# == Customization Options |
||||
|
# |
||||
|
# Set the page title shown in the main header within the admin. |
||||
|
# |
||||
|
config.site_title = "Latex Resumes" |
||||
|
|
||||
|
# Specify a custom image to be used in place of the site title for mobile and |
||||
|
# expanded/desktop navigation. These images should be placed within your |
||||
|
# asset paths, e.g. app/assets/images. |
||||
|
# |
||||
|
# config.site_logo = "logo.png" |
||||
|
|
||||
|
# Specify a custom image to be used for the collapsed/tablet navigation. |
||||
|
# |
||||
|
# config.site_logo_small = "logo-small.png" |
||||
|
|
||||
|
# Specify a favicon to be used within the admin. |
||||
|
# |
||||
|
# config.favicon = "favicon.ico" |
||||
|
|
||||
|
# Set the text shown in the page footer within the admin. |
||||
|
# Defaults to 'Powered by Trestle'. |
||||
|
# |
||||
|
# config.footer = "Powered by Trestle" |
||||
|
|
||||
|
# Sets the default precision for timestamps (either :minutes or :seconds). |
||||
|
# Defaults to :minutes. |
||||
|
# |
||||
|
# config.timestamp_precision = :minutes |
||||
|
|
||||
|
# == Mounting Options |
||||
|
# |
||||
|
# Set the path at which to mount the Trestle admin. Defaults to /admin. |
||||
|
# |
||||
|
# config.path = "/admin" |
||||
|
|
||||
|
# Toggle whether Trestle should automatically mount the admin within your |
||||
|
# Rails application's routes. Defaults to true. |
||||
|
# |
||||
|
# config.automount = false |
||||
|
|
||||
|
# == Navigation Options |
||||
|
# |
||||
|
# Set the path to consider the application root (for title links and breadcrumbs). |
||||
|
# Defaults to the same value as `config.path`. |
||||
|
# |
||||
|
# config.root = "/" |
||||
|
|
||||
|
# Set the initial breadcrumbs to display in the breadcrumb trail. |
||||
|
# Defaults to a breadcrumb labeled 'Home' linking to to the application root. |
||||
|
# |
||||
|
# config.root_breadcrumbs = -> { [Trestle::Breadcrumb.new("Home", Trestle.config.root)] } |
||||
|
|
||||
|
# Set the default icon class to use when it is not explicitly provided. |
||||
|
# Defaults to "fa fa-arrow-circle-o-right". |
||||
|
# |
||||
|
# config.default_navigation_icon = "fa fa-arrow-circle-o-right" |
||||
|
|
||||
|
# Add an explicit menu block to be added to the admin navigation. |
||||
|
# |
||||
|
# config.menu do |
||||
|
# group "Custom Group" do |
||||
|
# item "Custom Link", "/admin/custom", icon: "fa fa-car", badge: { text: "NEW!", class: "label-success" }, priority: :first |
||||
|
# end |
||||
|
# end |
||||
|
|
||||
|
# == Extension Options |
||||
|
# |
||||
|
# Specify helper modules to expose to the admin. |
||||
|
# |
||||
|
# config.helper :all |
||||
|
|
||||
|
# Register callbacks to run before, after or around all Trestle actions. |
||||
|
# |
||||
|
# config.before_action do |controller| |
||||
|
# Rails.logger.debug("Before action") |
||||
|
# end |
||||
|
# |
||||
|
# config.after_action do |controller| |
||||
|
# Rails.logger.debug("After action") |
||||
|
# end |
||||
|
# |
||||
|
# config.around_action do |controller, block| |
||||
|
# Rails.logger.debug("Around action (before)") |
||||
|
# block.call |
||||
|
# Rails.logger.debug("Around action (after)") |
||||
|
# end |
||||
|
|
||||
|
# Specify a custom hook to be injected into the admin. |
||||
|
# |
||||
|
# config.hook(:stylesheets) do |
||||
|
# stylesheet_link_tag "custom" |
||||
|
# end |
||||
|
|
||||
|
# Toggle whether Turbolinks is enabled within the admin. |
||||
|
# Defaults to true if Turbolinks is available. |
||||
|
# |
||||
|
# config.turbolinks = false |
||||
|
|
||||
|
# Specify the parameters that should persist across requests when |
||||
|
# paginating or reordering. Defaults to [:sort, :order, :scope]. |
||||
|
# |
||||
|
# config.persistent_params << :query |
||||
|
|
||||
|
# List of methods to try calling on an instance when displayed by the `display` helper. |
||||
|
# Defaults to [:display_name, :full_name, :name, :title, :username, :login, :email]. |
||||
|
# |
||||
|
# config.display_methods.unshift(:admin_label) |
||||
|
|
||||
|
# Customize the default adapter class used by all admin resources. |
||||
|
# See the documentation on Trestle::Adapters::Adapter for details on |
||||
|
# the adapter methods that can be customized. |
||||
|
# |
||||
|
# config.default_adapter = Trestle::Adapters.compose(Trestle::Adapters::SequelAdapter) |
||||
|
# config.default_adapter.include MyAdapterExtensions |
||||
|
|
||||
|
# Register a form field type to be made available to the Trestle form builder. |
||||
|
# Field types should conform to the following method definition: |
||||
|
# |
||||
|
# class CustomFormField |
||||
|
# def initialize(builder, template, name, options={}, &block); end |
||||
|
# def render; end |
||||
|
# end |
||||
|
# |
||||
|
# config.form_field :custom, CustomFormField |
||||
|
|
||||
|
# == Debugging Options |
||||
|
# |
||||
|
# Enable debugging of form errors. Defaults to true in development mode. |
||||
|
# |
||||
|
# config.debug_form_errors = true |
||||
|
end |
||||
@ -0,0 +1,18 @@ |
|||||
|
class CreateUsers < ActiveRecord::Migration[7.0] |
||||
|
def change |
||||
|
create_table :users do |t| |
||||
|
t.string :name |
||||
|
t.string :objective |
||||
|
t.string :address |
||||
|
t.string :email |
||||
|
t.string :phone |
||||
|
t.string :linkedin |
||||
|
t.string :github |
||||
|
t.string :other_page_url |
||||
|
|
||||
|
t.timestamps |
||||
|
end |
||||
|
|
||||
|
add_reference :work_experiences, :user, index: true |
||||
|
end |
||||
|
end |
||||
@ -0,0 +1,13 @@ |
|||||
|
class CreateEducationEntries < ActiveRecord::Migration[7.0] |
||||
|
def change |
||||
|
create_table :education_entries do |t| |
||||
|
t.string :title |
||||
|
t.string :institution |
||||
|
t.string :period |
||||
|
t.string :location |
||||
|
t.references :user |
||||
|
t.timestamps |
||||
|
end |
||||
|
add_column :work_experiences, :reference_date, :date |
||||
|
end |
||||
|
end |
||||
@ -0,0 +1,11 @@ |
|||||
|
class CreateSkills < ActiveRecord::Migration[7.0] |
||||
|
def change |
||||
|
create_table :skills do |t| |
||||
|
t.string :title |
||||
|
t.string :detail |
||||
|
t.integer :order |
||||
|
t.references :user |
||||
|
t.timestamps |
||||
|
end |
||||
|
end |
||||
|
end |
||||
@ -0,0 +1,13 @@ |
|||||
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html |
||||
|
|
||||
|
one: |
||||
|
title: MyString |
||||
|
institution: MyString |
||||
|
period: MyString |
||||
|
location: MyString |
||||
|
|
||||
|
two: |
||||
|
title: MyString |
||||
|
institution: MyString |
||||
|
period: MyString |
||||
|
location: MyString |
||||
@ -0,0 +1,11 @@ |
|||||
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html |
||||
|
|
||||
|
one: |
||||
|
title: MyString |
||||
|
detail: MyString |
||||
|
order: 1 |
||||
|
|
||||
|
two: |
||||
|
title: MyString |
||||
|
detail: MyString |
||||
|
order: 1 |
||||
@ -0,0 +1,21 @@ |
|||||
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html |
||||
|
|
||||
|
one: |
||||
|
name: MyString |
||||
|
objective: MyString |
||||
|
address: MyString |
||||
|
email: MyString |
||||
|
phone: MyString |
||||
|
linkedin: MyString |
||||
|
github: MyString |
||||
|
other_page_url: MyString |
||||
|
|
||||
|
two: |
||||
|
name: MyString |
||||
|
objective: MyString |
||||
|
address: MyString |
||||
|
email: MyString |
||||
|
phone: MyString |
||||
|
linkedin: MyString |
||||
|
github: MyString |
||||
|
other_page_url: MyString |
||||
@ -0,0 +1,7 @@ |
|||||
|
require "test_helper" |
||||
|
|
||||
|
class EducationEntryTest < ActiveSupport::TestCase |
||||
|
# test "the truth" do |
||||
|
# assert true |
||||
|
# end |
||||
|
end |
||||
@ -0,0 +1,7 @@ |
|||||
|
require "test_helper" |
||||
|
|
||||
|
class SkillTest < ActiveSupport::TestCase |
||||
|
# test "the truth" do |
||||
|
# assert true |
||||
|
# end |
||||
|
end |
||||
@ -0,0 +1,7 @@ |
|||||
|
require "test_helper" |
||||
|
|
||||
|
class UserTest < ActiveSupport::TestCase |
||||
|
# test "the truth" do |
||||
|
# assert true |
||||
|
# end |
||||
|
end |
||||
Loading…
Reference in new issue