diff --git a/app/views/admin/chambas/_new.html.erb b/app/views/admin/chambas/_new.html.erb
new file mode 100644
index 0000000000000..6139a25f5b42a
--- /dev/null
+++ b/app/views/admin/chambas/_new.html.erb
@@ -0,0 +1 @@
+Esto sera un formulario para crear nuevas chambas desde el apartado de admin sin el bot de slack :)
diff --git a/app/views/admin/chambas/index.html.erb b/app/views/admin/chambas/index.html.erb
new file mode 100644
index 0000000000000..16c0cc74d36f7
--- /dev/null
+++ b/app/views/admin/chambas/index.html.erb
@@ -0,0 +1,50 @@
+
+ Política publica: Acciones del gobierno (o documentos que generen o propongan acciones del gobierno), que surgen de
+ un proceso de diagnóstico y análisis de factibilidad para la atención efectiva de problemas públicos,
+ en donde la definición de problemas y soluciones se lleva a cabo con la participación ciudadana.
+
+
+
+
+ Política publica: Acciones del gobierno (o documentos que generen o propongan acciones del gobierno), que surgen de
+ un proceso de diagnóstico y análisis de factibilidad para la atención efectiva de problemas públicos,
+ en donde la definición de problemas y soluciones se lleva a cabo con la participación ciudadana.
+
+
+
+
+
diff --git a/config/database.yml b/config/database.yml
index eb2b8ab26c086..0435f4c354b10 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -27,11 +27,13 @@ default: &default
development:
<<: *default
- url: <%= ENV.fetch("DATABASE_URL", "postgres:///Forem_development") %>
database: <%= ENV.fetch("DATABASE_NAME", "Forem_development") %>
variables:
statement_timeout: <%= ENV.fetch("STATEMENT_TIMEOUT", 10_000).to_i %>
+ username: forem-test
+ password: forem-test
+ #url: <%= ENV.fetch("DATABASE_URL", "postgres:///Forem_development") %>
# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
diff --git a/config/routes.rb b/config/routes.rb
index 1dffa2f81d81d..c35e521f1451d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -245,7 +245,14 @@
get "/💸", to: redirect("t/hiring")
get "/survey", to: redirect("https://dev.to/ben/final-thoughts-on-the-state-of-the-web-survey-44nn")
get "/sponsors", to: "pages#sponsors"
+ get "/glosario", to: "pages#glosario"
get "/search", to: "stories/articles_search#index"
+
+ get "/chambas", to: "chambas#index"
+ get "chambas/:chamba_id", to: "chambas#chamba", as: "chamba"
+ get "/chambas:filtro_area", to: "chambas#filtro_areas"
+ get "/chamba", to: "chambas#chamba"
+
post "articles/preview", to: "articles#preview"
post "comments/preview", to: "comments#preview"
@@ -353,6 +360,17 @@
get "/:username/:slug/comments/:id_code/edit", to: "comments#edit"
get "/:username/:slug/comments/:id_code/delete_confirm", to: "comments#delete_confirm"
+ # Chambas admin
+ get "/:username/:slug/chambas", to: "admin/chambas#index"
+
+ # crud chamba from forem
+ post "/chambas", to: "admin/chambas#create_chamba_from_forem"
+ post "/admin/content_manager/edit_chambas_list", to: "admin/chambas#update_chamba_from_list" #this is only for update exp_date, and for bann or approve chambas
+ post "/admin/content_manager/update_chamba_list", to: "admin/chambas#update_chamba"
+
+
+
+
# Proper link format
get "/:username/comment/:id_code", to: "comments#index"
get "/:username/comment/:id_code/edit", to: "comments#edit"
diff --git a/db/migrate/20220203235658_create_chambas.rb b/db/migrate/20220203235658_create_chambas.rb
new file mode 100644
index 0000000000000..bdb8fea1d8e52
--- /dev/null
+++ b/db/migrate/20220203235658_create_chambas.rb
@@ -0,0 +1,16 @@
+class CreateChambas < ActiveRecord::Migration[6.1]
+ def change
+ create_table :chambas do |t|
+ t.string :title
+ t.string :post_date
+ t.string :date
+ t.date :exp_date
+ t.string :description
+ t.string :organization
+ t.string :location
+ t.integer :salary
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20220204001843_create_areas.rb b/db/migrate/20220204001843_create_areas.rb
new file mode 100644
index 0000000000000..79eee80fd6a34
--- /dev/null
+++ b/db/migrate/20220204001843_create_areas.rb
@@ -0,0 +1,9 @@
+class CreateAreas < ActiveRecord::Migration[6.1]
+ def change
+ create_table :areas do |t|
+ t.string :name
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20220204002225_create_areas_chambas.rb b/db/migrate/20220204002225_create_areas_chambas.rb
new file mode 100644
index 0000000000000..a501fd6736073
--- /dev/null
+++ b/db/migrate/20220204002225_create_areas_chambas.rb
@@ -0,0 +1,10 @@
+class CreateAreasChambas < ActiveRecord::Migration[6.1]
+ def change
+ create_table :areas_chambas do |t|
+ t.references :chamba, null: false, foreign_key: true
+ t.references :area, null: false, foreign_key: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20220204002336_create_requerimientos_chambas.rb b/db/migrate/20220204002336_create_requerimientos_chambas.rb
new file mode 100644
index 0000000000000..0f26f16581465
--- /dev/null
+++ b/db/migrate/20220204002336_create_requerimientos_chambas.rb
@@ -0,0 +1,10 @@
+class CreateRequerimientosChambas < ActiveRecord::Migration[6.1]
+ def change
+ create_table :requerimientos_chambas do |t|
+ t.string :description
+ t.references :chamba, null: false, foreign_key: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20220216222509_columns_added_to_chambas.rb b/db/migrate/20220216222509_columns_added_to_chambas.rb
new file mode 100644
index 0000000000000..c90269f2dc78e
--- /dev/null
+++ b/db/migrate/20220216222509_columns_added_to_chambas.rb
@@ -0,0 +1,7 @@
+class ColumnsAddedToChamba < ActiveRecord::Migration[6.1]
+ def change
+ add_column :chambas, :approve, :string
+ add_column :chambas, :requirements, :string
+ add_column :chambas, :stall, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index bcfa1a0be252a..4db1dd2d8f5b1 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,11 +10,10 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2022_01_26_205052) do
+ActiveRecord::Schema.define(version: 2022_02_17_230122) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
- enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
enable_extension "pgcrypto"
enable_extension "plpgsql"
@@ -80,6 +79,21 @@
t.index ["user_id"], name: "index_api_secrets_on_user_id"
end
+ create_table "areas", force: :cascade do |t|
+ t.datetime "created_at", precision: 6, null: false
+ t.string "name"
+ t.datetime "updated_at", precision: 6, null: false
+ end
+
+ create_table "areas_chambas", force: :cascade do |t|
+ t.bigint "area_id", null: false
+ t.bigint "chamba_id", null: false
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["area_id"], name: "index_areas_chambas_on_area_id"
+ t.index ["chamba_id"], name: "index_areas_chambas_on_chamba_id"
+ end
+
create_table "articles", force: :cascade do |t|
t.boolean "any_comments_hidden", default: false
t.boolean "approved", default: false
@@ -288,6 +302,23 @@
t.index ["title", "type_of"], name: "index_broadcasts_on_title_and_type_of", unique: true
end
+ create_table "chambas", force: :cascade do |t|
+ t.boolean "approve"
+ t.datetime "created_at", precision: 6, null: false
+ t.string "date"
+ t.string "description"
+ t.date "exp_date"
+ t.string "location"
+ t.string "organization"
+ t.string "position"
+ t.string "post_date"
+ t.string "requirements"
+ t.integer "salary"
+ t.string "stall"
+ t.string "title"
+ t.datetime "updated_at", precision: 6, null: false
+ end
+
create_table "classified_listing_categories", force: :cascade do |t|
t.integer "cost", null: false
t.datetime "created_at", null: false
@@ -962,6 +993,14 @@
t.index ["user_id", "reactable_id", "reactable_type", "category"], name: "index_reactions_on_user_id_reactable_id_reactable_type_category", unique: true
end
+ create_table "requerimientos_chambas", force: :cascade do |t|
+ t.bigint "chamba_id", null: false
+ t.datetime "created_at", precision: 6, null: false
+ t.string "description"
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["chamba_id"], name: "index_requerimientos_chambas_on_chamba_id"
+ end
+
create_table "response_templates", force: :cascade do |t|
t.text "content", null: false
t.string "content_type", null: false
@@ -1224,7 +1263,7 @@
t.datetime "last_article_at", default: "2017-01-01 05:00:00"
t.datetime "last_comment_at", default: "2017-01-01 05:00:00"
t.datetime "last_followed_at"
- t.datetime "last_moderation_notification", default: "2017-01-01 05:00:00"
+ t.datetime "last_moderation_notification", default: "2017-01-01 06:00:00"
t.datetime "last_notification_activity"
t.string "last_onboarding_page"
t.datetime "last_reacted_at"
@@ -1366,6 +1405,8 @@
add_foreign_key "ahoy_messages", "users", on_delete: :cascade
add_foreign_key "ahoy_visits", "users", on_delete: :cascade
add_foreign_key "api_secrets", "users", on_delete: :cascade
+ add_foreign_key "areas_chambas", "areas"
+ add_foreign_key "areas_chambas", "chambas"
add_foreign_key "articles", "collections", on_delete: :nullify
add_foreign_key "articles", "organizations", on_delete: :nullify
add_foreign_key "articles", "users", on_delete: :cascade
@@ -1427,6 +1468,7 @@
add_foreign_key "rating_votes", "articles", on_delete: :cascade
add_foreign_key "rating_votes", "users", on_delete: :nullify
add_foreign_key "reactions", "users", on_delete: :cascade
+ add_foreign_key "requerimientos_chambas", "chambas"
add_foreign_key "response_templates", "users"
add_foreign_key "sponsorships", "organizations"
add_foreign_key "sponsorships", "users"
diff --git a/db/seeds.rb b/db/seeds.rb
index aa1db312aa256..28a04e54cbcf7 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -589,6 +589,49 @@
##############################################################################
+Chamba.create(title: "Se busca Developer en 'RUBY'", post_date: "2022-02-01", exp_date: "2022-02-01",
+ description: "Se reuiere developer en ruby para desarrollar una web-app", organization: "FOCUSEM", location: "Mexico", salary: 10_000, created_at: "2022-02-02", updated_at: "2022-02-02")
+Chamba.create(title: "Se busca 'Full-stack'", post_date: "2022-02-01", exp_date: "2022-02-01",
+ description: "Se reuiere developer en fullstack para desarrollar una web-app", organization: "FOREM", location: "Canada", salary: 15_000, created_at: "2022-02-02", updated_at: "2022-02-02")
+Chamba.create(title: "Se busca 'Developer UX/UI'", post_date: "2022-02-01", exp_date: "2022-02-01",
+ description: "Se reuiere diseñador UX/UI", organization: "DEVS-MEXICO", location: "España", salary: 30_000, created_at: "2022-02-02", updated_at: "2022-02-02")
+Chamba.create(title: "Se busca 'QA'", post_date: "2022-02-01", exp_date: "2022-02-01",
+ description: "Se reuiere un especialista en QA", organization: "BRIGHTCODERS", location: "Panama", salary: 17_000, created_at: "2022-02-02", updated_at: "2022-02-02")
+Chamba.create(title: "Se busca 'Manager of database'", post_date: "2022-02-01", exp_date: "2022-02-01",
+ description: "Se reuiere un db-manager para administrar una base de datos", organization: "GOOGLE-INC", location: "Mexico", salary: 22_000, created_at: "2022-02-02", updated_at: "2022-02-02")
+
+# AreasChamba.create(chamba_id: 1, area_id: 2, created_at: "2022-02-02", updated_at: "2022-02-02")
+# AreasChamba.create(chamba_id: 3, area_id: 1, created_at: "2022-02-02", updated_at: "2022-02-02")
+# AreasChamba.create(chamba_id: 2, area_id: 3, created_at: "2022-02-02", updated_at: "2022-02-02")
+# AreasChamba.create(chamba_id: 4, area_id: 4, created_at: "2022-02-02", updated_at: "2022-02-02")
+# AreasChamba.create(chamba_id: 5, area_id: 5, created_at: "2022-02-02", updated_at: "2022-02-02")
+
+# Area.create(name: "Full-stack", created_at: "2022-02-02", updated_at: "2022-02-02")
+# Area.create(name: "Frontend", created_at: "2022-02-02", updated_at: "2022-02-02")
+# Area.create(name: "Backend", created_at: "2022-02-02", updated_at: "2022-02-02")
+# Area.create(name: "UX/UI", created_at: "2022-02-02", updated_at: "2022-02-02")
+# Area.create(name: "QA", created_at: "2022-02-02", updated_at: "2022-02-02")
+# Area.create(name: "Web", created_at: "2022-02-02", updated_at: "2022-02-02")
+# Area.create(name: "Programación", created_at: "2022-02-02", updated_at: "2022-02-02")
+# Area.create(name: "Api's", created_at: "2022-02-02", updated_at: "2022-02-02")
+
+# RequerimientosChamba.create(description: "HTML", chamba_id: 2)
+# RequerimientosChamba.create(description: "Python", chamba_id: 3)
+# RequerimientosChamba.create(description: "Javascript", chamba_id: 3)
+# RequerimientosChamba.create(description: "Buena comunicacion en equipo", chamba_id: 4)
+# RequerimientosChamba.create(description: "Atencion al detalle", chamba_id: 5)
+# RequerimientosChamba.create(description: "C++", chamba_id: 1)
+# RequerimientosChamba.create(description: "c#", chamba_id: 1)
+# RequerimientosChamba.create(description: "PHP", chamba_id: 5)
+# RequerimientosChamba.create(description: "MySQL", chamba_id: 3)
+# RequerimientosChamba.create(description: "Ruby", chamba_id: 2)
+# RequerimientosChamba.create(description: "RubyonRails", chamba_id: 2)
+# RequerimientosChamba.create(description: "NoSQL", chamba_id: 4)
+# RequerimientosChamba.create(description: "React Native", chamba_id: 5)
+# RequerimientosChamba.create(description: "React", chamba_id: 4)
+
+##############################################################################
+
puts <<-ASCII
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
diff --git a/spec/helpers/chambas_helper_spec.rb b/spec/helpers/chambas_helper_spec.rb
new file mode 100644
index 0000000000000..c0f90a8b847c6
--- /dev/null
+++ b/spec/helpers/chambas_helper_spec.rb
@@ -0,0 +1,15 @@
+require "rails_helper"
+
+# Specs in this file have access to a helper object that includes
+# the ChambasHelper. For example:
+#
+# describe ChambasHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# expect(helper.concat_strings("this","that")).to eq("this that")
+# end
+# end
+# end
+RSpec.describe ChambasHelper, type: :helper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/area_spec.rb b/spec/models/area_spec.rb
new file mode 100644
index 0000000000000..b8e21582b30d5
--- /dev/null
+++ b/spec/models/area_spec.rb
@@ -0,0 +1,5 @@
+require "rails_helper"
+
+RSpec.describe Area, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/areas_chamba_spec.rb b/spec/models/areas_chamba_spec.rb
new file mode 100644
index 0000000000000..b5e7a2d484051
--- /dev/null
+++ b/spec/models/areas_chamba_spec.rb
@@ -0,0 +1,5 @@
+require "rails_helper"
+
+RSpec.describe AreasChamba, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/chamba_spec.rb b/spec/models/chamba_spec.rb
new file mode 100644
index 0000000000000..dfe8720279553
--- /dev/null
+++ b/spec/models/chamba_spec.rb
@@ -0,0 +1,5 @@
+require "rails_helper"
+
+RSpec.describe Chamba, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/requerimientos_chamba_spec.rb b/spec/models/requerimientos_chamba_spec.rb
new file mode 100644
index 0000000000000..e34abfeb4a0c3
--- /dev/null
+++ b/spec/models/requerimientos_chamba_spec.rb
@@ -0,0 +1,5 @@
+require "rails_helper"
+
+RSpec.describe RequerimientosChamba, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/requests/chambas_spec.rb b/spec/requests/chambas_spec.rb
new file mode 100644
index 0000000000000..72482022a1855
--- /dev/null
+++ b/spec/requests/chambas_spec.rb
@@ -0,0 +1,7 @@
+require "rails_helper"
+
+RSpec.describe "Chambas", type: :request do
+ describe "GET /index" do
+ pending "add some examples (or delete) #{__FILE__}"
+ end
+end
diff --git a/vendor/cache/acts_as_follower-06393d3693a1/acts_as_follower.gemspec b/vendor/cache/acts_as_follower-06393d3693a1/acts_as_follower.gemspec
index b6c96db3e2aec..df73f65d05570 100644
--- a/vendor/cache/acts_as_follower-06393d3693a1/acts_as_follower.gemspec
+++ b/vendor/cache/acts_as_follower-06393d3693a1/acts_as_follower.gemspec
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
s.files = [".gitignore".freeze, ".travis.yml".freeze, "Gemfile".freeze, "MIT-LICENSE".freeze, "README.rdoc".freeze, "Rakefile".freeze, "acts_as_follower.gemspec".freeze, "init.rb".freeze, "lib/acts_as_follower.rb".freeze, "lib/acts_as_follower/follow_scopes.rb".freeze, "lib/acts_as_follower/followable.rb".freeze, "lib/acts_as_follower/follower.rb".freeze, "lib/acts_as_follower/follower_lib.rb".freeze, "lib/acts_as_follower/railtie.rb".freeze, "lib/acts_as_follower/version.rb".freeze, "lib/generators/USAGE".freeze, "lib/generators/acts_as_follower_generator.rb".freeze, "lib/generators/templates/migration.rb".freeze, "lib/generators/templates/model.rb".freeze, "test/README".freeze, "test/acts_as_followable_test.rb".freeze, "test/acts_as_follower_test.rb".freeze, "test/dummy30/Gemfile".freeze, "test/dummy30/Rakefile".freeze, "test/dummy30/app/models/application_record.rb".freeze, "test/dummy30/app/models/band.rb".freeze, "test/dummy30/app/models/band/punk.rb".freeze, "test/dummy30/app/models/band/punk/pop_punk.rb".freeze, "test/dummy30/app/models/custom_record.rb".freeze, "test/dummy30/app/models/some.rb".freeze, "test/dummy30/app/models/user.rb".freeze, "test/dummy30/config.ru".freeze, "test/dummy30/config/application.rb".freeze, "test/dummy30/config/boot.rb".freeze, "test/dummy30/config/database.yml".freeze, "test/dummy30/config/environment.rb".freeze, "test/dummy30/config/environments/development.rb".freeze, "test/dummy30/config/environments/test.rb".freeze, "test/dummy30/config/initializers/backtrace_silencers.rb".freeze, "test/dummy30/config/initializers/inflections.rb".freeze, "test/dummy30/config/initializers/secret_token.rb".freeze, "test/dummy30/config/initializers/session_store.rb".freeze, "test/dummy30/config/locales/en.yml".freeze, "test/dummy30/config/routes.rb".freeze, "test/factories/bands.rb".freeze, "test/factories/somes.rb".freeze, "test/factories/users.rb".freeze, "test/follow_test.rb".freeze, "test/schema.rb".freeze, "test/test_helper.rb".freeze]
s.homepage = "https://github.com/tcocca/acts_as_follower".freeze
s.licenses = ["MIT".freeze]
- s.rubygems_version = "3.1.4".freeze
+ s.rubygems_version = "3.2.22".freeze
s.summary = "A Rubygem to add Follow functionality for ActiveRecord models".freeze
- s.installed_by_version = "3.1.4" if s.respond_to? :installed_by_version
+ s.installed_by_version = "3.2.22" if s.respond_to? :installed_by_version
if s.respond_to? :specification_version then
s.specification_version = 4