Skip to content

Instantly share code, notes, and snippets.

@crusadergo
Last active November 3, 2015 15:51
Show Gist options
  • Save crusadergo/a8b9baf9b71fcf5d5132 to your computer and use it in GitHub Desktop.
Save crusadergo/a8b9baf9b71fcf5d5132 to your computer and use it in GitHub Desktop.
.menu-items
.tabled-menu-items
ul.menu
- menu.each do |hash|
li class=('' + (active_menu == hash[:name] ? ' active' : ''))
- if hash[:url]
= link_to hash[:title], hash[:url], id: hash[:id], class: hash[:class]
- else
div id=hash[:id] class=hash[:class]
span = hash[:title]
ul.second-level-menu
- sections.each do |menu_item|
li class = ('active' if menu_item.id == menu_id)
= link_to menu_item.title, restaurant_menu_path(menu_item)
- active_menu ||= :no_selected_menu
- restaurant_menu_id ||= 0
- menu =[ {title: 'Главная', url: '/', name: :frontpage},
{title: 'Меню', class: 'restaurant-menu', name: :restaurant_menu},
{title: 'Доставка', url: '/custom/delivery', name: :delivery},
{title: 'Отзывы', url: '/reviews', name: :reviews} ]
-sections = RestaurantMenuSection.root.shown.ordered
= render 'shared/mobile_menu', menu: menu, active_menu: active_menu, sections: sections, menu_id: restaurant_menu_id
= render 'shared/desktop_menu', menu: menu, active_menu: active_menu, sections: sections, menu_id: restaurant_menu_id
modulejs.define 'lib/profile', ->
init: ->
if ($('.dashboard').length > 0)
if $(window).width() < 980
$('#footer').css 'padding-left', '50px'
else
$('#footer').css 'padding-left', '205px'
else
$('#footer').css('padding-left', '0px')
$('.profile-arrow').on 'click', ->
if $('.dashboard-text').hasClass 'collapsed'
$('.dashboard-text').removeClass('collapsed').addClass 'expanded' #uncollapsed
$('a[class="fa fa-angle-right"]').removeClass('fa-angle-right').addClass('fa-angle-left').css left: '102.5px'
$('.profile-arrow').css width: '205px'
else
$('.dashboard-text').removeClass('expanded').addClass 'collapsed'
$('a[class="fa fa-angle-left"]').removeClass('fa-angle-left').addClass('fa-angle-right').css left: '22.5px'
$('.profile-arrow').css width:'50px'
@import bourbon
@import neat
#right-part
margin: 0
+right-part
#container
font-family: 'Georgia', serif
#background
background: $background-color
position: fixed
width: 100%
height: 100%
z-index: $background-z-index
#content
+span-columns(12)
display: block
max-width: $content-max-width
background: $content-background-color
padding: $mobile-content-padding
min-height: 100%
+media($desktop-menu)
#right-part
margin: $right-part-desktop-margin
padding-top: 0 !important
width: $right-part-desktop-width
#content
padding: $content-padding
form
position: relative
&.sending-message
color: rgba(black, 0.3)
input, textarea, button
opacity: 0.3
.field
display: block
img
max-width: 100%
.ajax-msg-handler.error
input, textarea
background-color: rgba(226, 122, 122, 0.32)
.waiting-message
position: absolute
top: 30%
left: 0
width: 100%
font-size: 30px
text-align: center
color: rgba(black, 0.6)
+media($desktop-menu)
top: 50%
+transform(translateY(-50%))
font-size: 70px
def feedback
@feedback = Feedback.new(feedback_params)
respond_to do |format|
if @feedback.valid?
if @feedback.need_copy?
FeedbackMailer.send_copy(@feedback, @feedback.email).deliver_now
end
FeedbackMailer.new_feedback_email(@feedback).deliver_now
notice = 'Сообщение отправлено'
format.html { render action: :contacts, notice: notice }
format.js { render json: {status: :ok, message: notice} }
else
format.html { render action: :contacts }
format.js { render json: {status: :error, errors: @feedback.errors} }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment