forked from saurabh/orbit4-5
now names saved in all locales while signup. added orbit site logo and also now favicon is rendered and orbit bar logo rendered.
This commit is contained in:
parent
2d54b50cf8
commit
23aef52422
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
|
@ -15,6 +15,7 @@ if($.support.touch) {
|
||||||
!function ($) {
|
!function ($) {
|
||||||
// Set sidebarState
|
// Set sidebarState
|
||||||
sidebarState = function (v) {
|
sidebarState = function (v) {
|
||||||
|
console.log(v)
|
||||||
if(v) {
|
if(v) {
|
||||||
window.localStorage.setItem('sidebarState', 1);
|
window.localStorage.setItem('sidebarState', 1);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -55,10 +55,10 @@ $(function() {
|
||||||
}
|
}
|
||||||
$('.set-sidebar-state').on({
|
$('.set-sidebar-state').on({
|
||||||
change: function() {
|
change: function() {
|
||||||
if($(this).prop('checked')) {
|
if($(this).parent().hasClass("disable")) {
|
||||||
sidebarState(1);
|
|
||||||
} else {
|
|
||||||
sidebarState(0);
|
sidebarState(0);
|
||||||
|
} else {
|
||||||
|
sidebarState(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -311,10 +311,16 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default;
|
||||||
.orbit-bar-logo {
|
.orbit-bar-logo {
|
||||||
@extend .orbitMenuLink;
|
@extend .orbitMenuLink;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background-position: center;
|
text-align: center;
|
||||||
background-repeat: no-repeat;
|
img {
|
||||||
background-image: url('<%= asset_path 'orbit-logo.svg' %>');
|
display: inline-block;
|
||||||
background-image: url('<%= asset_path 'orbit-logo.png' %>')\9;
|
width: auto;
|
||||||
|
height: 85%;
|
||||||
|
}
|
||||||
|
// background-position: center;
|
||||||
|
// background-repeat: no-repeat;
|
||||||
|
// background-image: url('<%= asset_path 'orbit-logo.svg' %>');
|
||||||
|
// background-image: url('<%= asset_path 'orbit-logo.png' %>')\9;
|
||||||
& + ul {
|
& + ul {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
@ -384,10 +390,10 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default;
|
||||||
margin-left: -45%;
|
margin-left: -45%;
|
||||||
.login-body {
|
.login-body {
|
||||||
form {
|
form {
|
||||||
width: 100%;
|
width: 85%;
|
||||||
}
|
}
|
||||||
.input-prepend {
|
.prepend {
|
||||||
.input-xlarge {
|
.input {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,6 +218,8 @@ class PagesController < ApplicationController
|
||||||
viewarea = doc.css("*[data-content='true']")[0]
|
viewarea = doc.css("*[data-content='true']")[0]
|
||||||
viewarea.inner_html = render_to_string(original_view)
|
viewarea.inner_html = render_to_string(original_view)
|
||||||
end
|
end
|
||||||
|
link = doc.css("link")[0]
|
||||||
|
link.attributes["href"].value = current_site.favicon.url.nil? ? "/assets/favicon.ico" : current_site.favicon.url
|
||||||
doc.to_html
|
doc.to_html
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,8 +7,16 @@ class SessionsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
user = User.find_by(user_name: params[:user_name]) rescue nil
|
user = User.find_by(user_name: params[:user_name]) rescue nil
|
||||||
if (user && user.authenticate(params[:password]) && user.is_confirmed?.eql?(true))
|
if (user && user.authenticate(params[:password]) && user.is_confirmed?.eql?(true))
|
||||||
session[:user_id] = user.id
|
if user.is_approved?
|
||||||
redirect_to admin_dashboards_path, :notice => "Logged in!"
|
session[:user_id] = user.id
|
||||||
|
redirect_to admin_dashboards_path, :notice => "Logged in!"
|
||||||
|
elsif user.is_admin?
|
||||||
|
session[:user_id] = user.id
|
||||||
|
redirect_to admin_dashboards_path, :notice => "Logged in!"
|
||||||
|
else
|
||||||
|
flash.now.alert = "User not approved."
|
||||||
|
render "new"
|
||||||
|
end
|
||||||
else
|
else
|
||||||
flash.now.alert = "Invalid username or password"
|
flash.now.alert = "Invalid username or password"
|
||||||
render "new"
|
render "new"
|
||||||
|
|
|
@ -5,8 +5,15 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
firstname = {}
|
||||||
|
lastname = {}
|
||||||
|
@site_valid_locales.each do |locale|
|
||||||
|
firstname[locale] = params[:first_name]
|
||||||
|
lastname[locale] = params[:last_name]
|
||||||
|
end
|
||||||
|
|
||||||
@user = User.new(user_params)
|
@user = User.new(user_params)
|
||||||
@member = MemberProfile.new(email: params[:email], first_name: params[:first_name], last_name: params[:last_name])
|
@member = MemberProfile.new(email: params[:email], first_name_translations: firstname, last_name_translations: lastname)
|
||||||
if @user.save
|
if @user.save
|
||||||
@member.save
|
@member.save
|
||||||
@user.update_attributes(member_profile_id: @member.id)
|
@user.update_attributes(member_profile_id: @member.id)
|
||||||
|
@ -49,7 +56,7 @@ class UsersController < ApplicationController
|
||||||
def basic_info_update
|
def basic_info_update
|
||||||
@user = User.find(params[:id])
|
@user = User.find(params[:id])
|
||||||
member_profile = @user.member_profile
|
member_profile = @user.member_profile
|
||||||
if member_profile.update_attributes(basic_info_params)
|
if member_profile.update_attributes(p)
|
||||||
redirect_to users_role_page_path(:user_id => @user.id.to_s)
|
redirect_to users_role_page_path(:user_id => @user.id.to_s)
|
||||||
else
|
else
|
||||||
render :action=> "form_page"
|
render :action=> "form_page"
|
||||||
|
@ -76,21 +83,15 @@ class UsersController < ApplicationController
|
||||||
response = {}
|
response = {}
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when "user_id"
|
when "user_id"
|
||||||
response["success"] = User.where(:user_id => params[:value]).count > 0 ? false : true
|
response["success"] = User.where(:user_name => params[:value]).count > 0 ? false : true
|
||||||
when "user_email"
|
when "user_email"
|
||||||
response["success"] = User.where(:email => params[:value]).count > 0? false : true
|
response["success"] = MemberProfile.where(:email => params[:value]).count > 0 ? false : true
|
||||||
end
|
end
|
||||||
render :json => response.to_json
|
render :json => response.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def email_template(token)
|
|
||||||
html = "<p>Thank you for registering your site with Orbit! Please click on the following link and confirm. This is to make sure we could provide you with a spam free experience. Thanks a lot.</p>"
|
|
||||||
html = html + "<a href='#{confirm_user_users_url(:token => token)} /> Please click here </a>"
|
|
||||||
html
|
|
||||||
end
|
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def user_params
|
def user_params
|
||||||
params.require(:user).permit(:password, :password_confirmation, :user_name, :member_profile_id, :email, :first_name, :last_name)
|
params.require(:user).permit(:password, :password_confirmation, :user_name, :member_profile_id, :email, :first_name, :last_name)
|
||||||
|
|
|
@ -25,7 +25,7 @@ module ApplicationHelper
|
||||||
sub_menu_html = site.sub_menu
|
sub_menu_html = site.sub_menu
|
||||||
html = header.to_s
|
html = header.to_s
|
||||||
html = html.gsub("{{site_name}}",site.title)
|
html = html.gsub("{{site_name}}",site.title)
|
||||||
html = html.gsub("%7B%7Blogo_url%7D%7D",(site.default_image.file.url rescue "http://placehold.it/50x50"))
|
html = html.gsub("%7B%7Blogo_url%7D%7D",(site.site_logo.url.nil? ? "/assets/site-logo.png" : site.site_logo.url))
|
||||||
if site.sitemap_menu_in_header
|
if site.sitemap_menu_in_header
|
||||||
sub_menu_html = sub_menu_html + "<a href='/#{I18n.locale.to_s}#{site.site_map_link}'>Sitemap</a>"
|
sub_menu_html = sub_menu_html + "<a href='/#{I18n.locale.to_s}#{site.site_map_link}'>Sitemap</a>"
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,6 +33,7 @@ class Site
|
||||||
|
|
||||||
|
|
||||||
mount_uploader :default_image, ImageUploader
|
mount_uploader :default_image, ImageUploader
|
||||||
|
mount_uploader :site_logo, ImageUploader
|
||||||
mount_uploader :favicon, ImageUploader
|
mount_uploader :favicon, ImageUploader
|
||||||
mount_uploader :mobile_icon, ImageUploader
|
mount_uploader :mobile_icon, ImageUploader
|
||||||
def to_param
|
def to_param
|
||||||
|
|
|
@ -91,6 +91,10 @@ class User
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_approved?
|
||||||
|
self.approved
|
||||||
|
end
|
||||||
|
|
||||||
def is_manager?(module_app)
|
def is_manager?(module_app)
|
||||||
if ((module_app.user_module_managers.include?(self.id) rescue nil) && (!self.is_admin?))
|
if ((module_app.user_module_managers.include?(self.id) rescue nil) && (!self.is_admin?))
|
||||||
true
|
true
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||||
<link rel="shortcut icon" href="/assets/images/favicon.ico" />
|
<link rel="shortcut icon" href="" />
|
||||||
<title>Orbit Classic</title>
|
<title>Orbit Classic</title>
|
||||||
<%= stylesheet_link_tag "default"%>
|
<%= stylesheet_link_tag "default"%>
|
||||||
<%= javascript_include_tag "lib/jquery-1.11.0.min"%>
|
<%= javascript_include_tag "lib/jquery-1.11.0.min"%>
|
||||||
|
|
|
@ -238,6 +238,37 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted">Orbit <%= t('preferences.site_logo') %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<!-- if this page editing please add class "fileupload-edit" -->
|
||||||
|
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
|
||||||
|
<div class="fileupload-new thumbnail pull-left">
|
||||||
|
<% if @site.site_logo.file.present? %>
|
||||||
|
<%= image_tag( @site.site_logo, :size=>"120x120") rescue ''%>
|
||||||
|
<% else %>
|
||||||
|
<%= image_tag "site-logo.png", :class => "pull-left upload-picture"%>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
|
||||||
|
<% if @site.site_logo.file.present?%>
|
||||||
|
<span class="btn btn-file">
|
||||||
|
<%= f.file_field :site_logo, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %><%= t('preferences.change') %>
|
||||||
|
</span>
|
||||||
|
<%= f.check_box :remove_site_logo %>
|
||||||
|
<%= t(:remove) %> <%= t('preferences.site_logo') %>
|
||||||
|
<%else%>
|
||||||
|
<span class="btn btn-file">
|
||||||
|
<%= f.file_field :site_logo, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %><%= t('preferences.select_image') %>
|
||||||
|
</span>
|
||||||
|
<%end%>
|
||||||
|
|
||||||
|
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
<div class="submit">
|
<div class="submit">
|
||||||
<button type="submit"><%= t(:login) %></button>
|
<button type="submit"><%= t(:login) %></button>
|
||||||
</div>
|
</div>
|
||||||
|
<div>Or</div>
|
||||||
|
<a href="/users/new">Sign up</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -38,7 +40,9 @@
|
||||||
</h1>
|
</h1>
|
||||||
<ul class="orbit-bar-menu">
|
<ul class="orbit-bar-menu">
|
||||||
<li>
|
<li>
|
||||||
<span class="orbit-bar-logo"></span>
|
<span class="orbit-bar-logo">
|
||||||
|
<img src="<%= current_site.default_image.url.nil? ? '/assets/orbit-logo.png' : current_site.default_image.url %>" />
|
||||||
|
</span>
|
||||||
<% if !current_user.nil? %>
|
<% if !current_user.nil? %>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -406,6 +406,7 @@ en:
|
||||||
classification: Classification
|
classification: Classification
|
||||||
frontend_open: "If Checked, the frontend will be open for all users."
|
frontend_open: "If Checked, the frontend will be open for all users."
|
||||||
favicon: Favicon
|
favicon: Favicon
|
||||||
|
site_logo: Site Logo
|
||||||
icon: Icon
|
icon: Icon
|
||||||
language: Language
|
language: Language
|
||||||
lang_detection: Enable User Language Detection
|
lang_detection: Enable User Language Detection
|
||||||
|
|
Loading…
Reference in New Issue