Курсовые - Интернет-каталог косметики

ПРИЛОЖЕНИЕ А

ПРИЛОЖЕНИЕ А

(обязательное)

Шаблон home/index.html.erb (главная страница)

 

<% @body_id = 'home-page' %>

<% content_for :sidebar do %>

  <div data-hook="homepage_sidebar_navigation">

    <%= render partial: 'spree/shared/taxonomies' %>

  </div>

<% end %>

<div data-hook="homepage_products">

  <% cache(cache_key_for_products) do %>

    <%= render partial: 'spree/shared/products', locals: { products: @products } %>

  <% end %>

</div>

Листинг кода создания схемы баз данных

ActiveRecord::Schema.define(version: 20180607090520) do

  # These are extensions that must be enabled in order to support this database

  enable_extension "plpgsql"

  create_table "friendly_id_slugs", id: :serial, force: :cascade do |t|

    t.string "slug", null: false

    t.integer "sluggable_id", null: false

    t.string "sluggable_type", limit: 50

    t.string "scope"

    t.datetime "created_at"

    t.datetime "deleted_at"

    t.index ["deleted_at"], name: "index_friendly_id_slugs_on_deleted_at"

    t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true

    t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"

    t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"

    t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"

  end

  create_table "spree_addresses", id: :serial, force: :cascade do |t|

    t.string "firstname"

    t.string "lastname"

    t.string "address1"

    t.string "address2"

    t.string "city"

    t.string "zipcode"

    t.string "phone"

    t.string "state_name"

    t.string "alternative_phone"

    t.string "company"

    t.integer "state_id"

    t.integer "country_id"

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.index ["country_id"], name: "index_spree_addresses_on_country_id"

    t.index ["firstname"], name: "index_addresses_on_firstname"

    t.index ["lastname"], name: "index_addresses_on_lastname"

    t.index ["state_id"], name: "index_spree_addresses_on_state_id"

  end

  create_table "spree_credit_cards", id: :serial, force: :cascade do |t|

    t.string "month"

    t.string "year"

    t.string "cc_type"

    t.string "last_digits"

    t.integer "address_id"

    t.string "gateway_customer_profile_id"

    t.string "gateway_payment_profile_id"

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.string "name"

    t.integer "user_id"

    t.integer "payment_method_id"

    t.boolean "default", default: false, null: false

    t.index ["address_id"], name: "index_spree_credit_cards_on_address_id"

    t.index ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id"

    t.index ["user_id"], name: "index_spree_credit_cards_on_user_id"

  end

  create_table "spree_customer_returns", id: :serial, force: :cascade do |t|

    t.string "number"

    t.integer "stock_location_id"

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.index ["number"], name: "index_spree_customer_returns_on_number", unique: true

    t.index ["stock_location_id"], name: "index_spree_customer_returns_on_stock_location_id"

  end

  create_table "spree_gateways", id: :serial, force: :cascade do |t|

    t.string "type"

    t.string "name"

    t.text "description"

    t.boolean "active", default: true

    t.string "environment", default: "development"

    t.string "server", default: "test"

    t.boolean "test_mode", default: true

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.text "preferences"

    t.index ["active"], name: "index_spree_gateways_on_active"

    t.index ["test_mode"], name: "index_spree_gateways_on_test_mode"

  end

  create_table "spree_orders", id: :serial, force: :cascade do |t|

    t.string "number", limit: 32

    t.decimal "item_total", precision: 10, scale: 2, default: "0.0", null: false

    t.decimal "total", precision: 10, scale: 2, default: "0.0", null: false

    t.string "state"

    t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0", null: false

    t.integer "user_id"

    t.datetime "completed_at"

    t.integer "bill_address_id"

    t.integer "ship_address_id"

    t.decimal "payment_total", precision: 10, scale: 2, default: "0.0"

    t.string "shipment_state"

    t.string "payment_state"

    t.string "email"

    t.text "special_instructions"

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.string "currency"

    t.string "last_ip_address"

    t.integer "created_by_id"

    t.decimal "shipment_total", precision: 10, scale: 2, default: "0.0", null: false

    t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"

    t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"

    t.string "channel", default: "spree"

    t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false

    t.integer "item_count", default: 0

    t.integer "approver_id"

    t.datetime "approved_at"

    t.boolean "confirmation_delivered", default: false

    t.boolean "considered_risky", default: false

    t.string "guest_token"

    t.datetime "canceled_at"

    t.integer "canceler_id"

    t.integer "store_id"

    t.integer "state_lock_version", default: 0, null: false

    t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false

    t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false

    t.index ["approver_id"], name: "index_spree_orders_on_approver_id"

    t.index ["bill_address_id"], name: "index_spree_orders_on_bill_address_id"

    t.index ["canceler_id"], name: "index_spree_orders_on_canceler_id"

    t.index ["completed_at"], name: "index_spree_orders_on_completed_at"

    t.index ["confirmation_delivered"], name: "index_spree_orders_on_confirmation_delivered"

    t.index ["considered_risky"], name: "index_spree_orders_on_considered_risky"

    t.index ["created_by_id"], name: "index_spree_orders_on_created_by_id"

    t.index ["guest_token"], name: "index_spree_orders_on_guest_token"

    t.index ["number"], name: "index_spree_orders_on_number", unique: true

    t.index ["ship_address_id"], name: "index_spree_orders_on_ship_address_id"

    t.index ["store_id"], name: "index_spree_orders_on_store_id"

    t.index ["user_id", "created_by_id"], name: "index_spree_orders_on_user_id_and_created_by_id"

  end

  create_table "spree_payments", id: :serial, force: :cascade do |t|

    t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false

    t.integer "order_id"

    t.string "source_type"

    t.integer "source_id"

    t.integer "payment_method_id"

    t.string "state"

    t.string "response_code"

    t.string "avs_response"

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.string "number"

    t.string "cvv_response_code"

    t.string "cvv_response_message"

    t.index ["number"], name: "index_spree_payments_on_number", unique: true

    t.index ["order_id"], name: "index_spree_payments_on_order_id"

    t.index ["payment_method_id"], name: "index_spree_payments_on_payment_method_id"

    t.index ["source_id", "source_type"], name: "index_spree_payments_on_source_id_and_source_type"

  end

create_table "spree_stores", id: :serial, force: :cascade do |t|

    t.string "name"

    t.string "url"

    t.text "meta_description"

    t.text "meta_keywords"

    t.string "seo_title"

    t.string "mail_from_address"

    t.string "default_currency"

    t.string "code"

    t.boolean "default", default: false, null: false

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.index "lower((code)::text)", name: "index_spree_stores_on_lower_code", unique: true

    t.index ["default"], name: "index_spree_stores_on_default"

    t.index ["url"], name: "index_spree_stores_on_url"

  end

  create_table "spree_taxons", id: :serial, force: :cascade do |t|

    t.integer "parent_id"

    t.integer "position", default: 0

    t.string "name", null: false

    t.string "permalink"

    t.integer "taxonomy_id"

    t.integer "lft"

    t.integer "rgt"

    t.string "icon_file_name"

    t.string "icon_content_type"

    t.integer "icon_file_size"

    t.datetime "icon_updated_at"

    t.text "description"

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.string "meta_title"

    t.string "meta_description"

    t.string "meta_keywords"

    t.integer "depth"

    t.index ["lft"], name: "index_spree_taxons_on_lft"

    t.index ["name"], name: "index_spree_taxons_on_name"

    t.index ["parent_id"], name: "index_taxons_on_parent_id"

    t.index ["permalink"], name: "index_taxons_on_permalink"

    t.index ["position"], name: "index_spree_taxons_on_position"

    t.index ["rgt"], name: "index_spree_taxons_on_rgt"

    t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id"

  end

  create_table "spree_users", id: :serial, force: :cascade do |t|

    t.string "encrypted_password", limit: 128

    t.string "password_salt", limit: 128

    t.string "email"

    t.string "remember_token"

    t.string "persistence_token"

    t.string "reset_password_token"

    t.string "perishable_token"

    t.integer "sign_in_count", default: 0, null: false

    t.integer "failed_attempts", default: 0, null: false

    t.datetime "last_request_at"

    t.datetime "current_sign_in_at"

    t.datetime "last_sign_in_at"

    t.string "current_sign_in_ip"

    t.string "last_sign_in_ip"

    t.string "login"

    t.integer "ship_address_id"

    t.integer "bill_address_id"

    t.string "authentication_token"

    t.datetime "reset_password_sent_at"

    t.datetime "created_at", null: false

    t.datetime "updated_at", null: false

    t.string "spree_api_key", limit: 48

    t.datetime "remember_created_at"

    t.datetime "deleted_at"

    t.string "confirmation_token"

    t.datetime "confirmed_at"

    t.datetime "confirmation_sent_at"

    t.index ["bill_address_id"], name: "index_spree_users_on_bill_address_id"

    t.index ["deleted_at"], name: "index_spree_users_on_deleted_at"

    t.index ["email"], name: "email_idx_unique", unique: true

    t.index ["ship_address_id"], name: "index_spree_users_on_ship_address_id"

    t.index ["spree_api_key"], name: "index_spree_users_on_spree_api_key"

  end

end

Количество комментариев: 0

Для того, чтобы оставить коментарий необходимо зарегистрироваться