diff options
| author | 2014-06-05 21:48:03 +0200 | |
|---|---|---|
| committer | 2014-06-05 21:48:03 +0200 | |
| commit | e47f91592061b1d5d9795c38e1f04ebdac6cdc4d (patch) | |
| tree | 4c4284c429dd8f777bc5ce8eb4a28bf44535d3d8 | |
| parent | 7ded58e808ced58b3024cca15a4840a6ce7408eb (diff) | |
Improve page of sharing configuration
- Use sticks
- Change order of buttons
| -rw-r--r-- | app/views/configure/sharing.phtml | 30 | ||||
| -rw-r--r-- | p/scripts/main.js | 5 |
2 files changed, 22 insertions, 13 deletions
diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index ddb404ef5..39951a209 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -4,13 +4,16 @@ <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url ('configure', 'sharing'); ?>" - data-simple='<div class="form-group"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="share remove"><?php echo FreshRSS_Themes::icon('close'); ?></a> + data-simple='<div class="form-group"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="share remove btn btn-attention"><?php echo FreshRSS_Themes::icon('close'); ?></a> <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>' - data-advanced='<div class="form-group"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="share remove"><?php echo FreshRSS_Themes::icon('close'); ?></a> + data-advanced='<div class="form-group"><label class="group-name">##label##</label><div class="group-controls"> <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /> + <div class="stick"> <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="##help##"><?php echo Minz_Translate::t ('more_information'); ?></a></div></div>'> + <a href="#" class="share remove btn btn-attention"><?php echo FreshRSS_Themes::icon('close'); ?></a></div> + <a target="_blank" class="btn" href="##help##"><?php echo FreshRSS_Themes::icon('help'); ?></a> + </div></div>'> <legend><?php echo Minz_Translate::t ('sharing'); ?></legend> <?php foreach ($this->conf->sharing as $key => $sharing): ?> <?php $share = $this->conf->shares[$sharing['type']]; ?> @@ -19,25 +22,30 @@ <?php echo Minz_Translate::t ($sharing['type']); ?> </label> <div class="group-controls"> - <a href='#' class='share remove'><?php echo FreshRSS_Themes::icon('close'); ?></a> <input type='hidden' id='share_<?php echo $key;?>_type' name="share[<?php echo $key;?>][type]" value='<?php echo $sharing['type']?>' /> - <?php if ($share['form'] === 'advanced'):?> - <input type="text" id="share_<?php echo $key;?>_name" name="share[<?php echo $key;?>][name]" class="extend" value="<?php echo $sharing['name']?>" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> - <input type="url" id="share_<?php echo $key;?>_url" name="share[<?php echo $key;?>][url]" class="extend" value="<?php echo $sharing['url']?>" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="<?php echo $share['help']?>"><?php echo Minz_Translate::t ('more_information'); ?></a> - <?php endif;?> + <?php if ($share['form'] === 'advanced'){ ?> + <div class="stick"> + <input type="text" id="share_<?php echo $key;?>_name" name="share[<?php echo $key;?>][name]" class="extend" value="<?php echo $sharing['name']?>" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> + <input type="url" id="share_<?php echo $key;?>_url" name="share[<?php echo $key;?>][url]" class="extend" value="<?php echo $sharing['url']?>" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> + <a href='#' class='share remove btn btn-attention'><?php echo FreshRSS_Themes::icon('close'); ?></a> + </div> + + <a target="_blank" class="btn" href="<?php echo $share['help']?>"><?php echo FreshRSS_Themes::icon('help'); ?></a> + <?php } else { ?> + <a href='#' class='share remove btn btn-attention'><?php echo FreshRSS_Themes::icon('close'); ?></a> + <?php } ?> </div> </div> <?php endforeach;?> - <div class="form-group form-actions"> + <div class="form-group"> <div class="group-controls"> - <a href='#' class='share add'><?php echo FreshRSS_Themes::icon('add'); ?></a> <select> <?php foreach($this->conf->shares as $key => $params):?> <option value='<?php echo $key?>' data-form='<?php echo $params['form']?>' data-help='<?php if (!empty($params['help'])) {echo $params['help'];}?>'><?php echo Minz_Translate::t($key) ?></option> <?php endforeach; ?> </select> + <a href='#' class='share add btn'><?php echo FreshRSS_Themes::icon('add'); ?></a> </div> </div> diff --git a/p/scripts/main.js b/p/scripts/main.js index aeb044e88..d91166e09 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -980,15 +980,16 @@ function init_share_observers() { }); $('.share.add').on('click', function(e) { - e.preventDefault(); var opt = $(this).siblings('select').find(':selected'); var row = $(this).parents('form').data(opt.data('form')); row = row.replace('##label##', opt.html(), 'g'); row = row.replace('##type##', opt.val(), 'g'); row = row.replace('##help##', opt.data('help'), 'g'); row = row.replace('##key##', shares, 'g'); - $(this).parents('.form-actions').before(row); + $(this).parents('.form-group').before(row); shares++; + + return false; }); } |
