-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the very beginning part of the company dashboard. This commit adds the company registration and login and requires login to register a new job.
- Loading branch information
1 parent
e731f52
commit 22ea341
Showing
48 changed files
with
629 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
@import "variables"; | ||
$background-color: #fff; | ||
$field-border-color: #ebebeb; | ||
$field-focus-border-color: #dcdcdc; | ||
$selection-background-color: #b5e2e7; | ||
$shadow-color: rgba(0, 0, 0, 0.25); | ||
$title-color: #757575; | ||
$white: #fff; | ||
|
||
|
||
.other-links { | ||
text-align: center; | ||
} | ||
|
||
.sign-box { | ||
background-color: $background-color; | ||
-moz-box-shadow: 0 1px 5px $shadow-color; | ||
-webkit-box-shadow: 0 1px 5px $shadow-color; | ||
box-shadow: 0 1px 5px $shadow-color; | ||
margin: 50px auto; | ||
padding: 10px; | ||
width: 340px; | ||
|
||
::selection { | ||
background-color: $selection-background-color; | ||
} | ||
|
||
::-moz-selection { | ||
background-color: $selection-background-color; | ||
} | ||
|
||
h1 { | ||
color: $title-color; | ||
font-size: 175%; | ||
font-weight: 300; | ||
text-align: center; | ||
} | ||
|
||
h1, | ||
input { | ||
font-family: "Open Sans", Helvetica, sans-serif; | ||
} | ||
|
||
.field { | ||
border: 0; | ||
border-bottom: 2px solid $field-border-color; | ||
display: block; | ||
height: 50px; | ||
margin: 0 auto 15px; | ||
padding: 0 15px; | ||
width: 75%; | ||
} | ||
|
||
.field:focus { | ||
border-bottom-color: $primary-color; | ||
outline: none; | ||
} | ||
|
||
.field:hover { | ||
border-bottom-color: $field-focus-border-color; | ||
} | ||
|
||
.field:invalid { | ||
box-shadow: none; | ||
} | ||
|
||
.field:-webkit-autofill { | ||
-webkit-box-shadow: 0 0 0 1000px $white inset; | ||
} | ||
|
||
.btn-sign { | ||
background-color: $primary-color; | ||
border: 0; | ||
box-shadow: 0 5px 0 $dark-primary-color; | ||
color: $white; | ||
display: block; | ||
height: 50px; | ||
margin: 30px auto; | ||
position: relative; | ||
width: 85%; | ||
} | ||
|
||
.btn-sign:hover { | ||
-moz-box-shadow: 0 3px 0 $dark-primary-color; | ||
-webkit-box-shadow: 0 3px 0 $dark-primary-color; | ||
box-shadow: 0 3px 0 $dark-primary-color; | ||
top: 2px; | ||
} | ||
|
||
.btn-sign:active { | ||
box-shadow: none; | ||
top: 5px; | ||
} | ||
|
||
.btn-sign:focus { | ||
outline: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
$footer-border-color: #e0e0e0; | ||
$footer-bg-color: #fff; | ||
$footer-heart-color: #e90606; | ||
|
||
$primary-color: #ff6f27; | ||
$dark-primary-color: darken($primary-color,15%); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class UsersController < Clearance::UsersController | ||
private | ||
|
||
def user_params | ||
params.require(:user).permit(:email, :password, company_attributes: %i[name url]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationMailer < ActionMailer::Base | ||
default from: 'from@example.com' | ||
default from: 'no-reply@openjobs.me' | ||
layout 'mailer' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class UserMailer < ApplicationMailer | ||
def welcome_email(user) | ||
@user = user | ||
|
||
mail(to: user.email, subject: t('.welcome_email.subject')) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
class Company < ApplicationRecord | ||
URL_REGEX = /\A^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$\Z/ix | ||
|
||
has_many :users | ||
has_many :vacancies | ||
|
||
validates :name, :url, presence: true | ||
validates :url, format: { with: URL_REGEX } | ||
|
||
before_validation do | ||
self.url = "http://#{url}" unless url.nil? || url[0, 4] == 'http' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class User < ApplicationRecord | ||
include Clearance::User | ||
|
||
belongs_to :company | ||
|
||
accepts_nested_attributes_for :company | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<p><%= t(".opening") %></p> | ||
|
||
<p> | ||
<%= link_to t(".link_text", default: "Change my password"), | ||
edit_user_password_url(@user, token: @user.confirmation_token.html_safe) %> | ||
</p> | ||
|
||
<p><%= raw t(".closing") %></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<%= t(".opening") %> | ||
<%= edit_user_password_url(@user, token: @user.confirmation_token.html_safe) %> | ||
<%= raw t(".closing") %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div id="clearance" class="sign-up"> | ||
<div class="login-container"> | ||
<div class="sign-box"> | ||
<small><%= t(".description") %></small> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div id="clearance" class="sign-up"> | ||
<div class="login-container"> | ||
<div class="sign-box"> | ||
<h1><%= t(".title") %></h1> | ||
|
||
<%= form_for :password_reset, url: user_password_path(@user, token: @user.confirmation_token), | ||
html: { method: :put } do |form| %> | ||
<%= form.password_field :password, autofocus: true, class: 'field', placeholder: t('helpers.label.password_reset.password') %> | ||
<%= form.submit class: 'btn btn-sign' %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div id="clearance" class="sign-up"> | ||
<div class="login-container"> | ||
<div class="sign-box"> | ||
<h1><%= t(".title") %></h1> | ||
|
||
<small><%= t(".description") %></small> | ||
|
||
<%= form_for :password, url: passwords_path do |form| %> | ||
<%= form.text_field :email, autofocus: true, class: 'field', type: 'email', placeholder: User.human_attribute_name('email') %> | ||
<%= form.submit class: 'btn btn-sign' %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="login-container"> | ||
<div class="sign-box"> | ||
<%= form_for :session, url: session_path do |form| %> | ||
<h1><%= title %></h1> | ||
|
||
<%= form.text_field :email, autofocus: true, class: 'field', type: 'email', placeholder: User.human_attribute_name('email') %> | ||
<%= form.password_field :password, class: 'field', placeholder: User.human_attribute_name('password') %> | ||
<%= form.submit class: 'btn btn-sign' %> | ||
|
||
<div class="other-links"> | ||
<% if Clearance.configuration.allow_sign_up? %> | ||
<%= link_to t(".sign_up"), sign_up_path %> | | ||
<% end %> | ||
<%= link_to t(".forgot_password"), new_password_path %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div id="clearance" class="sign-in"> | ||
<%= render partial: '/sessions/form', locals: { title: t('.title') } %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.