Iñigo Valentin %!s(int64=3) %!d(string=hai) anos
pai
achega
5f0ac8d804

+ 91 - 0
app/assets/stylesheets/profile.css

@@ -7,6 +7,7 @@ section#info{
     display: inline-block;
     vertical-align: top;
     width: 30%;
+    margin: auto;
 }
 @media screen and (max-width : 800px){
     section#info{
@@ -123,4 +124,94 @@ section#about div#resume_download details summary{
 section#about div#resume_download details ul{
     text-align: left;
     margin: 0.1em 0.1em 0.1em 0.1em;
+}
+section#skills{
+    width: 30%;
+    display: inline-block;
+    vertical-align: top;
+    margin: 2em auto auto auto;
+}
+@media screen and (max-width : 800px){
+    section#skills{
+        width: 90%;
+        margin: 2em auto auto auto;
+    }
+}
+section#skills p{
+    text-align: center;
+}
+section#experience{
+    width: 50%;
+    display: inline-block;
+    vertical-align: top;
+    margin: 2em auto auto auto;
+}
+@media screen and (max-width : 800px){
+    section#experience{
+        width: 90%;
+        margin: 2em auto auto auto;
+    }
+}
+section#experience table{
+    border-collapse: collapse;
+}
+section#experience table td.company{
+    vertical-align: top;
+    text-align: right;
+    padding-right: 2em;
+}
+section#experience table td.company h5.company{
+    margin-top: 0;
+    font-size: 120%;
+    min-width: 12em;
+    margin-bottom: 0.5em;
+}
+@media screen and (max-width : 800px){
+    section#experience table td.company h5.company{
+        font-size: 100%;
+        min-width: 9em;
+        margin-bottom: 0.2em;
+    }
+}
+section#experience table td.company span.company_logo{
+    vertical-align: middle;
+}
+section#experience table td.company span.company_logo img{
+    max-width: 4em;
+    max-height: 4em;
+    background-color: #ffffff;
+    border: 0.1em solid #000000;
+    border-radius: 0.3em;
+    vertical-align: middle;
+}
+section#experience table td.timeline{
+    width: 0.2em;
+    vertical-align: top;
+    padding: 0;
+    /*background-image: url("/assets/control/point-spaced.svg");
+    background-size: 2em;
+    background-repeat: repeat-y;*/
+    background-color: #00000033
+}
+section#experience table td.timeline img{
+    width: 2em;
+    height: 2em;
+    margin: 0 -0.9em;
+}
+section#experience table td.details{
+    padding: 0 0 1em 2em;
+    vertical-align: top;
+}
+section#experience table td.details h4.role{
+    margin-bottom: 0;
+    margin-top: 0;
+}
+
+section#experience table td.details span.date{
+    color: #444444;
+    font-style: italic;
+}
+
+section#experience table td.details p.description{
+    margin-left: 1em;
 }

+ 1 - 0
app/models/user.rb

@@ -4,6 +4,7 @@ class User < ApplicationRecord
     has_many_attached :picture
     has_and_belongs_to_many :technologies
     has_many :user_social_links
+    has_many :work_experiences
     def i18n_tagline
         return Text.where(user_id: self.id, language: I18n.locale, key: self.tagline)[0].text
     end

+ 115 - 0
app/views/profile/index.html.erb

@@ -62,3 +62,118 @@
         </div>
     </article>
 </section>
+<section id='skills'>
+    <h3>
+        TODO
+    </h3>
+    <article>
+        <%
+        prev_nature = ""
+            @user.technologies.each do |technology|
+                if technology.nature != prev_nature
+                    %>
+                        </p>
+                        <p>
+                    <%
+                end
+                %>
+                <span class='technology technology_<%=technology.nature%>'>
+                    <%= image_tag(technology.logo, class: "technology_logo", alt: "") %>
+                    <span class='technology_name'>
+                        <%= technology.name %>
+                    </span>
+                </span>
+                <%
+                prev_nature = technology.nature
+            end
+            %>
+        </p>
+    </article>
+</section>
+<section id='experience'>
+    <h3>
+        <%= t("profile.experience") %>
+    </h3>
+    <article>
+        <table>
+            <%
+            prev_company = ""
+            prev_city = ""
+            same_company = false
+            same_company_class = "last_role"
+            @user.work_experiences.each do |experience|
+                if experience.company == prev_company && experience.city == prev_city
+                    same_company = true
+                    same_company_class = "";
+                else
+                    same_company = false
+                    same_company_class = "last_role"
+                end
+                %>
+                <tr>
+                    <td class='company'>
+                        <% if !same_company %>
+                            <h5 class='company'>
+                                
+                                <%= experience.company %>
+                            </h5>
+                            <% if experience.companyLogo.attached? %>
+                                    <span class='company_logo'>
+                                        <%=
+                                        image_tag(
+                                            experience.companyLogo,
+                                            alt: experience.company
+                                        )
+                                        %>
+                                    </span>
+                                <% end %>
+                        <% end %>
+                    </td>
+                    <td class='timeline <%= same_company_class %>'>
+                        <% if !same_company %>
+                            <%= image_tag("control/point.svg", alt: "") %>
+                        <% end %>
+                    </td>
+                    <td class='details <%= same_company_class %>'>
+                        <%
+                            experience_date = "";
+                            if (experience.end == nil)
+                                experience_date = t(
+                                  "time.date_month_since",
+                                  year: experience.start.year,
+                                  month: t("time." + Date::MONTHNAMES[experience.start.month].downcase)
+                                ).humanize
+                            else
+                                experience_date =
+                                  t(
+                                    "time.date_month",
+                                    year: experience.start.year,
+                                    month: t("time." + Date::MONTHNAMES[experience.start.month].downcase)
+                                  ).humanize +
+                                  " - " +
+                                  t(
+                                    "time.date_month",
+                                    year: experience.end.year,
+                                    month: t("time." + Date::MONTHNAMES[experience.end.month].downcase)
+                                  ).humanize
+                            end
+                        %>
+                        <h4 class='role'>
+                            <%= experience.i18n_role %>
+                        </h4>
+                        <span class='date'>
+                            <%= experience_date %>
+                        </span>
+                        <p class='description'>
+                            <%= experience.i18n_description.html_safe %>
+                        </p>
+                    </td>
+                </tr>
+                <%
+                prev_company = experience.company
+                prev_city = experience.city
+            end
+            %>
+        </table>
+    </article>
+</section>

+ 5 - 0
config/locales/en.yml

@@ -55,6 +55,10 @@ en:
         october: "October"
         november: "November"
         december: "December"
+        date_day: "%{month} %{day}, %{year}"
+        date_month: "%{month} %{year}"
+        date_day_since: "Since %{month} %{day}, %{year}"
+        date_month_since: "Since %{month} %{year}"
     project_type:
         development: "Development"
         system: "System"
@@ -136,6 +140,7 @@ en:
         resume_es: "View in spanish"
         resume_en: "View in english"
         resume_eu: "View in basque"
+        experience: "Work experience"
     project:
         info: "Details"
         tags: "Tags"

+ 5 - 0
config/locales/es.yml

@@ -55,6 +55,10 @@ es:
         october: "octubre"
         november: "noviembre"
         december: "diciembre"
+        date_day: "%{day} de %{month} de %{year}"
+        date_month: "%{month} de %{year}"
+        date_day_since: "Desde el %{day} de %{month} de %{year}"
+        date_month_since: "Desde %{month} de %{year}"
     project_type:
         development: "Software"
         system: "Sistemas"
@@ -136,6 +140,7 @@ es:
         resume_es: "Ver en castellano"
         resume_en: "Ver en inglés"
         resume_eu: "Ver en euskera"
+        experience: "Experiencia laboral"
     project:
         info: "Detalles"
         tags: "Tags"

+ 17 - 12
config/locales/eu.yml

@@ -43,18 +43,22 @@ eu:
         friday: "ostirala"
         saturday: "larunbata"
         sunday: "igandea"
-        january: "urtarrila"
-        february: "otsaila"
-        march: "martxoa"
-        april: "apirila"
-        may: "maiatza"
-        june: "ekaina"
-        july: "uztaila"
-        august: "abuztua"
-        september: "iraila"
-        october: "urria"
-        november: "azaroa"
-        december: "abendua"
+        january: "urtarril"
+        february: "otsail"
+        march: "martxo"
+        april: "apiril"
+        may: "maiatz"
+        june: "ekain"
+        july: "uztail"
+        august: "abuztu"
+        september: "irail"
+        october: "urri"
+        november: "azaro"
+        december: "abendu"
+        date_day: "%{year}ko %{month}ak %{day}."
+        date_month: "%{year}ko %{month}ak"
+        date_day_since: "%{year}ko %{month}ak %{day}.tik"
+        date_month_since: "%{year}ko %{month}tik"
     project_type:
         development: "Software"
         system: "Sistemak"
@@ -136,6 +140,7 @@ eu:
         resume_es: "Gaztelanian ikusi"
         resume_en: "Ingelesan ikusi"
         resume_eu: "Euskaraz ikusi"
+        experience: "Lan esperientzia"
     project:
         info: "Xehetasunak"
         tags: "Tags"

+ 20 - 12
db/schema.rb

@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 2021_12_30_103227) do
+ActiveRecord::Schema.define(version: 2022_01_05_101931) do
 
   create_table "active_storage_attachments", charset: "utf8mb4", force: :cascade do |t|
     t.string "name", null: false
@@ -127,14 +127,6 @@ ActiveRecord::Schema.define(version: 2021_12_30_103227) do
     t.datetime "updated_at", precision: 6, null: false
   end
 
-  #create_table "tags", charset: "utf8mb4", force: :cascade do |t|
-  #  t.bigint "project_id", null: false
-  #  t.string "tag"
-  #  t.datetime "created_at", precision: 6, null: false
-  #  t.datetime "updated_at", precision: 6, null: false
-  #  t.index ["project_id"], name: "index_tags_on_project_id"
-  #end
-
   create_table "technologies", charset: "utf8mb4", force: :cascade do |t|
     t.string "name"
     t.integer "nature"
@@ -151,7 +143,7 @@ ActiveRecord::Schema.define(version: 2021_12_30_103227) do
   end
 
   create_table "texts", charset: "utf8mb4", force: :cascade do |t|
-    t.bigint "user_id", null: true
+    t.bigint "user_id"
     t.string "key"
     t.string "language"
     t.text "text"
@@ -195,15 +187,31 @@ ActiveRecord::Schema.define(version: 2021_12_30_103227) do
     t.datetime "updated_at", precision: 6, null: false
   end
 
-  add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
+  create_table "work_experiences", charset: "utf8mb4", force: :cascade do |t|
+    t.bigint "user_id", null: false
+    t.date "start", null: false
+    t.date "end"
+    t.string "company", null: false
+    t.string "role"
+    t.string "description"
+    t.string "comment"
+    t.boolean "professional"
+    t.boolean "related"
+    t.boolean "visible"
+    t.datetime "created_at", precision: 6, null: false
+    t.datetime "updated_at", precision: 6, null: false
+    t.string "city"
+    t.index ["user_id"], name: "index_work_experiences_on_user_id"
+  end
+
   add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
   add_foreign_key "mail_adresses", "users"
   add_foreign_key "messages", "users"
   add_foreign_key "projects", "licenses"
   add_foreign_key "projects", "users"
   add_foreign_key "resumes", "users"
-  #add_foreign_key "tags", "projects"
   add_foreign_key "texts", "users"
   add_foreign_key "user_social_links", "social_links"
   add_foreign_key "user_social_links", "users"
+  add_foreign_key "work_experiences", "users"
 end