Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/v13'
Browse files Browse the repository at this point in the history
Conflicts:
	app/assets/stylesheets/custom/_areas.scss
	app/assets/stylesheets/custom/_main.scss
	app/controllers/web/admin/events_controller.rb
	app/views/layouts/web/shared/_navigation.html.haml
	app/views/web/accounts/_form.html.haml
  • Loading branch information
alexeyfrank committed Mar 20, 2013
2 parents d320cc6 + 951a3a8 commit ca6e63a
Show file tree
Hide file tree
Showing 181 changed files with 2,217 additions and 813 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

/public/system/*
/coverage
# Ignore schema
schema.rb

#ignore idea project files
.idea
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ gem 'kaminari'
gem 'kaminari-bootstrap'
gem 'ransack'
gem 'chosen-rails'
gem 'select2-rails'
gem 'auditable', :github => 'harleyttd/auditable'
gem 'enumerize'
gem 'rack-rewrite'
Expand All @@ -40,6 +41,7 @@ gem 'gon'
gem 'redcarpet'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-twitter'

# Gems used only for assets and not required
# in production environments by default.
Expand All @@ -48,6 +50,8 @@ group :assets do
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'compass-rails'
gem 'bootstrap-colorpicker-rails'
end

group :test, :development do
Expand Down
24 changes: 24 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ GEM
open4 (~> 1.3.0)
thor (>= 0.15.4, < 2)
bcrypt-ruby (3.0.1)
bootstrap-colorpicker-rails (0.2)
railties (>= 3.0)
builder (3.0.4)
capi (0.1.1)
capistrano
Expand All @@ -70,6 +72,7 @@ GEM
railties (>= 3.0)
sass-rails (>= 3.2)
chronic (0.9.0)
chunky_png (1.2.7)
ci_reporter (1.8.4)
builder (>= 2.1.2)
ckeditor (4.0.2)
Expand All @@ -85,6 +88,12 @@ GEM
coffee-script-source (1.4.0)
colorize (0.5.8)
commonjs (0.2.6)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
compass-rails (1.0.3)
compass (>= 0.12.2, < 0.14)
configus (0.0.4)
rake
coveralls (0.5.6)
Expand All @@ -106,6 +115,7 @@ GEM
railties (>= 3.0.0)
faraday (0.8.5)
multipart-post (~> 1.1)
fssm (0.2.10)
gon (4.0.2)
actionpack (>= 2.3.0)
json
Expand Down Expand Up @@ -167,6 +177,7 @@ GEM
net-ssh (2.6.5)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
oauth (0.4.7)
oauth2 (0.8.0)
faraday (~> 0.8)
httpauth (~> 0.1)
Expand All @@ -178,9 +189,15 @@ GEM
rack
omniauth-facebook (1.4.1)
omniauth-oauth2 (~> 1.1.0)
omniauth-oauth (1.0.1)
oauth
omniauth (~> 1.0)
omniauth-oauth2 (1.1.1)
oauth2 (~> 0.8.0)
omniauth (~> 1.0)
omniauth-twitter (0.0.14)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
open4 (1.3.0)
orm_adapter (0.4.0)
pg (0.14.1)
Expand Down Expand Up @@ -233,6 +250,9 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
select2-rails (3.3.1)
sass-rails (>= 3.2)
thor (~> 0.14)
simple_form (2.0.4)
actionpack (~> 3.0)
activemodel (~> 3.0)
Expand Down Expand Up @@ -302,6 +322,7 @@ DEPENDENCIES
auditable!
backup
bcrypt-ruby (~> 3.0.0)
bootstrap-colorpicker-rails
capi
capistrano
capistrano-ext
Expand All @@ -313,6 +334,7 @@ DEPENDENCIES
ckeditor
cocoon
coffee-rails (~> 3.2.1)
compass-rails
configus
coveralls
enumerize
Expand All @@ -331,6 +353,7 @@ DEPENDENCIES
minitest
omniauth
omniauth-facebook
omniauth-twitter
pg
pre-commit
rack-rewrite
Expand All @@ -341,6 +364,7 @@ DEPENDENCIES
russian
rvm-capistrano
sass-rails (~> 3.2.3)
select2-rails
simple_form
simplecov
sqlite3
Expand Down
Binary file removed app/assets/images/rails.png
Binary file not shown.
Binary file modified app/assets/images/stars.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions app/assets/javascripts/admin/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@
//
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require ckeditor/init
//= require chosen-jquery
//= require twitter/bootstrap
//= require js-routes
//= require cocoon
//= require select2
//= require bootstrap-datetimepicker.min
//= require admin/chosen-selects
//= require admin/dates
//= require admin/halls
//= require admin/user_edit_form
//= require admin/dates
//= require admin/custom
9 changes: 5 additions & 4 deletions app/assets/javascripts/admin/chosen-selects.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# enable chosen js
$('.chosen-select').chosen
allow_single_deselect: true
no_results_text: 'Ничего не найдено по запросу'
#enable chosen js
$('.chosen-select').each ->
$(@).select2
allowClear: true
placeholder: $(@).data('placeholder')
5 changes: 5 additions & 0 deletions app/assets/javascripts/admin/custom.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
window.onload = ->
delay = (ms, func) -> setTimeout func, ms
delay 4000, -> $('.alert').fadeOut('slow')

$('.color-picker').colorpicker()
1 change: 1 addition & 0 deletions app/assets/javascripts/admin/dates.js.coffee
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
$('.datetimepicker').datetimepicker
format: "yyyy-MM-dd hh:mm:ss"
# format: "dd-MM-yyyy hh:mm"
47 changes: 47 additions & 0 deletions app/assets/javascripts/admin/halls.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
class Helpers
@setSelectOptions: (selectElement, values, valueKey, textKey) ->
selectElement.empty()
if values.length > 0
html = ("<option value='#{item[valueKey]}'>#{item[textKey]}</option>" for item in values)
selectElement.append(html)

class TimeSlotEditWidget
defaults:
event_type_select_class: 'select.event-type-select'
event_id_select_class: 'select.event-id-select'
select2_options:
placeholder: 'Выберите...'
allowClear: true

constructor: (options) ->
@item = options.item
@event_type_select_class = options.event_type_select_class || @defaults.event_type_select_class
@event_id_select_class = options.event_id_select_class || @defaults.event_id_select_class
@init()
@bind()

init: ->
@event_id_dropdown = @item.find @event_id_select_class
@event_type_dropdown = @item.find @event_type_select_class
@event_type_dropdown.select2 @select2_options
@event_id_dropdown.select2 @select2_options
@item.find('.datetimepicker').datetimepicker format: "yyyy-MM-dd hh:mm:ss"

bind: ->
@event_type_dropdown.on 'change', (e) =>
val = e.val
if val is ''
@reload_select @event_id_dropdown, []
else
$.get Routes.api_events_path(type: val), (data) =>
@reload_select @event_id_dropdown, data.root.events

reload_select: (obj, data)->
obj.select2("destroy")
Helpers.setSelectOptions(obj, data, 'id', 'title')
obj.select2 @select2_options



$('.hall-form .well').each -> new TimeSlotEditWidget item: $(@)
$('.hall-form').bind 'cocoon:after-insert', (e, inserted_item) -> new TimeSlotEditWidget item: $(inserted_item)
63 changes: 62 additions & 1 deletion app/assets/javascripts/custom.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,65 @@
window.onload = ->
delay = (ms, func) -> setTimeout func, ms
delay 4000, -> $('.alert').fadeOut('slow')


# side bar
affixTop = $("#nav_top").outerHeight() + $("#nav_main").outerHeight() + $("header").outerHeight() + $(".content h1:first").outerHeight() + parseInt($(".content h1:first").css('marginTop')) + parseInt($(".content h1:first").css('marginBottom'))
affixBottom = $(".sponsors").outerHeight() + parseInt($("#main_container").css("padding-bottom"))+ parseInt($(".border").css('marginTop'))
affixHeight = $(".b-affix:first").outerHeight()
docHeight = $(document).height()
bottomLimit = docHeight - affixBottom - affixHeight

setInterval (->
b_affix()
), 1

b_affix = ->
curPos = $(window).scrollTop()
if curPos > affixTop and curPos < bottomLimit
$(".b-affix").addClass("top")
else
$(".b-affix").removeClass("top")

if curPos > bottomLimit
$(".b-affix").addClass("bottom")
else
$(".b-affix").removeClass("bottom")

$(document).ready ->

# timetable long events hover
$('.event').mouseenter ->
heightSummary = $(this).find('.summary').outerHeight()
heightEvent = $(this).outerHeight()
if heightSummary > heightEvent
$(this).addClass('expand')
.mouseleave ->
$(this).removeClass('expand')

# events editing table
$('table').delegate 'a.edit-event', 'click', ->
parent_row = $(this).closest('tr')
parent_row.next().toggleClass('hidden')

$('#my_events a.edit-event').click()

$('table').delegate 'form.edit-event[data-remote]', 'ajax:success', (evt, data, status, xhr) ->
row = $(this).closest('tr')
row.after(data)
row.prev().remove()
row.remove()
delay 4000, -> $('.alert').fadeOut('slow')

# Twitter Bootstrap tabs hashes

# Automagically jump on good tab based on anchor; for page reloads or links
$("a[href=" + location.hash + "]").tab "show" if location.hash

# Update hash based on tab, basically restores browser default behavior to fix bootstrap tabs
$(document.body).on "click", "a[data-toggle=tab]", (event) ->
location.hash = @getAttribute("href")

# on history back activate the tab of the location hash if exists or the default tab if no hash exists
$(window).on "popstate", ->
anchor = location.hash or $("a[data-toggle=tab]").first().attr("href")
$("a[href=" + anchor + "]").tab "show"
5 changes: 5 additions & 0 deletions app/assets/stylesheets/admin/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@
*
*= require bootstrap_and_overrides
*= require chosen
*= require select2
*= require bootstrap-datetimepicker.min
*/

body {
padding-top: 60px;
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
*= require ../../../vendor/assets/stylesheets/mania-style/bootstrap.css
*= require_directory ../../../vendor/assets/stylesheets/mania-style
*= require jquery.ui.datepicker
*= require_directory ./custom
*= require screen.css.scss
*/

0 comments on commit ca6e63a

Please sign in to comment.