Commit 9969cd51 authored by cp's avatar cp

ruby 2.3.3, rails 4.2.8

git-svn-id: http://svn.sp-service.com.ua/svnroot/svn/base_site/trunk@9 d975c5f9-4e99-4c31-b122-d878075b96d9
parent beb1dd83
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<codeStyleSettings language="ruby">
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="RailsParamDefResolve" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="RubyInstanceMethodNamingConvention" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_maxLength" value="40" />
</inspection_tool>
<inspection_tool class="RubyResolve" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="warnImplicitResults" value="false" />
</inspection_tool>
<inspection_tool class="RubyStringKeysInHashInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
ruby-2.1.5
\ No newline at end of file
ruby-2.3.3
\ No newline at end of file
source 'https://rubygems.org'
gem 'rails', '4.2.7.1'
gem 'rails', '4.2.8'
gem 'mysql2'
gem 'uglifier', '>= 1.3.0'
gem 'sass-rails', '~> 5.0'
......@@ -31,7 +31,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
group :development do
gem 'web-console', '~> 2.0'
gem 'capistrano', '~> 3.6.1'
gem 'capistrano', '~> 3.7.2'
gem 'capistrano-faster-assets', '~> 1.0'
gem 'capistrano-bundler'
gem 'capistrano-rvm'
......
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
actionmailer (4.2.8)
actionpack (= 4.2.8)
actionview (= 4.2.8)
activejob (= 4.2.8)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.7.1)
actionview (= 4.2.7.1)
activesupport (= 4.2.7.1)
actionpack (4.2.8)
actionview (= 4.2.8)
activesupport (= 4.2.8)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.7.1)
activesupport (= 4.2.7.1)
actionview (4.2.8)
activesupport (= 4.2.8)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.7.1)
activesupport (= 4.2.7.1)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.8)
activesupport (= 4.2.8)
globalid (>= 0.3.0)
activemodel (4.2.7.1)
activesupport (= 4.2.7.1)
activemodel (4.2.8)
activesupport (= 4.2.8)
builder (~> 3.1)
activerecord (4.2.7.1)
activemodel (= 4.2.7.1)
activesupport (= 4.2.7.1)
activerecord (4.2.8)
activemodel (= 4.2.8)
activesupport (= 4.2.8)
arel (~> 6.0)
activesupport (4.2.7.1)
activesupport (4.2.8)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
acts_as_list (0.9.0)
acts_as_list (0.9.4)
activerecord (>= 3.0)
airbrussh (1.1.2)
sshkit (>= 1.6.1, != 1.7.0)
arel (6.0.4)
autoprefixer-rails (6.7.0)
autoprefixer-rails (6.7.7.1)
execjs
bcrypt (3.1.11-x64-mingw32)
bcrypt (3.1.11-x86-mingw32)
......@@ -50,12 +49,12 @@ GEM
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap-will_paginate (0.0.10)
bootstrap-will_paginate (0.0.11)
will_paginate
bootstrap3-datetimepicker-rails (4.15.35)
momentjs-rails (>= 2.8.1)
builder (3.2.3)
capistrano (3.6.1)
capistrano (3.7.2)
airbrussh (>= 1.0.0)
capistrano-harrow
i18n
......@@ -67,7 +66,7 @@ GEM
capistrano-faster-assets (1.0.2)
capistrano (>= 3.1)
capistrano-harrow (0.5.3)
capistrano-rails (1.2.2)
capistrano-rails (1.2.3)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
capistrano-rvm (0.1.2)
......@@ -91,15 +90,15 @@ GEM
execjs
coffee-script-source (1.12.2)
commonjs (0.2.7)
concurrent-ruby (1.0.4)
concurrent-ruby (1.0.5)
debug_inspector (0.0.2)
devise (4.2.0)
devise (4.2.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.1)
responders
warden (~> 1.2.3)
devise-i18n (1.1.1)
devise-i18n (1.1.2)
erubis (2.7.0)
execjs (2.7.0)
font-awesome-rails (4.7.0.1)
......@@ -119,11 +118,11 @@ GEM
haml (~> 4.0)
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
i18n (0.7.0)
jbuilder (2.6.1)
activesupport (>= 3.0.0, < 5.1)
i18n (0.8.1)
jbuilder (2.6.3)
activesupport (>= 3.0.0, < 5.2)
multi_json (~> 1.2)
jquery-rails (4.2.2)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
......@@ -144,7 +143,7 @@ GEM
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.6.0)
mini_magick (4.6.1)
mini_portile2 (2.1.0)
minitest (5.10.1)
momentjs-rails (2.17.1)
......@@ -155,25 +154,25 @@ GEM
nested_form (0.3.2)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.0.1)
nokogiri (1.7.0.1-x64-mingw32)
net-ssh (4.1.0)
nokogiri (1.7.1-x64-mingw32)
mini_portile2 (~> 2.1.0)
nokogiri (1.7.0.1-x86-mingw32)
nokogiri (1.7.1-x86-mingw32)
mini_portile2 (~> 2.1.0)
orm_adapter (0.5.0)
rack (1.6.5)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.7.1)
actionmailer (= 4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
activemodel (= 4.2.7.1)
activerecord (= 4.2.7.1)
activesupport (= 4.2.7.1)
rails (4.2.8)
actionmailer (= 4.2.8)
actionpack (= 4.2.8)
actionview (= 4.2.8)
activejob (= 4.2.8)
activemodel (= 4.2.8)
activerecord (= 4.2.8)
activesupport (= 4.2.8)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.7.1)
railties (= 4.2.8)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
......@@ -183,9 +182,9 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (4.2.7.1)
actionpack (= 4.2.7.1)
activesupport (= 4.2.7.1)
railties (4.2.8)
actionpack (= 4.2.8)
activesupport (= 4.2.8)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.0.0)
......@@ -204,7 +203,7 @@ GEM
sdoc (0.4.2)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
sexp_processor (4.7.0)
sexp_processor (4.8.0)
simple_form (3.4.0)
actionpack (> 4, < 5.1)
activemodel (> 4, < 5.1)
......@@ -215,12 +214,12 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sshkit (1.11.5)
sshkit (1.12.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.5)
thread_safe (0.3.6)
tilt (2.0.7)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
......@@ -231,11 +230,11 @@ GEM
railties (>= 3.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
tzinfo-data (1.2016.10)
tzinfo-data (1.2017.1)
tzinfo (>= 1.0.0)
uglifier (3.0.4)
uglifier (3.1.9)
execjs (>= 0.3.0, < 3)
warden (1.2.6)
warden (1.2.7)
rack (>= 1.0)
web-console (2.3.0)
activemodel (>= 4.0)
......@@ -253,7 +252,7 @@ DEPENDENCIES
bootstrap-sass (~> 3.3.4)
bootstrap-will_paginate
bootstrap3-datetimepicker-rails (~> 4.15.35)
capistrano (~> 3.6.1)
capistrano (~> 3.7.2)
capistrano-bundler
capistrano-faster-assets (~> 1.0)
capistrano-rails
......@@ -272,7 +271,7 @@ DEPENDENCIES
momentjs-rails (>= 2.9.0)
mysql2
nested_form
rails (= 4.2.7.1)
rails (= 4.2.8)
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
simple_form
......@@ -284,4 +283,4 @@ DEPENDENCIES
will_paginate
BUNDLED WITH
1.14.2
1.14.3
......@@ -24,9 +24,9 @@ $(document).on 'click', '#container:not(.pinned) #links_panel .handle', ->
$(document).on 'click', '#container:not(.pinned) #links_panel .pin', ->
$('#container').addClass('pinned')
$.ajax '/admin/settings/links_pinned', method: 'patch', dataType: 'json', data: {setting: {value: 1}}
$.ajax '/admin/links_pinned', method: 'patch', dataType: 'json', data: {pinned: 1}
$(document).on 'click', '#container.pinned #links_panel .pin', ->
$('#container').removeClass('pinned')
$.ajax '/admin/settings/links_pinned', method: 'patch', dataType: 'json', data: {setting: {value: 0}}
$.ajax '/admin/links_pinned', method: 'patch', dataType: 'json', data: {pinned: 0}
......@@ -4,6 +4,11 @@ class AdminController < ApplicationController
# console
end
def links_pinned
current_account.administrator.update links_pinned: params[:pinned]
render nothing: true
end
def paginated(scope)
scope.paginate(page: params[:page], per_page: 20)
end
......
module AdminHelper
def current_admin_path
return @current_admin_path if @current_admin_path
if params['controller'] == 'admin' && params['action'] == 'index'
link_to t('activerecord.attributes.page.links.admin_area'), admin_index_path, class: 'navbar-brand'
@current_admin_caption = t('activerecord.attributes.page.links.admin_area')
@current_admin_path = link_to @current_admin_caption, admin_index_path, class: 'navbar-brand'
else
link_to t("activerecord.models.#{controller_name.sub('Controller', '').singularize.downcase}.few"),
controller_path, class: 'navbar-brand'
model = controller_name.singularize.classify.constantize
@current_admin_caption = model ? model.model_name.human(count: 2).mb_chars.titleize : controller_name.humanize
@current_admin_path = link_to @current_admin_caption, controller_path, class: 'navbar-brand'
end
end
def current_admin_caption
current_admin_path unless @current_admin_caption
@current_admin_caption
end
end
......@@ -10,7 +10,6 @@ class Setting < ActiveRecord::Base
title: {default: 'Blank site', format: :string},
description: {default: 'New blank site - it is stub for future site!', format: :string},
keywords: {default: '', format: :string},
links_pinned: {default: false, format: :bool},
favicon: {default: nil, format: :image},
gse_id: {default: '007392588842326689376:3onw-lza4mc', format: :string},
google_analytics_id: {default: 'UA-63039804-12', format: :string}
......@@ -39,10 +38,6 @@ class Setting < ActiveRecord::Base
@@keywords ||= get(:keywords).real_value
end
def self.links_pinned
@@links_pinned ||= get(:links_pinned).real_value
end
def self.favicon
@@favicon ||= get(:favicon).real_value
end
......
- model_class = Account
.page-header.refresh_pagination
%h1
= model_class.model_name.human(count: 2)
= model_class.model_name.human(count: 2).mb_chars.titleize
.pull-right
- newsletter_params = tabular_filter.condition.present? ? {newsletter: {recipient_filter: tabular_filter.condition}} : nil
= link_to 'Newsletter', new_newsletter_path(newsletter_params), class: 'btn btn-default btn-sm'
......
......@@ -4,7 +4,7 @@
%meta(charset="utf-8")
%meta(http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1")
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
%title= content_for?(:title) ? yield(:title) : 'Admin area'
%title= content_for?(:title) ? yield(:title) : [current_admin_caption, Setting.title].join(' | ')
= csrf_meta_tags
/ Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
......@@ -40,7 +40,7 @@
= current_account.email
%b.caret
%ul.dropdown-menu.dropdown-menu-right(aria-labelledby="sign_in_mob_menu")
%li= link_to t('helpers.links.change_password'), edit_account_registration_path, data: { no_turbolink: true }
%li= link_to t('helpers.links.change_password'), edit_account_registration_path, data: { no_turbolink: true, turbolinks: false }
%li= link_to t('helpers.links.sign_out'), destroy_account_session_path, method: :delete
=render 'layouts/language_selector'
......@@ -55,19 +55,24 @@
%ul.dropdown-menu.dropdown-menu-right(aria-labelledby="sign_in_menu")
%li= link_to t('helpers.links.change_password'), edit_account_registration_path, data: { no_turbolink: true }
%li= link_to t('helpers.links.sign_out'), destroy_account_session_path, method: :delete
%li= render 'layouts/language_selector'
= render 'layouts/language_selector'
.container-fluid.yield-container#container{class: (:pinned if Setting.links_pinned)}
.container-fluid.yield-container#container{class: (:pinned if current_account.administrator.links_pinned?)}
.row
.col-xs-0
#links_panel
.well.sidebar-nav
%ul.nav.nav-list
%li{class: (:selected if params['controller'] == 'admin' && params['action'] == 'index')}= link_to t('activerecord.attributes.page.links.admin_area'), admin_index_path
%li{class: (:selected if controller.is_a? AccountsController)}= link_to t('activerecord.models.account.few'), accounts_path
%li{class: (:selected if controller.is_a? PagesController)}= link_to t('activerecord.models.page.few'), pages_path
%li{class: (:selected if controller.is_a? NewslettersController)}= link_to t('activerecord.models.newsletter.few'), newsletters_path
%li{class: (:selected if controller.is_a? SettingsController)}= link_to t('activerecord.models.setting.few'), settings_path
%li{class: (:selected if params['controller'] == 'admin' && params['action'] == 'index')}
= link_to t('activerecord.attributes.page.links.admin_area'), admin_index_path
%li{class: (:selected if controller.is_a? AccountsController)}
= link_to Account.model_name.human(count: 2).mb_chars.titleize, accounts_path
%li{class: (:selected if controller.is_a? PagesController)}
= link_to Page.model_name.human(count: 2).mb_chars.titleize, pages_path
%li{class: (:selected if controller.is_a? NewslettersController)}
= link_to Newsletter.model_name.human(count: 2).mb_chars.titleize, newsletters_path
%li{class: (:selected if controller.is_a? SettingsController)}
= link_to Setting.model_name.human(count: 2).mb_chars.titleize, settings_path
%li= link_to t('helpers.links.front'), root_path, target: :_blank
.handle
%i.fa.fa-chevron-circle-right.fa-2x
......
- model_class = Newsletter
.page-header
%h1=t '.title', :default => model_class.model_name.human(count: 2)
%h1= model_class.model_name.human(count: 2).mb_chars.titleize
%table.table.table-striped
%thead
%tr
......
- model_class = Page
.page-header
%h1= model_class.model_name.human(count: 2)
%h1= model_class.model_name.human(count: 2).mb_chars.titleize
%table.table.table-striped
%thead
%tr
......
- model_class = Setting
= title(t 'activerecord.models.setting.few')
= title(model_class.model_name.human(count: 2).mb_chars.titleize)
.page-header
%h1=t 'activerecord.models.setting.few'
%h1= model_class.model_name.human(count: 2).mb_chars.titleize
%table.table.table-striped.editable_rows{'data-resource' => model_class.name.underscore}
%thead
%tr
......
This diff is collapsed.
# config valid only for current version of Capistrano
lock '3.6.1'
lock '3.7.2'
# DEPLOY
set :application, 'base_site'
......
server 'storage.sp-service.com.u', user: 'deploy', roles: %w{app db web}
server 'storage.sp-service.com.ua', user: 'deploy', roles: %w{app db web}
# set :rvm_custom_path, '/usr/local/rvm' # only needed if not detected
......@@ -45,11 +45,6 @@ uk:
few: Блоки
many: Блоки
other: Блоки
certificate:
one: Сертифікат
few: Сертифікати
many: Сертифікатів
other: Сертифікати
page:
one: Сторінка
few: Сторінки
......@@ -373,16 +368,6 @@ uk:
ru: "Рус"
uk: "Укр"
info_box:
title: Пластична та естетична хірургія
hospital: Комунальна 8-ма клінічна лікарня
department: Центр Термічної травми та пластичної хірургії
doctor_name: Хаба Тарас Петрович
about_me: Про мене
certificates: Сертифікати
services: Послуги
contacts: Контакти
helpers:
links:
front: "Перегляд сайту"
......@@ -16,6 +16,7 @@ Rails.application.routes.draw do
controller :admin do
get '/' => :index, as: :admin_index
patch 'links_pinned' => :links_pinned
end
controller :blocks do
......
class AddLinksPinnedToAdministrator < ActiveRecord::Migration
def change
add_column :administrators, :links_pinned, :boolean, null: false, default: false
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160826182357) do
ActiveRecord::Schema.define(version: 20170215151410) do
create_table "accounts", force: :cascade do |t|
t.string "email", limit: 255, default: "", null: false
......@@ -47,6 +47,7 @@ ActiveRecord::Schema.define(version: 20160826182357) do
t.integer "account_id", limit: 4, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "links_pinned", default: false, null: false
end
add_index "administrators", ["account_id"], name: "index_administrators_on_account_id", using: :btree
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment