Skip to content

Instantly share code, notes, and snippets.

@ichaykin
Last active May 13, 2021 11:57
Show Gist options
  • Save ichaykin/83279408623849a49b92eeb391c1522e to your computer and use it in GitHub Desktop.
Save ichaykin/83279408623849a49b92eeb391c1522e to your computer and use it in GitHub Desktop.
diff --git a/1.tpl b/1.tpl
new file mode 100644
index 0000000000..10745f4ca7
--- /dev/null
+++ b/1.tpl
@@ -0,0 +1,65 @@
+{capture name="mainbox"}
+
+ <form action="{""|fn_url}" method="post" id="states_form" name="states_form">
+ {include file="common/pagination.tpl" save_current_page=true save_current_url=true}
+
+ {if $states}
+ {capture name="states_table"}
+ <div class="table-responsive-wrapper longtap-selection">
+ <table width="100%" class="table table-middle table--relative table-responsive state-table">
+ <thead
+ data-ca-bulkedit-default-object
+ data-ca-bulkedit-component
+ >
+ <tr>
+ <th width="6%" class="mobile-hide">
+ {include file="common/check_items.tpl" check_statuses=$state_statuses}
+
+ <input type="checkbox"
+ class="bulkedit-toggler hide"
+ data-ca-bulkedit-disable="[data-ca-bulkedit-default-object]"
+ data-ca-bulkedit-enable="[data-ca-bulkedit-expanded-object]"
+ />
+ </th>
+ <th width="10%">{__("code")}</th>
+ <th>{__("state")}</th>
+ </tr>
+ </thead>
+ {foreach $states as $state}
+ <tr class="cm-row-status-{$state.status|lower} cm-longtap-target"
+ data-ca-longtap-action="setCheckBox"
+ data-ca-longtap-target="input.cm-item"
+ data-ca-id="{$state.state_id}"
+ >
+ <td width="6%" class="mobile-hide">
+ <input type="checkbox" name="state_ids[]" value="{$state.state_id}" class="cm-item cm-item-status-{$state.status|lower} hide" />
+ </td>
+ <td width="10%" class="left nowrap row-status" data-th="{__("code")}">
+ <span>{$state.code}</span>
+ </td>
+ <td data-th="{__("state")}">
+ <input type="text" name="states[{$state.state_id}][state]" size="55" value="{$state.state}" class="input-hidden"/>
+ </td>
+ </tr>
+ {/foreach}
+ </table>
+ </div>
+ {/capture}
+
+ {include file="common/context_menu_wrapper.tpl"
+ form="states_form"
+ object="states"
+ items=$smarty.capture.states_table
+ }
+ {else}
+ <p class="no-items">{__("no_data")}</p>
+ {/if}
+
+ {include file="common/pagination.tpl"}
+ </form>
+
+ {capture name="buttons"}
+ {capture name="tools_list"}
+ {hook name="states:manage_tools_list"}
+ {/hook}
+ {/capture}
+ {dropdown content=$smarty.capture.tools_list}
+
+ {if $states}
+ {include file="buttons/save.tpl" but_name="dispatch[states.m_update]" but_role="action" but_target_form="states_form" but_meta="cm-submit"}
+ {/if}
+ {/capture}
+
+ {capture name="adv_buttons"}
+ {include file="common/popupbox.tpl" id="new_state" action="states.add" text=$title content=$smarty.capture.add_new_picker title=__("add_state") act="general" icon="icon-plus"}
+ {/capture}
+
+{/capture}
+
+{include file="common/mainbox.tpl"
+ title=__("states")
+ content=$smarty.capture.mainbox
+ adv_buttons=$smarty.capture.adv_buttons
+ buttons=$smarty.capture.buttons
+ select_languages=true
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment