Skip to content

Instantly share code, notes, and snippets.

@shahidbscs
Created February 7, 2016 09:29
Show Gist options
  • Save shahidbscs/c14c1ae9020a372c6d6c to your computer and use it in GitHub Desktop.
Save shahidbscs/c14c1ae9020a372c6d6c to your computer and use it in GitHub Desktop.
Root issues
%header
.language-selection{ "ng-controller": "LanguageCtrl" }
= link_to "English", "#/",
class: "language-choice", "ng-click": "changeLanguage($event, 'en')"
= link_to "العربية", "#/",
class: "language-choice", "ng-click": "changeLanguage($event, 'ar')",
lang: "ar"
%a.logo{ href: "/#/" }
= image_tag("search_in_mena_logo.png")
.mobile-menu-btn{ tabindex: "0", "toggle-nav": "true" }
%span.icon-list-alt
%nav{ role: "navigation", "toggle-nav": "true" }
%ul
%li{ hidden: true }
%a.nav-link{ href: Sim::Routes.browse_path }
%span.icon.icon-search
= t('main_nav.browse')
- if user_signed_in?
%li
%a.nav-link.user-link{ href: Sim::Routes.dashboard_path }
%span.icon.icon-home
= t('main_nav.dashboard')
%li
%a.nav-link.user-link{ href: Sim::Routes.destroy_user_session_path }
%span.icon.icon-off
= t('main_nav.logout')
- else
%li
%a.nav-link.user-link{ href: Sim::Routes.new_user_registration_path }
= t('main_nav.signup')
%li
%a.nav-link.user-link{ href: Sim::Routes.user_session_path }
= t('main_nav.login')
.gradient-decor
@Sim.config ['$stateProvider', '$urlRouterProvider',
($stateProvider, $urlRouterProvider) ->
$stateProvider.state('root',
url: '/',
templateUrl: 'home.html',
controller: 'HomeCtrl'
)
.state('dashboard',
url: '/dashboard',
abstract: true,
templateUrl: 'dashboard/layout.html',
controller: 'DashboardCtrl'
)
.state('dashboard.home',
url: '',
templateUrl: 'dashboard/home.html',
controller: 'DashboardHomeCtrl'
)
.state('dashboard.products',
url: '/products?:page',
templateUrl: 'products/index.html',
controller: 'ProductsIndexCtrl'
)
.state('dashboard.new_product',
url: '/products/new',
templateUrl: 'products/new.html',
controller: 'ProductsNewCtrl'
)
.state('dashboard.edit_product',
url: '/products/:id/edit',
templateUrl: 'products/edit.html',
controller: 'ProductsEditCtrl'
)
.state('dashboard.services',
url: '/services?:page',
templateUrl: 'services/index.html',
controller: 'ServicesIndexCtrl'
)
.state('dashboard.new_service',
url: '/services/new',
templateUrl: 'services/new.html',
controller: 'ServicesNewCtrl'
)
.state('dashboard.edit_service',
url: '/services/:id/edit',
templateUrl: 'services/edit.html',
controller: 'ServicesEditCtrl'
)
.state('dashboard.business',
url: '/company',
abstract: true,
templateUrl: 'business/index.html',
controller: 'BusinessCtrl'
)
.state('dashboard.business.basic_info',
url: '/basic_info',
templateUrl: 'business/basic_info.html',
controller: 'BusinessBasicInfoCtrl'
)
.state('dashboard.business.trade_details',
url: '/trade_details',
templateUrl: 'business/trade_details.html',
controller: 'BusinessTradeDetailsCtrl'
)
.state('dashboard.business.certifications',
url: '/certifications',
templateUrl: 'business/certifications.html',
controller: 'BusinessCertificationsCtrl'
)
$stateProvider.state('product',
url: '/products/:id',
templateUrl: 'products/show.html',
controller: 'ProductsShowCtrl'
)
$stateProvider.state('service',
url: '/services/:id',
templateUrl: 'services/show.html',
controller: 'ServicesShowCtrl'
)
# Temporarily hidden
# $stateProvider.state('browse',
# url: '/browse',
# templateUrl: 'browse.html'
# )
$stateProvider.state('results',
url: '/results?:type&:query&:business_type&:country&:category&:page&:viewOption',
templateUrl: 'search/results.html',
controller: 'ResultsCtrl'
)
$stateProvider.state('business',
url: '/company/:id',
templateUrl: 'business/show.html'
controller: 'BusinessShowCtrl'
)
$urlRouterProvider.otherwise('/')
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment