added some features
This commit is contained in:
parent
13e636d929
commit
684d7190f6
|
|
@ -3,10 +3,15 @@ $(function () {
|
|||
$("input[data-bootstrap-switch]").each(function(){
|
||||
$(this).bootstrapSwitch();
|
||||
})
|
||||
var searchTimeout = null;
|
||||
$( "#search_input" ).on('input', function() {
|
||||
if ($( "#search_input" ).val().length > 2 || $( "#search_input" ).val().length == 0) {
|
||||
clearTimeout(searchTimeout);
|
||||
searchTimeout = setTimeout(function() {
|
||||
$('#search').val($( "#search_input" ).val());
|
||||
$('#submit_form_btn').click();
|
||||
}, 400);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ class HomeController < ApplicationController
|
|||
@email_message = EmailMessage.new
|
||||
end
|
||||
|
||||
def statute; end
|
||||
def statute
|
||||
@setting = Setting.first
|
||||
end
|
||||
|
||||
def register_contact
|
||||
@email_message = EmailMessage.new(email_messages_params)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# module settings
|
||||
module Settings
|
||||
# Users
|
||||
class EmailMessagesController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
before_action :set_email_message, only: %i[show destroy]
|
||||
|
||||
def index
|
||||
@email_messages = EmailMessage.all
|
||||
end
|
||||
|
||||
def show; end
|
||||
|
||||
def destroy
|
||||
@email_message.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_email_messages_url, notice: 'Usunięto pomyślnie.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_email_message
|
||||
@email_message = EmailMessage.find(params[:id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# module settings
|
||||
module Settings
|
||||
# Users
|
||||
class FilterForEmailsController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
before_action :set_filter_for_email, only: %i[show destroy]
|
||||
|
||||
def index
|
||||
@filter_for_emails = FilterForEmail.all
|
||||
end
|
||||
|
||||
def show; end
|
||||
|
||||
def destroy
|
||||
@filter_for_email.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_filter_for_emails_url, notice: 'Usunięto pomyślnie.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_filter_for_email
|
||||
@filter_for_email = FilterForEmail.find(params[:id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# module settings
|
||||
module Settings
|
||||
# Users
|
||||
class SettingsController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
before_action :set_setting, only: %i[show edit update]
|
||||
|
||||
def index
|
||||
@settings = Setting.all
|
||||
end
|
||||
|
||||
def show; end
|
||||
|
||||
def new
|
||||
@setting = Setting.new
|
||||
end
|
||||
|
||||
def edit; end
|
||||
|
||||
def create
|
||||
@setting = Setting.new(setting_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @setting.save
|
||||
# @user.confirm
|
||||
# @user.save
|
||||
format.html { redirect_to settings_settings_url, notice: 'Utworzono pomyślnie.' }
|
||||
format.json { render :show, status: :created, location: @setting }
|
||||
else
|
||||
format.html { render :new, status: :unprocessable_entity }
|
||||
format.json { render json: @setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @setting.update_attributes(setting_params)
|
||||
format.html { redirect_to settings_settings_url, notice: 'Zaktualizowano pomyślnie.' }
|
||||
format.json { render :show, status: :ok, location: @setting }
|
||||
else
|
||||
format.html { render :edit, status: :unprocessable_entity }
|
||||
format.json { render json: @setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_setting
|
||||
@setting = Setting.first
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def setting_params
|
||||
params.require(:setting).permit(:disclaimer_clause, :privacy_policy,
|
||||
:statute)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -14,6 +14,9 @@ module ApplicationHelper
|
|||
ret += menu_item('far fa-circle', 'Eksperci', '/experts', 'experts') if role?('experts')
|
||||
ret += menu_item('far fa-circle', 'Partnerzy', '/partners', 'partners') if role?('partners')
|
||||
ret += menu_item('far fa-circle', 'Słownik', '/dictionaries', 'dictionaries') if role?('dictionaries')
|
||||
ret += menu_item('far fa-circle', 'Kontakty od klientów', '/settings/email_messages', 'email_messages') if admin?
|
||||
ret += menu_item('far fa-circle', 'Filtry klientów', '/settings/filter_for_emails', 'filter_for_emails') if admin?
|
||||
ret += menu_item('far fa-circle', 'Ustawienia', '/settings/settings', 'settings/settings') if admin?
|
||||
ret += menu_item('far fa-user', 'Użytkownicy', '/settings/users', 'users') if admin?
|
||||
|
||||
ret
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Settings
|
||||
class Setting < ApplicationRecord
|
||||
# == Constants ============================================================
|
||||
|
||||
# == Attributes ===========================================================
|
||||
|
||||
# == Extensions ===========================================================
|
||||
|
||||
# == Relationships ========================================================
|
||||
|
||||
# == Validations ==========================================================
|
||||
|
||||
# == Scopes ===============================================================
|
||||
|
||||
# == Callbacks ============================================================
|
||||
|
||||
# == Class Methods ========================================================
|
||||
|
||||
# == Instance Methods =====================================================
|
||||
def updated
|
||||
user = User.where('id = ?', updated_by).first
|
||||
if user.blank?
|
||||
'Brak'
|
||||
else
|
||||
user.email
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -36,6 +36,12 @@
|
|||
<% @dotations.each do |dotation| %>
|
||||
<%= render 'dotation_card', dotation: dotation %>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= link_to raw('<i class="fa fa-file-pdf"></i> Zapisz wyniki jako PDF'), "/zestawienie_dotacji/plik.pdf", class: 'btn btn-navy btn-block' %>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<% end %>
|
||||
<%= paginate @dotations, params: {controller: :home, action: :index}, theme: 'twitter-bootstrap-4' %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,14 +4,6 @@
|
|||
<h4 class="card-title" style="font-size: 1.1rem; text-align: center;">Użyj filtrów, aby szybko odnaleźć interesującą Cię dotację</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<% unless params[:search].blank? %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= link_to raw('<i class="fa fa-file-pdf"></i> Zapisz jako PDF'), "/zestawienie_dotacji/plik.pdf", class: 'btn btn-navy btn-block' %>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p><strong>Wyszukiwana fraza:</strong><br />
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
<h3 style='text-transform: uppercase;'><b>Szczegółowy opis dotacji</b></h3>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= raw dotation.replace_dictionary(dotation.replace_video, 'pdf') %>
|
||||
<%= raw dotation.replace_dictionary(dotation.replace_video.to_s, 'pdf') %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render '/home/statutes/statut' %>
|
||||
<%= raw @setting.statute %>
|
||||
<%# render '/home/statutes/statut' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -44,7 +45,8 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render '/home/statutes/privacy' %>
|
||||
<%= raw @setting.privacy_policy %>
|
||||
<%# render '/home/statutes/privacy' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -56,7 +58,8 @@
|
|||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render '/shared/disclaimer' %>
|
||||
<%= raw @setting.disclaimer_clause %>
|
||||
<%# render '/shared/disclaimer' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<% if @email_messages.blank? %>
|
||||
<div class="alert alert-info alert-dismissible">
|
||||
<h5><i class="icon fas fa-info"></i> Informacja</h5>
|
||||
Brak elementów na liście
|
||||
</div>
|
||||
<% else %>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>E-mail</th>
|
||||
<th>Temat</th>
|
||||
<th>Wiadomość</th>
|
||||
<th>Utworzono</th>
|
||||
<th style="width: 200px">Akcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @email_messages.each do |email_message| %>
|
||||
<tr>
|
||||
<td><%= email_message.email %></td>
|
||||
<td><%= email_message.subject %></td>
|
||||
<td><%= email_message.message %></td>
|
||||
<td><%= email_message.created_at.strftime("%Y-%m-%d %H:%M:%S") unless email_message.created_at.blank? %></td>
|
||||
<td>
|
||||
<%= link_to raw('<i class="fas fa-trash-can"></i> Usuń'), "/settings/email_messages/#{email_message.id}", class: 'btn-sm btn-danger', method: :delete, data: { confirm: 'Czy na pewno?' } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% end %>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kontakty od klientów</h1>
|
||||
</div>
|
||||
<div class="col-sm-6"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-folder"></i> Kontakty od klientów</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= render partial: 'list' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<% if @filter_for_emails.blank? %>
|
||||
<div class="alert alert-info alert-dismissible">
|
||||
<h5><i class="icon fas fa-info"></i> Informacja</h5>
|
||||
Brak elementów na liście
|
||||
</div>
|
||||
<% else %>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>E-mail</th>
|
||||
<th>Utworzono</th>
|
||||
<th style="width: 200px">Akcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @filter_for_emails.each do |filter_for_email| %>
|
||||
<tr>
|
||||
<td><%= filter_for_email.email %></td>
|
||||
<td><%= filter_for_email.created_at.strftime("%Y-%m-%d %H:%M:%S") unless filter_for_email.created_at.blank? %></td>
|
||||
<td>
|
||||
<%= link_to raw('<i class="fas fa-trash-can"></i> Usuń'), "/settings/filter_for_emails/#{filter_for_email.id}", class: 'btn-sm btn-danger', method: :delete, data: { confirm: 'Czy na pewno?' } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% end %>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Filtry Klientów</h1>
|
||||
</div>
|
||||
<div class="col-sm-6"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-folder"></i> Filtry Klientów</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= render partial: 'list' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<%= render '/shared/errors_list', error_object: setting %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<%= form.label :disclaimer_clause %>
|
||||
<%= form.text_area :disclaimer_clause, class: 'form-control', placeholder: 'Klauzula o wyłączeniu odpowiedzialności' %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :privacy_policy %>
|
||||
<%= form.text_area :privacy_policy, class: 'form-control', placeholder: 'Polityka prywatności' %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= form.label :statute %>
|
||||
<%= form.text_area :statute, class: 'form-control', placeholder: 'Regulamin' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-primary">Zapisz</button>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function() {
|
||||
tinymce.remove('#setting_disclaimer_clause');
|
||||
tinymce.remove('#setting_privacy_policy');
|
||||
tinymce.remove('#setting_statute');
|
||||
tinymce.init({
|
||||
selector: '#setting_disclaimer_clause',
|
||||
height: 500,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
|
||||
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
|
||||
'insertdatetime', 'media', 'table', 'code', 'wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | blocks | ' +
|
||||
'bold italic backcolor | alignleft aligncenter ' +
|
||||
'alignright alignjustify | bullist numlist outdent indent | ' +
|
||||
'removeformat link | table tableinsertdialog tablecellprops tableprops advtablerownumbering',
|
||||
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
|
||||
language: 'pl'
|
||||
});
|
||||
|
||||
tinymce.init({
|
||||
selector: '#setting_statute',
|
||||
height: 500,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
|
||||
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
|
||||
'insertdatetime', 'media', 'table', 'code', 'wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | blocks | ' +
|
||||
'bold italic backcolor | alignleft aligncenter ' +
|
||||
'alignright alignjustify | bullist numlist outdent indent | ' +
|
||||
'removeformat link | table tableinsertdialog tablecellprops tableprops advtablerownumbering',
|
||||
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
|
||||
language: 'pl'
|
||||
});
|
||||
|
||||
tinymce.init({
|
||||
selector: '#setting_privacy_policy',
|
||||
height: 500,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
|
||||
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
|
||||
'insertdatetime', 'media', 'table', 'code', 'wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | blocks | ' +
|
||||
'bold italic backcolor | alignleft aligncenter ' +
|
||||
'alignright alignjustify | bullist numlist outdent indent | ' +
|
||||
'removeformat link | table tableinsertdialog tablecellprops tableprops advtablerownumbering',
|
||||
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<% if @settings.blank? %>
|
||||
<div class="alert alert-info alert-dismissible">
|
||||
<h5><i class="icon fas fa-info"></i> Informacja</h5>
|
||||
Brak elementów na liście
|
||||
</div>
|
||||
<% else %>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Modyfikował</th>
|
||||
<th>Ostatnia zmiana</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings.each do |setting| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Ustawienia', edit_settings_setting_path(setting) %></td>
|
||||
<td><%= setting.updated %></td>
|
||||
<td><%= setting.updated_at.strftime("%Y-%m-%d %H:%M:%S") unless setting.updated_at.blank? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% end %>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Ustawienia</h1>
|
||||
</div>
|
||||
<div class="col-sm-6"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-edit"></i> Edycja ustawień</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= form_with(model: @setting, url: settings_setting_path(@setting), method: :patch, local: true) do |form| %>
|
||||
<%= render 'form', setting: @setting, form: form %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Ustawienia</h1>
|
||||
</div>
|
||||
<div class="col-sm-6"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-folder"></i> Ustawienia</h3>
|
||||
<div class="card-tools">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= render partial: 'list' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Użytkownicy</h1>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-sm-6"></div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-edit"></i> Nowy użytkownik</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= form_with(scope: @user, url: settings_users_path, local: true) do |form| %>
|
||||
<%= render 'form', user: @user, form: form %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
pl:
|
||||
activerecord:
|
||||
models:
|
||||
tag: Ustawienia
|
||||
attributes:
|
||||
filter_for_email:
|
||||
disclaimer_clause: "Klauzula o wyłączeniu odpowiedzialności"
|
||||
privacy_policy: "Polityka prywatności"
|
||||
statute: "Regulamin"
|
||||
errors:
|
||||
models:
|
||||
filter_for_email:
|
||||
attributes:
|
||||
disclaimer_clause:
|
||||
blank: nie może być pusta
|
||||
too_long: jest za długa (max 255 znaków)
|
||||
privacy_policy:
|
||||
blank: nie może być pusty
|
||||
too_long: jest za długi (max 1000 znaków)
|
||||
statute:
|
||||
blank: nie może być pusty
|
||||
too_long: jest za długi (max 50 znaków)
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
pl:
|
||||
activerecord:
|
||||
models:
|
||||
tag: Ustawienia
|
||||
attributes:
|
||||
setting:
|
||||
disclaimer_clause: "Klauzula o wyłączeniu odpowiedzialności"
|
||||
privacy_policy: "Polityka prywatności"
|
||||
statute: "Regulamin"
|
||||
errors:
|
||||
models:
|
||||
setting:
|
||||
attributes:
|
||||
disclaimer_clause:
|
||||
blank: nie może być pusta
|
||||
too_long: jest za długa (max 255 znaków)
|
||||
privacy_policy:
|
||||
blank: nie może być pusty
|
||||
too_long: jest za długi (max 1000 znaków)
|
||||
statute:
|
||||
blank: nie może być pusty
|
||||
too_long: jest za długi (max 50 znaków)
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
Rails.application.routes.draw do
|
||||
get 'dashboard/index'
|
||||
get 'zrezygnuj' => 'email_filter#unsubscribe'
|
||||
get 'email_filter/unsubscribe'
|
||||
get 'kontakt' => 'home#contact'
|
||||
|
|
@ -22,6 +23,7 @@ Rails.application.routes.draw do
|
|||
resources :company_activities
|
||||
post 'projects/chg_prio'
|
||||
resources :projects
|
||||
resources :dashboard
|
||||
resources :partners
|
||||
resources :experts
|
||||
resources :dictionaries
|
||||
|
|
@ -30,6 +32,9 @@ Rails.application.routes.draw do
|
|||
resources :grants
|
||||
namespace :settings do
|
||||
resources :users
|
||||
resources :settings
|
||||
resources :email_messages
|
||||
resources :filter_for_emails
|
||||
end
|
||||
get 'welcome/index'
|
||||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
class CreateSettings < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :settings do |t|
|
||||
t.longtext :disclaimer_clause
|
||||
t.longtext :privacy_policy
|
||||
t.longtext :statute
|
||||
t.bigint :updated_by
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/schema.rb
11
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_06_29_060749) do
|
||||
ActiveRecord::Schema.define(version: 2022_07_31_134927) do
|
||||
|
||||
create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
|
|
@ -253,6 +253,15 @@ ActiveRecord::Schema.define(version: 2022_06_29_060749) do
|
|||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "settings", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
||||
t.text "disclaimer_clause", limit: 4294967295
|
||||
t.text "privacy_policy", limit: 4294967295
|
||||
t.text "statute", limit: 4294967295
|
||||
t.bigint "updated_by"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "tags", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "description"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
disclaimer_clause:
|
||||
privacy_policy:
|
||||
statute:
|
||||
updated_by:
|
||||
|
||||
two:
|
||||
disclaimer_clause:
|
||||
privacy_policy:
|
||||
statute:
|
||||
updated_by:
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class SettingTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Loading…
Reference in New Issue