Permalink
Browse files

fix icons, add new airlines

  • Loading branch information...
sizief committed Dec 14, 2018
1 parent d46742a commit eda8a2cb337940054289ae1781b2d3a813c72b7b
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ def week_day_to_human_english index
def get_star_icon(total,amount,color,size)
markup_delivery = " "
markup_colored = "<i class=\"star icon #{color} #{size}\"></i>"
markup = "<i class=\"empty grey star icon #{size}\"></i>"
markup = "<i class=\"grey star outline icon #{size}\"></i>"
0.upto(amount-1) do
markup_delivery += markup_colored
end
@@ -63,7 +63,7 @@ def import_flights(response,route_id,origin,destination,date,search_history_id)

doc.each do |flight|
price = flight['amount']
airline_code = flight['airline'].tr(",","")
airline_code = get_airline_code(flight['airline'].tr(",",""))
combination_id = flight['combinationid']
deeplink_url = response[:deeplink]+combination_id
departure_hour = flight['sourcedeparttime']
@@ -101,6 +101,13 @@ def import_flights(response,route_id,origin,destination,date,search_history_id)
return flight_ids
end

def get_airline_code(airline_code)
airlines ={
"IS"=>"SR"
}
airlines[airline_code].nil? ? airline_code : airlines[airline_code]
end



end
@@ -122,7 +122,8 @@ def get_deep_link(flight_in_date_id,session_id)
def get_airline_code(airline_code)
airlines ={
"0"=>"SE",
"SPN"=>"SR"
"SPN"=>"SR",
"VR"=>"VA"
}
airlines[airline_code].nil? ? airline_code : airlines[airline_code]
end
@@ -25,7 +25,7 @@
</a>

<a style="margin-right:12px;"class="light-yellow" href="<%= en_flight_result_path(@search_parameter[:destination_english_name], @search_parameter[:origin_english_name],@search_parameter[:date]) %>">
<i class="yellow exchange icon"></i> return flight
<i class="yellow sync icon"></i> return flight
</a>
</div>

@@ -25,7 +25,7 @@
</a>

<a style="margin-right:12px;"class="light-yellow" href="<%= flight_result_path(@search_parameter[:destination_english_name], @search_parameter[:origin_english_name],@search_parameter[:date]) %>">
<i class="yellow exchange icon"></i> مشاهده پروازهای برگشت
<i class="yellow sync icon"></i> مشاهده پروازهای برگشت
</a>
</div>

@@ -1,3 +1,4 @@
=begin
supplier_list = [{"id":7,"name":"Trip","class_name":"Suppliers::Trip","status":false,"created_at":"2017-08-13T13:25:20.875Z","updated_at":"2018-07-16T21:10:09.564Z","international":true,"domestic":true,"job_search_allowed":false,"rate_count":0,"rate_average":0},{"id":5,"name":"ghasedak","class_name":"Suppliers::Ghasedak","status":true,"created_at":"2017-08-07T00:00:00.000Z","updated_at":"2018-07-16T22:00:11.036Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":4,"rate_average":3},{"id":20,"name":"flytoday","class_name":"Suppliers::Flytoday","status":false,"created_at":"2017-12-05T07:29:45.642Z","updated_at":"2018-07-21T13:59:52.602Z","international":true,"domestic":false,"job_search_allowed":false,"rate_count":2,"rate_average":5},{"id":9,"name":"iranhrc","class_name":"Suppliers::Iranhrc","status":false,"created_at":"2017-08-15T12:53:46.327Z","updated_at":"2018-06-29T16:34:22.804Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":3,"rate_average":2},{"id":11,"name":"safarestan","class_name":"Suppliers::Safarestan","status":true,"created_at":"2018-01-20T08:30:51.844Z","updated_at":"2018-06-29T16:34:29.764Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":4,"rate_average":5},{"id":10,"name":"sepehr","class_name":"Suppliers::Sepehr","status":false,"created_at":"2017-09-04T10:28:38.318Z","updated_at":"2018-04-15T18:15:16.822Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":1,"rate_average":5},{"id":1,"name":"flightio","class_name":"Suppliers::Flightio","status":true,"created_at":"2017-06-10T14:33:43.632Z","updated_at":"2018-06-29T17:01:17.159Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":4,"rate_average":5},{"id":3,"name":"alibaba","class_name":"Suppliers::Alibaba","status":false,"created_at":"2017-06-10T14:33:43.644Z","updated_at":"2018-03-13T22:15:18.085Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":0,"rate_average":0},{"id":8,"name":"travelchi","class_name":"Suppliers::Travelchi","status":false,"created_at":"2017-08-15T06:35:05.023Z","updated_at":"2018-03-13T22:15:18.092Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":0,"rate_average":0},{"id":6,"name":"Respina","class_name":"Suppliers::Respina","status":false,"created_at":"2017-08-09T00:00:00.000Z","updated_at":"2018-03-13T22:15:18.116Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":0,"rate_average":0},{"id":4,"name":"safarme","class_name":"Suppliers::Safarme","status":true,"created_at":"2017-07-25T00:00:00.000Z","updated_at":"2018-07-04T11:45:12.516Z","international":false,"domestic":true,"job_search_allowed":true,"rate_count":12,"rate_average":4},{"id":2,"name":"zoraq","class_name":"Suppliers::Zoraq","status":true,"created_at":"2017-06-10T14:33:43.641Z","updated_at":"2018-07-16T21:00:11.199Z","international":true,"domestic":true,"job_search_allowed":false,"rate_count":8,"rate_average":3},{"id":21,"name":"hipotrip","class_name":"Suppliers::Hipotrip","status":true,"created_at":"2018-02-07T19:03:42.664Z","updated_at":"2018-07-16T21:04:16.679Z","international":false,"domestic":true,"job_search_allowed":false,"rate_count":11,"rate_average":4}]
supplier_list.each do |supplier|
@@ -12,7 +13,6 @@
end

require 'csv'
csv_text = File.read("db/countries.csv")
csv = CSV.parse(csv_text, :headers => true)
@@ -44,7 +44,11 @@
Airline.create(x.to_hash)
end
City.create(english_name: "saint petersburg",persian_name: "سن‌پترزبورگ", country_code: "RU", city_code: "led", status: true)
User.create(email: "bot@parvazhub.com")
User.create(email: "job@parvazhub.com")
User.create(email: "app@parvazhub.com")
iranian_airlines =[{code: "W5", persian_name: "ماهان", english_name:"mahan"},
{code: "AK", persian_name: "اترک", english_name:"atrak"},
@@ -70,9 +74,12 @@
x.save
end
=end
virgin_airline = Airline.find_by(code: "VA")
virgin_airline.delete
Airline.create({code: "VA", persian_name: "وارش", english_name:"varesh", country_code: "IR"})
py_airline = Airline.find_by(code: "PY")
py_airline.delete
Airline.create({code: "PY", persian_name: "پویا", english_name:"pouya", country_code: "IR"})

City.create(english_name: "saint petersburg",persian_name: "سن‌پترزبورگ", country_code: "RU", city_code: "led", status: true)

User.create(email: "bot@parvazhub.com")
User.create(email: "job@parvazhub.com")
User.create(email: "app@parvazhub.com")

0 comments on commit eda8a2c

Please sign in to comment.