fix missing locales and bump name/email max

This commit is contained in:
Joshua Arts
2018-07-26 11:53:50 -04:00
parent fd2dc3abec
commit 89b1afa470
8 changed files with 23 additions and 18 deletions

View File

@ -45,12 +45,16 @@ a {
height: $header-height;
}
.page {
.wrapper {
position: relative;
height: auto;
min-height: calc(100% - #{$header-height} - #{$footer-height});
}
.flex-center {
transform: translateY(25%);
}
.footer {
height: $footer-height;
width: 100%;

View File

@ -163,7 +163,7 @@ class Room < ApplicationRecord
# Generates a random room uid that uses the users name.
def random_room_uid
[owner.firstname, uid_chunk, uid_chunk].join('-').downcase
[owner.name_chunk, uid_chunk, uid_chunk].join('-').downcase
end
# Rereives the loadbalanced BigBlueButton credentials for a user.

View File

@ -7,10 +7,10 @@ class User < ApplicationRecord
has_many :rooms
belongs_to :main_room, class_name: 'Room', foreign_key: :room_id, required: false
validates :name, length: { maximum: 32 }, presence: true
validates :name, length: { maximum: 256 }, presence: true
validates :provider, presence: true
validates :image, format: { with: /\.(png|jpg)\Z/i }, allow_blank: true
validates :email, length: { maximum: 60 }, allow_blank: true,
validates :email, length: { maximum: 256 }, allow_blank: true,
uniqueness: { case_sensitive: false },
format: { with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i }
@ -73,8 +73,8 @@ class User < ApplicationRecord
sorted + no_session
end
def firstname
name.split(' ').first
def name_chunk
name[0...3].downcase
end
def greenlight_account?
@ -86,7 +86,7 @@ class User < ApplicationRecord
# Initializes a room for the user and assign a BigBlueButton user id.
def initialize_main_room
self.uid = "gl-#{(0...12).map { (65 + rand(26)).chr }.join.downcase}"
self.main_room = Room.create!(owner: self, name: firstname + "'s Room")
self.main_room = Room.create!(owner: self, name: I18n.t("home_room"))
save
end
end

View File

@ -18,9 +18,9 @@
</head>
<body class="app-background" data-controller="<%= params[:controller] %>" data-action="<%= params[:action] %>">
<%= render "shared/header" %>
<%= render "shared/header" %>
<div class="page">
<div class="wrapper">
<% if bigbluebutton_endpoint_default? %>
<%= render "shared/error_banner" do %>
<i class="fas fa-exclamation-triangle"></i>

View File

@ -6,7 +6,7 @@
<% end %>
<% end %>
<div class="container">
<div class="container pt-9 pb-4">
<div class="row pb-8">
<div class="col-md-8 col-sm-12">
<p id="main-text" class="font-weight-400 display-4"><%= t("landing.welcome").html_safe %></p>

View File

@ -15,7 +15,7 @@
<% else %>
<span class="avatar" style="background-image: url(<%= @room.owner.image %>)"></span>
<% end %>
<h5 class="font-weight-normal ml-4 mt-3"><%= @room.owner.name %> (<%= t("room.invited") %>)</h5>
<h5 class="font-weight-normal ml-4 mt-3"><%= @room.owner.name %> (<%= t("room.owner") %>)</h5>
</div>
<div class="col-lg-6 col-md-4 col-sm-12">