Merge pull request #4406 from expsa/revert-4375-eltayar
Revert "enhance_hijri_date3"
This commit is contained in:
commit
9cd4e64fd9
|
|
@ -126,18 +126,32 @@ odoo.define('web_hijri_datepicker.datepicker', function (require) {
|
|||
var parsed_date = this.value ? this.datewidget._parseDate(this.value) : '';
|
||||
var hijri_value = parsed_date ? this.datewidget._convertGregorianToHijri(parsed_date) : '';
|
||||
|
||||
// Gregorian Date
|
||||
// Original Gregorian date (unchanged)
|
||||
$('<div>', {
|
||||
class: this.$el.attr('class'),
|
||||
text: value,
|
||||
}).appendTo($div);
|
||||
|
||||
// Hijri Date with simple display
|
||||
// Hijri date with label layout
|
||||
var $hijriContainer = $('<div>', {
|
||||
class: 'o_hijri_readonly_container'
|
||||
});
|
||||
|
||||
var $hijriRow = $('<div>', {
|
||||
class: 'o_hijri_readonly_row'
|
||||
}).appendTo($hijriContainer);
|
||||
|
||||
$('<div>', {
|
||||
class: this.$el.attr('class') + ' mt-1',
|
||||
text: hijri_value ? 'التاريخ الهجري: ' + hijri_value : '',
|
||||
style: 'font-size: 12px; color: #6c757d;'
|
||||
}).appendTo($div);
|
||||
class: 'o_hijri_readonly_label',
|
||||
text: 'التاريخ الهجري:'
|
||||
}).appendTo($hijriRow);
|
||||
|
||||
$('<div>', {
|
||||
class: 'o_hijri_readonly_value ' + this.$el.attr('class'),
|
||||
text: hijri_value,
|
||||
}).appendTo($hijriRow);
|
||||
|
||||
$hijriContainer.appendTo($div);
|
||||
|
||||
this.datewidget.appendTo('<div>').then(function () {
|
||||
self._replaceElement($div);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,126 @@
|
|||
.o_datepicker {
|
||||
.o_datepicker_button {
|
||||
&.o_hijri_datepicker_button {
|
||||
top: 30px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
// Hijri field container
|
||||
.o_hijri_field_container {
|
||||
margin-top: 8px;
|
||||
|
||||
.o_hijri_field_row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.o_hijri_label_container {
|
||||
min-width: 120px;
|
||||
padding-right: 8px;
|
||||
text-align: right;
|
||||
|
||||
.o_hijri_label {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
color: #495057;
|
||||
margin-bottom: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.o_hijri_input_container {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
|
||||
.o_hijri {
|
||||
width: 100%;
|
||||
padding-right: 30px; // مساحة للزرار
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Form view specific styles
|
||||
.o_form_view {
|
||||
.o_datepicker {
|
||||
.o_hijri_field_container {
|
||||
.o_hijri_field_row {
|
||||
.o_hijri_label_container {
|
||||
min-width: 140px; // عرض أكبر في الفورم
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Readonly mode styles for hijri field
|
||||
.o_hijri_readonly_container {
|
||||
margin-top: 8px;
|
||||
|
||||
.o_hijri_readonly_row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.o_hijri_readonly_label {
|
||||
min-width: 120px;
|
||||
padding-right: 8px;
|
||||
text-align: right;
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
color: #495057;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.o_hijri_readonly_value {
|
||||
flex: 1;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Form view readonly specific styles
|
||||
.o_form_view {
|
||||
.o_hijri_readonly_container {
|
||||
.o_hijri_readonly_row {
|
||||
.o_hijri_readonly_label {
|
||||
min-width: 140px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Responsive adjustments
|
||||
@media (max-width: 768px) {
|
||||
.o_datepicker {
|
||||
.o_hijri_field_container {
|
||||
.o_hijri_field_row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
||||
.o_hijri_label_container {
|
||||
min-width: auto;
|
||||
text-align: right;
|
||||
padding-right: 0;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.o_hijri_readonly_container {
|
||||
.o_hijri_readonly_row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
||||
.o_hijri_readonly_label {
|
||||
min-width: auto;
|
||||
text-align: right;
|
||||
padding-right: 0;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,22 +3,31 @@
|
|||
<t t-name="web.datepicker" t-extend="web.datepicker">
|
||||
<t t-jquery=".o_datepicker" t-operation="replace">
|
||||
<div class="o_datepicker" aria-atomic="true" t-att-id="datepickerID" data-target-input="nearest">
|
||||
<!-- الحقل الميلادي -->
|
||||
<!-- الحقل الميلادي العادي بدون تغيير -->
|
||||
<input type="text"
|
||||
class="o_datepicker_input o_input datetimepicker-input"
|
||||
t-att-name="widget.name"
|
||||
t-att-placeholder="'التاريخ الميلادي'"
|
||||
t-att-placeholder="placeholder"
|
||||
t-attf-data-target="##{datepickerID}"
|
||||
autocomplete="off"/>
|
||||
<span class="o_datepicker_button"/>
|
||||
|
||||
<!-- الحقل الهجري -->
|
||||
<input type="text"
|
||||
class="o_hijri o_input mt-2"
|
||||
t-att-name="widget.name"
|
||||
t-att-placeholder="'التاريخ الهجري'"
|
||||
readonly="readonly"/>
|
||||
<span class="o_datepicker_button o_hijri_datepicker_button"/>
|
||||
<!-- محاكاة شكل الحقل العادي للهجري -->
|
||||
<div class="o_hijri_field_container">
|
||||
<div class="o_hijri_field_row">
|
||||
<div class="o_hijri_label_container">
|
||||
<label class="o_form_label o_hijri_label">التاريخ الهجري:</label>
|
||||
</div>
|
||||
<div class="o_hijri_input_container">
|
||||
<input type="text"
|
||||
class="o_hijri o_input"
|
||||
t-att-name="widget.name"
|
||||
t-att-placeholder="'التاريخ الهجري'"
|
||||
readonly="readonly"/>
|
||||
<span class="o_datepicker_button o_hijri_datepicker_button"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
|
|
|
|||
Loading…
Reference in New Issue