changing to context menu single edit/delete.

This commit is contained in:
Naomi Aro 2013-08-19 23:19:13 -04:00
parent 9b45b9dc72
commit 09693ef174
11 changed files with 609 additions and 311 deletions

View file

@ -1,3 +1,3 @@
<div id="configure_item_template" class="ui-widget ui-widget-content block-shadow alpha-block padded">
<div id="configure_item_template" class="ui-widget ui-widget-content block-shadow alpha-block padded-strong">
<?php echo $this->render('playouthistory/template-contents.phtml'); ?>
</div>

View file

@ -7,7 +7,6 @@
<li><a href="#his-tabs-2"><?php echo _("File Summary"); ?></a></li>
</ul>
<div id="his-tabs-1">
<div id="his_create"><?php echo _("Create Entry"); ?></div>
<table id="history_table_list" cellpadding="0" cellspacing="0" class="datatable"></table>
</div>
<div id="his-tabs-2">

View file

@ -1,57 +1,70 @@
<div>
<?php if (!in_array($this->template_id, $this->configured)): ?>
<button id="template_set_default" data-template="<?php echo $this->template_id; ?>">Set Default Template</button>
<?php endif; ?>
<button id="template_item_save" data-template="<?php echo $this->template_id; ?>">Save</button>
</div>
<?php if ($this->template_type == Application_Service_HistoryService::TEMPLATE_TYPE_FILE): ?>
<h4>Creating File Summary Template</h4>
<?php else: ?>
<h4>Creating Log Sheet Template</h4>
<?php endif; ?>
<div><label>Name<input id="template_name" type="text" value="<?php echo $this->template_name; ?>"></label></div>
<div class="template_name_wrap">
<label>
Name
<input id="template_name" type="text" value="<?php echo $this->template_name; ?>">
</label>
</div>
<?php $i = 0; ?>
<ul class="template_item_list">
<?php foreach ($this->template_fields as $field): ?>
<li id="<?php echo "field_".$i?>"
data-id="<?php echo isset($field["id"]) ? $field["id"] : ""; ?>"
<li id="<?php echo "field_".$i?>"
data-id="<?php echo isset($field["id"]) ? $field["id"] : ""; ?>"
data-name="<?php echo $field["name"]?>"
data-label="<?php echo $field["label"]?>"
data-type="<?php echo $field["type"]?>"
data-label="<?php echo $field["label"]?>"
data-type="<?php echo $field["type"]?>"
data-filemd="<?php echo var_export($field["isFileMd"], true)?>">
<span><?php echo $field["label"]?></span>
<span><?php echo $field["type"]?></span>
<?php if(!in_array($field["name"], $this->required_fields)): ?>
<span class="template_item_remove">Remove</span>
<span class="template_item_remove">
<i class="icon icon-trash"></i>
</span>
<?php endif; ?>
</li>
<?php $i++; ?>
<?php endforeach; ?>
</ul>
<p>Add more elements:</p>
<ul class="template_file_md">
<?php foreach ($this->fileMD as $md): ?>
<li id="<?php echo "md_".$md["name"]?>"
data-name="<?php echo $md["name"]?>"
<li id="<?php echo "md_".$md["name"]?>"
data-name="<?php echo $md["name"]?>"
data-type="<?php echo $md["type"]?>"
data-label="<?php echo $md["label"]?>">
<?php echo $md["label"] ?>
<a class="field_add" href="#"><i class="icon icon-plus"></i></a>
</li>
<?php endforeach; ?>
</ul>
<?php if ($this->template_type !== Application_Service_HistoryService::TEMPLATE_TYPE_FILE): ?>
<div class="template_item_add">
<div>Add New Field</div>
<div>
<input type="text">
<select>
<?php foreach ($this->fields as $field): ?>
<option value="<?php echo $field; ?>"><?php echo $field; ?></option>
<?php endforeach; ?>
</select>
<button>Add</button>
</div>
<input type="text" placeholder="Add New Field">
<select>
<?php foreach ($this->fields as $field): ?>
<option value="<?php echo $field; ?>"><?php echo $field; ?></option>
<?php endforeach; ?>
</select>
<button class="btn"><i class="icon-white icon-plus"></i> Add</button>
</div>
<?php endif; ?>
<div>
<?php if (!in_array($this->template_id, $this->configured)): ?>
<button id="template_set_default" data-template="<?php echo $this->template_id; ?>" class="btn">Set Default Template</button>
<?php endif; ?>
<button id="template_item_save" data-template="<?php echo $this->template_id; ?>" class="btn">Save</button>
</div>

View file

@ -1,7 +1,7 @@
<div id="history_template" class="ui-widget ui-widget-content block-shadow alpha-block padded">
<div id="history_template" class="ui-widget ui-widget-content block-shadow alpha-block padded-strong">
<div>
<div>Edit Log Sheet Template</div>
<div><h4>Log Sheet Templates</h4></div>
<ul id="template_list">
<?php if (count($this->template_list) == 0): ?>
<li>No Log Sheet Templates</li>
@ -12,19 +12,30 @@
<?php endif; ?>
<?php if (in_array($id, $this->configured)): ?>
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured">
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>"><?php echo $name; ?></a>
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>">
<?php echo $name; ?>
</a>
<i class="icon icon-ok"></i>
<?php else: ?>
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>">
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>"><?php echo $name; ?></a>
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistory/set-template-default/id/{$id}"); ?>">Set Default</a>
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistory/delete-template/id/{$id}"); ?>">Remove</a>
<?php endif; ?>
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>">
<?php echo $name; ?>
</a>
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistory/delete-template/id/{$id}"); ?>">
<i class="icon icon-trash"></i>
</a>
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistory/set-template-default/id/{$id}"); ?>">
Set Default
</a>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<button id="new_item_template" class="btn">New Log Sheet Template</button>
</div>
<br><br>
<div>
<div>Edit File Summary Template</div>
<div><h4>File Summary Templates</h4></div>
<ul id="template_file">
<?php if (count($this->template_file) == 0): ?>
<li>No File Summary Templates</li>
@ -32,17 +43,25 @@
<?php foreach ($this->template_file as $id=>$name): ?>
<?php if (in_array($id, $this->configured)): ?>
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured">
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>"><?php echo $name; ?></a>
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>">
<?php echo $name; ?>
</a>
<i class="icon icon-ok"></i>
<?php else: ?>
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>">
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>"><?php echo $name; ?></a>
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistory/set-template-default/id/{$id}"); ?>">Set Default</a>
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistory/delete-template/id/{$id}"); ?>">Remove</a>
<?php endif; ?>
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>">
<?php echo $name; ?>
</a>
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistory/delete-template/id/{$id}"); ?>">
<i class="icon icon-trash"></i>
</a>
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistory/set-template-default/id/{$id}"); ?>">
Set Default
</a>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<button id="new_file_template" class="btn">New File Summary Template</button>
</div>
<button id="new_item_template" class="btn">New Log Sheet Template</button>
<button id="new_file_template" class="btn">New File Summary Template</button>
</div>