convert more to bootstrap
This commit is contained in:
		
							parent
							
								
									98e7169f34
								
							
						
					
					
						commit
						95c71f7c87
					
				
							
								
								
									
										125
									
								
								web/app.py
									
									
									
									
									
								
							
							
						
						
									
										125
									
								
								web/app.py
									
									
									
									
									
								
							@ -539,11 +539,14 @@ def create_app():
 | 
			
		||||
                    return self._do_login_user(user, safe_next_url, login_form.remember_me.data)
 | 
			
		||||
 | 
			
		||||
            # 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()
 | 
			
		||||
            template_filename = self.USER_LOGIN_AUTH0_TEMPLATE if self.USER_ENABLE_AUTH0 else self.USER_LOGIN_TEMPLATE
 | 
			
		||||
            return render_template(template_filename,
 | 
			
		||||
                          form=login_form,
 | 
			
		||||
                          login_form=login_form,
 | 
			
		||||
                          tos='hello there!',
 | 
			
		||||
                          register_form=register_form)
 | 
			
		||||
   
 | 
			
		||||
    #user_manager = UserManager(app, db, User)
 | 
			
		||||
@ -580,6 +583,12 @@ def create_app():
 | 
			
		||||
            time = datetime.datetime.utcnow()
 | 
			
		||||
            )
 | 
			
		||||
        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()
 | 
			
		||||
 | 
			
		||||
    # Query radioid.net for list of DMR IDs, then add to DB
 | 
			
		||||
@ -732,26 +741,19 @@ def create_app():
 | 
			
		||||
        svr_content = ''
 | 
			
		||||
        for i in sl:
 | 
			
		||||
            svr_content = svr_content + '''
 | 
			
		||||
<div class="panel panel-default">
 | 
			
		||||
  <div class="panel-heading" style="text-align: center;"><h3>''' + i.name + '''</h3></div>
 | 
			
		||||
  <div class="panel-body container-fluid center;">
 | 
			
		||||
    <div style="max-width:200px; word-wrap:break-word; text-align: center;">''' + i.public_notes + '''</div>
 | 
			
		||||
    <p> </p>
 | 
			
		||||
<table style="width: 200px; margin-left: auto; margin-right: auto;" border="1">
 | 
			
		||||
<tbody>
 | 
			
		||||
<tr>
 | 
			
		||||
<td style="text-align: center;">
 | 
			
		||||
<h4>Server: <strong>''' + i.name + '''</strong></h4>
 | 
			
		||||
</td>
 | 
			
		||||
</tr>
 | 
			
		||||
<td style="text-align: center;">
 | 
			
		||||
 ''' + i.public_notes + '''
 | 
			
		||||
</td>
 | 
			
		||||
</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>
 | 
			
		||||
    <a href="/talkgroups/''' + i.name + '''"><button type="button" class="btn btn-primary btn-block" >Available Talkgroups</button></a>
 | 
			
		||||
    <hr />
 | 
			
		||||
    <a href="''' + i.dash_url + '''"><button  type="button" class="btn btn-success btn-block" >Dashboard</button></a>
 | 
			
		||||
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
'''
 | 
			
		||||
        try:
 | 
			
		||||
            #content = Markup('<strong>The HTML String</strong>')
 | 
			
		||||
@ -772,73 +774,54 @@ def create_app():
 | 
			
		||||
                    script_links[i[0]] = link_num
 | 
			
		||||
                    #print(script_links)
 | 
			
		||||
                    content = content + '''\n
 | 
			
		||||
    <table style="width: 300px;" border="1">
 | 
			
		||||
    <tbody>
 | 
			
		||||
    <tr>
 | 
			
		||||
    <td>
 | 
			
		||||
            <p style="text-align: center;">Your passphrase for <strong>''' + str(i[0]) + '''</strong>:</p>
 | 
			
		||||
            <p style="text-align: center;">Copy and paste: <strong>''' + str(gen_passphrase(int(i[0]))) + '''</strong></p>
 | 
			
		||||
            <div class="panel panel-default" style="text-align: center;">
 | 
			
		||||
  <div class="panel-heading"><h4>''' + str(i[0]) + '''</h4></div>
 | 
			
		||||
  <div class="panel-body" style="max-width:300px; word-wrap:break-word; text-align: center;">MMDVM Passphrase:
 | 
			
		||||
  <pre><strong>''' + str(gen_passphrase(int(i[0]))) + '''</strong></pre>
 | 
			
		||||
  <hr />
 | 
			
		||||
 | 
			
		||||
            <p style="text-align: center;">Phonetically spelled: <span style="text-decoration: underline;"><em>''' + convert_nato(str(gen_passphrase(int(i[0])))) + '''</em></span></p>
 | 
			
		||||
 | 
			
		||||
    </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    </tbody>
 | 
			
		||||
    </table>
 | 
			
		||||
            <p> </p>
 | 
			
		||||
  <br />
 | 
			
		||||
  <p class="bg-warning"><em>''' + convert_nato(str(gen_passphrase(int(i[0])))) + '''</em></p>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
        '''
 | 
			
		||||
                elif i[1] == 0:
 | 
			
		||||
                    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
 | 
			
		||||
                    #print(script_links)
 | 
			
		||||
                    content = content + '''\n
 | 
			
		||||
    <table style="width: 300px;" border="1">
 | 
			
		||||
    <tbody>
 | 
			
		||||
    <tr>
 | 
			
		||||
    <td>
 | 
			
		||||
            <p style="text-align: center;">Your passphrase for <strong>''' + str(i[0]) + '''</strong>:</p>
 | 
			
		||||
            <p style="text-align: center;">Copy and paste: <strong>''' + str(gen_passphrase(int(i[0]))) + '''</strong></p>
 | 
			
		||||
<div class="panel panel-default" style="text-align: center;">
 | 
			
		||||
  <div class="panel-heading"><h4>''' + str(i[0]) + '''</h4></div>
 | 
			
		||||
  <div class="panel-body" style="max-width:300px; word-wrap:break-word; text-align: center;">MMDVM Passphrase:
 | 
			
		||||
  <pre><strong>''' + str(gen_passphrase(int(i[0]))) + '''</strong></pre>
 | 
			
		||||
  <hr />
 | 
			
		||||
 | 
			
		||||
            <p style="text-align: center;">Phonetically spelled: <span style="text-decoration: underline;"><em>''' + convert_nato(str(gen_passphrase(int(i[0])))) + '''</em></span></p>
 | 
			
		||||
 | 
			
		||||
    </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    </tbody>
 | 
			
		||||
    </table>
 | 
			
		||||
            <p> </p>
 | 
			
		||||
  <br />
 | 
			
		||||
  <p class="bg-warning"><em>''' + convert_nato(str(gen_passphrase(int(i[0])))) + '''</em></p>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
        '''
 | 
			
		||||
                elif i[1] == '':
 | 
			
		||||
                    content = content + '''
 | 
			
		||||
    <table style="width: 300px;" border="1">
 | 
			
		||||
    <tbody>
 | 
			
		||||
    <tr>
 | 
			
		||||
    <td>
 | 
			
		||||
    <p style="text-align: center;">Your passphrase for <strong>''' + str(i[0]) + '''</strong>:</p>
 | 
			
		||||
    <p style="text-align: center;">Copy and paste: <strong>''' + legacy_passphrase + '''</strong></p>
 | 
			
		||||
<div class="panel panel-default" style="text-align: center;">
 | 
			
		||||
  <div class="panel-heading"><h4>''' + str(i[0]) + '''</h4></div>
 | 
			
		||||
  <div class="panel-body" style="max-width:300px; word-wrap:break-word; text-align: center;">MMDVM Passphrase:
 | 
			
		||||
  <pre><strong>''' + legacy_passphrase + '''</strong></pre>
 | 
			
		||||
  <hr />
 | 
			
		||||
    <p style="text-align: center;">Phonetically spelled: <span style="text-decoration: underline;"><em>''' + convert_nato(legacy_passphrase) + '''</em></span></p>
 | 
			
		||||
    </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    </tbody>
 | 
			
		||||
    </table>
 | 
			
		||||
            <p> </p>'''
 | 
			
		||||
  <br />
 | 
			
		||||
  <p class="bg-warning"><em>''' + convert_nato(legacy_passphrase) + '''</em></p>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
            '''
 | 
			
		||||
                else:
 | 
			
		||||
                    content = content + '''
 | 
			
		||||
    <table style="width: 300px;" border="1">
 | 
			
		||||
    <tbody>
 | 
			
		||||
    <tr>
 | 
			
		||||
    <td>
 | 
			
		||||
    <p style="text-align: center;">Your passphrase for <strong>''' + str(i[0]) + '''</strong>:</p>
 | 
			
		||||
    <p style="text-align: center;">Copy and paste: <strong>''' + str(i[1]) + '''</strong></p>
 | 
			
		||||
  <div class="panel panel-default" style="text-align: center;">
 | 
			
		||||
  <div class="panel-heading"><h4>''' + str(i[0]) + '''</h4></div>
 | 
			
		||||
  <div class="panel-body" style="max-width:300px; word-wrap:break-word; text-align: center;">MMDVM Passphrase:
 | 
			
		||||
  <pre><strong>''' + str(i[1]) + '''</strong></pre>
 | 
			
		||||
  <hr />
 | 
			
		||||
    <p style="text-align: center;">Phonetically spelled: <span style="text-decoration: underline;"><em>''' + convert_nato(str(i[1])) + '''</em></span></p>
 | 
			
		||||
    </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    </tbody>
 | 
			
		||||
    </table>
 | 
			
		||||
            <p> </p>
 | 
			
		||||
  <br />
 | 
			
		||||
  <p class="bg-warning"><em>''' + convert_nato(str(i[1])) + '''</em></p>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>   
 | 
			
		||||
    '''
 | 
			
		||||
            #content = content + '\n\n' + str(script_links[i[0]])
 | 
			
		||||
        except:
 | 
			
		||||
 | 
			
		||||
@ -49,28 +49,5 @@
 | 
			
		||||
 | 
			
		||||
<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 %}
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,9 @@
 | 
			
		||||
<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="col-xs-4">{{server_content}}</div>
 | 
			
		||||
  <div class="col-xs-8">{{passphrase_content}}</div>
 | 
			
		||||
  <div class="col-xs-6">{{server_content}}</div>
 | 
			
		||||
  <div class="col-xs-6">{{passphrase_content}}</div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user