Skip to content
Snippets Groups Projects
Unverified Commit 68d1db31 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents 43e94d71 7c81d8f6
No related branches found
No related tags found
No related merge requests found
Showing
with 86 additions and 96 deletions
......@@ -3,5 +3,7 @@
//= require bootstrap-sprockets
//= require jquery3
//= require jquery_ujs
//= require cropperjs/dist/cropper
//= require jquery-cropper/dist/jquery-cropper
//= require simple_form_password_with_hints
//= require simple_form_bs5_file_input
main.content
padding-bottom: 65px
.footer.fixed
bottom: 0
left: 260px
position: fixed
right: 0
......@@ -9,9 +9,9 @@ h1
.sidebar-content
background-color: black
background-image: asset-url('sun.svg')
background-repeat: no-repeat
background-position-x: center
background-position-y: -420px
background-repeat: no-repeat
background-size: 400%
.sidebar-brand
padding: 90px 80px 120px
......
@import 'appstack/light'
@import 'admin/*'
......@@ -2,5 +2,6 @@
@import 'appstack/light'
@import 'simple_form_password_with_hints'
@import 'simple_form_bs5_file_input'
@import 'cropperjs/dist/cropper'
@import 'commons/*'
@import 'application/*'
......@@ -57,6 +57,6 @@ class Server::UniversitiesController < Server::ApplicationController
end
def university_params
params.require(:university).permit(:name, :address, :zipcode, :city, :country, :private, :identifier)
params.require(:university).permit(:name, :address, :zipcode, :city, :country, :private, :identifier, :logo, :logo_delete)
end
end
......@@ -19,11 +19,13 @@ class University < ApplicationRecord
validates_presence_of :name
scope :ordered, -> { order(:name) }
include WithIdentifier
include WithUsers
include WithCommunication
include WithEducation
include WithIdentifier
include WithResearch
include WithCommunication
include WithUsers
has_one_attached_deletable :logo
def to_s
"#{name}"
......
......@@ -4,7 +4,7 @@ module User::WithRoles
included do
attr_accessor :modified_by
enum role: { visitor: 0, admin: 20, superadmin: 30 }
enum role: { visitor: 0, admin: 20, server_admin: 30 }
scope :for_role, -> (role) { where(role: role) }
......
<footer class="footer">
<div class="container-fluid">
<div class="row text-muted">
<div class="col-6 text-start">
<ul class="list-inline">
<li class="list-inline-item">
<a class="text-muted" href="#">Support</a>
</li>
<li class="list-inline-item">
<a class="text-muted" href="#">Help Center</a>
</li>
<li class="list-inline-item">
<a class="text-muted" href="#">Privacy</a>
</li>
<li class="list-inline-item">
<a class="text-muted" href="#">Terms of Service</a>
</li>
</ul>
</div>
<div class="col-6 text-end">
<p class="mb-0">
<a href="https://www.osuny.org" target="_blank" rel="noreferrer">
<%= image_tag 'osuny-white.svg', width: 65 %>
</a>
</p>
</div>
<% if content_for?(:action_bar_left) or content_for?(:action_bar_right) %>
<footer class="footer fixed">
<div class="float-start">
<%= yield :action_bar_left %>
</div>
</div>
</footer>
<div class="float-end">
<%= yield :action_bar_right %>
</div>
</footer>
<% end %>
......@@ -14,7 +14,6 @@
<div class="col-md-6">
<label class="form-label">&nbsp;</label><br>
<%= f.button :submit, t(".resend_confirmation_instructions"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
</div>
</div>
<% end %>
......@@ -6,32 +6,32 @@
<%= f.input :reset_password_token, as: :hidden %>
<%= f.full_error :reset_password_token %>
<div class="form-inputs">
<%= f.input :password,
as: :password_with_hints,
label: t(".new_password"),
required: true,
autofocus: true,
allow_password_uncloaking: true,
validators: {
length: Devise.password_length.first,
uppercase_char: true,
lowercase_char: true,
numeric_char: true,
special_char: Rails.application.config.allowed_special_chars
},
input_html: { autocomplete: "new-password" } %>
<%= f.input :password_confirmation,
as: :password_with_sync,
label: t(".confirm_new_password"),
required: true,
allow_password_uncloaking: true,
compare_with_field: :password,
input_html: { autocomplete: "new-password" } %>
</div>
<div class="form-actions">
<%= f.button :submit, t(".change_my_password"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
<div class="row">
<div class="col-md-6">
<%= f.input :password,
as: :password_with_hints,
label: t(".new_password"),
required: true,
autofocus: true,
allow_password_uncloaking: true,
validators: {
length: Devise.password_length.first,
uppercase_char: true,
lowercase_char: true,
numeric_char: true,
special_char: Rails.application.config.allowed_special_chars
},
input_html: { autocomplete: "new-password" } %>
<%= f.button :submit, t(".change_my_password"), class: 'btn btn-primary' %>
</div>
<div class="col-md-6">
<%= f.input :password_confirmation,
as: :password_with_sync,
label: t(".confirm_new_password"),
required: true,
allow_password_uncloaking: true,
compare_with_field: :password,
input_html: { autocomplete: "new-password" } %>
</div>
</div>
<% end %>
......@@ -13,7 +13,6 @@
<div class="col-md-6">
<label class="form-label">&nbsp;</label><br>
<%= f.button :submit, t(".send_me_reset_password_instructions"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
</div>
</div>
<% end %>
......@@ -36,11 +36,11 @@
<% end %>
</div>
</div>
<%= f.button :submit, t(".update"), class: 'btn btn-primary' %>
<% content_for :action_bar_right do %>
<%= f.button :submit, t(".update"), class: 'btn btn-primary' %>
<% end %>
<% end %>
<h3 class="mt-5 mb-4"><%= t(".cancel_my_account") %></h3>
<p><%= t(".unhappy") %> <%= link_to t(".cancel_my_account"), registration_path(resource_name), data: { confirm: t(".are_you_sure") }, method: :delete %></p>
<%= link_to t("devise.shared.links.back"), :back %>
......@@ -41,10 +41,11 @@
input_html: { autocomplete: "new-password" } %>
<%= f.input :picture,
as: :single_deletable_file,
input_html: { accept: '.png' } %>
input_html: { accept: '.jpg,.jpeg,.png' },
preview: 200,
resize: 1,
direct_upload: true %>
</div>
</div>
<%= f.button :submit, t(".sign_up"), class: 'btn btn-primary' %>
<% end %>
<%= render "devise/shared/links" %>
......@@ -16,7 +16,7 @@
required: false,
autofocus: true,
input_html: { autocomplete: "email" } %>
<div class="mb-3 password optional user_password">
<div class="mb-3 password optional user_password password_with_hints">
<%= f.input :password,
as: :password_with_hints,
allow_password_uncloaking: true,
......@@ -32,7 +32,17 @@
<div class="form-actions">
<%= f.button :submit, t(".sign_in"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
<div class="mt-3">
<% if devise_mapping.confirmable? %>
<%= link_to t('devise.shared.links.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %><br />
<% end %>
<% if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) %>
<%= link_to t('devise.shared.links.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) %><br />
<% end %>
</div>
</div>
<% end %>
</div>
......
<div class="mt-3">
<%- if controller_name != 'sessions' %>
<%= link_to t(".sign_in"), new_session_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to t('.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), method: :post %><br />
<% end %>
<% end %>
</div>
......@@ -13,7 +13,6 @@
<div class="col-md-6">
<label class="form-label">&nbsp;</label><br>
<%= f.button :submit, t(".resend_unlock_instructions"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
</div>
</div>
<% end %>
......@@ -14,7 +14,9 @@
<div class="container">
<div class="row">
<div class="col-sm-10 mx-auto">
<h1 class="my-5 py-5 text-center"><%= current_university %></h1>
<h1 class="my-5 py-5 text-center">
<%= link_to current_university, root_path %>
</h1>
<div class="card">
<div class="card-body text-start">
<% unless notice.blank? %>
......
......@@ -8,7 +8,7 @@
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&display=swap" rel="stylesheet">
<%= stylesheet_link_tag 'adminserver', media: 'all' %>
<%= stylesheet_link_tag 'admin', media: 'all' %>
<%= favicon_link_tag 'favicon.png' %>
</head>
......
......@@ -5,7 +5,7 @@
<%= f.input :identifier %>
<%= f.input :private %>
</div>
<div class="col-md-8">
<div class="col-md-4">
<%= f.input :address %>
<div class="row">
<div class="col-md-4">
......@@ -17,6 +17,13 @@
</div>
<%= f.input :country %>
</div>
<div class="col-md-4">
<%= f.input :logo,
as: :single_deletable_file,
input_html: { accept: '.jpg,.jpeg,.png,.svg' },
preview: 200,
direct_upload: true %>
</div>
</div>
<% content_for :buttons do %>
<%= submit f %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment