add support page inside odex25_website module

This commit is contained in:
MohamedGad100 2024-09-01 15:36:51 +03:00
parent ebc1e10e78
commit f9f1e36bed
12 changed files with 4566 additions and 1 deletions

View File

@ -0,0 +1 @@
from . import controllers

View File

@ -10,7 +10,8 @@ This module overrides community website features and introduces odex25 look and
""",
'depends': ['website'],
'data': [
'views/odex25_website_templates.xml'
'views/odex25_website_templates.xml',
'views/support.xml',
],
'installable': True,
'auto_install': True,

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import controllers

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from odoo import http
class OdexSupport(http.Controller):
@http.route('/support', type='http', auth='public', website=True)
def support(self, **kw):
return http.request.render("odex25_website.support")

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -0,0 +1,34 @@
$(document).ready(function () {
var addFileInputButton = document.getElementById('add-file-input');
if (addFileInputButton) {
addFileInputButton.addEventListener('click', function(e) {
e.preventDefault();
var addAnotherAttachment = document.getElementById('file-input-container');
var wrapper = document.createElement('div');
wrapper.classList.add('attachment-wrapper');
var newInput = document.createElement('input');
newInput.type = 'file';
newInput.name = 'attachments[]';
var deleteButton = document.createElement('button');
deleteButton.textContent = 'X';
deleteButton.classList.add('delete-button');
deleteButton.type = 'button';
deleteButton.addEventListener('click', function() {
wrapper.remove();
});
wrapper.appendChild(newInput);
wrapper.appendChild(deleteButton);
addAnotherAttachment.insertBefore(wrapper, this);
});
} else {
console.error("The 'add-file-input' element does not exist in the DOM.");
}
});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,9 @@
<template id="assets_frontend" inherit_id="website.assets_frontend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/scss" href="/odex25_website/static/src/scss/odex25_website.scss"/>
<link rel="stylesheet" href="/odex25_website/static/src/scss/support.css" />
<script type="text/javascript" src="/odex25_website/static/src/js/odex25_website.js"></script>
<script type="text/javascript" src="/odex25_website/static/src/js/support.js"></script>
</xpath>
</template>

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="support" name="support">
<t t-call="website.layout">
<div class="oe_structure"/>
<div id="wrap">
<div class="support-banner">
<img src="/odex25_website/static/img/support_banner.jpg" alt=""/>
<h1>Get Some Help</h1>
</div>
<div class="support-form-container">
<form id="support-form" action="">
<div class="form-row">
<label for="">Your Name</label>
<div class="input-container">
<input type="text"/>
</div>
</div>
<div class="form-row">
<label for="email">Your Email</label>
<div class="input-container">
<input type="email" name="email" id=""/>
</div>
</div>
<div class="form-row">
<label for="phone">Your Phone</label>
<div class="input-container">
<input type="tel" name="phone" id=""/>
</div>
</div>
<div class="form-row">
<label for="url">System URL</label>
<div class="input-container">
<input type="url" name="url" id=""/>
</div>
</div>
<div class="form-row">
<label for="">Database Name</label>
<div class="input-container">
<input type="text"/>
</div>
</div>
<div class="form-row align-top small-devices">
<label for="">Ticket Type (Question - Issue/Error)</label>
<div class="questions-container">
<label for="questions1">
<input type="radio" id="questions1" name="ticket-type" checked=""/>
<p>Question 1</p>
</label>
<label for="questions2">
<input type="radio" id="questions2" name="ticket-type" checked=""/>
<p>Question 2</p>
</label>
<label for="questions3">
<input type="radio" id="questions3" name="ticket-type" checked=""/>
<p>Question 3</p>
</label>
<label for="questions4">
<input type="radio" id="questions4" name="ticket-type" checked=""/>
<p>Question 4</p>
</label>
<label for="questions5">
<input type="radio" id="questions5" name="ticket-type" checked=""/>
<p>Question 5</p>
</label>
</div>
</div>
<div class="form-row">
<label for="">Subject</label>
<div class="input-container">
<input type="text"/>
</div>
</div>
<div class="form-row align-top">
<label for="">Details</label>
<div class="input-container">
<textarea name="" id=""></textarea>
</div>
</div>
<div class="form-row align-top">
<label for="">Attachments</label>
<div class="input-container" id="file-input-container">
<input type="file" name="attachments[]" id="file-input-1"/>
<a href="#" id="add-file-input"><img src="/odex25_website/static/img/add.png" alt=""/> Add More Attachments</a>
</div>
</div>
<div class="form-row">
<button type="submit" id="support-submit">Submit</button>
</div>
</form>
</div>
</div>
</t>
</template>
</odoo>