1. Panayiotis Lipiridis
  2. gae-init-pro

Commits

Panayiotis Lipiridis  committed d981993 Merge

Merged with gae-init

  • Participants
  • Parent commits 673604d, 10235ce
  • Branches default

Comments (0)

Files changed (13)

File main/__init__.py

View file
 
 """
 
-__version__ = '0.16.2'
+__version__ = '0.16.3'

File main/admin.py

View file
 
 
 class ConfigUpdateForm(wtf.Form):
-  analytics_id = wtf.StringField('Analytics ID', filters=[util.strip_filter])
+  analytics_id = wtf.StringField('Tracking ID', filters=[util.strip_filter])
   announcement_html = wtf.TextAreaField('Announcement HTML', filters=[util.strip_filter])
   announcement_type = wtf.SelectField('Announcement Type', choices=[(t, t.title()) for t in model.Config.announcement_type._choices])
   brand_name = wtf.StringField('Brand Name', [wtf.validators.required()], filters=[util.strip_filter])
   facebook_app_id = wtf.StringField('Facebook App ID', filters=[util.strip_filter])
   facebook_app_secret = wtf.StringField('Facebook App Secret', filters=[util.strip_filter])
   feedback_email = wtf.StringField('Feedback Email', [wtf.validators.optional(), wtf.validators.email()], filters=[util.email_filter])
-  flask_secret_key = wtf.StringField('Flask Secret Key', [wtf.validators.required()], filters=[util.strip_filter])
+  flask_secret_key = wtf.StringField('Secret Key', [wtf.validators.optional()], filters=[util.strip_filter])
   notify_on_new_user = wtf.BooleanField('Send an email notification when a user signs up')
   twitter_consumer_key = wtf.StringField('Twitter Consumer Key', filters=[util.strip_filter])
   twitter_consumer_secret = wtf.StringField('Twitter Consumer Secret', filters=[util.strip_filter])
   form = ConfigUpdateForm(obj=config_db)
   if form.validate_on_submit():
     form.populate_obj(config_db)
+    if not config_db.flask_secret_key:
+      config_db.flask_secret_key = util.uuid()
     config_db.put()
     reload(config)
     app.config.update(CONFIG_DB=config_db)

File main/main.py

View file
   message = wtf.TextAreaField('Message',
       [wtf.validators.required()], filters=[util.strip_filter],
     )
-  email = wtf.StringField('Email (optional)',
+  email = wtf.StringField('Your email (optional)',
       [wtf.validators.optional(), wtf.validators.email()],
       filters=[util.email_filter],
     )

File main/static/src/script/common/util.coffee

View file
   ($ '.alert-announcement button.close').click ->
     sessionStorage?.setItem 'closedAnnouncement', ($ '.alert-announcement').html()
 
-  if sessionStorage?.getItem('closedAnnouncement') == ($ '.alert-announcement').html()
-    ($ '.alert-announcement').hide()
+  if sessionStorage?.getItem('closedAnnouncement') != ($ '.alert-announcement').html()
+    ($ '.alert-announcement').show()
 
 
 window.clear_notifications = ->

File main/static/src/style/base.less

View file
 }
 
 .alert-announcement {
+  display: none;
   &.container {
     border-radius: 0;
     margin-bottom: 0;

File main/templates/admin/bit/flask_secret_key.html

View file
+{{
+  forms.oauth_fields(
+      'Flask',
+      (form.flask_secret_key,),
+      form.flask_secret_key.data,
+    )
+}}

File main/templates/admin/bit/google_analytics_tracking_id.html

View file
+{{
+  forms.oauth_fields(
+      'Google Analytics',
+      (form.analytics_id,),
+      form.analytics_id.data,
+    )
+}}

File main/templates/admin/config_update.html

View file
         {{forms.text_field(form.brand_name, autofocus=True)}}
         {{forms.email_field(form.feedback_email)}}
         {{forms.checkbox_field(form.notify_on_new_user)}}
-        {{forms.text_field(form.analytics_id)}}
-        {{forms.text_field(form.flask_secret_key)}}
         {{forms.textarea_field(form.announcement_html)}}
         {{forms.select_field(form.announcement_type)}}
       </fieldset>
 
       <fieldset class="col-sm-6 col-md-7">
-        <legend>Third Party OAuth</legend>
+        <legend>Keys</legend>
         <div class="panel-group" id="oauth">
+          # include "admin/bit/flask_secret_key.html"
           # include "admin/bit/facebook_oauth.html"
+          # include "admin/bit/google_analytics_tracking_id.html"
           # include "admin/bit/twitter_oauth.html"
         </div>
       </fieldset>

File main/templates/macro/forms.html

View file
   <div class="form-group {{'has-error' if field.errors}}">
     {{field.label(class='control-label')}}
     {{field_description(field)}}
-    # for key, value in field.choices.items()
+    # for key, value in field.choices
       <div class="checkbox">
         <label>
           <input type="checkbox" name="{{field.name}}" value="{{key}}"

File main/templates/macro/utils.html

File contents unchanged.

File main/templates/signin.html

View file
       # endif
 
       <div class="checkbox remember">
-        <label><input type="checkbox" checked> Remember me</label>
+        <label><input type="checkbox" checked> Keep me signed in</label>
       </div>
     </div>
   </div>

File main/user.py

View file
   user_key = wtf.StringField('User Key', [wtf.validators.required()])
   user_keys = wtf.StringField('User Keys', [wtf.validators.required()])
   username = wtf.StringField('Username', [wtf.validators.optional()])
-  name = wtf.StringField('Merged Name',
+  name = wtf.StringField('Name (merged)',
       [wtf.validators.required()], filters=[util.strip_filter],
     )
-  email = wtf.StringField('Merged Email',
+  email = wtf.StringField('Email (merged)',
       [wtf.validators.optional(), wtf.validators.email()],
       filters=[util.email_filter],
     )

File run.py

View file
     '-f', '--flush', dest='flush', action='store_true',
     help='clears the datastore, blobstore, etc',
   )
+PARSER.add_argument(
+    '--appserver-args', dest='args', nargs=argparse.REMAINDER, default=[],
+    help='all following args are passed to dev_appserver.py',
+  )
 ARGS = PARSER.parse_args()
 
 
       --storage_path=%s
       --clear_datastore=%s
       --skip_sdk_update_check
-    ''' % (DIR_MAIN, ARGS.host, port, port + 1, DIR_STORAGE, clear)
+      %s
+    ''' % (DIR_MAIN, ARGS.host, port, port + 1, DIR_STORAGE, clear,
+           " ".join(ARGS.args))
   os.system(run_command.replace('\n', ' '))
 
 
 def run():
-  if len(sys.argv) == 1:
+  if len(sys.argv) == 1 or (ARGS.args and not ARGS.start):
     PARSER.print_help()
     sys.exit(1)