Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issues with admin editing enterprises (and groups) caused by i18n #1012

Merged
merged 2 commits into from Jun 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -4,12 +4,12 @@ angular.module("admin.enterprise_groups")
$scope.select = SideMenu.select

$scope.menu.setItems [
{ name: 'Primary Details', icon_class: "icon-user" }
{ name: (t('users')), icon_class: "icon-user" }
{ name: (t('about')), icon_class: "icon-pencil" }
{ name: (t('images')), icon_class: "icon-picture" }
{ name: (t('contact')), icon_class: "icon-phone" }
{ name: (t('web')), icon_class: "icon-globe" }
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-user" }
{ name: 'users', label: t('users'), icon_class: "icon-user" }
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
{ name: 'contact', label: t('admin_entreprise_groups_contact'), icon_class: "icon-phone" }
{ name: 'web', label: t('admin_entreprise_groups_web'), icon_class: "icon-globe" }
]

$scope.select(0)
Expand Up @@ -5,21 +5,21 @@ angular.module("admin.enterprises")
$scope.select = SideMenu.select

$scope.menu.setItems [
{ name: t('primary_details'), icon_class: "icon-home" }
{ name: t('users'), icon_class: "icon-user" }
{ name: t('address'), icon_class: "icon-map-marker" }
{ name: t('contact'), icon_class: "icon-phone" }
{ name: t('social'), icon_class: "icon-twitter" }
{ name: t('about'), icon_class: "icon-pencil" }
{ name: t('business_details'), icon_class: "icon-briefcase" }
{ name: t('images'), icon_class: "icon-picture" }
{ name: t('properties'), icon_class: "icon-tags", show: "showProperties()" }
{ name: t('shipping_methods'), icon_class: "icon-truck", show: "showShippingMethods()" }
{ name: t('payment_methods'), icon_class: "icon-money", show: "showPaymentMethods()" }
{ name: t('enterprise_fees'), icon_class: "icon-tasks", show: "showEnterpriseFees()" }
{ name: t('inventory_settings'), icon_class: "icon-list-ol", show: "enterpriseIsShop()" }
{ name: t('tag_rules'), icon_class: "icon-random", show: "enterpriseIsShop()" }
{ name: t('shop_preferences'), icon_class: "icon-shopping-cart", show: "enterpriseIsShop()" }
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-home" }
{ name: 'users', label: t('users'), icon_class: "icon-user" }
{ name: 'address', label: t('address'), icon_class: "icon-map-marker" }
{ name: 'contact', label: t('contact'), icon_class: "icon-phone" }
{ name: 'social', label: t('social'), icon_class: "icon-twitter" }
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
{ name: 'business_details', label: t('business_details'), icon_class: "icon-briefcase" }
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
{ name: 'properties', label: t('properties'), icon_class: "icon-tags", show: "showProperties()" }
{ name: 'shipping_methods', label: t('shipping_methods'), icon_class: "icon-truck", show: "showShippingMethods()" }
{ name: 'payment_methods', label: t('payment_methods'), icon_class: "icon-money", show: "showPaymentMethods()" }
{ name: 'enterprise_fees', label: t('enterprise_fees'), icon_class: "icon-tasks", show: "showEnterpriseFees()" }
{ name: 'inventory_settings', label: t('inventory_settings'), icon_class: "icon-list-ol", show: "enterpriseIsShop()" }
{ name: 'tag_rules', label: t('tag_rules'), icon_class: "icon-random", show: "enterpriseIsShop()" }
{ name: 'shop_preferences', label: t('shop_preferences'), icon_class: "icon-shopping-cart", show: "enterpriseIsShop()" }
]

$scope.select(0)
Expand Down
5 changes: 2 additions & 3 deletions app/views/admin/enterprise_groups/_form_about.html.haml
@@ -1,6 +1,5 @@
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='About'" } }
%legend
= t 'admin_entreprise_groups_about'
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='about'" } }
%legend {{menu.selected.label}}
= f.field_container :long_description do
%text-angular{'id' => 'enterprise_group_long_description', 'name' => 'enterprise_group[long_description]', 'class' => 'text-angular',
'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]"}
Expand Down
5 changes: 2 additions & 3 deletions app/views/admin/enterprise_groups/_form_address.html.haml
@@ -1,7 +1,6 @@
= f.fields_for :address do |af|
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Contact'" } }
%legend
= t 'admin_entreprise_groups_contact'
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='contact'" } }
%legend {{menu.selected.label}}
.row
.alpha.three.columns
= af.label :phone
Expand Down
5 changes: 2 additions & 3 deletions app/views/admin/enterprise_groups/_form_images.html.haml
@@ -1,6 +1,5 @@
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Images'" } }
%legend
= t 'admin_entreprise_groups_images'
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='images'" } }
%legend {{menu.selected.label}}
.row
.alpha.three.columns
= f.label :logo, 'ofn-with-tip' => t('admin_entreprise_groups_data_powertip_logo')
Expand Down
@@ -1,6 +1,5 @@
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Primary Details'" } }
%legend
= t "admin_entreprise_groups_primary_details"
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='primary_details'" } }
%legend {{menu.selected.label}}
= f.field_container :name do
= f.label :name
%br/
Expand Down
5 changes: 2 additions & 3 deletions app/views/admin/enterprise_groups/_form_users.html.haml
@@ -1,6 +1,5 @@
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Users'" } }
%legend
= t(:users)
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='users'" } }
%legend {{menu.selected.label}}
.row
.three.columns.alpha
=f.label :owner_id, t(:admin_entreprise_groups_owner)
Expand Down
5 changes: 2 additions & 3 deletions app/views/admin/enterprise_groups/_form_web.html.haml
@@ -1,6 +1,5 @@
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Web'" } }
%legend
= t 'admin_entreprise_groups_web'
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='web'" } }
%legend {{menu.selected.label}}
.row
.alpha.three.columns
= f.label :website
Expand Down
60 changes: 30 additions & 30 deletions app/views/admin/enterprises/_form.html.haml
@@ -1,60 +1,60 @@
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Primary Details'" } }
%legend Primary Details
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='primary_details'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/primary_details', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Users'" } }
%legend Users
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='users'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/users', f: f

= f.fields_for :address do |af|
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Address'" } }
%legend Address
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='address'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/address', af: af

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Contact'" } }
%legend Contact
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='contact'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/contact', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Social'" } }
%legend Social
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='social'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/social', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Business Details'" } }
%legend Business Details
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='business_details'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/business_details', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='About'" } }
%legend About Us
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='about'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/about_us', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Images'" } }
%legend Images
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='images'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/images', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Properties'" } }
%legend Properties
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='properties'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/properties', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Shipping Methods'" } }
%legend Shipping Methods
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='shipping_methods'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/shipping_methods', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Payment Methods'" } }
%legend Payment Methods
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='payment_methods'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/payment_methods', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Enterprise Fees'" } }
%legend Enterprise Fees
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='enterprise_fees'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/enterprise_fees', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Inventory Settings'" } }
%legend Inventory Settings
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='inventory_settings'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/inventory_settings', f: f

%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Shop Preferences'" } }
%legend Shop Preferences
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='shop_preferences'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/shop_preferences', f: f

%fieldset.alpha.no-border-bottom{ ng: { if: "menu.selected.name=='Tag Rules'" } }
%legend Tag Rules
%fieldset.alpha.no-border-bottom{ ng: { if: "menu.selected.name=='tag_rules'" } }
%legend {{menu.selected.label}}
= render 'admin/enterprises/form/tag_rules', f: f
2 changes: 1 addition & 1 deletion app/views/admin/shared/_side_menu.html.haml
Expand Up @@ -5,4 +5,4 @@
show: '!showItem || showItem(item)',
class: '{ selected: item.selected }' } }
%i{ class: "{{item.icon_class}}" }
%span {{ item.name }}
%span {{ item.label }}
3 changes: 0 additions & 3 deletions config/locales/en.yml
Expand Up @@ -838,12 +838,9 @@ Please follow the instructions there to make your enterprise visible on the Open
admin_entreprise_groups_owner: "Owner"
admin_entreprise_groups_on_front_page: "On front page ?"
admin_entreprise_groups_entreprise: "Enterprises"
admin_entreprise_groups_primary_details: "Primary Details"
admin_entreprise_groups_data_powertip: "The primary user responsible for this group."
admin_entreprise_groups_data_powertip_logo: "This is the logo for the group"
admin_entreprise_groups_data_powertip_promo_image: "This image is displayed at the top of the Group profile"
admin_entreprise_groups_about: "About"
admin_entreprise_groups_images: "Images"
admin_entreprise_groups_contact: "Contact"
admin_entreprise_groups_contact_phone_placeholder: "eg. 98 7654 3210"
admin_entreprise_groups_contact_address1_placeholder: "eg. 123 High Street"
Expand Down