Skip to content

Commit

Permalink
less javascript, more htmx
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalfox committed Nov 10, 2024
1 parent 05bbea8 commit 8b078db
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 37 deletions.
14 changes: 2 additions & 12 deletions templates/billing/bill_review.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,7 @@ <h2 class="mt-3">{% trans "Recent leads without bill" %}</h2>
{% endif %}

<div class="row my-2">
<div id="outstanding_billing_graph_content" class="col-lg-12"></div>
<script type="text/javascript">
$(document).ready(function() {
$('#outstanding_billing_graph_content').load("{% url 'billing:graph_outstanding_billing' %}?{{ scope_current_filter }}")
});
</script>
<div hx-get="{% url 'billing:graph_outstanding_billing' %}?{{ scope_current_filter }}" hx-trigger="load" class="col-lg-12"><div class="loader m-3"></div></div>
<div hx-get="{% url 'billing:graph_billing' %}?{{ scope_current_filter }}" hx-trigger="load" class="my-2"><div class="loader m-3"></div></div>
</div>

<div id="graph_billing_content" class="my-2"></div>
<script type="text/javascript">
$('#graph_billing_content').load('{% url 'billing:graph_billing' %}?{{ scope_current_filter }}')
</script>

{% endblock %}
7 changes: 1 addition & 6 deletions templates/crm/clientcompany_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,7 @@ <h5><div class="text-center">{% trans "Overall won lead rate: " %}{{ overall_won

<div class="row mt-4">
<div class="col-12">
<div id="graph_company_business_activity_content"></div>
<script type="text/javascript">
$(document).ready(function() {
$('#graph_company_business_activity_content').load('{% url 'crm:graph_company_business_activity' company.id %}?{{scope_current_filter}}');
});
</script>
<div hx-get="{% url 'crm:graph_company_business_activity' company.id %}?{{scope_current_filter}}" hx-trigger="load"><div class="loader m-3"></div></div>
</div>
</div>
</div> <!-- end of dashboard tab -->
Expand Down
11 changes: 4 additions & 7 deletions templates/people/consultant_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,13 @@ <h3 class="pydici-block-title">{% trans "Current leads as resource" %}</h3>
</div>
{% endif %}


<div id="consultant_rate_graph_content" class="col-12"></div>
<script type="text/javascript">
$(document).ready(function() {
$('#consultant_rate_graph_content').load("{% url 'staffing:graph_consultant_rates' consultant.id %}")
});
</script>
<div hx-get="{% url 'staffing:graph_consultant_rates' consultant.id %}" hx-trigger="load" class="col-12"><div class="loader m-3"></div></div>

</div> <!-- end of row -->

<script type="text/javascript">
$(document).ready(function() { htmx.process(document.body); });

function displayConsultantGraph () {
var chart_timesheet = bb.generate({
bindto: '#consultant_timesheet_status',
Expand Down
14 changes: 2 additions & 12 deletions templates/staffing/prod_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,10 @@ <h2 class="mx-3 align-self-center my-0">{% trans "Staff production" %}</h2>
<div class="row">
<div class="col-lg-12">
<h2>{% trans "Production rates and daily rates review" %}</h2>

<div id="graph_timesheet_rates_bar_content"></div>
<script type="text/javascript">
$('#graph_timesheet_rates_bar_content').load('{% url 'staffing:graph_timesheet_rates_bar' %}/{{team_current_url_filter}}?{{scope_current_filter}}')
</script>
<div hx-get="{% url 'staffing:graph_timesheet_rates_bar' %}/{{team_current_url_filter}}?{{scope_current_filter}}" hx-trigger="load"><div class="loader m-3"></div></div>
</div>
</div>

<div class="row">
<div class="col-lg-12">
<div id="graph_profile_rates_content"></div>
<script type="text/javascript">
$('#graph_profile_rates_content').load('{% url 'staffing:graph_profile_rates' %}/{{team_current_url_filter}}?{{scope_current_filter}}')
</script>
<div hx-get="{% url 'staffing:graph_profile_rates' %}/{{team_current_url_filter}}?{{scope_current_filter}}" hx-trigger="load"><div class="loader m-3"></div></div>
</div>
</div>

Expand Down

0 comments on commit 8b078db

Please sign in to comment.