Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ GEM
activerecord (= 6.1.4.4)
activesupport (= 6.1.4.4)
marcel (~> 1.0.0)
mini_magick
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me pregunto si agregaste mini_magick en el Gemfile para que el proyecto pudiera correr en tu ambiente local, o si esto se agrego solo 🤔

Si no es necesario, podriamos remover esto del commit? 😄

mini_mime (>= 1.1.0)
activesupport (6.1.4.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand Down
Binary file added app/assets/images/chamba-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions app/assets/stylesheets/base/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,87 @@
}
}
}

.chamba-info {
padding-bottom: 20px;
padding-left: 80px;
}

.card-chamba {
background: rgba(59, 73, 223, 0.21);
border-radius: 5px;
}

.chamba-logo {
display: flex;
flex-direction: row;
align-items: center;
color: #4449e0d6;
margin-top: 30px;
margin-bottom: 30px;
}

.chamba-logo h3 {
font-weight: bold;
}

.chamba-logo h4 {
font-weight: 500;
}

.codeando-logo {
width: 130px;
margin-right: 10px;
}

.chamba-title {
color: #4449e0d6;
padding-left: 80px;
padding-right: 80px;
}

.chamba-title h1 {
font-size: 70px;
}

.chamba-title h2 {
font-weight: 400;
margin: 5px;
}

.chamba-btn .apply {
color: white;
padding: 20px;
margin-top: 30px;
margin-bottom: 30px;
background-color: #4449e0d6;
border: none;
border-radius: 10px;
font-size: 20px;
}

.chamba-details h3 {
font-style: normal;
font-weight: 600;
font-size: 30px;
color: rgba(68, 73, 224, 0.84);
margin-top: 30px;
}

.chamba-details p {
font-size: 24px;
}

.chamba-details ul {
font-size: 24px;
}

.return-chamba {
font-size: 18.0778px;
padding-left: 30px;
}

.chamba-div {
display: flex;
align-items: center;
}
166 changes: 166 additions & 0 deletions app/assets/stylesheets/components/cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,169 @@
padding: var(--su-4);
}
}

.i-icon {
margin-right: 0.3rem;
}

.chambita-title {
a {
font-weight: 700;
}
}

.chambas-found {
display: flex;
justify-content: space-between;
align-items: center;
span {
color: black;
font-weight: 600;
}
a {
color: #b0b0b0;
background-color: white;
border-radius: 5px;
border: 5px solid #d7d7d7;
padding: 0.5rem 1.5rem;
cursor: pointer;
}
}

.crud-card-main {
background-color: #cdd1e4;
border: none;

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

/* Firefox */
input[type='number'] {
-moz-appearance: textfield;
}
}

#add-btn {
border: none;
color: white;
background-color: #6c7a89;

&:hover {
background-color: #bdc3c7;
}
}

.chambas-card {
display: grid;
grid-template-columns: 13% 77% 10%;

&:hover {
box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px,
rgba(0, 0, 0, 0.05) 0px 4px 6px -2px;
transition: all var(--transition-props);
}
.chamba-image {
display: block;
margin: 0 auto;
width: 130px;
}
.chamba-summary {
h4 {
color: #a3a3a3;
font-weight: 500;
font-size: 24px;
line-height: 36px;
}
h3 {
color: #84858c;
font-weight: 600;
font-size: 36px;
line-height: 54px;
margin-bottom: 0.7rem;
}
span {
color: #4449e0a8;
font-weight: 600;
font-size: 14px;
line-height: 21px;
border-radius: 14px;
background-color: #3b49df36;
padding: 0.5rem 0.7rem;
}
}
.chamba-date {
text-align: center;
font-weight: 600;
line-height: 21px;
font-size: 14px;
color: #84858c;
}
}

.crud-card {
&:hover {
box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px,
rgba(0, 0, 0, 0.05) 0px 4px 6px -2px;
transition: all var(--transition-props);
}
}

@mixin clearfix {
&:after {
content: '';
display: table;
clear: both;
}
}

.body-blackout {
position: absolute;
z-index: 1010;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.65);
display: none;

&.is-blacked-out {
display: block;
}
}

.popup-trigger {
display: inline-block;
}

.popup-modal {
height: 365px;
width: 650px;
background-color: #fff;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
padding: 45px;
opacity: 0;
pointer-events: none;
transition: all 300ms ease-in-out;
z-index: 1011;
border-radius: 6px;

&.is--visible {
opacity: 1;
pointer-events: auto;
}

&__close {
position: absolute;
font-size: 1.2rem;
right: -10px;
top: -10px;
cursor: pointer;
}
}
57 changes: 57 additions & 0 deletions app/controllers/admin/chambas_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module Admin
class ChambasController < Admin::ApplicationController
layout "admin"

@chamba_record_save = nil

def index
@chambas = Chamba.all
@chamba_save = @chamba_record_save
# variable para crear una nueva chamba
@chamba = Chamba.new
end

# //////para crear nueva chamaba

def create
@chamba = Chamba.new(chamba_params)
if @chamba.save
@chamba_record_save = true
else
@chamba_record_save = false
render admin_path
end
end

# def create
# @employee = Employee.new(employee_params)
# if @employee.save
# redirect_to pages_employees_path
# else
# render :new
# end
# end

# //////para editar una chamaba
def edit
@chamba = Chamba.find(params[:id_chamba])
end

# //////para borrar una chamaba
def delete
id_to_delete = params[:id_chamba]

# modificar esto despues para eliminar en cascada (por medio de los modelos)
RequerimientosChamba.find(id_to_delete).destroy
AreasChamba.find(id_to_delete).destroy
Chamba.find(id_to_delete).destroy
Area.find(id_to_delete).destroy
end

private

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rubocop] <Layout/EmptyLinesAroundAccessModifier> reported by reviewdog 🐶
Keep a blank line before and after private. (https://rubystyle.guide#empty-lines-around-access-modifier, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions)

Suggested change
private
private


def chamba_params
params.require(:chamba).permit(:title, :exp_date, :location, :description, :organization, :salary)
end
end
end
25 changes: 25 additions & 0 deletions app/controllers/chambas_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class ChambasController < ApplicationController
# vista index (chambas)
def index
@chambas_vec = req_chambas
@areas = %w[Mexico Web-Developer Programación Issues]
@filters = req_filters
@areas_chambas = AreasChamba.all
end

# vista chamba
def chamba
@chamba = Chamba.find(params[:chamba_id])
@requerimientos = RequerimientosChamba.where(chamba_id: params[:chamba_id])
end

def req_chambas
# DESIDO HACERLO FUERA EN OTRO METODO PARA DESPUES PRE-PROSESAR LAS PUBS
Chamba.all
end

def req_filters
%w[Mexico Web-Developer Programación Issues]
# @var_back = params[:filter_active]
end
end
6 changes: 6 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def terms
set_surrogate_key_header "terms_page"
end

def glosario
@page = Page.find_by(slug: "glosario")
render :show if @page
set_surrogate_key_header "glosario"
end

def report_abuse
reported_url = params[:reported_url] || params[:url] || request.referer.presence
@feedback_message = FeedbackMessage.new(
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/chambas_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module ChambasHelper
end
3 changes: 3 additions & 0 deletions app/javascript/admin/adminModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
* @param {string} modalProps.leftCustomDataAttr A custom data attribute for the left button.
* @param {string} modalProps.rightCustomDataAttr A custom data attribute for the right button.
*/

//AQUI PONES EL SCRIPT DEL CRUD:

export const adminModal = function ({
title,
controllerName,
Expand Down
1 change: 1 addition & 0 deletions app/models/admin_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class AdminMenu
item(name: "organizations"),
item(name: "podcasts"),
item(name: "tags"),
item(name: "chambas"),
]

scope :customization, "tools-line", [
Expand Down
3 changes: 3 additions & 0 deletions app/models/area.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Area < ApplicationRecord
has_many :areas_chamba, dependent: :nil
end
4 changes: 4 additions & 0 deletions app/models/areas_chamba.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class AreasChamba < ApplicationRecord
belongs_to :chamba
belongs_to :area
end
3 changes: 3 additions & 0 deletions app/models/chamba.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Chamba < ApplicationRecord
has_many :requerimientos_chamba, dependent: :nil
end
Loading