Update ui to use bootstrap ui in more places

This commit is contained in:
2012-01-15 14:23:47 +00:00
parent c14fdcd2e3
commit 56d499b1aa
23 changed files with 221 additions and 272 deletions

View File

@@ -32,7 +32,7 @@ try {
} break;
case 'hash': {
$type = Sihnon_Config::TYPE_HASH;
$value = array();
$value = array('' => '');
} break;
}

View File

@@ -11,7 +11,14 @@ if ($req->exists('submit')) {
// Update the recently used list
$recent_output_directories = $config->get('rips.output_directories.recent');
if ( ! in_array($_POST['rip-options']['output-directory'], $recent_output_directories)) {
if (( $key = array_search($_POST['rip-options']['output-directory'], $recent_output_directories, true))) {
// Move the entry to the top of the recently used list if necessary
$recent_directory = array_splice($recent_output_directories, $key, 1);
if ($key > 0) {
array_unshift($recent_output_directories, $recent_directory[0]);
$config->set('rips.output_directories.recent', array_slice($recent_output_directories, 0, $config->get('rips.output_directories.recent_limit', 10)));
}
} else {
array_unshift($recent_output_directories, $_POST['rip-options']['output-directory']);
$config->set('rips.output_directories.recent', array_slice($recent_output_directories, 0, $config->get('rips.output_directories.recent_limit', 10)));
}

View File

@@ -1,28 +0,0 @@
<?php
$main = RippingCluster_Main::instance();
$req = $main->request();
$config = $main->config();
// Grab the name of this source
$encoded_filename = null;
if ($req->exists('confirm')) {
$plugin = $req->get('plugin', 'RippingCluster_Exception_InvalidParameters');
$encoded_filename = $req->get('id', 'RippingCluster_Exception_InvalidParameters');
$source = RippingCluster_Source_PluginFactory::loadEncoded($plugin, $encoded_filename, false);
$source->delete();
// Redirect back to the sources page
RippingCluster_Page::redirect('rips/sources');
} else {
$plugin = $req->get('plugin', 'RippingCluster_Exception_InvalidParameters');
$encoded_filename = $req->get('id', 'RippingCluster_Exception_InvalidParameters');
$source = RippingCluster_Source_PluginFactory::loadEncoded($plugin, $encoded_filename, false);
$this->smarty->assign('source', $source);
}
?>

View File

@@ -17,8 +17,8 @@
<tfoot>
<tr>
<td colspan="2">
<input type="button" id="settings_save" name="save" value="Save" />
<input type="button" id="settings_new" name="new_setting" value="New Setting" />
<button id="settings_save" class="btn primary" name="save">Save</button>
<button id="settings_new" class="btn" name="new_setting">New Setting</button>
</td>
</tr>
</tfoot>

View File

@@ -1,10 +1,10 @@
"page_replacements": {
"dialogheadertitle": {
"dialog-header-title": {
"content": "Add Setting"
},
"dialogcontent": {
"dialog-body": {
{include file="fragments/new-setting-dialog.tpl" assign=new_setting_dialog_content}
"content": {$new_setting_dialog_content|json_encode}
}

View File

@@ -14,11 +14,11 @@
"success": {$success|json_encode}
{else}
"page_replacements": {
"dialogheadertitle": {
"dialog-header-title": {
"content": "Rename Setting"
},
"dialogcontent": {
"dialog-body": {
{include file="fragments/rename-setting-dialog.tpl" assign="content"}
"content": {$content|json_encode}
}

View File

@@ -6,11 +6,11 @@
"content": {$sources_html|json_encode}
}
{else}
"dialogheadertitle": {
"content": "Delete Source"
"dialog-header-title": {
"content": "Delete this source?"
},
"dialogcontent": {
"dialog-body": {
{include file="fragments/delete-source.tpl" assign="delete_source_html"}
"content": {$delete_source_html|json_encode}
}

View File

@@ -1,10 +1,10 @@
"page_replacements": {
"dialogheadertitle": {
"content": "Update Settings"
"dialog-header-title": {
"content": "Settings updated"
},
"dialogcontent": {
"dialog-body": {
{include file="fragments/update-settings-dialog.tpl" assign=dialog_content}
"content": {$dialog_content|json_encode}
}

View File

@@ -1,9 +1,11 @@
<tr id="setting_{$id}_row">
<td>
<p>
{$name}<br />
<input type="button" id="setting_{$id}_rename" value="Rename" onclick="rc.settings.rename_setting('{$id}', '{$name}');" />
<input type="button" id="setting_{$id}_remove" value="Remove" onclick="rc.settings.remove_setting('{$id}', '{$name}');" />
<strong>{$name}</strong>
</p>
<p>
<button id="setting_{$id}_rename" class="btn" onclick="rc.settings.rename_setting('{$id}', '{$name}');">Rename</button>
<button id="setting_{$id}_remove" class="btn" onclick="rc.settings.remove_setting('{$id}', '{$name}');">Remove</button>
</p>
</td>
<td>

View File

@@ -3,38 +3,40 @@
<input type="checkbox" id="setting_{$id}" name="{$id}" value="1" {if $value}checked="checked" {/if} class="setting" />
{/case}
{case Sihnon_Config::TYPE_INT}
<input type="text" id="setting_{$id}" name="{$id}" value="{$value}" class="setting settings_field_numeric" />
<input type="text" id="setting_{$id}" name="{$id}" value="{$value}" class="small setting settings_field_numeric" />
{/case}
{case Sihnon_Config::TYPE_STRING}
<input type="text" id="setting_{$id}" name="{$id}" value="{$value}" class="setting settings_field_string" />
<input type="text" id="setting_{$id}" name="{$id}" value="{$value}" class="xxlarge setting settings_field_string" />
{/case}
{case Sihnon_Config::TYPE_STRING_LIST}
<div id="container_{$id}">
{foreach from=$value item=line name=settings}
<div id="settings_{$id}_line{$smarty.foreach.settings.iteration}">
<input type="text" name="{$id}[]" value="{$line}" class="setting settings_field_string" />
<input type="button" value="-" class="settings_field_remove" onclick="rc.settings.remove_stringlist_field('{$id}', '{$smarty.foreach.settings.iteration}')" />
<input type="text" name="{$id}[]" value="{$line}" class="xxlarge setting settings_field_string" />
<button class="btn small settings_field_remove" onclick="rc.settings.remove_stringlist_field('{$id}', '{$smarty.foreach.settings.iteration}')">-</button>
</div>
{/foreach}
</div>
<div class="settings_addfieldcontainer">
<input type="hidden" id="settings_{$id}_next" value="{$smarty.foreach.settings.iteration+1}" />
<input type="button" value="+" class="settings_field_add" onclick="rc.settings.add_stringlist_field('{$id}')" />
<button class="btn small settings_field_add" onclick="rc.settings.add_stringlist_field('{$id}')">+</button>
</div>
{/case}
{case Sihnon_Config::TYPE_HASH}
<div id="container_{$id}">
{foreach from=$value item=hash_value key=hash_key name=settings}
<div id="settings_{$id}_line{$smarty.foreach.settings.iteration}">
<input type="text" value="{$hash_key}" class="setting hash_key" />
<input type="text" name="{$id}[{$hash_key}]" value="{$hash_value}" class="setting hash_value" />
<input type="button" value="-" class="settings_field_remove" onclick="rc.settings.remove_hash_field('{$id}', '{$smarty.foreach.settings.iteration}')" />
</div>
{/foreach}
{if $value}
{foreach from=$value item=hash_value key=hash_key name=settings}
<div id="settings_{$id}_line{$smarty.foreach.settings.iteration}">
<input type="text" value="{$hash_key}" class="small setting hash_key" />
<input type="text" name="{$id}[{$hash_key}]" value="{$hash_value}" class="xlarge setting hash_value" />
<button class="btn small settings_field_remove" onclick="rc.settings.remove_hash_field('{$id}', '{$smarty.foreach.settings.iteration}')">-</button>
</div>
{/foreach}
{/if}
</div>
<div class="settings_addfieldcontainer">
<input type="hidden" id="settings_{$id}_next" value="{$smarty.foreach.settings.iteration+1}" />
<input type="button" value="+" class="settings_field_add" onclick="rc.settings.add_hash_field('{$id}')" />
<button class="btn small settings_field_add" onclick="rc.settings.add_hash_field('{$id}')">+</button>
</div>
{/case}

View File

@@ -0,0 +1,9 @@
<dl>
<dt>Destination Filename</dt>
<dd>{$job->destinationFilename()|escape:html}</dd>
{if $job->isFinished()}
<dt>File size</dt>
<dd>({$job->outputFilesize()|formatFilesize|escape:html})</dd>
{/if}
</dl>

View File

@@ -0,0 +1,15 @@
<dl>
{if $current_status->hasProgressInfo()}
<dt>Started</dt>
<dd>{$current_status->ctime()|date_format:"%D %T"}</dd>
<dt>Progress</dt>
<dd>{$current_status->ripProgress()}%</dd>
<dt>ETA</dt>
<dd>{$job->calculateETA()|formatDuration}</dd>
{/if}
<dt>Last update</dt>
<dd>{$current_status->mtime()|date_format:"%D %T"}</dd>
</dl>

View File

@@ -1,22 +1,11 @@
<table>
<thead>
<th>Name</th>
<th>Type</th>
</thead>
<tbody>
<tr>
<td>
<input type="text" id="settings_add_name" value="" />
</td>
<td>
<select id="settings_add_type">
<option value="int">Integer</option>
<option value="bool">Boolean</option>
<option value="string">String</option>
<option value="string-list">String List</option>
<option value="hash">Hash</option>
</select>
</td>
</tr>
</tbody>
</table>
<label for="settings_add_name">Name</label>
<input type="text" id="settings_add_name" value="" />
<label for="settings_add_type">Type</label>
<select id="settings_add_type">
<option value="int">Integer</option>
<option value="bool">Boolean</option>
<option value="string">String</option>
<option value="string-list">String List</option>
<option value="hash">Hash</option>
</select>

View File

@@ -2,5 +2,5 @@
<p>
Enter a new name for setting '{$name|escape}' below.
</p>
<input type="text" id="settings_rename_name" value="" />
<input type="text" id="settings_rename_name" value="{$name|escape:html}" />
</div>

View File

@@ -7,7 +7,7 @@
{assign var='source_filename' value=$source->filename()}
{assign var='source_filename_encoded' value=$source->filenameEncoded()}
{assign var='source_cached' value=$source->isCached()}
<li>
<li class="hover-highlight">
[ <a href="{$base_uri}sources/details/plugin/{$source_plugin}/id/{$source_filename_encoded}" title="Browse source details">Browse</a> |
<a href="{$base_uri}rips/setup/plugin/{$source_plugin}/id/{$source_filename_encoded}" title="Rip this source">Rip</a> |
<a href="javascript:rc.sources.remove('{$source_plugin|escape:'quote'}', '{$source_filename_encoded|escape:'quote'}');" title="Delete this source">Delete</a> ]

View File

@@ -1,5 +1,5 @@
<p>
Settings have been saved.
Your changes have been saved.
</p>
{if $messages}

View File

@@ -4,7 +4,7 @@
<title>{$title}</title>
<!-- JQuery //-->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/smoothness/jquery-ui.css" rel="Stylesheet" />
<!-- JQuery Plugins //-->
@@ -99,31 +99,29 @@
</div>
<div id="centrepoint">
<div id="dialog">
<div id="dialogheader">
<div id="dialogheadertitle">Dialog</div>
<div id="dialogheaderclose">X</div>
<div id="dialog" class="modal hide fade">
<div class="modal-header">
<a href="#" class="close">&times;</a>
<h3 id="dialog-header-title"></h3>
</div>
<div id="dialog-body" class="modal-body"></div>
<div id="dialog-footer" class="modal-footer">
<div id="dialog-footer-ok" class="dialog-footer-buttonset">
<fieldset>
<input type="button" class="btn primary" id="dialog-footer-ok-ok" value="Ok" />
</fieldset>
</div>
<div id="dialogcontent"></div>
<div id="dialogfooter">
<div id="dialogfooterok" class="dialogfooterbuttonset">
<fieldset>
<input type="button" class="dialogbutton" id="dialogfooterok" value="Ok" />
</fieldset>
</div>
<div id="dialogfooterokcancel" class="dialogfooterbuttonset">
<fieldset>
<input type="button" class="dialogbutton" id="dialogfooterokcancel_ok" value="Ok" />
<input type="button" class="dialogbutton" id="dialogfooterokcancel_cancel" value="Cancel" />
</fieldset>
</div>
<div id="dialogfooteryesno" class="dialogfooterbuttonset">
<fieldset>
<input type="button" class="dialogbutton" id="dialogfooteryes" value="Yes" />
<input type="button" class="dialogbutton" id="dialogfooterno" value="No" />
</fieldset>
</div>
<div id="dialog-footer-okcancel" class="dialog-footer-buttonset">
<fieldset>
<input type="button" class="btn primary" id="dialog-footer-okcancel-ok" value="Ok" />
<input type="button" class="btn secondary" id="dialog-footer-okcancel-cancel" value="Cancel" />
</fieldset>
</div>
<div id="dialog-footer-yesno" class="dialog-footer-buttonset">
<fieldset>
<input type="button" class="btn primary" id="dialog-footer-yesno-yes" value="Yes" />
<input type="button" class="btn secondary" id="dialog-footer-yesno-no" value="No" />
</fieldset>
</div>
</div>
</div>

View File

@@ -31,44 +31,41 @@
<table>
<thead>
<tr>
<th>
<input id="jobs_select_all" class="select_all" type="checkbox" />
Actions
</th>
<th>Name</th>
<th>Destination</th>
<th>Title</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{foreach from=$jobs item=job}
{assign var=current_status value=$job->currentStatus()}
<tr>
<td><a href="{$base_uri}jobs/details/id/{$job->id()}" title="View job details">{$job->name()}</a></td>
<td>
{$job->destinationFilename()}
{if $job->isFinished()}
({$job->outputFilesize()|formatFilesize})
{/if}
</td>
<td>{$job->title()}</td>
<td>
{$current_status->statusName()}
{if $current_status->hasProgressInfo()}
<br />
Started: <em>{$current_status->ctime()|date_format:"%D %T"}</em><br />
Progress: {$current_status->ripProgress()}%<br />
Last update: <em>{$current_status->mtime()|date_format:"%D %T"}</em><br />
ETA: <em>{$job->calculateETA()|formatDuration}</em>
{/if}
</td>
<td>
<fieldset>
<input type="checkbox" name="include[]" value="{$job->id()}" />
<input type="checkbox" class="jobs_select_all" name="include[]" value="{$job->id()}" />
<input type="image" class="icon" name="action" id="mark-failed-{$job->id()}" value="mark-failed[{$job->id()}]" src="{$base_uri}images/caution.png" alt="Mark job as failed" />
<input type="image" class="icon" name="action" id="redo-{$job->id()}" value="retry[{$job->id()}]" src="{$base_uri}images/redo.png" alt="Repeat job" />
<input type="image" class="icon" name="action" id="delete-{$job->id()}" value="delete[{$job->id()}]" src="{$base_uri}images/trash.png" alt="Delete job" />
<input type="image" class="icon" name="action" id="fix-broken-timestamps-{$job->id()}" value="fix-broken-timestamps[{$job->id()}]" src="{$base_uri}images/clock.png" alt="Fix broken status timestamps" />
</fieldset>
</td>
<td><a href="{$base_uri}jobs/details/id/{$job->id()}" title="View job details">{$job->name()}</a></td>
<td>
{include file="fragments/job-filename-popover.tpl" assign=popover_content}
<a href="#" rel="popover" data-placement="below" data-title="Destination details" data-content="{$popover_content|escape:html}">{$job->destinationFileBasename()|escape:html}</a>
</td>
<td>
{include file="fragments/job-status-popover.tpl" assign=popover_content}
<a href="#" rel="popover" title="{$current_status->statusName()|escape:html}" data-placement="below" data-content="{$popover_content|escape:html}">{$current_status->statusName()}</a>
{if $current_status->hasProgressInfo()}
<br />
<small>{$job->calculateETA()|formatDuration:1} remaining</small>
{/if}
</td>
</tr>
{/foreach}
</tbody>

View File

@@ -17,9 +17,9 @@
<input type="hidden" name="id" value="{$source->filenameEncoded()|escape:"html"}" />
<div>
<div class="clearfix">
<label for="global-output-directory">Output directory</label>
<select id="global-output-directory" name="rip-options[output-directory]">
<select id="global-output-directory" name="rip-options[output-directory]" class="xxlarge">
<optgroup label="Custom"></optgroup>
<optgroup label="Defaults">
{foreach from=$default_output_directories item=dir key=name}
@@ -45,41 +45,45 @@
</div>
<div>
<div class="clearfix">
<label for="global-format">Output format</label>
<select id="global-format" name="rip-options[format]">
<select id="global-format" name="rip-options[format]" class="small">
<option value="mkv" selected="selected">MKV</option>
</select>
</div>
<div>
<div class="clearfix">
<label for="global-video-codec">Video codec</label>
<select id="global-video-codec" name="rip-options[video-codec]">
<select id="global-video-codec" name="rip-options[video-codec]" class="small">
<option value="x264" selected="selected">x264</option>
</select>
</div>
<div>
<div class="clearfix">
<label for="global-video-width">Video width</label>
<input type="text" id="global-video-width" name="rip-options[video-width]" value="0" />
<em>(Use 0 to leave size unchanged from source.)</em>
</div>
<div>
<label for="global-video-height">Video height</label>
<input type="text" id="global-video-height" name="rip-options[video-height]" value="0" />
<em>(Use 0 to leave size unchanged from source.)</em>
<div class="input">
<input type="text" id="global-video-width" name="rip-options[video-width]" value="0" />
<span class="help-inline">(Use 0 to leave size unchanged from source.)</span>
</div>
</div>
<div>
<div class="clearfix">
<label for="global-video-height">Video height</label>
<div class="input">
<input type="text" id="global-video-height" class="small" name="rip-options[video-height]" value="0" />
<span class="help-inline">(Use 0 to leave size unchanged from source.)</span>
</div>
</div>
<div class="clearfix">
<label for="global-quantizer">Quantizer</label>
<input type="text" id="global-quantizer" name="rip-options[quantizer]" value="" readonly="readonly" />
<em>(Defaults to 0.61, x264's quantizer value for 20)</em>
<div id="quantizer-slider"></div>
<div class="input">
<div id="quantizer-slider"></div>
<input type="text" id="global-quantizer" class="small" name="rip-options[quantizer]" value="" readonly="readonly" />
<span class="help-inline">(Defaults to 0.61, x264's quantizer value for 20)</span>
</div>
</div>
<div>
<input type="submit" name="submit" value="Queue rips" />
</div>
</fieldset>
<div id="available-titles">
@@ -89,17 +93,17 @@
<fieldset>
<legend>Configure title rip options</legend>
<div>
<div class="clearfix">
<label for="rip-title-{$title->id()}">Rip this title</label>
<input type="checkbox" id="rip-title-{$title->id()}" name="rips[{$title->id()}][queue]" value="1" />
</div>
<div>
<div class="clearfix">
<label for="rip-name-{$title->id()}">Short Name</label>
<input type="text" id="rip-name-{$title->id()}" name="rips[{$title->id()}][name]" value="" />
</div>
<div>
<div class="clearfix">
<label for="rip-audio-{$title->id()}">Audio tracks</label>
<select id="rip-audio-{$title->id()}" name="rips[{$title->id()}][audio][]" title="Select audio tracks" size="5" multiple="multiple" class="rip-streams">
{foreach from=$title->audioTracks() item=audio}
@@ -107,22 +111,7 @@
{/foreach}
</select>
<table class="audio-tracks">
<caption>Selected audio tracks</caption>
<thead>
<tr>
<th>Track</th>
<th>Encoder</th>
<th>Name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div>
<div class="clearfix">
<label for="rip-subtitle-{$title->id()}">Subtitle tracks</label>
<select id="rip-subtitle-{$title->id()}" name="rips[{$title->id()}][subtitles][]" title="Select subtitle tracks" size="5" multiple="multiple" class="rip-streams">
{foreach from=$title->subtitleTracks() item=subtitle}
@@ -130,27 +119,12 @@
{/foreach}
</select>
<table class="subtitle-tracks">
<caption>Selected subtitle tracks</caption>
<thead>
<tr>
<th>Track</th>
<th>Language</th>
<th>Format</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div>
<div class="clearfix">
<label for="rips-output-{$title->id()}">Output filename</label>
<input type="text" id="rips-output-{$title->id()}" name="rips[{$title->id()}][output_filename]" value="" />
</div>
<div>
<div class="clearfix">
<label for="rip-deinterlace-{$title->id()}">Deinterlacing</label>
<select id="rip-deinterlace-{$title->id()}" name="rips[{$title->id()}][deinterlace]">
<option value="0">None</option>

View File

@@ -1,7 +0,0 @@
<h2>Delete Source</h2>
<p>
Are you sure you want to delete {$source->plugin()|escape:"html"}:{$source->filename()|escape:"html"}?
[ <a href="{$base_uri}sources/delete/plugin/{$source->plugin()}/id/{$source->filenameEncoded()}/confirm" title="Delete it">Delete</a>
| <a href="{$base_uri}rips/sources" title="Return to sources list">Cancel</a> ]
</p>