I hereby claim:
- I am aya-soft on github.
- I am ayasoft (https://keybase.io/ayasoft) on keybase.
- I have a public key ASBhgc1_HmmDBdnLDGID4t_gCjb_N6S6kxRiD44rRDKB0go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
redirect_to catalog_path and return if not params[:vendor].present? or params[:search_string].present? |
def spares_for_yandex | |
@spares = Spare.available_for_purchase | |
end |
if catalog_state.level?(:catalog) | |
"КАТАЛОГ ЗАПЧАСТЕЙ ДЛЯ АМЕРИКАНСКИХ АВТОМОБИЛЕЙ" | |
elsif catalog_state.level?(:brand) | |
"КАТАЛОГ ЗАПЧАСТЕЙ ДЛЯ АВТОМОБИЛЕЙ #{breadcrumbs[1].upcase} «#{(I18n.t breadcrumbs[1].downcase).upcase}»" # "каталог" в расчет не берем | |
elsif catalog_state.level?(:model) | |
"ЗАПЧАСТИ ДЛЯ #{breadcrumbs[1].upcase} #{breadcrumbs[2].upcase}" | |
elsif catalog_state.level?(:year) | |
"ЗАПЧАСТИ ДЛЯ #{breadcrumbs[1].upcase} #{breadcrumbs[2].upcase} #{breadcrumbs[3].upcase} ГОДА" | |
elsif catalog_state.level?(:engine) | |
"ЗАПЧАСТИ ДЛЯ #{breadcrumbs[1].upcase} #{breadcrumbs[2].upcase} #{breadcrumbs[3].upcase} #{breadcrumbs[4].upcase}" |
@page_title = CatalogMetaTagGenerator.new.generate_title(@catalog_state) | |
@page_description = CatalogMetaTagGenerator.new.generate_description(@catalog_state) | |
@page_keywords = CatalogMetaTagGenerator.new.generate_keywords(@catalog_state) |
.down-stars-list-block(style="font-size: 16px" ) | |
- if current_user | |
- if current_user.role?(:admin) | |
.popover-info-hover.pointer(data-title="Ваша оценка" data-content="#{render partial: "/catalog/stars_and_rows_for_admin", locals: {spare: spare}}" placement="top") | |
%span(title="Посмотреть отзывы") | |
= spare_ratio_link(spare, admin_spare_comments_path(spare_id: spare.id)) | |
- else | |
- if current_user.spare_comments.by_spare(spare.id).where("active = 0").present? | |
%span(title="Посмотреть отзывы") | |
= spare_ratio_link(spare, profile_spare_comments_path(spare_id: spare.id)) |
def spare_ratio_link(spare, url) | |
if SpareComment.has_comments?(spare) | |
link_to (rating_stars_row(average_ratio(spare)).html_safe + sum_ratios(spare).to_s), url | |
else | |
link_to (rating_stars_row(average_ratio(spare)).html_safe + sum_ratios(spare).to_s), '' | |
end | |
end |
resources :spare_comments, path: "отзывы" |
def new | |
unless current_user.service_station.present? | |
redirect_to new_profile_service_station_path | |
else | |
service = current_user.service_station.service_station_comments.where("spare_id = ?", params[:spare_id]) | |
if service.present? | |
redirect_to "/profile/service_station_comments/#{service.first.id}/edit" | |
end | |
@comment = ServiceStationComment.new | |
gon.labor_times_price = current_user.service_station.labor_times_price |
:javascript | |
$("#service_station_comment_time_of_installing_current_part").change(function() { | |
var a = $("#service_station_comment_time_of_installing_current_part").val(); | |
$("#service_station_comment_installing_current_part_price").val(a * gon.labor_times_price) | |
}); |