1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00
freshrss_ynh/sources/app/views/configure/queries.phtml

87 lines
3.5 KiB
PHTML
Raw Normal View History

2014-07-23 15:52:50 +02:00
<?php $this->partial('aside_configure'); ?>
<div class="post">
2015-02-08 18:55:48 +01:00
<a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a>
2014-07-23 15:52:50 +02:00
<form method="post" action="<?php echo _url('configure', 'queries'); ?>">
2015-02-08 18:55:48 +01:00
<legend><?php echo _t('conf.query'); ?></legend>
2014-07-23 15:52:50 +02:00
2015-11-06 16:54:20 +01:00
<?php foreach ($this->queries as $key => $query) { ?>
2014-07-23 15:52:50 +02:00
<div class="form-group" id="query-group-<?php echo $key; ?>">
<label class="group-name" for="queries_<?php echo $key; ?>_name">
2015-02-08 18:55:48 +01:00
<?php echo _t('conf.query.number', $key + 1); ?>
2014-07-23 15:52:50 +02:00
</label>
<div class="group-controls">
2015-11-06 16:54:20 +01:00
<input type="hidden" id="queries_<?php echo $key; ?>_search" name="queries[<?php echo $key; ?>][url]" value="<?php echo $query->getUrl(); ?>"/>
<input type="hidden" id="queries_<?php echo $key; ?>_search" name="queries[<?php echo $key; ?>][search]" value="<?php echo $query->getSearch(); ?>"/>
<input type="hidden" id="queries_<?php echo $key; ?>_state" name="queries[<?php echo $key; ?>][state]" value="<?php echo $query->getState(); ?>"/>
<input type="hidden" id="queries_<?php echo $key; ?>_order" name="queries[<?php echo $key; ?>][order]" value="<?php echo $query->getOrder(); ?>"/>
<input type="hidden" id="queries_<?php echo $key; ?>_get" name="queries[<?php echo $key; ?>][get]" value="<?php echo $query->getGet(); ?>"/>
2014-07-23 15:52:50 +02:00
<div class="stick">
<input class="extend"
type="text"
id="queries_<?php echo $key; ?>_name"
name="queries[<?php echo $key; ?>][name]"
2015-11-06 16:54:20 +01:00
value="<?php echo $query->getName(); ?>"
data-leave-validation="<?php echo $query->getName(); ?>"
2014-07-23 15:52:50 +02:00
/>
2015-11-06 16:54:20 +01:00
<a class="btn" href="<?php echo $query->getUrl(); ?>">
2014-07-23 15:52:50 +02:00
<?php echo _i('link'); ?>
</a>
<a class="btn btn-attention remove" href="#" data-remove="query-group-<?php echo $key; ?>">
<?php echo _i('close'); ?>
</a>
</div>
2015-11-06 16:54:20 +01:00
<?php if (!$query->hasParameters()) { ?>
2014-07-23 15:52:50 +02:00
<div class="alert alert-warn">
2015-02-08 18:55:48 +01:00
<div class="alert-head"><?php echo _t('conf.query.no_filter'); ?></div>
2014-07-23 15:52:50 +02:00
</div>
2015-11-06 16:54:20 +01:00
<?php } elseif ($query->isDeprecated()) { ?>
2014-09-27 10:10:43 +02:00
<div class="alert alert-error">
2015-02-08 18:55:48 +01:00
<div class="alert-head"><?php echo _t('conf.query.deprecated'); ?></div>
2014-09-27 10:10:43 +02:00
</div>
2014-07-23 15:52:50 +02:00
<?php } else { ?>
<div class="alert alert-success">
2015-02-08 18:55:48 +01:00
<div class="alert-head"><?php echo _t('conf.query.filter'); ?></div>
2014-07-23 15:52:50 +02:00
<ul>
2015-11-06 16:54:20 +01:00
<?php if ($query->hasSearch()) { ?>
<li class="item"><?php echo _t('conf.query.search', $query->getSearch()->getRawInput()); ?></li>
2014-07-23 15:52:50 +02:00
<?php } ?>
2015-11-06 16:54:20 +01:00
<?php if ($query->getState()) { ?>
<li class="item"><?php echo _t('conf.query.state_' . $query->getState()); ?></li>
2014-07-23 15:52:50 +02:00
<?php } ?>
2015-11-06 16:54:20 +01:00
<?php if ($query->getOrder()) { ?>
<li class="item"><?php echo _t('conf.query.order_' . strtolower($query->getOrder())); ?></li>
2014-07-23 15:52:50 +02:00
<?php } ?>
2015-11-06 16:54:20 +01:00
<?php if ($query->getGet()) { ?>
<li class="item"><?php echo _t('conf.query.get_' . $query->getGetType(), $query->getGetName()); ?></li>
2014-07-23 15:52:50 +02:00
<?php } ?>
</ul>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
2015-02-08 18:55:48 +01:00
<?php if (count(FreshRSS_Context::$user_conf->queries) > 0) { ?>
2014-07-23 15:52:50 +02:00
<div class="form-group form-actions">
<div class="group-controls">
2015-02-08 18:55:48 +01:00
<button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
<button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
2014-07-23 15:52:50 +02:00
</div>
</div>
<?php } else { ?>
2015-02-08 18:55:48 +01:00
<p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('conf.query.none'); ?></p>
2014-07-23 15:52:50 +02:00
<?php } ?>
</form>
</div>