gamingflexer commited on
Commit
ac0902f
·
1 Parent(s): 3559258

html pages updated

Browse files
src/app/api/templates/edit_product.html CHANGED
@@ -1,44 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Edit Product</title>
7
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
8
- </head>
9
- <body>
10
- <header>
11
- <nav class="navbar navbar-expand-lg navbar-light bg-light">
12
- <div class="container">
13
- <a class="navbar-brand" href="{% url 'index' %}">Catalogue</a>
14
- </div>
15
- </nav>
16
- </header>
17
- <div class="container mt-5">
18
- <h1 class="text-center">Edit Product</h1>
19
- <form method="post">
20
- {% csrf_token %}
21
- <div class="form-group">
22
- <label for="barcode">Barcode:</label>
23
- <input type="text" class="form-control" id="barcode" name="barcode" value="{{ product.barcode }}">
24
- </div>
25
- <div class="form-group">
26
- <label for="brand">Brand:</label>
27
- <input type="text" class="form-control" id="brand" name="brand" value="{{ product.brand }}">
28
- </div>
29
- <div class="form-group">
30
- <label for="sub_brand">Sub Brand:</label>
31
- <input type="text" class="form-control" id="sub_brand" name="sub_brand" value="{{ product.sub_brand }}">
32
- </div>
33
- <div class="form-group">
34
- <label for="manufacturer">Manufacturer:</label>
35
- <input type="text" class="form-control" id="manufacturer" name="manufacturer" value="{{ product.manufacturer }}">
36
- </div>
37
- <!-- Add similar form fields for other attributes -->
38
- <div class="text-center">
39
- <button type="submit" class="btn btn-primary">Save</button>
40
- </div>
41
- </form>
42
- </div>
43
- </body>
44
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/app/api/templates/edit_voice_product.html CHANGED
@@ -1,90 +1,46 @@
1
- <!-- edit_voice_product.html -->
2
-
3
  <!DOCTYPE html>
4
  <html lang="en">
5
  <head>
6
- <meta charset="UTF-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
- <title>Edit Voice Product</title>
9
- <!-- Include necessary CSS or stylesheets -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  </head>
 
 
 
 
 
 
 
11
  <body>
12
- <h1>Edit Voice Product</h1>
13
-
14
- <div id="recording-status"></div>
15
- <button id="record-button">Start Recording</button>
16
-
17
- <form id="voice-form" method="post" enctype="multipart/form-data">
18
- {% csrf_token %}
19
- <input type="file" id="voice-file" name="voice_file" style="display: none;">
20
- <button type="submit" id="submit-button" style="display: none;">Submit</button>
21
- </form>
22
-
23
- <!-- Include necessary JavaScript -->
24
- <script>
25
- const recordButton = document.getElementById('record-button');
26
- const recordingStatus = document.getElementById('recording-status');
27
- const voiceForm = document.getElementById('voice-form');
28
- const voiceFileInput = document.getElementById('voice-file');
29
- const submitButton = document.getElementById('submit-button');
30
- let mediaRecorder;
31
- let chunks = [];
32
-
33
- recordButton.addEventListener('click', async () => {
34
- if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
35
- try {
36
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
37
- startRecording(stream);
38
- } catch (error) {
39
- console.error('Error accessing microphone:', error);
40
- }
41
- } else {
42
- console.error('getUserMedia not supported on your browser');
43
- }
44
- });
45
-
46
- function startRecording(stream) {
47
- mediaRecorder = new MediaRecorder(stream);
48
- mediaRecorder.ondataavailable = handleDataAvailable;
49
- mediaRecorder.start();
50
- recordingStatus.innerText = 'Recording...';
51
- recordingStatus.style.color = 'red';
52
- recordButton.disabled = true;
53
- }
54
-
55
- function handleDataAvailable(event) {
56
- chunks.push(event.data);
57
- }
58
 
59
- mediaRecorder.onstop = async () => {
60
- const blob = new Blob(chunks, { 'type' : 'audio/ogg; codecs=opus' });
61
- chunks = [];
62
- const formData = new FormData();
63
- formData.append('voice_file', blob);
64
- try {
65
- const response = await fetch('/edit-voice-product/', {
66
- method: 'POST',
67
- body: formData,
68
- });
69
- if (response.ok) {
70
- console.log('Voice file submitted successfully');
71
- // Optionally, you can redirect or show a success message
72
- } else {
73
- console.error('Failed to submit voice file');
74
- }
75
- } catch (error) {
76
- console.error('Error submitting voice file:', error);
77
- }
78
- };
79
-
80
- mediaRecorder.onpause = () => {
81
- recordingStatus.innerText = 'Recording paused';
82
- recordingStatus.style.color = 'grey';
83
- };
84
-
85
- voiceForm.addEventListener('submit', () => {
86
- mediaRecorder.stop();
87
- });
88
- </script>
89
  </body>
90
  </html>
 
 
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
  <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>{{ product.product_name }}</title>
7
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
8
+ <style>
9
+ /* Custom styles */
10
+ .product-title {
11
+ font-size: 24px;
12
+ font-weight: bold;
13
+ margin-bottom: 20px;
14
+ }
15
+ .carousel-item img {
16
+ border: 2px solid #ccc;
17
+ border-radius: 5px;
18
+ }
19
+ .product-details p {
20
+ margin-bottom: 5px;
21
+ }
22
+ .edit-btn {
23
+ margin-top: 20px;
24
+ }
25
+ </style>
26
  </head>
27
+ <header>
28
+ <nav class="navbar navbar-expand-lg navbar-light bg-light">
29
+ <div class="container">
30
+ <a class="navbar-brand" href="{% url 'index' %}">Catalogue</a>
31
+ </div>
32
+ </nav>
33
+ </header>
34
  <body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
+ <head>
37
+ <meta charset="UTF-8">
38
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
39
+ <title>Your Title Here</title>
40
+ <!-- Include Gradio JS library -->
41
+ <script type="module" src="https://gradio.s3-us-west-2.amazonaws.com/4.12.0/gradio.js"></script>
42
+ </head>
43
+ <body>
44
+ <gradio-app src="http://34.122.223.224:9003/"></gradio-app>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  </body>
46
  </html>
src/app/api/templates/record.html CHANGED
@@ -1,6 +1,3 @@
1
- <!--inherits the layout-->
2
- {% extends '_base.html' %}
3
- <!--static-->
4
  {% load static %}
5
  <!--title-->
6
  {% block title %}{{page_title}}{% endblock title %}
 
 
 
 
1
  {% load static %}
2
  <!--title-->
3
  {% block title %}{{page_title}}{% endblock title %}
src/app/api/templates/record_detail.html CHANGED
@@ -1,6 +1,3 @@
1
- <!--inherits the layout-->
2
- {% extends '_base.html' %}
3
- <!--static-->
4
  {% load static %}
5
  <!--title-->
6
  {% block title %}{{page_title}}{% endblock title %}
 
 
 
 
1
  {% load static %}
2
  <!--title-->
3
  {% block title %}{{page_title}}{% endblock title %}