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/v11.9'
Browse files Browse the repository at this point in the history
Conflicts:
	app/assets/stylesheets/custom/_areas.scss
	app/views/layouts/web/shared/_navigation.html.haml
  • Loading branch information
PanfilovDenis committed Mar 15, 2013
2 parents 78de339 + 560286a commit 140162f
Show file tree
Hide file tree
Showing 33 changed files with 297 additions and 159 deletions.
38 changes: 29 additions & 9 deletions app/assets/javascripts/custom.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@ 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 ->
$('table').delegate 'a.edit-event', 'click', ->
parent_row = $(this).closest('tr')
parent_row.next().toggleClass('hidden')
Expand All @@ -15,8 +39,10 @@ window.onload = ->
row.remove()
delay 4000, -> $('.alert').fadeOut('slow')

# Twitter Bootstrap tabs hashes
$(document).ready ->
# popover demo
$("[data-toggle=popover]").popover()

# 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
Expand All @@ -28,10 +54,4 @@ $(document).ready ->
# 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"



# popover demo
$(document).ready ->
$("[data-toggle=popover]").popover()
$("a[href=" + anchor + "]").tab "show"
32 changes: 18 additions & 14 deletions app/assets/stylesheets/custom/_areas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,25 @@ $tp_width : $tt_width - $tl_width; // timepad column width
$areas_count : 6; // Number of rooms
$area_width : $tp_width / $areas_count;

$b_height : 30px; // height of 15-minutes block
$b_height : 2px; // height of 1-minute block
$timing_step: 15; // step for drawing timeline (min)
$td_color : #ccc; // Time delimiters color
$hour_start : 10; // Event begin at
$hour_end : 20; // Event till this time
$hour_start : 11; // Event begin at
$hour_end : 19; // Event till this time

$min_speech_time : 30; // The shortest speech time
$min_speech_time : 15; // The shortest speech time
$max_speech_time : 240; // The longest speech time

$step_offset_render: 1; // The start time accuracy (min)
$step_cont_render: 1; // The continuance time accuracy (min)

.awesome-timetable {
width: 940px;
padding: 30px 0;

.area {
float: left;
height: $b_height;
height: $b_height * $timing_step;
width: $area_width + px;
text-align: center;
}
Expand Down Expand Up @@ -117,7 +121,7 @@ $max_speech_time : 240; // The longest speech time
}

.b-quart {
height: $b_height;
height: $b_height * $timing_step;
}

.area-name {
Expand All @@ -129,7 +133,7 @@ $max_speech_time : 240; // The longest speech time

.event {
width: $area_width + px;
height: $b_height;
height: $b_height * $timing_step;
background-color: #ccc;
position: absolute;
top: 0;
Expand Down Expand Up @@ -222,29 +226,29 @@ $colors: $blue $red $green $orange $yellow $violin;
// Events start hour time
@for $i from $hour_start through $hour_end {
.event.start-#{$i} {
top: $b_height * 4 * ($i - $hour_start);
top: $b_height * 60 * ($i - $hour_start);
}
}

$start_offset : 15;
$start_offset : 1;
@while $start_offset < 60 {
.event.offset-#{$start_offset} {
margin-top: $b_height * $start_offset / 15;
$start_offset : $start_offset + 15;
margin-top: $b_height * $start_offset / $step_offset_render;
$start_offset : $start_offset + $step_offset_render;
}
}

// Events continuance
$i : $min_speech_time;
@while $i <= $max_speech_time {
.event.long-#{$i} {
height: $b_height * $i / 15 + 1;
height: $b_height * $i / $step_cont_render + 1;
}
.event.full-event.long-#{$i} {
line-height: $b_height * $i / 15 - 11;
line-height: $b_height * $i / $step_cont_render - 11;
}
$i : $i + 15;

$i : $i + $step_cont_render;
}

@media (max-width: 940px) {
Expand Down
55 changes: 52 additions & 3 deletions app/assets/stylesheets/custom/_events.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
.sinfo {
h5 {
line-height: 20px;
margin-bottom: 15px;
margin-bottom: 10px;
position: relative;
top: -2px;
}
h6 {
margin-bottom: 15px;
}
.pic {
margin-bottom: 15px;
}
}
.ainfo {
margin-bottom: 20px;
Expand Down Expand Up @@ -59,12 +62,58 @@

// lectors
.workshop {
margin-bottom: 40px;
padding-top: 20px;
position: relative;
.col-l {
width: 100%;
&.thin {
width: 47.5%;
}
}
}
.workshop p,
.workshop h6.grey {
text-overflow: ellipsis;
overflow: hidden;
}

.workshop h6.grey {
white-space: pre-wrap;
}

// nav-list
.nav-list {
>li {
padding: 0 !important;
margin-bottom: 4px;
>a {
padding-top: 6px;
padding-bottom: 6px;
&:hover {
background: none;
text-decoration: underline;
}
}
&.active {
>a {
background-color: #7c7852 !important;
color: #fff !important;
text-decoration: none !important;
}
}
}
}

// bootstrap-affix
.b-affix {
width: inherit;
box-sizing: border-box;
background-color: #f4f4f4 !important;
&.top {
position: fixed;
top: 4px;
}
&.bottom {
position: absolute;
bottom: 0;
}
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/custom/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ body {
// header
header {
border: none !important;
height: 134px;
}
header .info {
padding-top: 44px;
Expand Down
9 changes: 6 additions & 3 deletions app/assets/stylesheets/custom/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
}
.navbar-position-top .navbar-inner {
background-color: transparent !important;
min-height: auto;
height: 28px;
min-height: 28px;
height: auto;
line-height: 28px !important;
padding-right: 0 !important;
}
Expand Down Expand Up @@ -118,6 +118,9 @@
padding-left: 10px !important;
padding-right: 10px !important;
background-color: #7c7852 !important;
&.prev_year {
font-size: 14px !important;
}
}

// dropdown menu
Expand All @@ -142,4 +145,4 @@
text-decoration: none !important;
font-size: 12px !important;
}
}
}
13 changes: 12 additions & 1 deletion app/assets/stylesheets/custom/_sponsors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
height: 80px;
}
.info-sponsors-6th-line {
height: 30px;
height: 53px;
}

// star sponsors
Expand Down Expand Up @@ -154,4 +154,15 @@
.dailycomm {
position: relative;
top: 12px;
}
.cru {
padding-top: 10px;
}
.raec {
position: relative;
top: 10px;
}
.rocid {
position: relative;
top: 10px;
}
5 changes: 1 addition & 4 deletions app/controllers/web/events_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
class Web::EventsController < Web::ApplicationController
def index
@events = UserEvent.scheduled.with_active_speaker.by_listener_votes.ransack(params).result
if params[:workshop_id_eq]
@workshop = Workshop.find params[:workshop_id_eq]
title @workshop
end
@workshops = Workshop.web
end
end
5 changes: 1 addition & 4 deletions app/controllers/web/lectors_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
class Web::LectorsController < Web::ApplicationController
def index
@lectors = User.activated.as_lectors.by_created_at.ransack(params).result
if params[:topics_id_eq]
@topic = Topic.find params[:topics_id_eq]
title @topic
end
@topics = Topic.web
end
end
8 changes: 7 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ def navbar_link(label, path, options = {})

def markdown(content)
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true)
markdown.render(content).html_safe
sanitized_content = sanitize content
markdown.render(sanitized_content).html_safe
end

def nl2br(content)
lines = content.split(/\r\n/)
render 'helpers/web/nl2br', lines: lines
end

def item(tag, name, path, link_options = {}, &block)
Expand Down
2 changes: 1 addition & 1 deletion app/models/hall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Hall < ActiveRecord::Base
has_many :events, class_name: :BaseEvent, through: :slots
has_many :slots, order: :start_time

accepts_nested_attributes_for :slots
accepts_nested_attributes_for :slots, allow_destroy: true

audit :title

Expand Down
2 changes: 1 addition & 1 deletion app/uploaders/ckeditor_attachment_file_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/ckeditor/attachments/#{model.id}"
"system/uploads/ckeditor/attachments/#{model.id}"
end

# Provide a default URL as a default if there hasn't been a file uploaded:
Expand Down
2 changes: 1 addition & 1 deletion app/uploaders/ckeditor_picture_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CkeditorPictureUploader < CarrierWave::Uploader::Base
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/ckeditor/pictures/#{model.id}"
"system/uploads/ckeditor/pictures/#{model.id}"
end

# Provide a default URL as a default if there hasn't been a file uploaded:
Expand Down
3 changes: 3 additions & 0 deletions app/views/helpers/web/_nl2br.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- lines.each do |l|
= l
%br
2 changes: 1 addition & 1 deletion app/views/layouts/web/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
= render "layouts/web/shared/navbar"
= render "layouts/web/shared/header"
= render "layouts/web/shared/navigation"
.container
.container#main_container
.content
= bootstrap_flash
= yield
Expand Down
3 changes: 2 additions & 1 deletion app/views/layouts/web/shared/_navbar.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.navbar.navbar-position-top
.navbar.navbar-position-top#nav_top
.navbar-inner
.container
%nav.social-public-links.pull-left
Expand All @@ -14,6 +14,7 @@
%i.ficon-vkontakte-rect

%ul.nav.pull-left
%li= link_to t('.stachka_2012'), 'http://2012.nastachku.ru', class: 'btn-shine add_lecture prev_year', target: "_blank"
%li= link_to t('.add_lecture'), new_account_event_path, class: 'btn-shine add_lecture'

%ul.nav.pull-right
Expand Down

0 comments on commit 140162f

Please sign in to comment.