Added filter-users basic template

This commit is contained in:
Bofh 2022-12-03 18:54:18 +01:00
parent d8d2e39a74
commit d76fa05683
4 changed files with 97 additions and 1 deletions

View File

@ -95,6 +95,10 @@ textarea {
max-width: -moz-available;
}
br.sep {
margin-bottom: 1em;
}
a {
text-decoration: none;
color: inherit;
@ -164,10 +168,19 @@ a {
margin: 0 auto;
padding-top: 1em;
}
#window-instance #container #new-accounts .card {
#window-instance #container input[type="text"],
#window-instance #container textarea {
padding: 1em;
}
#window-instance #container .input {
margin-bottom: 1em;
}
#window-instance #container .card {
background: #fff;
padding: 1em;
margin-bottom: 1em;
}
#window-instance #container #new-accounts .card {
width: calc(100vw - 4em);
max-width: 30em;
}

View File

@ -72,6 +72,27 @@ var E = {
cback(data);
});
},
custom: {
btncollapse_render: function() {
E.elements('button[id*="btncollapse-"]').forEach(function(it) {
it.setAttribute('onclick', 'E.custom.btncollapse_click(this)');
});
},
btncollapse_click: function(elem) {
const stat = elem.innerText.trim().toLowerCase();
const refelem = E.elemid(elem.id.replace('btncollapse-',''));
if (stat === 'hide') {
elem.innerText = 'show';
refelem.style.visibility = 'collapse';
refelem.style.height = '1px';
refelem.style.padding = 0;
refelem.style.margin = 0;
} else {
elem.innerText = 'hide';
refelem.removeAttribute('style');
}
},
},
};
function isVisible(element) {

View File

@ -0,0 +1,55 @@
<h3><span>New filter</span>: <button id="btncollapse-filters-current">hide</button></h3>
<div id="filters-current" class="card">
<div class="input">
<label for="preset_name">Preset name:</label>
<input type="text" name="preset_name" placeholder="Preset name" value="Undefined"/>
</div>
<div class="input">
<label for="profile">Profile query:</label>
<input type="radio" id="profile-search-type-simple"
name="profile_search_type" value="simple" checked
/><label for="profile-search-type-simple">simple</label>
<input type="radio" id="profile-search-type-query"
name="profile_search_type" value="query"
/><label for="profile-search-type-query">query</label>
<input type="radio" id="profile-search-type-empty"
name="profile_search_type" value="empty"
/><label for="profile-search-type-empty">Empty</label>
<br class="sep"/>
<textarea name="profile" type="text" style="width: 100%"
placeholder="Input your text here"></textarea>
</div>
<div class="input">
<label for="user_filter">Account type:</label>
<br class="sep"/>
<input type="radio" id="user-filter-local"
name="user_filter" value="local" checked
/><label for="user-filter-local">local</label>
<input type="radio" id="user_filter-remote"
name="user_filter" value="remote"
/><label for="user_filter-remote">remote</label>
</div>
<div class="input">
<label>Account stages</label>
<br class="sep"/>
<input type="checkbox" id="account-prop-noavatar"
name="no_avatar" value="1"
/><label for="account-prop-noavatar">No avatar</label>
<input type="checkbox" id="account-prop-nostatuses"
name="no_statuses" value="1"
/><label for="account-prop-nostatuses">No statuses</label>
<input type="checkbox" id="account-prop-nofollows"
name="no_follows" value="1"
/><label for="account-prop-nofollows">No follows</label>
</div>
<br>
<div class="input flex">
<button class="btn center"
><i class="fa fa-search fa-fw"></i>
Execute</button>
<div style="width:1em"></div>
<button class="btn center"
><i class="fa fa-save fa-fw"></i>
Save filter</button>
</div>
</div>

View File

@ -59,6 +59,13 @@ window.view.instance = {
});
});
},
filter_users: function() {
E.http_template('instance/filter-users', function(html) {
E.element('#window-instance #container').innerHTML = html;
E.custom.btncollapse_render();
});
console.log('aaa');
},
},
load_content: function(content, hashload) {
hashload = hashload === undefined ? false : hashload;