Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/application/lib/sr/app/tags.py b/application/lib/sr/app/tags.py
- index ceba61f..e3acafe 100644
- --- a/application/lib/sr/app/tags.py
- +++ b/application/lib/sr/app/tags.py
- @@ -41,6 +41,14 @@ def get_tag_groups_for_entity(entity_key, domain='VenueGroupClient', privacy_fil
- return cached_results
- +
- +def get_tag_groups_for_venue(venue, domain='VenueGroupClient', privacy_filter=None, include_deleted=False):
- + global_tag_groups = \
- + get_tag_groups_for_entity(venue.venue_group.key(), domain, privacy_filter)
- + local_tag_groups = get_tag_groups_for_entity(venue.key(), domain, privacy_filter)
- + return global_tag_groups + local_tag_groups
- +
- +
- def invalidate_tag_groups_cache(entity_key, domain='VenueGroupClient'):
- cache_key = _get_tags_cache_key(entity_key, domain)
- entitymemcache.invalidate_cached_results(cache_key, _GET_TAGS_NAMESPACE)
- @@ -65,7 +73,7 @@ def filter_hash_to_json(tags):
- pass
- return tag_list
- -def create_or_update_tag_group(venue,delete, is_new_group, group_id, category, color, privacy, tag_list, domain='VenueGroupClient'):
- +def create_or_update_tag_group(venue,delete, is_new_group, group_id, category, color, privacy, tag_list, scope, type, disabled, domain='VenueGroupClient'):
- error_message = None
- tag_group = None
- modified = False
- @@ -75,24 +83,45 @@ def create_or_update_tag_group(venue,delete, is_new_group, group_id, category, c
- except:
- tag_group = None
- error_message = 'There was an error processing tag changes.'
- -
- +
- if delete:
- if tag_group:
- tag_group.delete()
- modified = True
- else:
- error_message = 'There was an error processing tag changes.'
- -
- +
- if modified:
- invalidate_tag_groups_cache(tag_group.entity_key, tag_group.domain)
- -
- +
- return error_message, tag_group
- -
- +
- + if disabled is not None and tag_group.is_default():
- + tag_group.disabled = int(disabled)
- + tag_group.save()
- + invalidate_tag_groups_cache(tag_group.entity_key, tag_group.domain)
- + return None, tag_group
- +
- if not error_message and tag_group is None:
- tag_group = TagGroup()
- if not error_message:
- +<<<<<<< Updated upstream
- + if tag_group.type == TagGroup.get_type_code(TagGroup.UNCATEGORIZED_PREFERENCE):
- +=======
- +<<<<<<< Updated upstream
- tag_group.entity_key = venue.venue_group.key()
- +=======
- + if tag_group.type == TagGroupManager.get_type_code(TagGroupManager.UNCATEGORIZED_PREFERENCE):
- +>>>>>>> Stashed changes
- + if int(scope) == TagGroup.VENUE_SCOPE:
- + tag_group.entity_key = venue.key()
- + else:
- + tag_group.entity_key = venue.venue_group.key()
- +<<<<<<< Updated upstream
- +=======
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- tag_group.name = category
- tag_group.domain = domain
- tag_group.privacy = privacy
- @@ -100,7 +129,7 @@ def create_or_update_tag_group(venue,delete, is_new_group, group_id, category, c
- tag_group.tags = tag_list
- TagGroupManager.save(tag_group)
- modified = True
- -
- +
- if modified:
- invalidate_tag_groups_cache(tag_group.entity_key, tag_group.domain)
- diff --git a/application/lib/sr/db/model/taggroup.py b/application/lib/sr/db/model/taggroup.py
- index def2609..57ecf3c 100644
- --- a/application/lib/sr/db/model/taggroup.py
- +++ b/application/lib/sr/db/model/taggroup.py
- @@ -6,7 +6,44 @@ from base import Model
- class TagGroup(Model):
- +<<<<<<< Updated upstream
- +
- + UNCATEGORIZED_PREFERENCE = 'Uncategorized'
- + CHAMPAGNE_PREFERENCE = 'Champagne',
- + LIQUOR_PREFERENCE = 'Liquor',
- + WINE_PREFERENCE = 'Wine'
- + SEATING_PREFERENCE = 'Seating'
- + ALLERGY_PREFERENCE = 'Allergy'
- + ORIGIN_PREFERENCE = 'Origin'
- +=======
- +<<<<<<< Updated upstream
- +=======
- +
- +>>>>>>> Stashed changes
- +
- + VENUE_GROUP_SCOPE = 1
- + VENUE_SCOPE = 0
- +
- +<<<<<<< Updated upstream
- + TYPE_CHOICES = {
- + 0: UNCATEGORIZED_PREFERENCE,
- + 1: ALLERGY_PREFERENCE,
- + 2: WINE_PREFERENCE,
- + 3: LIQUOR_PREFERENCE,
- + 4: CHAMPAGNE_PREFERENCE,
- + 5: SEATING_PREFERENCE,
- + 6: ORIGIN_PREFERENCE
- + }
- +
- + @classmethod
- + def get_type_code(cls, name):
- + choice_code_lookup = dict(zip(TagGroup.TYPE_CHOICES.values(), TagGroup.TYPE_CHOICES.keys()))
- + return choice_code_lookup.get(name)
- +
- +=======
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- class Meta:
- app_label = 'nightloop'
- @@ -15,6 +52,8 @@ class TagGroup(Model):
- )
- _display_getters_ = (
- + 'is_global',
- + 'is_default'
- )
- entity_key = KeyProperty()
- @@ -23,10 +62,32 @@ class TagGroup(Model):
- privacy = db.StringProperty(default='PUBLIC', choices=['PUBLIC', 'PRIVATE'])
- color_hex = db.StringProperty()
- tags = db.StringListProperty()
- +<<<<<<< Updated upstream
- + type = db.IntegerProperty(default=0, choices=TYPE_CHOICES.keys())
- + disabled = db.IntegerProperty(default=0, choices=[0,1])
- +=======
- +<<<<<<< Updated upstream
- +=======
- + type = db.IntegerProperty(default=0)
- + disabled = db.IntegerProperty(default=0, choices=[0,1])
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- sort_order = db.IntegerProperty(default=0)
- def is_public(self):
- return self.privacy == 'PUBLIC'
- def is_private(self):
- - return self.privacy == 'PRIVATE'
- \ No newline at end of file
- + return self.privacy == 'PRIVATE'
- +
- + def is_default(self):
- + return self.type > 0
- +
- + def is_not_default(self):
- + return not self.is_default()
- +
- + def is_global(self):
- + return db.get(self.entity_key).kind() == 'nightloop_VenueGroup'
- +
- + def is_local(self):
- + return not self.is_global()
- diff --git a/application/lib/sr/db/model/venuegroupclient.py b/application/lib/sr/db/model/venuegroupclient.py
- index 3cd3485..160fea8 100644
- --- a/application/lib/sr/db/model/venuegroupclient.py
- +++ b/application/lib/sr/db/model/venuegroupclient.py
- @@ -2,6 +2,17 @@ import datetime
- import logging
- import re
- import json
- +<<<<<<< Updated upstream
- +from sr.app.tags import get_tag_groups_for_entity
- +from sr.db.model.taggroup import TagGroup
- +=======
- +<<<<<<< Updated upstream
- +=======
- +from sr.app.tags import get_tag_groups_for_entity
- +from sr.db.model.taggroup import TagGroup
- +from sr.manager.taggroupmanager import TagGroupManager
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- from sr.util import location as lutil
- from ..gaeuser import User as SRUser
- @@ -73,6 +84,7 @@ class VenueGroupClient(Model):
- 'get_name_last_first_display',
- 'get_name_first_first_display',
- 'get_name_display',
- + 'get_default_tags',
- 'get_name_only_display',
- 'get_title_company_display',
- 'get_phone_number_formatted',
- @@ -310,6 +322,44 @@ class VenueGroupClient(Model):
- tag_groups[key]['tags'].append(tag)
- return tag_groups.values()
- +<<<<<<< Updated upstream
- +=======
- +<<<<<<< Updated upstream
- +=======
- +>>>>>>> Stashed changes
- + def get_tags_group_display_by_venue(self, venue):
- + """ Will return global and local tags for a given venue
- + """
- + display_tags = self.get_tags_group_display()
- + filtered_tag_groups = map(lambda t: t.id,
- + filter(lambda t: t.is_global() or t.entity_key == venue.key(),
- + filter(None, TagGroup.get(list(set(map(lambda tag: tag['id'], display_tags)))))
- + )
- + )
- + return filter(lambda t: t['id'] in filtered_tag_groups, display_tags)
- +
- + def get_default_tags(self):
- + default_tags = {}
- + global_tag_groups = get_tag_groups_for_entity(self.venue_group)
- + global_tags_by_key = {str(x.key()):x for i, x in enumerate(global_tag_groups)}
- + orders_list = map(lambda x: str(x.key()), global_tag_groups)
- + for tag in self.get_tags_group_display():
- + if tag['id'] in orders_list:
- + tag_model = (global_tags_by_key[tag['id']] or {})
- + if tag_model.is_default():
- + tag['tags_list'] = ', '.join(map(lambda x: x.get('tag_name'), tag['tags']))
- +<<<<<<< Updated upstream
- + tag['type'] = (''.join(TagGroup.TYPE_CHOICES.get(tag_model.type))).lower()
- + default_tags[tag['id']] = tag
- + return filter(None, map(lambda rank: default_tags.get(rank), orders_list))
- +
- +=======
- + tag['type'] = (''.join(TagGroupManager.TYPE_CHOICES.get(tag_model.type))).lower()
- + default_tags[tag['id']] = tag
- + return filter(None, map(lambda rank: default_tags.get(rank), orders_list))
- +
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- def has_tag(self, tag_hash):
- if tag_hash in self.tags:
- @@ -358,6 +408,17 @@ class VenueGroupClient(Model):
- pass
- return ','.join(temp_tags)
- + def merge_tags_for_venue(self, tags, can_use_private, venue):
- + existing_tags = filter(None, TagGroup.get(list(set(map(lambda t: t.split('##')[1], self.tags)))))
- + existing_private_tags = filter(lambda t: t.split('##')[0] == "PRIVATE", self.tags)
- + self.tags = filter(
- + lambda t: t.split('##')[1] in map(
- + lambda tag: tag.id, filter(
- + lambda inner_tag: not(inner_tag.is_global() or inner_tag.entity_key == venue.key()), existing_tags
- + )
- + ), self.tags) + tags + ([] if can_use_private else existing_private_tags)
- +
- +
- def merge_tags(self, tags, can_use_private):
- if can_use_private:
- self.tags = tags
- diff --git a/application/lib/sr/manager/reservationactualauditmanager.py b/application/lib/sr/manager/reservationactualauditmanager.py
- index 7340179..65fdc88 100644
- --- a/application/lib/sr/manager/reservationactualauditmanager.py
- +++ b/application/lib/sr/manager/reservationactualauditmanager.py
- @@ -175,7 +175,7 @@ class ReservationActualAuditManager(object):
- 'duration': 'changed duration from %s to %s' % (old_value, curr_value),
- 'phone_number': 'changed phone number from %s to %s' % (old_value, curr_value),
- 'email': 'changed email address from %s to %s' % (old_value, curr_value),
- - 'reservation_type': 'changed reservation type from %s to %s' %
- + 'reservation_type': 'changed reservation code from %s to %s' %
- (cls.get_reference_prop(old_value, 'name'),
- cls.get_reference_prop(curr_value, 'name')),
- 'bookedby_user': 'changed Booked by name from %s to %s' % (old_value, curr_value),
- diff --git a/application/lib/sr/manager/resgroupmanager.py b/application/lib/sr/manager/resgroupmanager.py
- new file mode 100644
- index 0000000..cb5ce4a
- --- /dev/null
- +++ b/application/lib/sr/manager/resgroupmanager.py
- @@ -0,0 +1,108 @@
- +from sr.db.model.taggroup import TagGroup
- +
- +
- +class ResGroupManager(object):
- +
- + DOMAIN = 'ReservationActual'
- + UNCATEGORIZED_PREFERENCE = 'Uncategorized'
- + SPECIAL_OCCASION_PREFERENCE = 'Special Occasions'
- + SPECIAL_ATTENTION_PREFERENCE = 'Special Attention'
- + SEATING_REQUEST_PREFERENCE = 'Seating Request'
- + ALLERGY_PREFERENCE = 'Allergy'
- + COMPS_PREFERENCE = 'Comps'
- +
- + TYPE_CHOICES = {
- + 0: UNCATEGORIZED_PREFERENCE,
- + 1: ALLERGY_PREFERENCE,
- + 2: SPECIAL_OCCASION_PREFERENCE,
- + 3: SPECIAL_ATTENTION_PREFERENCE,
- + 4: SEATING_REQUEST_PREFERENCE,
- + 5: COMPS_PREFERENCE
- + }
- +
- + @staticmethod
- + def get_default_tags():
- + return [
- + {
- + 'name': 'Allergy',
- + 'tags': ['Nuts', 'Peanuts', 'Seafood', 'Shellfish', 'Vegan', 'Dairy-Free', 'Gluten-Free', 'Shrimp',
- + 'Fish', 'Kosher', 'Salt', 'Vegetarian'],
- + 'color': '#EEEEEE',
- + 'type': ResGroupManager.get_type_code(ResGroupManager.ALLERGY_PREFERENCE)
- + },
- + {
- + 'name': 'Special Occasions',
- + 'tags': ['Anniversary', 'Baby Shower', 'Bachelor', 'Bachelorette', 'Birthday', 'Bridal Shower',
- + 'Business Meeting', 'Engagement', 'Female Birthday', 'Graduation', 'Male Birthday', 'Wedding',
- + 'Special Event', 'Corporate Event'],
- + 'color': '#EEEEEE',
- + 'type': ResGroupManager.get_type_code(ResGroupManager.SPECIAL_OCCASION_PREFERENCE)
- + },
- + {
- + 'name': 'Special Attention',
- + 'tags': ['Alert GM', 'Alert Chef', 'Wheelchair', 'First Time Diner', 'Non-English Speaking',
- + 'Highchair', 'Server Request', 'Seperate Checks', 'House Account'],
- + 'color': '#EEEEEE',
- + 'type': ResGroupManager.get_type_code(ResGroupManager.SPECIAL_ATTENTION_PREFERENCE)
- + },
- + {
- + 'name': 'Seating Request',
- + 'tags': ['Patio', 'DJ', 'VIP Area', 'Main', 'Outdoor', 'Corner', 'Kitchen', 'Bar Area', 'Booth',
- + 'Round', 'Quiet Table', 'Outdoors'],
- + 'color': '#EEEEEE',
- + 'type': ResGroupManager.get_type_code(ResGroupManager.SEATING_REQUEST_PREFERENCE)
- + },
- + {
- + 'name': 'Comps',
- + 'tags': ['Comp Dessert', 'Comp Champagne', 'Comp Round', 'Comp Appetizer', 'Comp Wine'],
- + 'color': '#EEEEEE',
- + 'type': ResGroupManager.get_type_code(ResGroupManager.COMPS_PREFERENCE)
- + }
- + ]
- +
- + @staticmethod
- + def get_type_code(name):
- + choice_code_lookup = dict(zip(ResGroupManager.TYPE_CHOICES.values(), ResGroupManager.TYPE_CHOICES.keys()))
- + return choice_code_lookup.get(name)
- +
- + @staticmethod
- + def get_by(entity_key=None, domain=DOMAIN):
- + query = TagGroup.all()
- +
- + if entity_key:
- + query = query.filter('entity_key', entity_key)
- +
- + if domain:
- + query = query.filter('domain', domain)
- +
- + return query
- +
- + @staticmethod
- + def get_by_type(entity_key, search_type):
- + return TagGroup.all().\
- + filter('entity_key', entity_key).\
- + filter('domain', ResGroupManager.DOMAIN).\
- + filter('type', search_type).get()
- +
- + @staticmethod
- + def save(res_group):
- + res_group.put()
- +
- + @staticmethod
- + def bulk_save(res_groups):
- + TagGroup.bulk_put(res_groups)
- +
- + @staticmethod
- + def create_default_tags(venue_group):
- + rgs = []
- + for v in ResGroupManager.get_default_tags():
- + if not ResGroupManager.get_by_type(venue_group.key(), v['type']):
- + resgroup = TagGroup(entity_key=venue_group.key(),
- + name=v['name'],
- + tags=v['tags'],
- + color_hex=v['color'],
- + type=v['type'],
- + domain=ResGroupManager.DOMAIN)
- + rgs = rgs + [resgroup]
- + ResGroupManager.bulk_save(rgs)
- +
- diff --git a/application/lib/sr/manager/taggroupmanager.py b/application/lib/sr/manager/taggroupmanager.py
- index 7c0b831..b1ee22d 100644
- --- a/application/lib/sr/manager/taggroupmanager.py
- +++ b/application/lib/sr/manager/taggroupmanager.py
- @@ -1,10 +1,140 @@
- from sr.db.model.taggroup import TagGroup
- +<<<<<<< Updated upstream
- +=======
- +<<<<<<< Updated upstream
- +=======
- class TagGroupManager(object):
- -
- +
- + DOMAIN = 'VenueGroupClient'
- + UNCATEGORIZED_PREFERENCE = 'Uncategorized'
- + CHAMPAGNE_PREFERENCE = 'Champagne',
- + LIQUOR_PREFERENCE = 'Liquor',
- + WINE_PREFERENCE = 'Wine'
- + SEATING_PREFERENCE = 'Seating'
- + ALLERGY_PREFERENCE = 'Allergy'
- + ORIGIN_PREFERENCE = 'Origin'
- +
- + TYPE_CHOICES = {
- + 0: UNCATEGORIZED_PREFERENCE,
- + 1: ALLERGY_PREFERENCE,
- + 2: WINE_PREFERENCE,
- + 3: LIQUOR_PREFERENCE,
- + 4: CHAMPAGNE_PREFERENCE,
- + 5: SEATING_PREFERENCE,
- + 6: ORIGIN_PREFERENCE
- + }
- +
- + @staticmethod
- + def get_default_tags_list():
- + return [
- + {
- + 'name': 'Allergy',
- + 'tags': ['Nuts', 'Peanuts', 'Seafood', 'Shellfish', 'Vegan', 'Dairy-Free', 'Gluten-Free', 'Shrimp',
- + 'Fish', 'Kosher', 'Salt', 'Vegetarian'],
- + 'color': '#EEEEEE',
- + 'type': TagGroupManager.get_type_code(TagGroupManager.ALLERGY_PREFERENCE)
- + },
- + {
- + 'name': 'Wine',
- + 'tags': ['Bordeaux', 'Cabernet Sauvignon', 'Pinot Noir', 'Chardonnay', 'Pinot Grigio/Pinot Gris',
- + 'Reisling', 'Sancerre', 'Sauvignon Blanc', 'Prosecco', 'Rose Champagne', 'Champagne',
- + 'Barbaresco', 'Barolo', 'Merlot', 'Cava', 'Chianti', 'Rose', 'Zinfandel', 'Malbec',
- + 'Chenin Blanc', 'Dessert Wine', 'Sherry', 'Wine $', 'Wine $$', 'Wine $$$', 'Wine $$$$',
- + 'Large Format Wine'],
- + 'color': '#EEEEEE',
- + 'type': TagGroupManager.get_type_code(TagGroupManager.WINE_PREFERENCE)
- + },
- + {
- + 'name': 'Liquor',
- + 'tags': ['Absolut Vodka', 'Belvedere Vodka', 'Bombay Sapphire', 'Chopin', 'Ciroc', 'Courvosier',
- + 'Don Julio', 'Grey Goose', 'Hennessy', 'Johnnie Walker Black', 'Ketel One', 'Patron',
- + 'Stolichnaya', '1942', 'Campari', 'Johnnie Walker Blue', "Maker's Mark", 'Macallan', 'Bacardi',
- + 'Jack Daniels', 'Jameson', 'Crown Royal', 'Remy Martin', 'Glenmorangie', 'Glenfiddich',
- + 'Dewers', 'Captain Morgans', 'Hendricks', 'Tanquery', 'Milagro', 'Large Format Liquor',
- + "Tito's Vodka"],
- + 'color': '#EEEEEE',
- + 'type': TagGroupManager.get_type_code(TagGroupManager.LIQUOR_PREFERENCE)
- + },
- + {
- + 'name': 'Champagne',
- + 'tags': ['Ace of Spades', 'Cristal', 'Dom Perignon', 'Krug', 'Moet Imperial', 'Moet Rose',
- + 'Veuve Clicquot Brut', 'Veuve Clicquot Rose', 'Large Format Champagne'],
- + 'color': '#EEEEEE',
- + 'type': TagGroupManager.get_type_code(TagGroupManager.CHAMPAGNE_PREFERENCE)
- + },
- +
- + {
- + 'name': 'Seating Preference',
- + 'tags': ['Patio', 'DJ', 'VIP Area', 'Main', 'Outdoor', 'Corner', 'Kitchen', 'Bar Area', 'Booth',
- + 'Round', 'Quiet Table', 'Outdoors'],
- + 'color': '#EEEEEE',
- + 'type': TagGroupManager.get_type_code(TagGroupManager.SEATING_PREFERENCE)
- + },
- + {
- + 'name': 'Origin',
- + 'tags': ['New York', 'Los Angeles', 'San Fransisco', 'Miami', 'Las Vegas', 'Chicago', 'Boston',
- + 'Atlanta', 'Austin', 'DC', 'Montreal', 'Toronto', 'Philadelphia', 'Denver', 'London', 'Paris',
- + 'Dubai', 'Hong Kong', 'Tel Aviv', 'Berlin', 'Dallas', 'Paris', 'Istanbul', 'Madrid',
- + 'Barcelona', 'Vancouver', 'Seattle'],
- + 'color': '#EEEEEE',
- + 'type': TagGroupManager.get_type_code(TagGroupManager.ORIGIN_PREFERENCE)
- + }
- + ]
- +
- + @staticmethod
- + def get_type_code(name):
- + choice_code_lookup = dict(zip(TagGroupManager.TYPE_CHOICES.values(), TagGroupManager.TYPE_CHOICES.keys()))
- + return choice_code_lookup.get(name)
- +>>>>>>> Stashed changes
- +
- +>>>>>>> Stashed changes
- +class TagGroupManager(object):
- + DEFAULT_TAGS = [
- +
- + {
- + 'name': 'Allergy',
- + 'tags': ['Nuts','Peanuts','Seafood','Shellfish','Vegan','Dairy-Free','Gluten-Free','Shrimp','Fish','Kosher','Salt','Vegetarian'],
- + 'color': '#EEEEEE',
- + 'type': TagGroup.get_type_code(TagGroup.ALLERGY_PREFERENCE)
- + },
- + {
- + 'name': 'Wine',
- + 'tags': ['Bordeaux','Cabernet Sauvignon','Pinot Noir','Chardonnay','Pinot Grigio/Pinot Gris','Reisling','Sancerre','Sauvignon Blanc','Prosecco','Rose Champagne','Champagne','Barbaresco','Barolo','Merlot','Cava','Chianti','Rose','Zinfandel','Malbec','Chenin Blanc','Dessert Wine','Sherry','Wine $','Wine $$','Wine $$$','Wine $$$$','Large Format Wine'],
- + 'color': '#EEEEEE',
- + 'type': TagGroup.get_type_code(TagGroup.WINE_PREFERENCE)
- + },
- + {
- + 'name': 'Liquor',
- + 'tags': ['Absolut Vodka','Belvedere Vodka','Bombay Sapphire','Chopin','Ciroc','Courvosier','Don Julio','Grey Goose','Hennessy','Johnnie Walker Black','Ketel One','Patron','Stolichnaya','1942','Campari','Johnnie Walker Blue',"Maker's Mark",'Macallan','Bacardi','Jack Daniels','Jameson','Crown Royal','Remy Martin','Glenmorangie','Glenfiddich','Dewers','Captain Morgans','Hendricks','Tanquery','Milagro','Large Format Liquor',"Tito's Vodka"],
- + 'color': '#EEEEEE',
- + 'type': TagGroup.get_type_code(TagGroup.LIQUOR_PREFERENCE)
- + },
- + {
- + 'name': 'Champagne',
- + 'tags': ['Ace of Spades','Cristal','Dom Perignon','Krug','Moet Imperial','Moet Rose','Veuve Clicquot Brut', 'Veuve Clicquot Rose', 'Large Format Champagne'],
- + 'color': '#EEEEEE',
- + 'type': TagGroup.get_type_code(TagGroup.CHAMPAGNE_PREFERENCE)
- + },
- +
- + {
- + 'name': 'Seating Preference',
- + 'tags': ['Patio','DJ','VIP Area','Main','Outdoor','Corner','Kitchen','Bar Area','Booth','Round','Quiet Table','Outdoors'],
- + 'color': '#EEEEEE',
- + 'type': TagGroup.get_type_code(TagGroup.SEATING_PREFERENCE)
- + },
- + {
- + 'name': 'Origin',
- + 'tags': ['New York','Los Angeles','San Fransisco','Miami','Las Vegas','Chicago','Boston','Atlanta','Austin','DC','Montreal','Toronto','Philadelphia','Denver','London','Paris','Dubai','Hong Kong','Tel Aviv','Berlin','Dallas','Paris','Istanbul','Madrid','Barcelona','Vancouver','Seattle'],
- + 'color': '#EEEEEE',
- + 'type': TagGroup.get_type_code(TagGroup.ORIGIN_PREFERENCE)
- + }
- +
- + ]
- +
- @staticmethod
- - def get_by(entity_key=None, domain=None):
- + def get_by(entity_key=None, domain=DOMAIN):
- query = TagGroup.all()
- if entity_key:
- @@ -14,6 +144,23 @@ class TagGroupManager(object):
- query = query.filter('domain', domain)
- return query
- +<<<<<<< Updated upstream
- +
- + @staticmethod
- + def get_by_type(entity_key, search_type):
- + return TagGroup.all().filter('entity_key', entity_key).filter('type', search_type).get()
- +=======
- +<<<<<<< Updated upstream
- +=======
- +
- + @staticmethod
- + def get_by_type(entity_key, search_type):
- + return TagGroup.all().\
- + filter('domain', TagGroupManager.DOMAIN).\
- + filter('entity_key', entity_key).\
- + filter('type', search_type).get()
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- @staticmethod
- def save(tag_group):
- @@ -21,4 +168,37 @@ class TagGroupManager(object):
- @staticmethod
- def bulk_save(tag_groups):
- - TagGroup.bulk_put(tag_groups)
- \ No newline at end of file
- +<<<<<<< Updated upstream
- +=======
- +<<<<<<< Updated upstream
- + TagGroup.bulk_put(tag_groups)
- +=======
- +>>>>>>> Stashed changes
- + TagGroup.bulk_put(tag_groups)
- +
- + @staticmethod
- + def create_default_tags(venue_group):
- + tgs = []
- +<<<<<<< Updated upstream
- + for v in TagGroupManager.DEFAULT_TAGS:
- +=======
- + for v in TagGroupManager.get_default_tags_list():
- +>>>>>>> Stashed changes
- + if not TagGroupManager.get_by_type(venue_group.key(), v['type']):
- + tag = TagGroup(entity_key=venue_group.key(),
- + name=v['name'],
- + tags=v['tags'],
- + color_hex=v['color'],
- + type=v['type'],
- +<<<<<<< Updated upstream
- + domain='VenueGroupClient')
- + tgs = tgs + [tag]
- + TagGroupManager.bulk_save(tgs)
- +
- +=======
- + domain=TagGroupManager.DOMAIN)
- + tgs = tgs + [tag]
- + TagGroupManager.bulk_save(tgs)
- +
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- diff --git a/application/lib/sr/manager/venuegroupmanager.py b/application/lib/sr/manager/venuegroupmanager.py
- index b0b639f..27e6f5a 100644
- --- a/application/lib/sr/manager/venuegroupmanager.py
- +++ b/application/lib/sr/manager/venuegroupmanager.py
- @@ -1,5 +1,6 @@
- from google.appengine.ext import db
- from sr.db.model.venuegroup import VenueGroup
- +from sr.manager.taggroupmanager import TagGroupManager
- class VenueGroupManager(object):
- @@ -50,4 +51,7 @@ class VenueGroupManager(object):
- @staticmethod
- def save(venue_group):
- - venue_group.put()
- \ No newline at end of file
- + is_venue_created = venue_group.is_saved()
- + venue_group.put()
- + if is_venue_created:
- + TagGroupManager.create_default_tags(venue_group)
- \ No newline at end of file
- diff --git a/application/site/app.conf.yaml b/application/site/app.conf.yaml
- index b725011..dfe3320 100644
- --- a/application/site/app.conf.yaml
- +++ b/application/site/app.conf.yaml
- @@ -8,7 +8,7 @@ instance_class: F4
- # other code will require that this is of the format: INTEGER-INTEGER
- # think v1.0 -> 1-0
- -version: 9-351-status
- +version: 9-351-status
- # Set the deployment evironment here instead of checking Domain name.
- env_variables:
- diff --git a/application/site/apps/sr_api_venue_mgr_sync/models.py b/application/site/apps/sr_api_venue_mgr_sync/models.py
- index 762029d..980b2fc 100644
- --- a/application/site/apps/sr_api_venue_mgr_sync/models.py
- +++ b/application/site/apps/sr_api_venue_mgr_sync/models.py
- @@ -1241,7 +1241,7 @@ class ClientGroupSyncModel(SyncModel, NdbSyncModelMixin):
- self.batch = True
- def query(self):
- - 'Sync global and local client groups'
- + 'Sync global and local client codes'
- local_results = super(ClientGroupSyncModel, self).query()
- global_results = self.query_kind('ClientGroupGlobal') # get all results
- results = local_results + global_results
- diff --git a/application/site/apps/sr_site_venue_mgr/decorators/reservation.py b/application/site/apps/sr_site_venue_mgr/decorators/reservation.py
- index 082a86a..645015a 100644
- --- a/application/site/apps/sr_site_venue_mgr/decorators/reservation.py
- +++ b/application/site/apps/sr_site_venue_mgr/decorators/reservation.py
- @@ -2,10 +2,10 @@ from sr.app import feature as feature_app, venue as venue_app, shift_app, \
- venuegroupclient as venuegroupclient_app, tableitem as tableitem_app
- from sr.db.model.venueuser import VenuePrivilegeLevel
- -from sr.manager.reservation_type_manager import ReservationTypeManager
- from sr.manager.venuesettingsmanager import VenueSettingsManager
- from sr.util.rendermodel import create_render_models
- from sr_site_venue_mgr import manager as manager_app
- +from sr.app import venue as venue_app, feature as features_app, tags as tags_app
- class add_reservation_form_params(object):
- @@ -21,6 +21,9 @@ class add_reservation_form_params(object):
- venue_privilege_level = kwargs['venue_privilege_level']
- _v_user = venue_app.get_venue_user(venue, request.user)
- content = {}
- + current_venue_user = venue_app.get_venue_user(venue, request.user)
- + can_modify_private_data = features_app.can_manage_private_data(current_venue_user, request.user)
- + privacy = 'PUBLIC' if not can_modify_private_data else None
- content['booked_by_key'] = request.user.id
- content['can_pick_seating'] = venue_privilege_level in (VenuePrivilegeLevel.SUPERUSER, VenuePrivilegeLevel.MANAGER, VenuePrivilegeLevel.SUBMANAGER)
- content['venue_eta_options'] = venue.get_allowable_eta_options()
- @@ -32,7 +35,10 @@ class add_reservation_form_params(object):
- all_table_inventory_items = create_render_models(all_table_inventory_items, with_locale=venue.get_locale(),
- properties=('id', 'item_code', 'party_size_range_display',))
- content['all_table_inventory_items'] = all_table_inventory_items
- - content['reservation_types'] = ReservationTypeManager.as_select_options(venue)
- + content['reservation_types'] = tags_app.get_tag_groups_for_venue(venue,
- + domain='ReservationActual',
- + privacy_filter=privacy)
- + content['reservation_tags_url'] = '%s/data/reservationtags' % venue.get_manager_base_url()
- content['reservations_require_approval'] = None
- content['can_edit_client_tags'] = None
- content['is_basic_user'] = venue_privilege_level == VenuePrivilegeLevel.BASIC
- diff --git a/application/site/apps/sr_site_venue_mgr/form/tags.py b/application/site/apps/sr_site_venue_mgr/form/tags.py
- index 153d951..8bcfdf1 100644
- --- a/application/site/apps/sr_site_venue_mgr/form/tags.py
- +++ b/application/site/apps/sr_site_venue_mgr/form/tags.py
- @@ -2,19 +2,33 @@ import logging
- import re
- from gae.serializers import json
- from sr.app import tags
- +from sr.db.model.taggroup import TagGroup
- +
- def process_tag_group_from_post(post):
- error_message = None
- group_id = post.get('tag_group_id',None)
- delete = post.get('delete', False)
- + disabled = post.get('disabled', None)
- - if delete:
- - return error_message, delete, False, group_id, None, None, None, None
- + if delete or disabled:
- + return error_message, delete, False, group_id, None, None, None, None, None, None, disabled
- category = post.get('category_name',None)
- color = post.get('color',None)
- privacy = post.get('privacy',None)
- +<<<<<<< Updated upstream
- + scope = post.get('scope', TagGroup.VENUE_SCOPE)
- + type = post.get('type', 0)
- +=======
- +<<<<<<< Updated upstream
- +=======
- + scope = post.get('scope', TagGroup.VENUE_SCOPE)
- + type = post.get('type', 0)
- + tags_type = post.get('tags_type', 0)
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- tag_list = post.getlist('tags[]')
- is_new_group =group_id in [None,'']
- @@ -38,7 +52,15 @@ def process_tag_group_from_post(post):
- privacy = 'PUBLIC'
- error_message = 'Invalid privacy setting'
- +<<<<<<< Updated upstream
- + return error_message, delete, is_new_group, group_id, category, color, privacy, tag_list, scope, type, disabled
- +=======
- +<<<<<<< Updated upstream
- return error_message, delete, is_new_group, group_id, category, color, privacy, tag_list
- +=======
- + return error_message, delete, is_new_group, group_id, category, color, privacy, tag_list, scope, type, disabled, tags_type
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- def process_tag_group_order(post):
- diff --git a/application/site/apps/sr_site_venue_mgr/urls.py b/application/site/apps/sr_site_venue_mgr/urls.py
- index 047a148..74cde54 100644
- --- a/application/site/apps/sr_site_venue_mgr/urls.py
- +++ b/application/site/apps/sr_site_venue_mgr/urls.py
- @@ -77,6 +77,7 @@ urlpatterns += patterns(
- (r'^manager/(?P<venue_id>[\w\-_]+)/data/bookedbynames$', 'get_bookedby_names'),
- (r'^manager/(?P<venue_id>[\w\-_]+)/data/seatingareastables$', 'get_seatingareastables'),
- (r'^manager/(?P<venue_id>[\w\-_]+)/data/tags$', 'get_tags'),
- + (r'^manager/(?P<venue_id>[\w\-_]+)/data/reservationtags$', 'get_reservation_tags'),
- (r'^manager/(?P<venue_id>[\w\-_]+)/venue/search$', 'view_all_venues'),
- )
- @@ -335,7 +336,7 @@ urlpatterns += patterns(
- (r'^manager/(?P<venue_id>[\w\-_]+)/blocks/(?P<block_id>[\w\-_]+)$', 'view_block'),
- )
- -# client groups
- +# client codes
- urlpatterns += patterns(
- 'sr_site_venue_mgr.views.client_groups',
- (r'^manager/(?P<venue_id>[\w\-_]+)/clientgroups$', 'view_groups'),
- diff --git a/application/site/apps/sr_site_venue_mgr/views/clients.py b/application/site/apps/sr_site_venue_mgr/views/clients.py
- index 6124ba4..4784792 100644
- --- a/application/site/apps/sr_site_venue_mgr/views/clients.py
- +++ b/application/site/apps/sr_site_venue_mgr/views/clients.py
- @@ -34,7 +34,7 @@ from sr.manager.venuesettingsmanager import VenueSettingsManager
- from sr.stats.groups import ClientGroupStatistics
- from sr.util import formatters, cryptography, searchcomposite, location as lutil
- from sr.util.filters import phone_number_filter
- -from sr.util.rendermodel import create_render_models, set_cached_property
- +from sr.util.rendermodel import create_render_models, set_cached_property, serialize_render_model
- from sr.util.strings import escape
- from sr_common.formutil import zip_params
- from sr_site_infra.uploads import get_venue_client_photo_key, crop_client_photo
- @@ -836,13 +836,13 @@ def _handle_view_client_profile(request, venue, venue_privilege_level, venue_gro
- venue_group_client.anniversary = anniversary
- if can_manage_client_tags:
- - venue_group_client.merge_tags(tags, can_view_private_tags)
- + venue_group_client.merge_tags_for_venue(tags, can_view_private_notes, venue)
- if can_view_private_notes:
- venue_group_client.private_notes = private_notes
- client_groups_changed = list(set(client_groups).symmetric_difference(set(venue_group_client.client_groups)))
- - venue_group_client.client_groups = client_groups # outright replace the client groups
- + venue_group_client.client_groups = client_groups # outright replace the client codes
- cgroups = ClientGroupManager.get_multi(client_groups)
- venue_group_client.status = ''
- @@ -943,33 +943,35 @@ The below client profile has been created for the unlinked reservation.
- group_name=group.name,
- term_formatted=plan.term_formatted,
- description=membership_plan.description))
- + vgc_rendered = None
- if venue_group_client is not None:
- - venue_group_client = create_render_models(venue_group_client, with_locale=venue.get_locale(), convert_to_currency=venue.get_currency_code(),
- + vgc_rendered = create_render_models(venue_group_client, with_locale=venue.get_locale(), convert_to_currency=venue.get_currency_code(),
- properties=('name_display', 'phone_number_formatted', 'phone_number_locale', 'phone_number_alt_formatted', 'phone_number_alt_locale', 'email_address', 'gender_display',
- 'total_spend_formatted_no_decimals', 'total_visits', 'avg_rating_formatted', 'address_formatted', 'address', 'address_2',
- 'notes', 'first_name', 'last_name', 'title', 'company', 'title_company_display', 'status_display', 'name_only_display', 'gender', 'status',
- - 'birthday_display', 'birthday_day', 'birthday_month', 'tags_display', 'tags_group_display', 'is_contact_private',
- + 'birthday_display', 'birthday_day', 'birthday_month', 'tags_display', 'is_contact_private',
- 'is_email_address_viewable', 'is_email_address_editable', 'is_phone_viewable', 'is_phone_editable', 'is_address_editable',
- 'city_display', 'state_display', 'country_display', 'postal_code_display', 'is_phone_alt_viewable', 'is_phone_alt_editable',
- 'is_city_editable', 'is_state_editable', 'is_postal_code_editable', 'is_country_editable', 'created_by_display',
- 'is_email_address_alt_editable', 'is_email_address_alt_viewable', 'salutation', 'email_address_alt',
- - 'anniversary_display', 'anniversary_day', 'anniversary_month', 'total_spend_per_cover_formatted',
- + 'anniversary_display', 'anniversary_day', 'anniversary_month', 'total_spend_per_cover_formatted', 'default_tags',
- 'total_spend_per_visit_formatted', 'total_noshows', 'total_cancellations', 'is_member_profile',
- 'photo', 'photo_crop_info',), cached_properties={'can_view_contact_info' : can_view_private_notes,
- 'can_view_private_tags': can_view_private_tags,
- 'current_user_id' : request.user.id,
- 'can_view_all_contact_info' : can_view_all_contact_info})
- + vgc_rendered.add_property('tags_group_display', venue_group_client.get_tags_group_display_by_venue(venue))
- month_name_options = formatters.get_month_name_options(venue.get_locale())
- is_month_before_day = formatters.is_formatted_month_before_day(venue.get_locale())
- - if can_view_private_notes and venue_group_client is not None:
- - venue_group_client.add_property('private_notes', private_notes)
- + if can_view_private_notes and vgc_rendered is not None:
- + vgc_rendered.add_property('private_notes', private_notes)
- tags_url = '%s/data/tags' % venue.get_manager_base_url()
- content = {
- - 'venue_group_client': venue_group_client,
- + 'venue_group_client': vgc_rendered,
- 'currentday_formatted': today_date_formats['currentday_formatted'],
- 'currentday_formatted_default': today_date.strftime('%m/%d/%Y'),
- 'status_options_map': status_options_map,
- @@ -995,10 +997,10 @@ The below client profile has been created for the unlinked reservation.
- 'error_msg': error_msg
- }
- - if venue_group_client:
- + if vgc_rendered:
- redirect_url = gae.blobstore.utils.create_redirect_url(
- get_venue_client_photo_key,
- - venue_group_client.model.id)
- + vgc_rendered.model.id)
- content['upload_redirect_url'] = redirect_url
- return render_to_response('Nightloop.Templates.Manager.Clients.Profile',
- diff --git a/application/site/apps/sr_site_venue_mgr/views/home.py b/application/site/apps/sr_site_venue_mgr/views/home.py
- index d08cf0b..d51fc8f 100644
- --- a/application/site/apps/sr_site_venue_mgr/views/home.py
- +++ b/application/site/apps/sr_site_venue_mgr/views/home.py
- @@ -26,6 +26,8 @@ from sr.manager.activitylogmanager import ActivityLogManager
- from sr.manager.blackoutdatemanager import BlackoutDateManager
- from sr.manager.reservation_type_manager import ReservationTypeManager
- from sr.manager.reservationactualviewmanager import ReservationActualViewManager
- +from sr.manager.resgroupmanager import ResGroupManager
- +from sr.manager.taggroupmanager import TagGroupManager
- from sr.manager.venuedatemanager import VenueDateManager
- from sr.manager.venuemanager import VenueManager
- from sr.manager.venuesettingsmanager import VenueSettingsManager
- @@ -869,10 +871,29 @@ def get_seatingareastables(request, venue):
- @venue_from_venue_id
- @venue_user_only()
- def get_tags(request, venue):
- + return get_tags_for_domain(request, venue, TagGroupManager.DOMAIN)
- +
- +
- +@do_not_write_session
- +@venue_from_venue_id
- +@venue_user_only()
- +def get_reservation_tags(request, venue):
- + return get_tags_for_domain(request, venue, ResGroupManager.DOMAIN)
- +
- +
- +def get_tags_for_domain(request, venue, domain):
- current_venue_user = venue_app.get_venue_user(venue, request.user)
- can_modify_private_data = feature_app.can_manage_private_data(current_venue_user, request.user)
- privacy = 'PUBLIC' if not can_modify_private_data else None
- +<<<<<<< Updated upstream
- + tag_groups = tags_app.get_tag_groups_for_venue(venue, privacy_filter=privacy)
- +=======
- +<<<<<<< Updated upstream
- tag_groups = tags_app.get_tag_groups_for_entity(venue.venue_group.key(), privacy_filter=privacy)
- +=======
- + tag_groups = tags_app.get_tag_groups_for_venue(venue, domain=domain, privacy_filter=privacy)
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- return render_json(context_instance=RequestContext(request),
- dictionary={
- 'content' : {
- @@ -880,7 +901,6 @@ def get_tags(request, venue):
- }
- })
- -
- @venue_from_venue_id
- @venue_user_only()
- def save_venue_user_settings(request, venue):
- diff --git a/application/site/apps/sr_site_venue_mgr/views/manage.py b/application/site/apps/sr_site_venue_mgr/views/manage.py
- index 08c1196..e3cd4e4 100644
- --- a/application/site/apps/sr_site_venue_mgr/views/manage.py
- +++ b/application/site/apps/sr_site_venue_mgr/views/manage.py
- @@ -10,6 +10,16 @@ import gae.blobstore
- from gae.shortcuts import get_or_404
- from google.appengine.api.blobstore.blobstore import BlobFetchSizeTooLargeError
- from google.appengine.ext import db, deferred
- +<<<<<<< Updated upstream
- +from sr.db.model.taggroup import TagGroup
- +=======
- +<<<<<<< Updated upstream
- +=======
- +from sr.db.model.taggroup import TagGroup
- +from sr.manager.resgroupmanager import ResGroupManager
- +from sr.manager.taggroupmanager import TagGroupManager
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- from sr.util import location as lutil
- from pyclosure.django.shortcuts import render_to_response, redirect, redirect_with_get_params, render_json
- from sr.db.model.bottle import Bottle
- @@ -1674,7 +1684,17 @@ def view_tags(request, venue):
- can_modify_private_data = features_app.can_manage_private_data(current_venue_user, request.user)
- privacy = 'PUBLIC' if not can_modify_private_data else None
- +<<<<<<< Updated upstream
- + tag_groups = tags_app.get_tag_groups_for_venue(venue, privacy_filter=privacy)
- + tag_group_types = TagGroup.TYPE_CHOICES
- +=======
- +<<<<<<< Updated upstream
- tag_groups = tags_app.get_tag_groups_for_entity(venue.venue_group.key(), privacy_filter=privacy)
- +=======
- + tag_groups = tags_app.get_tag_groups_for_venue(venue, privacy_filter=privacy)
- + tag_group_types = TagGroupManager.TYPE_CHOICES
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- tags_url = '%s/data/tags' % venue.get_manager_base_url()
- venue_settings = VenueSettingsManager.get_or_create(venue)
- return render_to_response('Nightloop.Templates.Manager.Manage.Tags',
- @@ -1684,8 +1704,10 @@ def view_tags(request, venue):
- 'venue' : venue,
- 'venue_settings' : venue_settings,
- 'content' : {
- + 'display': False,
- 'error_message': error_message,
- 'tag_groups' : tag_groups,
- + 'tag_group_types' : tag_group_types,
- 'can_manage_private' : can_modify_private_data,
- 'venue_group_name' : venue.venue_group.name,
- 'tags_url' : tags_url
- @@ -1704,18 +1726,44 @@ def view_tags_save(request, venue):
- if not error_message and request.POST:
- can_modify_private_data = features_app.can_manage_private_data(current_venue_user, request.user)
- +<<<<<<< Updated upstream
- + error_message, should_delete, is_new_group, group_id, category, color, privacy, tag_list, scope, type, disabled = \
- + tags_form.process_tag_group_from_post(request.POST)
- +
- + if not can_modify_private_data and privacy == 'PRIVATE':
- + error_message = 'You do not have permissions to create private tags.'
- + if not error_message:
- + error_message, tag_group = tags_app.create_or_update_tag_group(venue, should_delete, is_new_group, group_id,
- + category, color, privacy, tag_list, scope,
- + type, disabled)
- +=======
- +<<<<<<< Updated upstream
- error_message, should_delete, is_new_group, group_id, category, color, privacy, tag_list = tags_form.process_tag_group_from_post(request.POST)
- if not can_modify_private_data and privacy == 'PRIVATE':
- error_message = 'You do not have permissions to create private tags.'
- if not error_message:
- error_message, tag_group = tags_app.create_or_update_tag_group(venue,should_delete,is_new_group, group_id, category, color, privacy, tag_list)
- +=======
- + error_message, should_delete, is_new_group, group_id, category, color, privacy, tag_list, \
- + scope, type, disabled, tags_type = tags_form.process_tag_group_from_post(request.POST)
- +
- + domain = ResGroupManager.DOMAIN if tags_type == 'reservation_types' else TagGroupManager.DOMAIN
- + if not can_modify_private_data and privacy == 'PRIVATE':
- + error_message = 'You do not have permissions to create private tags.'
- + if not error_message:
- + error_message, tag_group = tags_app.create_or_update_tag_group(venue, should_delete, is_new_group, group_id,
- + category, color, privacy, tag_list, scope,
- + type, disabled, domain=domain)
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- if not error_message:
- sync.update_sync_data(venue.id, 'TagGroup')
- +
- return render_json(context_instance=RequestContext(request),
- - dictionary={
- - 'error' : error_message,
- - 'tag_group' : tag_group
- - })
- + dictionary={
- + 'error': error_message,
- + 'tag_group': tag_group
- + })
- @venue_from_venue_id
- @venue_user_only([VenuePrivilegeLevel.SUPERUSER,VenuePrivilegeLevel.MANAGER])
- diff --git a/application/site/apps/sr_site_venue_mgr/views/manage_rt.py b/application/site/apps/sr_site_venue_mgr/views/manage_rt.py
- index 48240e2..8e3f679 100644
- --- a/application/site/apps/sr_site_venue_mgr/views/manage_rt.py
- +++ b/application/site/apps/sr_site_venue_mgr/views/manage_rt.py
- @@ -2,14 +2,15 @@
- # manage_rt - manage reservation types
- from django.template import RequestContext
- +
- from pyclosure.django.shortcuts import render_to_response
- from sr.db.model.venueuser import VenuePrivilegeLevel
- from sr.manager.reservation_type_manager import ReservationTypeManager
- +from sr.manager.resgroupmanager import ResGroupManager
- from sr.manager.venuesettingsmanager import VenueSettingsManager
- -from sr.app import venue as venue_app, feature as feature_app
- from sr_common.formutil import zip_params, group_by
- from sr_site_venue_mgr.tasks import sync
- -
- +from sr.app import venue as venue_app, feature as features_app, tags as tags_app
- from ..decorators.venue import venue_from_venue_id, venue_user_only
- @@ -30,19 +31,28 @@ def view_edit_reservation_types(request, venue):
- message = 'Changes saved'
- sync.update_sync_data(venue.id, 'ReservationType')
- - types = ReservationTypeManager.as_select_options(venue, include_blank=False)
- current_venue_user = venue_app.get_venue_user(venue, request.user)
- + can_modify_private_data = features_app.can_manage_private_data(current_venue_user, request.user)
- + privacy = 'PUBLIC' if not can_modify_private_data else None
- + tag_groups = tags_app.get_tag_groups_for_venue(venue, domain='ReservationActual', privacy_filter=privacy)
- + tag_group_types = ResGroupManager.TYPE_CHOICES
- + reservation_tags_url = '%s/data/reservationtags' % venue.get_manager_base_url()
- - return render_to_response('Nightloop.Templates.Manager.Manage.ReservationTypes.Edit',
- + return render_to_response('Nightloop.Templates.Manager.Manage.Tags',
- context_instance=RequestContext(request),
- dictionary=dict(
- navigation='settings',
- venue=venue,
- + identifier='reservation_types',
- + label='Reservation Code',
- venue_settings=VenueSettingsManager.get_or_create(venue),
- content=dict(
- + display=False,
- message=message,
- - reservation_types=types,
- - venue_has_floorplan=venue_app.has_floorplan(venue),
- - can_view_floorplan=feature_app.can_view_floorplan(current_venue_user, request.user),
- + tag_groups=tag_groups,
- + tag_group_types=tag_group_types,
- + can_manage_private=can_modify_private_data,
- + venue_group_name=venue.venue_group.name,
- + reservation_tags_url=reservation_tags_url
- )
- - ))
- + ))
- \ No newline at end of file
- diff --git a/application/site/apps/sr_site_venue_mgr/views/reservation.py b/application/site/apps/sr_site_venue_mgr/views/reservation.py
- index 221f8ce..3bebbd3 100644
- --- a/application/site/apps/sr_site_venue_mgr/views/reservation.py
- +++ b/application/site/apps/sr_site_venue_mgr/views/reservation.py
- @@ -614,7 +614,7 @@ def view_actual_details_popup(request, venue, venue_privilege_level, actual):
- properties=('name_display', 'phone_number', 'phone_number_formatted', 'phone_number_locale', 'phone_number_alt_formatted', 'phone_number_alt_locale','email_address', 'gender_display',
- 'total_spend_formatted_no_decimals', 'total_visits', 'avg_rating_formatted', 'address_formatted', 'address', 'address_2',
- 'notes', 'first_name', 'last_name', 'title','company','title_company_display','status_display', 'name_only_display', 'gender', 'status',
- - 'birthday_display', 'birthday_day', 'birthday_month', 'tags_display', 'tags_group_display', 'is_contact_private',
- + 'birthday_display', 'birthday_day', 'birthday_month', 'tags_display', 'is_contact_private',
- 'is_email_address_viewable', 'is_email_address_editable', 'is_phone_viewable', 'is_phone_editable', 'is_address_editable',
- 'city_display', 'state_display', 'country_display', 'postal_code_display', 'is_phone_alt_viewable', 'is_phone_alt_editable',
- 'is_city_editable', 'is_state_editable', 'is_postal_code_editable', 'is_country_editable', 'created_by_display',
- @@ -625,6 +625,7 @@ def view_actual_details_popup(request, venue, venue_privilege_level, actual):
- 'can_view_all_contact_info':can_view_all_contact_info,
- 'current_user_id':request.user.id})
- + venue_group_client.add_property('tags_group_display', actual.venue_group_client.get_tags_group_display_by_venue(venue))
- actual = create_render_models(actual, with_locale=venue.get_locale(), convert_to_currency=venue.get_currency_code(),
- properties=('client_name_first_first_display',
- 'bookedby_alt_view', 'bookedby_view', 'date_formatted_short', 'transaction_type',
- diff --git a/application/site/static/css/manager/components.styl b/application/site/static/css/manager/components.styl
- index 1c4cd4b..018404c 100644
- --- a/application/site/static/css/manager/components.styl
- +++ b/application/site/static/css/manager/components.styl
- @@ -940,7 +940,6 @@ p.chatting
- margin 2px
- overflow hidden
- .tag-name
- - font-weight bold
- padding-right 6px
- padding-left 5px
- .tag-item-color
- @@ -964,17 +963,63 @@ p.chatting
- z-index 20
- .tag-editor
- + .relative-container
- + position absolute
- + .new
- + font-weight bold
- + .tag-table-container.new-style
- + .color
- + display block
- + width 10px
- + height 10px
- + border-radius 5px
- + margin 3px 3px 0px 0px
- + height 200px
- + overflow scroll
- + width 200px
- + .tag-item-container
- + padding 0px 5px
- + float none
- + .tag-item
- + .tag-item-color
- + background-color: #FFFFFF !important
- + .tag-item:hover
- + background-color #EEEEEE !important
- + .tag-group-display-container
- + min-height 200px
- h3
- color #aaa
- font bold 12px $Lato
- margin 10px 0
- + .tag-area-css
- + .tag-item
- + background-color #FFF
- + .close-tag
- + color: #FFF
- + .tag-item.hover
- + background-color #EEE
- + .close-tag
- + color: #999
- .tag-table-category
- .tags-group-category
- color #999
- font-weight bold
- margin 5px 0
- + span
- + width 10px
- + height 10px
- + radius(5px)
- + margin 3px 3px 0 0
- + display block
- + .tag-group-name
- + margin-left 5px
- +#find-tags-input
- + width 194px
- #find-tags-results
- + width 200px
- + -ms-text-overflow: ellipsis
- + text-overflow: ellipsis
- radius(3px)
- shadow(2px)
- background white
- diff --git a/application/site/static/css/manager/page/clients-profile.styl b/application/site/static/css/manager/page/clients-profile.styl
- index c659ed5..4f6f100 100644
- --- a/application/site/static/css/manager/page/clients-profile.styl
- +++ b/application/site/static/css/manager/page/clients-profile.styl
- @@ -20,8 +20,8 @@
- #basics
- background #d7e6ff
- - padding 20px 20px 20px 20px
- - width 185px
- + padding 2%
- + width 20%
- h3
- font bold 14px $Lato
- margin 20px 0
- @@ -68,7 +68,8 @@
- #activity-area
- - padding 15px 15px 100px
- + width 50%
- + padding 1% 1% 5%
- h3.company
- h3.location
- font-size 18px
- @@ -139,7 +140,7 @@
- #stats-area
- freeshadow(inset 2px 0px 1px 0px rgba(216,216,216,1))
- background #f4f4f4
- - width 324px
- + width 30%
- div.header
- freeshadow(inset 2px 0px 1px 0px rgba(216,216,216,1))
- background #d7e6ff
- @@ -150,14 +151,30 @@
- text-align center
- text-transform uppercase
- .stat-group
- + width 100%
- border-bottom 1px dotted $light_divide
- clear both
- float left
- p
- float left
- - padding 10px 4px
- + padding 2% 1%
- text-align center
- - width 100px
- + width 30%
- + .tags-icon
- + border-right 1px dotted #e1e1e1
- + img
- + height 30px
- + .tags-list span
- + color black
- + &.service
- + width 100%
- + padding 10px
- + tr
- + border-bottom 1px dotted #e1e1e1
- + table
- + border-top 1px dotted #e1e1e1
- + td
- + border 0px
- strong, span
- display block
- strong
- diff --git a/application/site/static/css/manager/page/manage-tags.styl b/application/site/static/css/manager/page/manage-tags.styl
- index a34b701..9ace392 100644
- --- a/application/site/static/css/manager/page/manage-tags.styl
- +++ b/application/site/static/css/manager/page/manage-tags.styl
- @@ -3,7 +3,10 @@
- float left
- font-size 14px
- margin 20px 10px
- -
- + .styled
- + padding 5px
- + border 1px solid #DEDEDE
- + margin-bottom 10px
- h3
- border-bottom 1px solid $light_divide
- font bold 16px $Lato
- @@ -61,10 +64,24 @@ p.description
- clear both
- float left
- -.category-name-header
- - cursor move
- - font bold 16px $Lato
- - margin-top 10px
- +.category-header
- + .category-name-header
- + cursor move
- + font bold 16px $Lato
- + margin-top 10px
- + float left
- + clear none !important
- + .enable-header
- + float right
- + clear none
- + width 60px
- + height 30px
- + margin-top 8px
- + cursor pointer
- + background url('{$MEDIA_URL}images/off-switch.png')
- + &.on
- + width 55px
- + background: url('{$MEDIA_URL}images/on-switch.png')
- .tag-group-colorpicker
- width 40px
- @@ -82,7 +99,9 @@ p.description
- margin-top 5px
- padding 0 20px
- -.tag-group-privacy
- +.tag-group-privacy,
- +.tag-group-scope,
- +.tag-group-type
- padding 5px 0.5em 7px !important
- .tag-group-add p.button
- @@ -108,11 +127,14 @@ div.tag-group-add
- padding 0 10px
- width 40px
- -.form-element.privacy
- - p.input
- - width 100px !important
- - .downer
- - top 13px !important
- +.form-element
- + &.privacy,
- + &.level,
- + &.type
- + p.input
- + width 100px !important
- + .downer
- + top 13px !important
- .tag-display
- clear both
- diff --git a/application/site/static/css/nightloop.manager.settings.styl b/application/site/static/css/nightloop.manager.settings.styl
- index f91554b..6b59eed 100644
- --- a/application/site/static/css/nightloop.manager.settings.styl
- +++ b/application/site/static/css/nightloop.manager.settings.styl
- @@ -161,7 +161,7 @@
- @import "manager/page/clients-merge"
- #page-clientsprofile
- - min-width 1192px
- + min-width 800px
- @import "manager/page/clients-profile"
- @import "manager/page/photo-editor"
- diff --git a/application/site/static/css/nightloop.mobile.styl b/application/site/static/css/nightloop.mobile.styl
- index f380104..79898a1 100644
- --- a/application/site/static/css/nightloop.mobile.styl
- +++ b/application/site/static/css/nightloop.mobile.styl
- @@ -1873,8 +1873,13 @@ body #manager
- #stats-area
- float left
- width 100% !important
- - .stat-group p
- - width 98px
- + .stat-group
- + p
- + width 98px
- + img
- + height 30px
- + .tags-list
- + padding-top 20px
- #basics div.thumb
- left 50%
- diff --git a/application/site/static/images/tags/allergy.png b/application/site/static/images/tags/allergy.png
- new file mode 100644
- index 0000000..17b36b2
- Binary files /dev/null and b/application/site/static/images/tags/allergy.png differ
- diff --git a/application/site/static/js/page/common/common.tagcache.js b/application/site/static/js/page/common/common.tagcache.js
- index 63ea3bb..c5e8c2c 100644
- --- a/application/site/static/js/page/common/common.tagcache.js
- +++ b/application/site/static/js/page/common/common.tagcache.js
- @@ -19,7 +19,7 @@ Pmp.Common.TagCache = {
- self.renderTags();
- }
- if (the_call_back) {
- - the_call_back();
- + the_call_back(content);
- }
- });
- },
- @@ -46,7 +46,20 @@ Pmp.Common.TagCache = {
- renderTags : function() {
- var self = this;
- + $('.tags-group.new-style').each(function (e, obj){
- + var tag_group_id = $(obj).find('.tag-group-id').val(),
- + tag_group_obj = self._findTagGroupById(tag_group_id),
- + bg_color_hex = tag_group_obj.color_hex;
- + $(obj).find('.tags-group-category span').css({'background-color':bg_color_hex});
- + });
- +
- $('.tag-item').each(function(e,obj){
- + $(this).on('mouseover', function(event) {
- + $(this).addClass('hover')
- + });
- + $(this).on('mouseout', function(event) {
- + $(this).removeClass('hover')
- + });
- var tag_group_id = $(obj).find('.tag-group-id').val();
- if (tag_group_id == '') {
- tag_group_id = $(obj).find('.tag-group-id').html();
- diff --git a/application/site/static/js/page/manager/manager.clients.profile.js b/application/site/static/js/page/manager/manager.clients.profile.js
- index 1f7c32c..aeb186d 100644
- --- a/application/site/static/js/page/manager/manager.clients.profile.js
- +++ b/application/site/static/js/page/manager/manager.clients.profile.js
- @@ -140,42 +140,6 @@ Pmp.Manager.Clients.Profile = {
- Pmp.Utils.AddDropdown('#delete-client-btn', '#contextual-content-cannot-delete-client');
- }
- - var findtagsinput = $('#find-tags-input');
- - findtagsinput.keyup(function(ev) {
- - if ((ev.which == 37) || (ev.which == 38)) {
- - // left/up
- - self._onFindTagsPressUp();
- - ev.preventDefault();
- - } else if ((ev.which == 39) || (ev.which == 40)){
- - // right/down
- - self._onFindTagsPressDown();
- - ev.preventDefault();
- - } else if (ev.which == 13) {
- - // enter
- - self._onFindTagsPressEnter();
- - ev.preventDefault();
- - } else if (ev.which == 8) {
- - self._onFindTagsInputKeypress(this);
- - if (findtagsinput.val().length == 0) {
- - var lastTag = $('.find-tags-container').find('.tag-item-container').last();
- - if (lastTag.length) {
- - lastTag.fadeOut('slow').remove();
- - }
- - }
- - } else {
- - self._onFindTagsInputKeypress(this);
- - }
- - });
- - //findtagsinput.blur(function() { $('#find-tags-results').hide(); });
- - findtagsinput.click(function() { self._onFindTagsInputKeypress(this); });
- - page.AddLiveHandler('#find-tags-results .tag-item-container', 'mousedown', function(event) {
- - self._onAddTagToSearch(this);
- - $('#find-tags-results').hide();
- - });
- -
- - var onClickDocumentHideTagsPicker = function(event) {self._hideTagsPicker(event); };
- - $(document).mouseup(onClickDocumentHideTagsPicker);
- -
- },
- _loadCards : function() {
- @@ -229,6 +193,7 @@ Pmp.Manager.Clients.Profile = {
- $('#membership-block').prepend(html);
- },
- +<<<<<<< Updated upstream
- _hideTagsPicker : function(e) {
- var container = $('#find-tags-results');
- if (container.has(e.target).length === 0)
- @@ -253,6 +218,8 @@ Pmp.Manager.Clients.Profile = {
- }
- var html = Nightloop.Templates.Widget.Tag({
- + 'is_new_style': true,
- + 'newly_added': true,
- 'tag_name' : tag_name,
- 'tag_group_id' : tag_group_id,
- 'tag_group_name' : tag_group_name,
- @@ -260,10 +227,10 @@ Pmp.Manager.Clients.Profile = {
- 'is_private' : privacy.toUpperCase() == 'PRIVATE',
- 'close_func' : 'Pmp.Manager.Search.Page.onCloseTag(this)'
- });
- -
- +
- // find category it belongs to and add after last one
- var added = false;
- -
- +
- $('.tags-group', '.tag-area-edit').each(function(idx,el) {
- if ($(el).attr('tag_group_id') === tag_group_id) {
- // found the group
- @@ -273,6 +240,14 @@ Pmp.Manager.Clients.Profile = {
- } else {
- $(html).insertBefore($('.insert-tags-here', $(el)));
- }
- + // Bind events
- + $(html).find('.tag-item').on('mouseover', function(event) {
- + $(this).addClass('hover')
- + });
- + $(html).find('.tag-item').on('mouseout', function(event) {
- + $(this).removeClass('hover')
- + });
- +
- added = true;
- return false;
- }
- @@ -289,11 +264,15 @@ Pmp.Manager.Clients.Profile = {
- 'is_private' : privacy.toUpperCase() == 'PRIVATE',
- 'tags' : [{
- 'tag_name' : tag_name,
- + 'is_new_style': true,
- + 'newly_added': true,
- 'tag_group_id' : tag_group_id,
- 'tag_group_name' : tag_group_name,
- 'is_private' : privacy.toUpperCase() == 'PRIVATE'
- }]
- },
- + 'is_new_style': true,
- + 'color_hex': tag_group_color,
- 'can_view_private' : true, // doesn't matter
- 'close_func' : 'Pmp.Manager.Search.Page.onCloseTag(this)'
- });
- @@ -304,13 +283,18 @@ Pmp.Manager.Clients.Profile = {
- 'name' : tag_group_name,
- 'id' : tag_group_id,
- 'is_private' : privacy.toUpperCase() == 'PRIVATE',
- + 'is_new_style': true,
- + 'color_hex': tag_group_color,
- 'tags' : [{
- 'tag_name' : tag_name,
- 'tag_group_id' : tag_group_id,
- + 'is_new_style': true,
- + 'newly_added': true,
- 'tag_group_name' : tag_group_name,
- 'is_private' : privacy.toUpperCase() == 'PRIVATE'
- }]
- }],
- + 'is_new_style': true,
- 'can_view_private' : true, // doesn't matter
- 'close_func' : 'Pmp.Manager.Search.Page.onCloseTag(this)'
- });
- @@ -398,6 +382,8 @@ Pmp.Manager.Clients.Profile = {
- tags.filter(':visible').first().addClass('selected');
- },
- +=======
- +>>>>>>> Stashed changes
- _adjustBoxHeight : function() {
- // make sure menu is the same height for both halves
- var client_info = $('.client-info-box', '#profile-summary-pane');
- diff --git a/application/site/static/js/page/manager/manager.manage.tags.js b/application/site/static/js/page/manager/manager.manage.tags.js
- index 29ad4a0..114256a 100644
- --- a/application/site/static/js/page/manager/manager.manage.tags.js
- +++ b/application/site/static/js/page/manager/manager.manage.tags.js
- @@ -3,10 +3,11 @@ Pmp.Manager = Pmp.Manager || {};
- Pmp.Manager.Manage = Pmp.Manager.Manage || {};
- Pmp.Manager.Manage.Tags = {
- - initialize : function(manager_base_url, media_url, can_manage_private_data) {
- + initialize : function(manager_base_url, media_url, can_manage_private_data, tags_type) {
- this._manager_base_url = manager_base_url;
- this._media_url = media_url;
- this._can_manage_private_data = can_manage_private_data;
- + this._tags_type = tags_type;
- var self = this;
- var destroyerFn = function() { self.destroy(); };
- @@ -65,6 +66,16 @@ Pmp.Manager.Manage.Tags = {
- self._makeTagGroupEditMode(tag_group);
- });
- + page.AddLiveHandler('.enable-header', 'mousedown', _.bind(function(e) {
- + var currElement = $(e.currentTarget),
- + tagBlock = $(currElement).closest('.tag-group-block'),
- + tag_group_id = tagBlock.find('.tag-group-id').val();
- + $(currElement).toggleClass('on');
- + tagBlock.find('.tag-group-tags')
- + .toggleClass('no-display', !$(currElement).hasClass('on'));
- + this.disableCategoryId(tag_group_id, !$(currElement).hasClass('on'));
- + }, this));
- +
- page.AddLiveHandler('.cancel-link', 'click', function(e) {
- var tag_group = $(this).parents('.tag-group-block');
- var group_id = tag_group.find('.tag-group-id').val();
- @@ -122,7 +133,8 @@ Pmp.Manager.Manage.Tags = {
- tag_group_order[tag_group_id] = idx;
- });
- var post_dict = {
- - 'tag_group_order' : JSON.stringify(tag_group_order)
- + 'tag_group_order' : JSON.stringify(tag_group_order),
- + tags_type: this._tags_type
- }
- var baseUrl = this._manager_base_url;
- var url = baseUrl + '/manage/tags/order/save';
- @@ -237,6 +249,7 @@ Pmp.Manager.Manage.Tags = {
- var self = this;
- var html = Nightloop.Templates.Manager.Manage.TagGroup({'MEDIA_URL': this._media_url, 'can_manage_private': this._can_manage_private_data});
- var new_category = $(html).insertBefore('#insert-tag-groups-here');
- + $('body').animate({scrollTop: $(new_category).offset().top});
- // bind color picker
- self._bindColorPicker(new_category);
- @@ -272,7 +285,7 @@ Pmp.Manager.Manage.Tags = {
- var category_color = $(tag_group).find('.tag-group-colorpicker-val').val();
- var privacy = $(tag_group).find('.tag-group-privacy').val();
- valid = (category_name.length > 0) && valid;
- - valid = ((privacy == 'PUBLIC') || (privacy == 'PRIVATE')) && valid;
- + valid = (!privacy || privacy == 'PUBLIC' || privacy == 'PRIVATE') && valid;
- if (!valid) {
- $(tag_group).find('.error-message-area').html('Please enter a category name.');
- Pmp.Utils.GoldButtonReset($(tag_group).find('.save-tag-group-btn'));
- @@ -283,10 +296,12 @@ Pmp.Manager.Manage.Tags = {
- },
- deleteCategory: function(el) {
- - var tag_group = $(el).parents('.tag-group-block');
- - var tag_group_id = $(tag_group).find('.tag-group-id').val();
- + var tag_group = $(el).parents('.tag-group-block'),
- + tag_group_id = $(tag_group).find('.tag-group-id').val();
- +
- if (tag_group_id.length > 0) {
- var post_dict = {
- + tags_type: this._tags_type,
- 'tag_group_id' : tag_group_id,
- 'delete' : true
- }
- @@ -306,6 +321,30 @@ Pmp.Manager.Manage.Tags = {
- }
- },
- +<<<<<<< Updated upstream
- + disableCategoryId: function(tag_group_id, disable) {
- + var post_dict = {
- + 'tag_group_id' : tag_group_id,
- + 'disabled' : Number(disable)
- +=======
- +<<<<<<< Updated upstream
- +=======
- + disableCategoryId: function(tag_group_id, disable) {
- + var post_dict = {
- + 'tag_group_id' : tag_group_id,
- + 'disabled' : Number(disable),
- + tags_type: this._tags_type
- +>>>>>>> Stashed changes
- + },
- + baseUrl = this._manager_base_url,
- + url = baseUrl + '/manage/tags/save';
- + Pmp.Client.LoadAjaxData(url, post_dict, true, $.noop);
- + },
- +
- +<<<<<<< Updated upstream
- +=======
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- submitTagGroup: function(tag_group) {
- var self = this;
- var sort_order = 'asc';
- @@ -331,6 +370,9 @@ Pmp.Manager.Manage.Tags = {
- $(tag_group).find('.tag-name-input').each(function(idx,el){
- tags.push($(el).val());
- });
- +<<<<<<< Updated upstream
- +=======
- +<<<<<<< Updated upstream
- var category_name = $(tag_group).find('.tag-group-category-name').val();
- var privacy = $(tag_group).find('.tag-group-privacy').val();
- var post_dict = {
- @@ -339,6 +381,26 @@ Pmp.Manager.Manage.Tags = {
- 'color' : $(tag_group).find('.tag-group-colorpicker-val').val(),
- 'privacy' : privacy,
- 'tags' : tags
- +=======
- +>>>>>>> Stashed changes
- + var category_name = $(tag_group).find('.tag-group-category-name').val(),
- + privacy = $(tag_group).find('.tag-group-privacy').val(),
- + scope = $(tag_group).find('.tag-group-scope').val(),
- + type = $(tag_group).find('.tag-group-type').val(),
- + post_dict = {
- + 'tag_group_id' : $(tag_group).find('.tag-group-id').val(),
- + 'category_name' : category_name,
- + 'color' : $(tag_group).find('.tag-group-colorpicker-val').val(),
- + 'privacy' : privacy,
- + 'tags' : tags,
- + 'scope': scope,
- +<<<<<<< Updated upstream
- + 'type': type
- +=======
- + 'type': type,
- + tags_type: this._tags_type
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- }
- var baseUrl = this._manager_base_url;
- var url = baseUrl + '/manage/tags/save';
- @@ -346,9 +408,12 @@ Pmp.Manager.Manage.Tags = {
- if (data.payload.error) {
- $(tag_group).find('.error-message-area').html(data.payload.error);
- } else {
- - var private_add = (privacy.toUpperCase() == 'PRIVATE') ? ' (private)' : '';
- - $(tag_group).find('.category-name-header').html(category_name + private_add);
- + var private_add = (privacy.toUpperCase() == 'PRIVATE') ? ' (private)' : '',
- + global_add = data.payload.tag_group.is_global ? ' (Global)' : '';
- + $(tag_group).find('.category-name-header').html(category_name + global_add + private_add);
- $(tag_group).find('.tag-group-id').val(data.payload.tag_group.id);
- + $(tag_group).closest('form').toggleClass('global', data.payload.tag_group.is_global);
- + $(tag_group).closest('form').find('.form-element.level').toggleClass('no-display', data.payload.tag_group.is_global);
- self._makeTagGroupViewMode($(tag_group));
- self._setRevertColor($(tag_group));
- $('.tag-item-container', tag_group).tsort({attr:'sort_tag_name', order:sort_order, sortFunction:sort_fn});
- diff --git a/application/site/static/js/page/manager/manager.reservation.book.js b/application/site/static/js/page/manager/manager.reservation.book.js
- index 42027bb..3e6e24e 100644
- --- a/application/site/static/js/page/manager/manager.reservation.book.js
- +++ b/application/site/static/js/page/manager/manager.reservation.book.js
- @@ -180,8 +180,8 @@ Pmp.Manager.Reservation.Book = {
- $('#input-phone').change(changeClientProfileSearchFn);
- $('#input-email').keyup(changeClientProfileSearchFn);
- $('#input-email').change(changeClientProfileSearchFn);
- - $('#reservation-type-select').change(function() { self._changeReservationTypeSelect(); });
- -
- + //$('#reservation-type-select').change(function() { self._changeReservationTypeSelect(); });
- +
- // comp and nomin replacements
- $('#id_comp_table, #id_nomin_table').on('click', function() {
- $('#min-price-override').val('');
- diff --git a/application/site/static/js/page/manager/manager.tags.lookup.js b/application/site/static/js/page/manager/manager.tags.lookup.js
- new file mode 100644
- index 0000000..2a9ab37
- --- /dev/null
- +++ b/application/site/static/js/page/manager/manager.tags.lookup.js
- @@ -0,0 +1,358 @@
- +/**
- + * Created by krunal on 9/1/15.
- + */
- +var Pmp = Pmp || {};
- +Pmp.Manager = Pmp.Manager || {};
- +Pmp.Manager.Tags = Pmp.Manager.Tags || {};
- +Pmp.Manager.Tags.Lookup = {
- + initialize: function (tag_groups,
- + container_div,
- + tags_input_identifier,
- + tags_results_identifier,
- + tags_input_parent_identifier,
- + tag_item_identifier,
- + tag_table_identifier,
- + tag_table_group_identifier) {
- + debugger;
- + this._container_div = container_div;
- + this._tags_input = this._container_div.find(tags_input_identifier);
- + this._tags_results = this._container_div.find(tags_results_identifier);
- + this._tags_input_parent = this._container_div.find(tags_input_parent_identifier);
- + this._tag_item_identifier = tag_item_identifier;
- + this._tag_table_identifier = tag_table_identifier;
- + this._tag_table_group_identifier = tag_table_group_identifier;
- + this._tags_group = '.tags-group';
- + this._tag_group_id = '.tag-group-id';
- + this._tag_area = '.tag-area';
- + this._tag_item = '.tag-item';
- + this._tag_area_edit = '.tag-area-edit';
- + this._insert_tag_area = '.insert-tags-here';
- + this._tag_item_color_identifier = '.tag-item-color';
- + this._privacy = '.privacy';
- + this._tag_name = '.tag-name';
- + this._tags_group_category_identifier = '.tags-group-category';
- + this._tag_groups = tag_groups;
- + },
- +
- + bindEvents: function () {
- + this._tags_input.on('keyup', {}, _.bind(function (ev) {
- + if ((ev.which == 37) || (ev.which == 38)) { // left/up
- + this._onFindTagsPressUp();
- + } else if ((ev.which == 39) || (ev.which == 40)) { // right/down
- + this._onFindTagsPressDown();
- + } else if (ev.which == 13) { // enter
- + this._onFindTagsPressEnter();
- + } else if (ev.which == 8) {
- + this._onFindTagsInputKeypress(ev.currentTarget);
- + if (this._tags_input.val().length == 0) {
- + var lastTag = this._container_div.find(this._tags_input_parent).find(this._tag_item_identifier).last();
- + if (lastTag.length) {
- + lastTag.fadeOut('slow').remove();
- + }
- + }
- + } else {
- + this._onFindTagsInputKeypress(ev.currentTarget);
- + }
- + ev.preventDefault();
- + }, this));
- +
- + this._tags_input.on('click', {},
- + _.bind(function (ev) {
- + this._onFindTagsInputKeypress(ev.currentTarget)
- + }, this)
- + );
- +
- + this._tags_results.find(this._tag_item_identifier).on('mousedown', {}, _.bind(function (ev) {
- + this._onAddTagToSearch(ev.currentTarget);
- + this._tags_results.hide();
- + }, this));
- +
- + $(document).on('mouseup', {}, _.bind(function(ev) {
- + this._hideTagsPicker(ev.currentTarget);
- + }, this));
- + },
- +
- + _onFindTagsPressUp: function () {
- + var selected = this._container_div.find(this._tag_table_identifier).find(this._tag_item_identifier).find('.selected'),
- + all_visible = this._container_div.find(this._tag_table_identifier).find(this._tag_item_identifier).filter(':visible'),
- + idx = all_visible.index(selected);
- +
- + if ((idx - 1) >= 0) {
- + var new_selected = all_visible.get(idx - 1);
- + if ($(new_selected).length > 0) {
- + $(new_selected).addClass('selected');
- + $(selected).removeClass('selected');
- + }
- + }
- + },
- +
- + _onFindTagsPressDown: function () {
- + var selected = this._container_div.find(this._tag_table_identifier).find(this._tag_item_identifier).find('.selected'),
- + all_visible = this._container_div.find(this._tag_table_identifier).find(this._tag_item_identifier).filter(':visible'),
- + idx = all_visible.index(selected);
- +
- + if ((idx + 1) < all_visible.length) {
- + var new_selected = all_visible.get(idx + 1);
- + if ($(new_selected).length > 0) {
- + $(new_selected).addClass('selected');
- + $(selected).removeClass('selected');
- + }
- + }
- + },
- +
- + _onFindTagsPressEnter: function () {
- + this._container_div.find(this._tag_table_identifier).find(this._tag_item_identifier).find('.selected').mousedown();
- + },
- +
- + search : function(search_str) {
- + var results = [];
- + for (var i=0; i < this._tag_groups.length; i++) {
- + var tag_group = this._tag_groups[i];
- + for (var j=0; j < tag_group.tags.length; j++) {
- + var tag_name = tag_group.tags[j];
- + if (this._startsWith(search_str.toLowerCase(), tag_name.toLowerCase())) {
- + results.push({
- + 'tag_name' : tag_name,
- + 'tag_group_name' : tag_group.name,
- + 'tag_group_id' : tag_group.id,
- + 'privacy' : tag_group.privacy,
- + 'color_hex' : tag_group.color_hex
- + });
- + }
- + }
- + }
- + return results;
- + },
- +
- + _onFindTagsInputKeypress: function (el) {
- + var searchStr = $(el).val(),
- + resultsDom = this._tags_results,
- + results = this.search(searchStr);
- +
- + this._toggle_tags_display(!Boolean(searchStr.length));
- +
- + for (var i = 0; i < results.length; i++) {
- + var tag_name = results[i].tag_name,
- + tag_group_id = results[i].tag_group_id,
- + privacy = results[i].privacy,
- + hash = privacy + '##' + tag_group_id + '##' + tag_name;
- +
- + this._container_div.find('.tag-group-id-name-hash' + ',' + this._tag_item_identifier).each(function (idx, el) {
- + if ($(el).html() == hash) {
- + $(el).parents(this._tag_table_group_identifier).show();
- + $(el).parents(this._tag_item_identifier).show();
- + return false;
- + }
- + });
- + }
- + var tags = this._container_div.find(this._tag_item_identifier +','+ this._tag_table_identifier);
- + tags.removeClass('selected');
- + if (!resultsDom.is(':visible')) {
- + resultsDom.show();
- + }
- + tags.filter(':visible').first().addClass('selected');
- + },
- +
- + _hideTagsPicker: function (e) {
- + var container = this._tags_results;
- + if (container.has(e.target).length === 0) {
- + container.hide();
- + }
- + },
- +
- + onCloseTag: function (el) {
- + var tag = $(el).parents(this._tag_item_identifier),
- + siblings = tag.siblings(),
- + total_siblings = siblings.length;
- + if (total_siblings == 1) {
- + tag.closest('.tags-group').remove()
- + } else {
- + tag.remove();
- + }
- + },
- +
- + groupNameFromId : function(id) {
- + var group = this._findTagGroupById(id);
- + if (group) {
- + return group.name;
- + }
- + return '';
- + },
- +
- + _findTagGroupById : function(id) {
- + for (var i=0; i < this._tag_groups.length; i++) {
- + var tag_group = this._tag_groups[i];
- + if (tag_group.id == id) {
- + return tag_group;
- + }
- + }
- + return null;
- + },
- +
- + groupColorFromId : function(id) {
- + var group = this._findTagGroupById(id);
- + if (group) {
- + return group.color_hex;
- + }
- + return '#ffffff';
- + },
- +
- + _onAddTagToSearch: function (el) {
- + var tag_group_id = $(el).find(this._tag_group_id).html(),
- + privacy = $(el).find(this._privacy).html(),
- + tag_group_name = this.groupNameFromId(tag_group_id),
- + tag_group_color = this.groupColorFromId(tag_group_id),
- + tag_name = $(el).find(this._tag_name).html();
- +
- + debugger;
- + if (this._tagAlreadyExists(tag_group_id, tag_name, this._container_div.find(this._tag_area))) {
- + return;
- + }
- +
- + var html = Nightloop.Templates.Widget.Tag({
- + 'is_new_style': true,
- + 'newly_added': true,
- + 'tag_name': tag_name,
- + 'tag_group_id': tag_group_id,
- + 'tag_group_name': tag_group_name,
- + 'tag_color': tag_group_color,
- + 'is_private': privacy.toUpperCase() == 'PRIVATE',
- + 'close_func': 'Pmp.Manager.Tags.Lookup.onCloseTag(this)'
- + });
- +
- + // find category it belongs to and add after last one
- + var added = false;
- +
- + this._container_div.find(this._tags_group +','+ this._tag_area_edit).each(_.bind(function (idx, el) {
- + if ($(el).attr('tag_group_id') === tag_group_id) {
- + // found the group
- + var tag_containers = $(el).find(this._tag_item_identifier);
- + if (tag_containers.length) {
- + $(html).insertAfter(tag_containers.last());
- + } else {
- + $(html).insertBefore(this._container_div.find(this._insert_tag_area), $(el));
- + }
- +
- + // Bind events
- + $(html).find(this._tag_item).on('mouseover', function(ev) {
- + $(this).addClass('hover')
- + });
- + $(html).find(this._tag_item).on('mouseout', function(ev) {
- + $(this).removeClass('hover')
- + });
- +
- + added = true;
- + return false;
- + }
- + }, this));
- +
- + // category doesn't exist
- + if (!added) {
- + var last_tag_group = this._container_div.find(this._tags_group +','+ this._tag_area).last();
- + if (last_tag_group.length) {
- + var tag_group_html = Nightloop.Templates.Widget.TagsInGroup({
- + 'tag_group': {
- + 'name': tag_group_name,
- + 'id': tag_group_id,
- + 'is_private': privacy.toUpperCase() == 'PRIVATE',
- + 'tags': [{
- + 'tag_name': tag_name,
- + 'is_new_style': true,
- + 'newly_added': true,
- + 'tag_group_id': tag_group_id,
- + 'tag_group_name': tag_group_name,
- + 'is_private': privacy.toUpperCase() == 'PRIVATE'
- + }]
- + },
- + 'is_new_style': true,
- + 'color_hex': tag_group_color,
- + 'can_view_private': true, // doesn't matter
- + 'close_func': 'Pmp.Manager.Tags.Lookup.onCloseTag(this)'
- + });
- + $(tag_group_html).insertAfter(last_tag_group);
- + } else {
- + var tag_group_container_html = Nightloop.Templates.Widget.TagsByGroupDisplay({
- + 'tag_groups': [{
- + 'name': tag_group_name,
- + 'id': tag_group_id,
- + 'is_private': privacy.toUpperCase() == 'PRIVATE',
- + 'is_new_style': true,
- + 'color_hex': tag_group_color,
- + 'tags': [{
- + 'tag_name': tag_name,
- + 'tag_group_id': tag_group_id,
- + 'is_new_style': true,
- + 'newly_added': true,
- + 'tag_group_name': tag_group_name,
- + 'is_private': privacy.toUpperCase() == 'PRIVATE'
- + }]
- + }],
- + 'is_new_style': true,
- + 'can_view_private': true, // doesn't matter
- + 'close_func': 'Pmp.Manager.Tags.Lookup.onCloseTag(this)'
- + });
- + this._container_div.find(this._tag_area).html(tag_group_container_html)
- + }
- + this.renderTags();
- + }
- +
- + this._tags_input.val('');
- + this._toggle_tags_display(true);
- + },
- +
- + _toggle_tags_display: function(should_show) {
- + var selectedElements = this._container_div.find(this._tag_table_group_identifier + ',' + this._tag_table_identifier + ',' +
- + this._tag_item_identifier + ',' + this._tag_table_identifier);
- + if (should_show) {
- + $(selectedElements).show();
- + } else {
- + $(selectedElements).hide();
- + }
- + },
- +
- + _tagAlreadyExists: function (tag_group_id, new_tag_name, tag_group_obj) {
- + var tag_map = {};
- + $(tag_group_obj).find(this._tag_name).each(function (e, div) {
- + var tag_name = $(div).html(),
- + existing_tag_group_id = $(div).parents(this._tag_item_identifier).find(this._tag_group_id).html();
- +
- + tag_map[tag_name.toLowerCase() + existing_tag_group_id] = true;
- + });
- + return ((new_tag_name.toLowerCase() + tag_group_id) in tag_map);
- + },
- +
- + _startsWith : function(search_str, full_str) {
- + return(full_str.indexOf(search_str) == 0);
- + },
- +
- + renderTags : function() {
- + this._container_div.find(this._tags_group).filter('.new-style').each(_.bind(function (e, obj){
- + var tag_group_id = $(obj).find(this._tag_group_id).val(),
- + tag_group_obj = this._findTagGroupById(tag_group_id),
- + bg_color_hex = tag_group_obj.color_hex;
- + $(obj).find(this._tags_group_category_identifier).find('span').css({'background-color':bg_color_hex});
- + }, this));
- +
- + this._container_div.find(this._tag_item).each(_.bind(function(e,obj){
- + $(this).on('mouseover', function(event) {
- + $(this).addClass('hover')
- + });
- + $(this).on('mouseout', function(event) {
- + $(this).removeClass('hover')
- + });
- + var tag_group_id = $(obj).find(this._tag_group_id).val();
- + if (tag_group_id == '') {
- + tag_group_id = $(obj).find(this._tag_group_id).html();
- + }
- + var tag_group_obj = this._findTagGroupById(tag_group_id);
- + // some tags can be removed from tag list but still be on other objects
- + if (tag_group_obj) {
- + var bg_color_hex = tag_group_obj.color_hex;
- + $(obj).find(this._tag_item_color_identifier).css({'background-color':bg_color_hex});
- + $(obj).parents(this._tag_item_identifier).attr('sort_order_group', tag_group_obj.sort_order);
- + $(obj).parents(this._tags_group).attr('sort_order_group', tag_group_obj.sort_order);
- + $(obj).parents(this._tags_group).attr('tag_group_id', tag_group_id);
- + }
- + }, this));
- + },
- +}
- \ No newline at end of file
- diff --git a/application/site/static/js/react/service_status.jsx b/application/site/static/js/react/service_status.jsx
- index cd26f4a..43fea29 100644
- --- a/application/site/static/js/react/service_status.jsx
- +++ b/application/site/static/js/react/service_status.jsx
- @@ -177,14 +177,14 @@ var Status = React.createClass({
- switch_type += ' check';
- }
- return(
- - <div className='list-row'>
- - <div className='row-title'>
- - <span>{this.state.display}</span>
- - </div>
- - <div className={switch_type} onClick={this.clickEnable}>
- + <div className='list-row'>
- + <div className='row-title'>
- + <span>{this.state.display}</span>
- + </div>
- + <div className={switch_type} onClick={this.clickEnable}>
- + </div>
- + <div className='float-end'></div>
- </div>
- - <div className='float-end'></div>
- - </div>
- );
- /*ignore jslint end*/
- }
- diff --git a/application/site/templates/manager/manager.clients.merge.soy b/application/site/templates/manager/manager.clients.merge.soy
- index 06cb353..c15c07e 100644
- --- a/application/site/templates/manager/manager.clients.merge.soy
- +++ b/application/site/templates/manager/manager.clients.merge.soy
- @@ -66,7 +66,7 @@
- Company
- </div>
- <div class="col col-clientgroup">
- - Client Groups
- + Client codes
- </div>
- {if $content.member_profiles_exist}
- diff --git a/application/site/templates/manager/manager.clients.profile.soy b/application/site/templates/manager/manager.clients.profile.soy
- index 54c6e5f..b82ecd3 100644
- --- a/application/site/templates/manager/manager.clients.profile.soy
- +++ b/application/site/templates/manager/manager.clients.profile.soy
- @@ -355,7 +355,7 @@
- <div class="form-element text groups">
- <label for="">
- <p class="label">
- - Client groups
- + Client codes
- </p>
- <div id="groups-area" class="input">
- @@ -815,8 +815,9 @@
- {if $content.venue_group_client}
- {call Nightloop.Templates.Widget.TagsByGroupDisplay}
- {param tag_groups:$content.venue_group_client.tags_group_display /}
- + {param is_new_style:true /}
- {param can_view_private:$content.can_view_private_notes /}
- - {param close_func: 'Pmp.Manager.Clients.Profile.onCloseTag(this)' /}
- + {param close_func: 'Pmp.Manager.Tags.Lookup.onCloseTag(this)' /}
- {/call}
- {/if}
- {else}
- @@ -905,6 +906,26 @@
- <span>no shows</span>
- </p>
- </div>
- + <div class="stat-group service">
- + <strong>
- + Service cheat sheet
- + </strong>
- + </div>
- + {if $content.venue_group_client.default_tags}
- + <table class="stat-group">
- + {foreach $default_tag in $content.venue_group_client.default_tags}
- + <tr>
- + <td class="tags-icon" align="center">
- + <img src="{$MEDIA_URL}images/tags/{$default_tag.type}.png" alt="{$default_tag.type}" />
- + <span>{$default_tag.name}</span>
- + </td>
- + <td class="tags-list">
- + <span>{$default_tag.tags_list}</span>
- + </td>
- + </tr>
- + {/foreach}
- + </table>
- + {/if}
- </div>
- </div>
- {/if}
- @@ -1008,8 +1029,20 @@
- );
- Pmp.Common.TagCache.initialize("{$content.tag_url}");
- - Pmp.Common.TagCache.refresh(function() {lb}
- + Pmp.Common.TagCache.refresh(function(content) {lb}
- Pmp.Common.TagCache.renderTagTable('#find-tags-results');
- + Pmp.Manager.Tags.Lookup.initialize(
- + content.tag_groups,
- + $('#profile-summary-edit-pane .tag-editor'),
- + '#find-tags-input',
- + '#find-tags-results',
- + '.find-tags-container',
- + '.tag-item-container',
- + '.tag-table-container',
- + '.tag-group-container'
- + );
- +
- + Pmp.Manager.Tags.Lookup.bindEvents();
- Pmp.Common.TagCache.sortTagsGroup('.tag-area-css');
- Pmp.Manager.Clients.Profile._adjustBoxHeight();
- {rb});
- diff --git a/application/site/templates/manager/manager.clients.soy b/application/site/templates/manager/manager.clients.soy
- index 9113075..2cb37dc 100644
- --- a/application/site/templates/manager/manager.clients.soy
- +++ b/application/site/templates/manager/manager.clients.soy
- @@ -28,9 +28,9 @@
- <div id="sidebar">
- <div class="clientgroups-container">
- - <h3 class="subheader">Client Groups</h3>
- + <h3 class="subheader">Client codes</h3>
- <ul class="submenu clientgroups"></ul>
- - <a class='menu-link' href="{$venue.manager_base_url}/manage/clientgroups">Add client groups</a>
- + <a class='menu-link' href="{$venue.manager_base_url}/manage/clientgroups">Add client codes</a>
- </div>
- <div class="membershipgroups-container no-display">
- diff --git a/application/site/templates/manager/manager.maininterface.soy b/application/site/templates/manager/manager.maininterface.soy
- index b4c62c7..f819d25 100644
- --- a/application/site/templates/manager/manager.maininterface.soy
- +++ b/application/site/templates/manager/manager.maininterface.soy
- @@ -194,7 +194,7 @@
- <span class="auto -est_arrival_time_display"></span>
- </p>
- {/if}
- - /* A blank option is returned if no reservation types have been added. */
- + /* A blank option is returned if no reservation codes have been added. */
- {if $content.reservation_types and length($content.reservation_types) > 1}
- <p class="info">
- <em>Type</em>
- diff --git a/application/site/templates/manager/manager.manage.clientgroup.edit.soy b/application/site/templates/manager/manager.manage.clientgroup.edit.soy
- index 3f24dd2..6224089 100644
- --- a/application/site/templates/manager/manager.manage.clientgroup.edit.soy
- +++ b/application/site/templates/manager/manager.manage.clientgroup.edit.soy
- @@ -1,7 +1,7 @@
- {namespace Nightloop.Templates.Manager.Manage}
- /**
- - * Client Groups edit/create page
- + * Client Codes edit/create page
- */
- {template .ClientGroupEdit}
- {call Nightloop.Templates.Manager.Layout data="all" }
- @@ -24,7 +24,7 @@
- <div id="main-area">
- <div id="content-header">
- <h2>
- - <a href="{$venue.manager_base_url}/manage/clientgroups">CLIENT GROUPS</a>
- + <a href="{$venue.manager_base_url}/manage/clientgroups">CLIENT CODES</a>
- /
- {if $content.group_id}
- {$content.group.name}
- diff --git a/application/site/templates/manager/manager.manage.clientgroups.soy b/application/site/templates/manager/manager.manage.clientgroups.soy
- index 7a6ffd6..2d0d22e 100644
- --- a/application/site/templates/manager/manager.manage.clientgroups.soy
- +++ b/application/site/templates/manager/manager.manage.clientgroups.soy
- @@ -1,7 +1,7 @@
- {namespace Nightloop.Templates.Manager.Manage}
- /**
- - * Client Groups page
- + * Client Codes page
- */
- {template .ClientGroups}
- {call Nightloop.Templates.Manager.Layout data="all" }
- @@ -11,7 +11,7 @@
- /**
- - * Client groups template
- + * Client codes template
- * @param content
- * @param venue
- * @param venue_settings
- @@ -23,7 +23,7 @@
- <div id="page-client-groups" class="has-sidebar">
- <div id="main-area">
- <div id="content-header">
- - <h2>CLIENT GROUPS</h2>
- + <h2>CLIENT CODES</h2>
- <p class="button">
- <a id="add-client-group" href="{$venue.manager_base_url}/manage/clientgroups/create">Add Client Group</a>
- </p>
- diff --git a/application/site/templates/manager/manager.manage.reservationtypes.edit.soy b/application/site/templates/manager/manager.manage.reservationtypes.edit.soy
- index d1a0a62..1185280 100644
- --- a/application/site/templates/manager/manager.manage.reservationtypes.edit.soy
- +++ b/application/site/templates/manager/manager.manage.reservationtypes.edit.soy
- @@ -1,7 +1,7 @@
- {namespace Nightloop.Templates.Manager.Manage.ReservationTypes}
- /**
- - * Reservation Types page
- + * Reservation Codes page
- */
- {template .Edit}
- {call Nightloop.Templates.Manager.Layout data="all" }
- @@ -11,7 +11,7 @@
- /**
- - * Reservation Types template
- + * Reservation Codes template
- * @param venue
- * @param venue_settings
- * @param content
- @@ -23,7 +23,7 @@
- <div id="page-reservation-types" class="has-sidebar">
- <div id="main-area">
- <div id="content-header">
- - <h2>RESERVATION TYPES</h2>
- + <h2>RESERVATION CODES</h2>
- </div>
- {if $content.message}
- <div class="global-message success fade">{$content.message}</div>
- @@ -41,7 +41,7 @@
- {/foreach}
- </div>
- <p class="indent">
- - <a id="add-new-reservation-type" href="javascript:void(0)">Add new reservation type</a>
- + <a id="add-new-reservation-type" href="javascript:void(0)">Add new reservation code</a>
- </p>
- <p class="button">
- <a id="reservation-types-submit-btn" href="">Save changes</a>
- diff --git a/application/site/templates/manager/manager.manage.tags.soy b/application/site/templates/manager/manager.manage.tags.soy
- index 48e34a4..6a84a6d 100644
- --- a/application/site/templates/manager/manager.manage.tags.soy
- +++ b/application/site/templates/manager/manager.manage.tags.soy
- @@ -13,43 +13,56 @@
- * Manage Tags
- * @param content
- * @param venue
- + * @param label
- + * @param identifier
- * @param venue_settings
- * @param MEDIA_URL
- */
- {template .TagsBit}
- {call Nightloop.Templates.Manager.SettingsSidebar data="all"}
- - {param subcategory: 'tags' /}
- + {param subcategory: $identifier /}
- {/call}
- <div id="page-tags" class="has-sidebar">
- <div id="main-area">
- <div id="content-header">
- +<<<<<<< Updated upstream
- <h2>Manage Tags - {$content.venue_group_name}</h3>
- +<<<<<<< Updated upstream
- + <p class="button">
- + <a id="new-tag-category-link" href="javascript:void(0);">New tag category</a>
- + </p>
- +=======
- +=======
- + <h2>Manage {$label} - {$content.venue_group_name}</h3>
- + <p class="button">
- + <a id="new-tag-category-link" href="javascript:void(0);">New {$label} category</a>
- + </p>
- +>>>>>>> Stashed changes
- +>>>>>>> Stashed changes
- </div>
- {if $content.error_message}
- <p class="global-message error fade">{$content.error_message}</p>
- {/if}
- - <div id="content-area" class="control-block">
- + <div id="content-area" class="control-block {if $content and not $content.display}no-display{/if}">
- {foreach $tag_group in $content.tag_groups}
- {call .TagGroup}
- {param MEDIA_URL:$MEDIA_URL /}
- {param can_manage_private:$content.can_manage_private /}
- {param tag_group:$tag_group /}
- + {param tag_group_types:$content.tag_group_types /}
- {/call}
- {/foreach}
- <div id="insert-tag-groups-here"></div>
- <div id="tag-instructions"></div>
- {if length($content.tag_groups) == 0}
- - <div id="sample-tag">There are no tags yet. <a target="_blank" href="{$MEDIA_URL}images/sample-tag-list.png">See a sample list</a>.</div>
- + <div id="sample-tag">There are no {$label} yet. <a target="_blank" href="{$MEDIA_URL}images/sample-tag-list.png">See a sample list</a>.</div>
- {/if}
- </div>
- - <div id="content-new-category-area" class="control-block">
- - <a id="new-tag-category-link" href="javascript:void(0);"><span class="adder-link">+</span>New tag category</a>
- - </div>
- <div id="action-tags" class="control-block">
- <form method="POST" action="{$venue.manager_base_url}/manage/tags/bulk">
- <h3>Bulk Operations</h3>
- <div class="actions">
- - <span class="line">Apply tag </span>
- + <span class="line">Apply {$label} </span>
- <span class="line">
- {call Nightloop.Templates.Widget.TagPicker}
- {param results_id: 'apply-tag-results' /}
- @@ -57,7 +70,7 @@
- {param scope_id: 'apply-tag-container' /}
- {/call}
- </span>
- - <span class="line"> to client profiles with tag </span>
- + <span class="line"> to client profiles with {$label}</span>
- <span class="line">
- {call Nightloop.Templates.Widget.TagPicker}
- {param results_id: 'apply-tag-target-results' /}
- @@ -77,8 +90,8 @@
- <img src="{$MEDIA_URL}images/important.png" />
- </p>
- <p class="description">
- - Tags you have removed from this list may still appear on client profiles. Click SYNC to
- - clear removed tags from your database (this action is irreversible and may take up to 60 minutes in the background).
- + {$label} you have removed from this list may still appear on client profiles. Click SYNC to
- + clear removed {$label} from your database (this action is irreversible and may take up to 60 minutes in the background).
- </p>
- <div class="float-end"></div>
- </div>
- @@ -92,7 +105,7 @@
- <script type="text/javascript">
- $(document).ready( function() {lb}
- var can_manage_private = {if $content.can_manage_private}true{else}false{/if};
- - Pmp.Manager.Manage.Tags.initialize("{$venue.manager_base_url}","{$MEDIA_URL}", can_manage_private);
- + Pmp.Manager.Manage.Tags.initialize("{$venue.manager_base_url}","{$MEDIA_URL}", can_manage_private, "{$identifier}");
- Pmp.Common.TagCache.initialize("{$content.tags_url}");
- Pmp.Common.TagCache.refresh(function() {lb}
- Pmp.Common.TagCache.renderTagTable("#apply-tag-results");
- @@ -100,6 +113,7 @@
- {rb}, true);
- Pmp.Common.TagCache.initializeTagPicker("#apply-tag-input", "#apply-tag-results", "#apply-tag-container", "from");
- Pmp.Common.TagCache.initializeTagPicker("#apply-tag-target-input", "#apply-tag-target-results", "#apply-tag-target-container", "to");
- + $('#content-area').toggleClass('no-display');
- {rb})
- </script>
- </div>
- @@ -116,13 +130,22 @@
- <div class="tag-group-block" name="{if $tag_group}{if $tag_group.name}{$tag_group.name}-webdriver{/if}{/if}">
- <div class="category-header view-mode-only">
- - <div class="category-name-header">{if $tag_group}{if $tag_group.name}{$tag_group.name}{if $tag_group.privacy == 'PRIVATE'}{sp}(private) {/if}{/if}{/if}</div>
- + <div class="category-name-header">
- + {if $tag_group}
- + {if $tag_group.name}{$tag_group.name}
- + {if $tag_group.is_global} (Global){/if}
- + {if $tag_group.privacy == 'PRIVATE'}{sp}(private) {/if}{/if}
- + {/if}
- + </div>
- + {if $tag_group and $tag_group.is_default > 0}
- + <div class="enable-header {if $tag_group.disabled == 0} on {/if}"></div>
- + {/if}
- /* <div class="move-pic no-display"><img src="{$MEDIA_URL}images/up-down-arrows.png" /></div> */
- <div class="float-end"></div>
- </div>
- <input type="hidden" class="tag-group-id" value="{if $tag_group}{if $tag_group.id}{$tag_group.id}{/if}{/if}" />
- -
- +
- <div class="tag-group-metadata edit-mode-only">
- <div class="input-col float-left">
- <div class="input-area">
- @@ -150,7 +173,7 @@
- </div>
- </div>
- </div>
- - <div class="input-col float-left {if not $can_manage_private}no-display{/if}">
- + <div class="input-col float-left {if $tag_group and $tag_group.is_default}no-display{/if}">
- <div class="form-element select privacy">
- <label>
- <p class="label">
- @@ -168,11 +191,26 @@
- </label>
- </div>
- </div>
- -
- + <div class="input-col float-left {if $tag_group and ($tag_group.is_default or $tag_group.is_global)}no-display{/if}">
- + <div class="form-element select level">
- + <label>
- + <p class="label">
- + Scope
- + </p>
- + <p class="input">
- + <select class="tag-group-scope">
- + <option value="1" {if $tag_group}{if $tag_group.is_global}selected="selected"{/if}{/if}>Global</option>
- + <option value="0" {if $tag_group}{if not $tag_group.is_global}selected="selected"{/if}{/if}>Local</option>
- + </select>
- + <span class="downer"></span>
- + </p>
- + </label>
- + </div>
- + </div>
- <div class="float-end"></div>
- </div>
- -
- - <div class="tag-group-tags">
- +
- + <div class="tag-group-tags {if $tag_group and $tag_group.disabled}no-display{/if}">
- <div class="edit-mode-only">
- <div class="tag-group-add">
- <input class="add-tag-input" type="text" />
- @@ -208,9 +246,11 @@
- <p class="cancel-link-area button plain">
- <a class="cancel-link" href="javascript:void(0);">cancel</a>
- </p>
- - <p class="button danger">
- - <a class="delete-category-link" href="javascript:void(0);">Delete category</a>
- - </p>
- + {if $tag_group and $tag_group.type == 0}
- + <p class="button danger">
- + <a class="delete-category-link" href="javascript:void(0);">Delete category</a>
- + </p>
- + {/if}
- <div class="delete-category-area">
- <div class="delete-category-container no-display">
- <div class="delete-category local-popup">
- diff --git a/application/site/templates/manager/manager.requestactionform.soy b/application/site/templates/manager/manager.requestactionform.soy
- index 5542aa9..54c4078 100644
- --- a/application/site/templates/manager/manager.requestactionform.soy
- +++ b/application/site/templates/manager/manager.requestactionform.soy
- @@ -84,7 +84,7 @@
- {if $venue.is_nightlife_class}
- <div class="form-element select inline">
- <label for="res_type">
- - <p class="label pre">Reservation Type</p>
- + <p class="label pre">Reservation Code</p>
- <p id="res-type-wrap" class="input">
- <select id="res_type" name="res_type">
- <option value="TABLE">Table Service</option>
- diff --git a/application/site/templates/manager/manager.reservationform.soy b/application/site/templates/manager/manager.reservationform.soy
- index 2a30081..64ce2be 100644
- --- a/application/site/templates/manager/manager.reservationform.soy
- +++ b/application/site/templates/manager/manager.reservationform.soy
- @@ -251,7 +251,12 @@
- {if $content.reservation_types and length($content.reservation_types) > 1 and not $content.reservations_require_approval}
- <div class="form-element select reservation-type nightlife">
- <label for="reservation-type">
- +<<<<<<< Updated upstream
- + <p class="label">Reservation code</p>
- +=======
- +<<<<<<< Updated upstream
- <p class="label">Reservation type</p>
- +>>>>>>> Stashed changes
- <p class="input">
- <select name="reservation_type" class="auto" id="reservation-type-select">
- {foreach $restype in $content.reservation_types}
- @@ -260,8 +265,61 @@
- </select>
- <span class="downer"></span>
- </p>
- +=======
- + <p class="label">Reservation code</p>
- + <div id="tag-manager" class="tag-editor">
- + <div class="add-tags-area">
- + <div class="find-tags-container">
- + <input id="find-tags-input">
- + <div class="relative-container">
- + <div class="no-display" id="find-tags-results">
- + <div id="find-tags-results">
- + <div class="tag-table-container new-style selected" >
- + {call Nightloop.Templates.Widget.TagTable}
- + {param tag_groups:$content.reservation_types /}
- + {/call}
- + </div>
- + </div>
- + </div>
- + </div>
- + </div>
- + </div>
- + <div class="tag-area tag-area-css tag-area-edit">
- + <div class="tag-group-display-container">
- + </div>
- + </div>
- + </div>
- +>>>>>>> Stashed changes
- </label>
- </div>
- + <script type="text/javascript">
- + $(document).ready( function() {lb}
- + console.log("{$content.reservation_tags_url}");
- + Pmp.Common.TagCache.initialize("{$content.reservation_tags_url}");
- + Pmp.Common.TagCache.refresh(function(content) {lb}
- + //Pmp.Common.TagCache.renderTagTable('#find-tags-results');
- + //Pmp.Common.TagCache.sortTags('.tags-area-sortable');
- + //Pmp.Common.TagCache.initializeTagPicker("#add-tag-input",
- + //"#add-tag-results",
- + //"#add-tag-container",
- + //"add",
- + //"add-client-tags-here",
- + //"add-client-tags-container");
- + Pmp.Manager.Tags.Lookup.initialize(
- + content.tag_groups,
- + $('.reservation-type .tag-editor'),
- + '#find-tags-input',
- + '#find-tags-results',
- + '.find-tags-container',
- + '.tag-item-container',
- + '.tag-table-container',
- + '.tag-group-container'
- + );
- +
- + Pmp.Manager.Tags.Lookup.bindEvents();
- + {rb});
- + {rb});
- + </script>
- <div id="reservation-type-color-indicator" class="form-element text inline-end">
- <label for="reservation-type-color">
- <p class="label"> </p>
- @@ -444,13 +502,13 @@
- {call .CostOptionsForm data="all"/}
- {/if}
- - /* A blank option is returned if no reservation types have been added. */
- + /* A blank option is returned if no reservation codes have been added. */
- {if $venue.is_nightlife_class}
- {if $content.reservation_types and length($content.reservation_types) > 1 and not $content.reservations_require_approval}
- <div class="inline">
- <div class="form-element select">
- <label for="reservation-type">
- - <p class="label">Reservation type</p>
- + <p class="label">Reservation code</p>
- <p class="input">
- <select name="reservation_type" class="auto" id="reservation-type-select">
- {foreach $restype in $content.reservation_types}
- @@ -625,7 +683,7 @@
- <div class="form-element text groups">
- <label for="">
- <p class="label">
- - Client groups
- + Client codes
- </p>
- <div id="groups-area" class="input">
- diff --git a/application/site/templates/manager/manager.reservations.soy b/application/site/templates/manager/manager.reservations.soy
- index 3c8d2fb..fe75a61 100644
- --- a/application/site/templates/manager/manager.reservations.soy
- +++ b/application/site/templates/manager/manager.reservations.soy
- @@ -846,7 +846,7 @@
- {/if}
- {if $content.reservation_types and length($content.reservation_types) > 1}
- - <li><a id="regroup-link-restype" href="javascript:void(0)">Reservation type</a></li>
- + <li><a id="regroup-link-restype" href="javascript:void(0)">Reservation code</a></li>
- {/if}
- </ul>
- diff --git a/application/site/templates/manager/manager.settingssidebar.soy b/application/site/templates/manager/manager.settingssidebar.soy
- index 3781c9d..e74d1c3 100644
- --- a/application/site/templates/manager/manager.settingssidebar.soy
- +++ b/application/site/templates/manager/manager.settingssidebar.soy
- @@ -21,9 +21,9 @@
- {if $user_domain.venue_manage_tag_list}
- <li><a class="{if $subcategory == 'tags'}selected{/if}" id="" href="{$venue.manager_base_url}/manage/tags">Tags</a></li>
- {/if}
- - <li><a class="{if $subcategory == 'reservation_types'}selected{/if}" id="" href="{$venue.manager_base_url}/manage/reservationtypes">Reservation types</a></li>
- + <li><a class="{if $subcategory == 'reservation_types'}selected{/if}" id="" href="{$venue.manager_base_url}/manage/reservationtypes">Reservation codes</a></li>
- {if $user_domain.can_manage_client_groups}
- - <li><a class="{if $subcategory == 'clientgroups'}selected{/if}" href="{$venue.manager_base_url}/manage/clientgroups">Client groups</a></li>
- + <li><a class="{if $subcategory == 'clientgroups'}selected{/if}" href="{$venue.manager_base_url}/manage/clientgroups">Client codes</a></li>
- {/if}
- {if $venue_settings and $venue_settings.membership_enabled and $user_domain.can_manage_membership_groups}
- <li><a class="{if $subcategory == 'membershipgroups'}selected{/if}" href="{$venue.manager_base_url}/manage/membershipgroups">Membership groups</a></li>
- diff --git a/application/site/templates/widget/widget.tag.soy b/application/site/templates/widget/widget.tag.soy
- index 1d79218..4ec5076 100644
- --- a/application/site/templates/widget/widget.tag.soy
- +++ b/application/site/templates/widget/widget.tag.soy
- @@ -12,11 +12,15 @@
- * @param? full_hash_only
- * @param? full_hash_prefix
- * @param? confirm_close
- + * @param? is_new_style
- + * @param? newly_added
- */
- {template .Tag}
- - <div class="tag-item-container float-left" sort_tag_name="{$tag_name}" sort_order_group="">
- + <div class="tag-item-container float-left {if $is_new_style}new-style{/if} {if $newly_added}new{/if}" sort_tag_name="{$tag_name}" sort_order_group="">
- <div class="tag-item" >
- - <div class="tag-item-color float-left" style="background-color:{$tag_color};"> </div>
- + {if not $is_new_style}
- + <div class="tag-item-color float-left" style="background-color:{$tag_color};"> </div>
- + {/if}
- <div class="tag-name float-left">
- {$tag_name}
- </div>
- @@ -97,7 +101,7 @@
- * @param tag_groups
- */
- {template .TagTable}
- - <div class="tag-table-container">
- + <div class="tag-table-container new-style">
- {foreach $tag_group in $tag_groups}
- {call .TagTableGroup}
- {param tag_group:$tag_group /}
- @@ -112,7 +116,10 @@
- */
- {template .TagTableGroup}
- <div class="tag-table-group">
- - <div class="tag-table-category">{$tag_group.name}{if $tag_group.privacy == 'PRIVATE'}{sp}(private){/if}</div>
- + <div class="tag-table-category">
- + <span class="color float-left" style="background-color:{$tag_group.color_hex}"></span>
- + <div>{$tag_group.name}{if $tag_group.privacy == 'PRIVATE'}{sp}(private){/if}</div>
- + </div>
- <div class="tag-table-tags">
- {foreach $tag in $tag_group.tags}
- {call .Tag}
- @@ -135,23 +142,19 @@
- * Tag Category Display
- * @param tag_groups
- * @param can_view_private
- + * @param? is_new_style
- * @param? close_func
- */
- {template .TagsByGroupDisplay}
- <div class="tag-group-display-container">
- {foreach $tag_group in $tag_groups}
- - {if $close_func}
- - {call .TagsInGroup}
- - {param tag_group:$tag_group /}
- - {param can_view_private:$can_view_private /}
- - {param close_func: $close_func /}
- - {/call}
- - {else}
- - {call .TagsInGroup}
- - {param tag_group:$tag_group /}
- - {param can_view_private:$can_view_private /}
- - {/call}
- - {/if}
- + {call .TagsInGroup}
- + {param tag_group:$tag_group /}
- + {param can_view_private:$can_view_private /}
- + {param is_new_style:$is_new_style /}
- + {param background_color:$tag_group.color_hex /}
- + {param close_func:$close_func /}
- + {/call}
- {/foreach}
- </div>
- {/template}
- @@ -199,11 +202,20 @@
- * Tag Box
- * @param tag_group
- * @param can_view_private
- + * @param? is_new_style
- + * @param? background_color
- * @param? close_func
- */
- {template .TagsInGroup}
- - <div class="tags-group">
- - <div class="tags-group-category">{$tag_group.name}{if $tag_group.is_private}{sp}(private){/if}</div>
- + <div class="tags-group {if $is_new_style}new-style{/if}">
- + <div class="tags-group-category">
- + {if $is_new_style}
- + <span class="float-left" style="background-color: {$background_color}"></span>
- + <div class="tag-group-name">{$tag_group.name}{if $tag_group.is_private}{sp}(private){/if}</div>
- + {else}
- + {$tag_group.name}{if $tag_group.is_private}{sp}(private){/if}
- + {/if}
- + </div>
- <div class="tags-group-tags">
- {foreach $tag in $tag_group.tags}
- {if $tag.is_private}
- @@ -215,6 +227,8 @@
- {param tag_group_name: $tag.tag_group_name /}
- {param tag_color: 'white' /}
- {param text_color: 'gray' /}
- + {param is_new_style:$is_new_style /}
- + {param newly_added:$tag.newly_added /}
- {param is_private: true /}
- {param close_func: $close_func /}
- {/call}
- @@ -223,7 +237,9 @@
- {param tag_name: $tag.tag_name /}
- {param tag_group_id: $tag.tag_group_id /}
- {param tag_group_name: $tag.tag_group_name /}
- + {param is_new_style:$is_new_style /}
- {param tag_color: 'white' /}
- + {param newly_added:$tag.newly_added /}
- {param text_color: 'gray' /}
- {param is_private: true /}
- {/call}
- @@ -236,6 +252,8 @@
- {param tag_group_id: $tag.tag_group_id /}
- {param tag_group_name: $tag.tag_group_name /}
- {param tag_color: 'white' /}
- + {param newly_added:$tag.newly_added /}
- + {param is_new_style:$is_new_style /}
- {param text_color: 'gray' /}
- {param close_func: $close_func /}
- {/call}
- @@ -243,7 +261,9 @@
- {call .Tag}
- {param tag_name: $tag.tag_name /}
- {param tag_group_id: $tag.tag_group_id /}
- + {param newly_added:$tag.newly_added /}
- {param tag_group_name: $tag.tag_group_name /}
- + {param is_new_style:$is_new_style /}
- {param tag_color: 'white' /}
- {param text_color: 'gray' /}
- {/call}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement