Merge pull request #24 from beatriceo/brand

done brand
This commit is contained in:
Beatrice Olivera 2018-08-31 10:33:46 +01:00 committed by GitHub
commit 18bc693b5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 188 additions and 3 deletions

View File

@ -1,2 +1,3 @@
@import "show"; @import "show";
@import "edit"; @import "edit";
@import "setting";

View File

@ -34,6 +34,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
color: #f2321f;
h1 { h1 {
margin: 0 0 .5em 0 ; margin: 0 0 .5em 0 ;
} }
@ -49,3 +50,4 @@
} }

View File

@ -26,6 +26,11 @@ class UsersController < ApplicationController
redirect_to root_path redirect_to root_path
end end
def setting
@user = current_user
end
private private
def find_user def find_user
@ -33,7 +38,8 @@ class UsersController < ApplicationController
#authorize @user #authorize @user
end end
def user_params def user_params
params.require(:user).permit(:email, :first_name, :last_name, :description, :photo) params.require(:user).permit(:email, :first_name, :last_name, :description, :photo, :language, :caption_font, :caption_font_size, :enable_transcript)
end end
end end

View File

@ -1,2 +1,4 @@
import "bootstrap"; import "bootstrap";
import { profilePageAnimation } from '../users/lesson';
profilePageAnimation();

View File

@ -6,7 +6,7 @@
<div class="right-align"> <div class="right-align">
<div class="links"> <div class="links">
<div class="active"><%= link_to "Dashboard", contacts_path %></div> <div class="active"><%= link_to "Dashboard", contacts_path %></div>
<div><%= link_to "Settings", "#" %></div> <div><%= link_to "Settings", setting_path %></div>
</div> </div>
<div class="profile"> <div class="profile">
<% if current_user.nil? %> <% if current_user.nil? %>

View File

@ -0,0 +1,158 @@
<div class="profile-container">
<%= simple_form_for(@user) do |t| %>
<div class="profile-form">
<div>
<div class="lign">
<div class="card"><%= t.input :language, collection:
[
"Afrikaans (South Africa)",
"Amharic (Ethiopia)",
"Armenian (Armenia)",
"Azerbaijani (Azerbaijan)",
"Indonesian (Indonesia)",
"Malay (Malaysia)",
"Bengali (Bangladesh)",
"Bengali (India)",
"Catalan (Spain)",
"Czech (Czech Republic)",
"Danish (Denmark)",
"German (Germany)",
"English (Australia)",
"English (Canada)",
"English (Ghana)",
"English (United Kingdom)",
"English (India)",
"English (Ireland)",
"English (Kenya)",
"English (New Zealand)",
"English (Nigeria)",
"English (Philippines)",
"English (South Africa)",
"English (Tanzania)",
"English (United States)",
"Spanish (Argentina)",
"Spanish (Bolivia)",
"Spanish (Chile)",
"Spanish (Colombia)",
"Spanish (Costa Rica)",
"Spanish (Ecuador)",
"Spanish (El Salvador)",
"Spanish (Spain)",
"Spanish (United States)",
"Spanish (Guatemala)",
"Spanish (Honduras)",
"Spanish (Mexico)",
"Spanish (Nicaragua)",
"Spanish (Panama)",
"Spanish (Paraguay)",
"Spanish (Peru)",
"Spanish (Puerto Rico)",
"Spanish (Dominican Republic)",
"Spanish (Uruguay)",
"Spanish (Venezuela)",
"Basque (Spain)",
"Filipino (Philippines)",
"French (Canada)",
"French (France)",
"Galician (Spain)",
"Georgian (Georgia)",
"Gujarati (India)",
"Croatian (Croatia)",
"Zulu (South Africa)",
"Icelandic (Iceland)",
"Italian (Italy)",
"Javanese (Indonesia)",
"Kannada (India)",
"Khmer (Cambodia)",
"Lao (Laos)",
"Latvian (Latvia)",
"Lithuanian (Lithuania)",
"Hungarian (Hungary)",
"Malayalam (India)",
"Marathi (India)",
"Dutch (Netherlands)",
"Nepali (Nepal)",
"Norwegian Bokmål (Norway)",
"Polish (Poland)",
"Portuguese (Brazil)",
"Portuguese (Portugal)",
"Romanian (Romania)",
"Sinhala (Sri Lanka)",
"Slovak (Slovakia)",
"Slovenian (Slovenia)",
"Sundanese (Indonesia)",
"Swahili (Tanzania)",
"Swahili (Kenya)",
"Finnish (Finland)",
"Swedish (Sweden)",
"Tamil (India)",
"Tamil (Singapore)",
"Tamil (Sri Lanka)",
"Tamil (Malaysia)",
"Telugu (India)",
"Vietnamese (Vietnam)",
"Turkish (Turkey)",
"Urdu (Pakistan)",
"Urdu (India)",
"Greek (Greece)",
"Bulgarian (Bulgaria)",
"Russian (Russia)",
"Serbian (Serbia)",
"Ukrainian (Ukraine)",
"Hebrew (Israel)",
"Arabic (Israel)",
"Arabic (Jordan)",
"Arabic (United Arab Emirates)",
"Arabic (Bahrain)",
"Arabic (Algeria)",
"Arabic (Saudi Arabia)",
"Arabic (Iraq)",
"Arabic (Kuwait)",
"Arabic (Morocco)",
"Arabic (Tunisia)",
"Arabic (Oman)",
"Arabic (Qatar)",
"Arabic (Lebanon)",
"Arabic (Egypt)",
"Persian (Iran)",
"Hindi (India)",
"Thai (Thailand)",
"Korean (South Korea)",
"Chinese, Mandarin (Traditional, Taiwan)",
"Chinese, Cantonese (Traditional, Hong Kong)",
"Japanese (Japan)",
"Chinese, Mandarin (Simplified, Hong Kong)",
"Chinese, Mandarin (Simplified, China)"] %>
</div>
</div>
<div class="card"><%= t.input :caption_font %></div>
<div class="card"><%= t.input :caption_font_size %></div>
<div class="card"><%= t.input :enable_transcript %></div>
<%= link_to "Save", contacts_path, class: "btn btn-primary save-btn form-control" %>
<p></p>
</div>
<div class="profile-pic">
<% if @user.photo.url.nil? %>
<%= image_tag "https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png"%>
<% else %>
<%= cl_image_tag current_user.photo%>
<% end %>
<%#= t.input_field :photo, onchange: 'this.form.submit();' %>
<%#= t.input_field :photo, as: :hidden %>
</div>
</div>
<% end %>
</div>

View File

@ -22,5 +22,6 @@
confirm: "Are you sure?" confirm: "Are you sure?"
} %> } %>
</div> </div>
</div> </div>
</div>

View File

@ -22,6 +22,7 @@ Rails.application.routes.draw do
patch '/accept_call/:request_id', to: 'requests#update', as: 'update_request' patch '/accept_call/:request_id', to: 'requests#update', as: 'update_request'
get '/contacts', to: 'pages#index' get '/contacts', to: 'pages#index'
get '/setting', to: 'users#setting'
post '/sessions', to: 'video_sessions#create' post '/sessions', to: 'video_sessions#create'
post '/chat_rooms/chat_room_sessions', to: 'chat_rooms#create' post '/chat_rooms/chat_room_sessions', to: 'chat_rooms#create'

View File

@ -0,0 +1,8 @@
class AddColumnsToUsers < ActiveRecord::Migration[5.2]
def change
add_column :users, :language, :string
add_column :users, :caption_font, :string
add_column :users, :caption_font_size, :integer
add_column :users, :enable_transcript, :boolean
end
end

View File

@ -10,6 +10,8 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
# ActiveRecord::Schema.define(version: 2018_08_30_100110) do
ActiveRecord::Schema.define(version: 2018_08_29_123204) do ActiveRecord::Schema.define(version: 2018_08_29_123204) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
@ -57,6 +59,10 @@ ActiveRecord::Schema.define(version: 2018_08_29_123204) do
t.string "first_name" t.string "first_name"
t.string "last_name" t.string "last_name"
t.string "photo" t.string "photo"
t.string "language"
t.string "caption_font"
t.integer "caption_font_size"
t.boolean "enable_transcript"
t.index ["email"], name: "index_users_on_email", unique: true t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end end