Merge branch 'master' into front-end

This commit is contained in:
Beatrice Olivera 2018-08-28 17:21:12 +01:00 committed by GitHub
commit e7b4b74c00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 146 additions and 47 deletions

BIN
app/assets/images/phone.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@ -18,3 +18,4 @@
body {
background-color: $background;
}
@import "devise/index";

View File

@ -0,0 +1,24 @@
.banner {
color: white;
text-align: center;
height: 100vh;
/* if you have a 70px navbar => height: calc(100vh - 70px); */
background-size: cover !important;
display: flex;
align-items: center;
justify-content: center;
}
.banner h1 {
font-size: 60px;
font-weight: bold;
text-shadow: 0px 1px rgba(0, 0, 0, 0.2);
color: #F0FFFF;
}
.banner p {
font-size: 30px;
font-weight: lighter;
color: #F0FFFF;
opacity: 0.8;
margin-bottom: 20px;
}

View File

@ -1,3 +1,4 @@
// Import your components CSS files here.
@import "alert";
@import "navbar";
@import "banner";

View File

@ -0,0 +1 @@
@import 'login';

View File

@ -0,0 +1,40 @@
.login-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
position: absolute;
background-image:
linear-gradient(
-225deg,
rgba(5,25,55,0.3) 0%,
rgba(68,73,101,0.3),
rgba(128,129,149,0.3),
rgba(191,190,200,0.3),
rgba(255,255,255,0.3)
50%),
url('https://unsplash.com/photos/jay5BqVyf5A');
.login-content {
position: relative;
top: -10vh;
padding: 50px;
background-color: white;
width: 25vw;
border-radius: 3px;
box-shadow: 1px 1px 10px rgba(0,0,0, 0.21);
h2 {
color: $primary;
}
}
}
.login {
// color: $primary;
width:100%;
}

View File

@ -1,5 +1,5 @@
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :authenticate_user!
# before_action :authenticate_user!
protect_from_forgery unless: -> { request.format.json? } # Only accept json
end

View File

@ -1,9 +1,12 @@
class PagesController < ApplicationController
skip_before_action :authenticate_user!, only: [:call]
# skip_before_action :authenticate_user!, only: [:call]
def call
end
def index
end
def home
end
end

View File

@ -1,6 +1,8 @@
<h2>Sign up</h2>
<div class="login-container">
<div class="login-content">
<h2>Sign up</h2>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
@ -18,8 +20,10 @@
</div>
<div class="form-actions">
<%= f.button :submit, "Sign up" %>
<%= f.button :submit, "Sign up", class: "login btn btn-primary" %>
</div>
<% end %>
<% end %>
<%= render "devise/shared/links" %>
<%= render "devise/shared/links" %>
</div>
</div>

View File

@ -1,6 +1,8 @@
<h2>Log in</h2>
<div class="login-container">
<div class="login-content">
<h2>Log in</h2>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email,
required: false,
@ -13,8 +15,10 @@
</div>
<div class="form-actions">
<%= f.button :submit, "Log in" %>
<%= f.button :submit, "Log in", class: "login btn btn-primary" %>
</div>
<% end %>
<% end %>
<%= render "devise/shared/links" %>
<%= render "devise/shared/links" %>
</div>
</div>

View File

@ -3,7 +3,7 @@
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<%#= link_to "Sign up", new_registration_path(resource_name) %><!-- <br /> -->
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>

View File

@ -3,14 +3,14 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>TODO</title>
<title>Polyglot</title>
<%= csrf_meta_tags %>
<%= action_cable_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%#= stylesheet_pack_tag 'application', media: 'all' %> <!-- Uncomment if you import CSS in app/javascript/packs/application.js -->
</head>
<body>
<%= render 'shared/navbar' %>
<%= render 'shared/navbar' unless params["action"] == "home"%>
<%= render 'shared/flashes' %>
<%= yield %>
<%= javascript_include_tag 'application' %>

View File

@ -0,0 +1,17 @@
<div class="banner" style="background-image: linear-gradient(-225deg, rgba(5,25,55,0.3) 0%, rgba(68,73,101,0.3),rgba(128,129,149,0.3),rgba(191,190,200,0.3),rgba(255,255,255,0.3) 50%), url('<%= image_path 'phone.jpg' %>');">
<div class="banner-content">
<h1>Make a call</h1>
<p>Communicate in different languages</p>
<p>and receive real-time translated</p>
<p> subtitles in your native tongue.</p>
<p>
<span id="banner-typed-text"></span>
</p>
<%= link_to "Sign Up",new_user_registration_path, class: "btn btn-primary btn-lg" %>
<%= link_to "Login", new_user_session_path, class: "btn btn-primary btn-lg" %>
</div>
</div>
<% unless current_user.nil? %>
<% end %>

View File

@ -1,10 +1,14 @@
Rails.application.routes.draw do
get 'video_sessions/create'
devise_for :users
root to: 'pages#call'
devise_for :users, path: '', path_names: { sign_out: 'logout'}
devise_scope :user do
get '/logout', to: 'devise/sessions#destroy'
end
root to: 'pages#home'
get '/contacts', to: 'pages#index'
post '/sessions', to: 'video_sessions#create'
mount ActionCable.server, at: '/cable'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
get '/home', to: 'pages#home'
end