convert more to bootstrap
This commit is contained in:
		
							parent
							
								
									98e7169f34
								
							
						
					
					
						commit
						95c71f7c87
					
				
							
								
								
									
										137
									
								
								web/app.py
									
									
									
									
									
								
							
							
						
						
									
										137
									
								
								web/app.py
									
									
									
									
									
								
							@ -498,7 +498,7 @@ def create_app():
 | 
				
			|||||||
            """Prepare and process the login form."""
 | 
					            """Prepare and process the login form."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Authenticate username/email and login authenticated users.
 | 
					            # Authenticate username/email and login authenticated users.
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
            safe_next_url = self._get_safe_next_url('next', self.USER_AFTER_LOGIN_ENDPOINT)
 | 
					            safe_next_url = self._get_safe_next_url('next', self.USER_AFTER_LOGIN_ENDPOINT)
 | 
				
			||||||
            safe_reg_next = self._get_safe_next_url('reg_next', self.USER_AFTER_REGISTER_ENDPOINT)
 | 
					            safe_reg_next = self._get_safe_next_url('reg_next', self.USER_AFTER_REGISTER_ENDPOINT)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -539,11 +539,14 @@ def create_app():
 | 
				
			|||||||
                    return self._do_login_user(user, safe_next_url, login_form.remember_me.data)
 | 
					                    return self._do_login_user(user, safe_next_url, login_form.remember_me.data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Render form
 | 
					            # Render form
 | 
				
			||||||
 | 
					            tos_db = Misc.query.filter_by(field_1='terms_of_service').first()
 | 
				
			||||||
 | 
					            print(Misc.query.filter_by(field_1='terms_of_service').first())
 | 
				
			||||||
            self.prepare_domain_translations()
 | 
					            self.prepare_domain_translations()
 | 
				
			||||||
            template_filename = self.USER_LOGIN_AUTH0_TEMPLATE if self.USER_ENABLE_AUTH0 else self.USER_LOGIN_TEMPLATE
 | 
					            template_filename = self.USER_LOGIN_AUTH0_TEMPLATE if self.USER_ENABLE_AUTH0 else self.USER_LOGIN_TEMPLATE
 | 
				
			||||||
            return render_template(template_filename,
 | 
					            return render_template(template_filename,
 | 
				
			||||||
                          form=login_form,
 | 
					                          form=login_form,
 | 
				
			||||||
                          login_form=login_form,
 | 
					                          login_form=login_form,
 | 
				
			||||||
 | 
					                          tos='hello there!',
 | 
				
			||||||
                          register_form=register_form)
 | 
					                          register_form=register_form)
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
    #user_manager = UserManager(app, db, User)
 | 
					    #user_manager = UserManager(app, db, User)
 | 
				
			||||||
@ -580,6 +583,12 @@ def create_app():
 | 
				
			|||||||
            time = datetime.datetime.utcnow()
 | 
					            time = datetime.datetime.utcnow()
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        db.session.add(flash_entry_add)
 | 
					        db.session.add(flash_entry_add)
 | 
				
			||||||
 | 
					        tos_entry_add = Misc(
 | 
				
			||||||
 | 
					            field_1 = 'terms_of_service',
 | 
				
			||||||
 | 
					            field_2 = '<strong>TOS</strong>',
 | 
				
			||||||
 | 
					            time = datetime.datetime.utcnow()
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        db.session.add(tos_entry_add)
 | 
				
			||||||
        db.session.commit()
 | 
					        db.session.commit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Query radioid.net for list of DMR IDs, then add to DB
 | 
					    # Query radioid.net for list of DMR IDs, then add to DB
 | 
				
			||||||
@ -732,26 +741,19 @@ def create_app():
 | 
				
			|||||||
        svr_content = ''
 | 
					        svr_content = ''
 | 
				
			||||||
        for i in sl:
 | 
					        for i in sl:
 | 
				
			||||||
            svr_content = svr_content + '''
 | 
					            svr_content = svr_content + '''
 | 
				
			||||||
<p> </p>
 | 
					<div class="panel panel-default">
 | 
				
			||||||
<table style="width: 200px; margin-left: auto; margin-right: auto;" border="1">
 | 
					  <div class="panel-heading" style="text-align: center;"><h3>''' + i.name + '''</h3></div>
 | 
				
			||||||
<tbody>
 | 
					  <div class="panel-body container-fluid center;">
 | 
				
			||||||
<tr>
 | 
					    <div style="max-width:200px; word-wrap:break-word; text-align: center;">''' + i.public_notes + '''</div>
 | 
				
			||||||
<td style="text-align: center;">
 | 
					    <p> </p>
 | 
				
			||||||
<h4>Server: <strong>''' + i.name + '''</strong></h4>
 | 
					    <a href="/talkgroups/''' + i.name + '''"><button type="button" class="btn btn-primary btn-block" >Available Talkgroups</button></a>
 | 
				
			||||||
</td>
 | 
					    <hr />
 | 
				
			||||||
</tr>
 | 
					    <a href="''' + i.dash_url + '''"><button  type="button" class="btn btn-success btn-block" >Dashboard</button></a>
 | 
				
			||||||
<td style="text-align: center;">
 | 
					
 | 
				
			||||||
 ''' + i.public_notes + '''
 | 
					  </div>
 | 
				
			||||||
</td>
 | 
					</div>
 | 
				
			||||||
</tr>
 | 
					
 | 
				
			||||||
<tr>
 | 
					
 | 
				
			||||||
<td style="text-align: center;"><a href="/talkgroups/''' + i.name + '''"><button type="button" class="btn btn-primary btn-block" >Available Talkgroups</button></a></td>
 | 
					 | 
				
			||||||
</tr>
 | 
					 | 
				
			||||||
<tr>
 | 
					 | 
				
			||||||
<td style="text-align: center;"><a href="''' + i.dash_url + '''"><button  type="button" class="btn btn-success btn-block" >Dashboard</button></a></td>
 | 
					 | 
				
			||||||
</tr>
 | 
					 | 
				
			||||||
</tbody>
 | 
					 | 
				
			||||||
</table>
 | 
					 | 
				
			||||||
'''
 | 
					'''
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            #content = Markup('<strong>The HTML String</strong>')
 | 
					            #content = Markup('<strong>The HTML String</strong>')
 | 
				
			||||||
@ -772,73 +774,54 @@ def create_app():
 | 
				
			|||||||
                    script_links[i[0]] = link_num
 | 
					                    script_links[i[0]] = link_num
 | 
				
			||||||
                    #print(script_links)
 | 
					                    #print(script_links)
 | 
				
			||||||
                    content = content + '''\n
 | 
					                    content = content + '''\n
 | 
				
			||||||
    <table style="width: 300px;" border="1">
 | 
					            <div class="panel panel-default" style="text-align: center;">
 | 
				
			||||||
    <tbody>
 | 
					  <div class="panel-heading"><h4>''' + str(i[0]) + '''</h4></div>
 | 
				
			||||||
    <tr>
 | 
					  <div class="panel-body" style="max-width:300px; word-wrap:break-word; text-align: center;">MMDVM Passphrase:
 | 
				
			||||||
    <td>
 | 
					  <pre><strong>''' + str(gen_passphrase(int(i[0]))) + '''</strong></pre>
 | 
				
			||||||
            <p style="text-align: center;">Your passphrase for <strong>''' + str(i[0]) + '''</strong>:</p>
 | 
					  <hr />
 | 
				
			||||||
            <p style="text-align: center;">Copy and paste: <strong>''' + str(gen_passphrase(int(i[0]))) + '''</strong></p>
 | 
					  <br />
 | 
				
			||||||
    <hr />
 | 
					  <p class="bg-warning"><em>''' + convert_nato(str(gen_passphrase(int(i[0])))) + '''</em></p>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
            <p style="text-align: center;">Phonetically spelled: <span style="text-decoration: underline;"><em>''' + convert_nato(str(gen_passphrase(int(i[0])))) + '''</em></span></p>
 | 
					</div>
 | 
				
			||||||
 | 
					 | 
				
			||||||
    </td>
 | 
					 | 
				
			||||||
    </tr>
 | 
					 | 
				
			||||||
    </tbody>
 | 
					 | 
				
			||||||
    </table>
 | 
					 | 
				
			||||||
            <p> </p>
 | 
					 | 
				
			||||||
        '''
 | 
					        '''
 | 
				
			||||||
                elif i[1] == 0:
 | 
					                elif i[1] == 0:
 | 
				
			||||||
                    link_num = str(random.randint(1,99999999)).zfill(8) + str(time.time()) + str(random.randint(1,99999999)).zfill(8)
 | 
					                    link_num = str(random.randint(1,99999999)).zfill(8) + str(time.time()) + str(random.randint(1,99999999)).zfill(8)
 | 
				
			||||||
                    script_links[i[0]] = link_num
 | 
					                    script_links[i[0]] = link_num
 | 
				
			||||||
                    #print(script_links)
 | 
					                    #print(script_links)
 | 
				
			||||||
                    content = content + '''\n
 | 
					                    content = content + '''\n
 | 
				
			||||||
    <table style="width: 300px;" border="1">
 | 
					<div class="panel panel-default" style="text-align: center;">
 | 
				
			||||||
    <tbody>
 | 
					  <div class="panel-heading"><h4>''' + str(i[0]) + '''</h4></div>
 | 
				
			||||||
    <tr>
 | 
					  <div class="panel-body" style="max-width:300px; word-wrap:break-word; text-align: center;">MMDVM Passphrase:
 | 
				
			||||||
    <td>
 | 
					  <pre><strong>''' + str(gen_passphrase(int(i[0]))) + '''</strong></pre>
 | 
				
			||||||
            <p style="text-align: center;">Your passphrase for <strong>''' + str(i[0]) + '''</strong>:</p>
 | 
					  <hr />
 | 
				
			||||||
            <p style="text-align: center;">Copy and paste: <strong>''' + str(gen_passphrase(int(i[0]))) + '''</strong></p>
 | 
					  <br />
 | 
				
			||||||
    <hr />
 | 
					  <p class="bg-warning"><em>''' + convert_nato(str(gen_passphrase(int(i[0])))) + '''</em></p>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
            <p style="text-align: center;">Phonetically spelled: <span style="text-decoration: underline;"><em>''' + convert_nato(str(gen_passphrase(int(i[0])))) + '''</em></span></p>
 | 
					</div>
 | 
				
			||||||
 | 
					 | 
				
			||||||
    </td>
 | 
					 | 
				
			||||||
    </tr>
 | 
					 | 
				
			||||||
    </tbody>
 | 
					 | 
				
			||||||
    </table>
 | 
					 | 
				
			||||||
            <p> </p>
 | 
					 | 
				
			||||||
        '''
 | 
					        '''
 | 
				
			||||||
                elif i[1] == '':
 | 
					                elif i[1] == '':
 | 
				
			||||||
                    content = content + '''
 | 
					                    content = content + '''
 | 
				
			||||||
    <table style="width: 300px;" border="1">
 | 
					<div class="panel panel-default" style="text-align: center;">
 | 
				
			||||||
    <tbody>
 | 
					  <div class="panel-heading"><h4>''' + str(i[0]) + '''</h4></div>
 | 
				
			||||||
    <tr>
 | 
					  <div class="panel-body" style="max-width:300px; word-wrap:break-word; text-align: center;">MMDVM Passphrase:
 | 
				
			||||||
    <td>
 | 
					  <pre><strong>''' + legacy_passphrase + '''</strong></pre>
 | 
				
			||||||
    <p style="text-align: center;">Your passphrase for <strong>''' + str(i[0]) + '''</strong>:</p>
 | 
					  <hr />
 | 
				
			||||||
    <p style="text-align: center;">Copy and paste: <strong>''' + legacy_passphrase + '''</strong></p>
 | 
					  <br />
 | 
				
			||||||
    <hr />
 | 
					  <p class="bg-warning"><em>''' + convert_nato(legacy_passphrase) + '''</em></p>
 | 
				
			||||||
    <p style="text-align: center;">Phonetically spelled: <span style="text-decoration: underline;"><em>''' + convert_nato(legacy_passphrase) + '''</em></span></p>
 | 
					  </div>
 | 
				
			||||||
    </td>
 | 
					</div>
 | 
				
			||||||
    </tr>
 | 
					            '''
 | 
				
			||||||
    </tbody>
 | 
					 | 
				
			||||||
    </table>
 | 
					 | 
				
			||||||
            <p> </p>'''
 | 
					 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    content = content + '''
 | 
					                    content = content + '''
 | 
				
			||||||
    <table style="width: 300px;" border="1">
 | 
					  <div class="panel panel-default" style="text-align: center;">
 | 
				
			||||||
    <tbody>
 | 
					  <div class="panel-heading"><h4>''' + str(i[0]) + '''</h4></div>
 | 
				
			||||||
    <tr>
 | 
					  <div class="panel-body" style="max-width:300px; word-wrap:break-word; text-align: center;">MMDVM Passphrase:
 | 
				
			||||||
    <td>
 | 
					  <pre><strong>''' + str(i[1]) + '''</strong></pre>
 | 
				
			||||||
    <p style="text-align: center;">Your passphrase for <strong>''' + str(i[0]) + '''</strong>:</p>
 | 
					  <hr />
 | 
				
			||||||
    <p style="text-align: center;">Copy and paste: <strong>''' + str(i[1]) + '''</strong></p>
 | 
					  <br />
 | 
				
			||||||
    <hr />
 | 
					  <p class="bg-warning"><em>''' + convert_nato(str(i[1])) + '''</em></p>
 | 
				
			||||||
    <p style="text-align: center;">Phonetically spelled: <span style="text-decoration: underline;"><em>''' + convert_nato(str(i[1])) + '''</em></span></p>
 | 
					  </div>
 | 
				
			||||||
    </td>
 | 
					</div>   
 | 
				
			||||||
    </tr>
 | 
					 | 
				
			||||||
    </tbody>
 | 
					 | 
				
			||||||
    </table>
 | 
					 | 
				
			||||||
            <p> </p>
 | 
					 | 
				
			||||||
    '''
 | 
					    '''
 | 
				
			||||||
            #content = content + '\n\n' + str(script_links[i[0]])
 | 
					            #content = content + '\n\n' + str(script_links[i[0]])
 | 
				
			||||||
        except:
 | 
					        except:
 | 
				
			||||||
 | 
				
			|||||||
@ -49,28 +49,5 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<p> </p>
 | 
					<p> </p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!-- Trigger the modal with a button -->
 | 
					 | 
				
			||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#terms">Terms of Use</button>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!-- TOS -->
 | 
					 | 
				
			||||||
<div id="terms" class="modal fade" role="dialog">
 | 
					 | 
				
			||||||
  <div class="modal-dialog">
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <!-- Modal content-->
 | 
					 | 
				
			||||||
    <div class="modal-content">
 | 
					 | 
				
			||||||
      <div class="modal-header">
 | 
					 | 
				
			||||||
        <button type="button" class="close" data-dismiss="modal">×</button>
 | 
					 | 
				
			||||||
        <h4 class="modal-title">Modal Header</h4>
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
      <div class="modal-body">
 | 
					 | 
				
			||||||
        <p>{{tos}}</p>
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
      <div class="modal-footer">
 | 
					 | 
				
			||||||
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  </div>
 | 
					 | 
				
			||||||
</div>
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
{% endblock %}
 | 
					{% endblock %}
 | 
				
			||||||
 | 
				
			|||||||
@ -2,9 +2,10 @@
 | 
				
			|||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
<p> </p><h4 style="text-align: center;"><a href="/generate_passphrase/pi-star">Click here</a> for automated Pi-Star script.</h4><p> </p>
 | 
					<p> </p><h4 style="text-align: center;"><a href="/generate_passphrase/pi-star">Click here</a> for automated Pi-Star script.</h4><p> </p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 <div class="row">
 | 
					<div class="row">
 | 
				
			||||||
  <div class="col-xs-4">{{server_content}}</div>
 | 
					  <div class="col-xs-6">{{server_content}}</div>
 | 
				
			||||||
  <div class="col-xs-8">{{passphrase_content}}</div>
 | 
					  <div class="col-xs-6">{{passphrase_content}}</div>
 | 
				
			||||||
</div> 
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<p> </p>
 | 
					<p> </p>
 | 
				
			||||||
{% endblock %}
 | 
					{% endblock %}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user