webmin / authentic-theme

Official theme for the best server management panel of the 21st Century
https://authentic-theme.com
MIT License
947 stars 163 forks source link

need advise to better integrate module majordomo with authentic theme #795

Closed gnadelwartz closed 7 years ago

gnadelwartz commented 7 years ago

JC accepted my patches to convert majordomo module from button based to more modern table based layout, see https://github.com/webmin/webmin/pull/572

to work with every theme I placed regular [edit] links to call existing cgi's. For better integration (and nicer look) I need some advice how to change HTML Code to display edit Icons if atuthetic theme is used,

HTML Code for a table line looks currently like this;

[<td class="td_tag">
<div class="majordomo_icon"><a href="edit_list.cgi?name=admin" style="text-decoration: none;" data-original-title="" title=""><img src="images/smallicon.gif"></a></div></td>
<td class="td_tag">
<a href="edit_list.cgi?name=admin" data-original-title="" title="">admin</a></td>
<td class="td_tag">
<div class="majordomo_edit"><em>Contact the BOSS
</em>&nbsp;&nbsp;<em>[<a href="edit_info.cgi?name=admin" data-original-title="" title="">edit</a>]</em></div></td>
<td class="td_tag">
<em>admin@rrr.de</em></td>
<td class="td_tag">
<em>Nein</em></td>
<td class="td_tag">
<div class="majordomo_edit">4
&nbsp;&nbsp;<em>[<a href="edit_members.cgi?name=admin" data-original-title="" title="">edit</a>]</em></div></td>](url)

I put mailinglist icon in a div .majordomo_icon and text+edit links in a div .majordomo_edit

any suggestions for improvements?

iliajie commented 7 years ago

You better use default output and the theme can replace it with the button

Here is the hint for you. Find right frame url and edit the following command and then run it using console making sure that the frame is selected (not top).

f__lnk_t_btn(['/virtual-server/', '/virtual-server/index.cgi', '/virtual-server/edit_plan.cgi'], 'form table tbody td', 'a[href*="list_users.cgi?"], a[href*="list_aliases.cgi?"]', 'btn btn-transparent btn-transparent-link-force btn-borderless btn-xxs vertical-align-top margined-top-2', 0, '(~)', ' ~ ', '(~..)');

Plain links in the table will be replaced with buttons. This function also receives icon name, replace 0 with fa-eye for example to let the button have an icon.

gnadelwartz commented 7 years ago

thanks, I'll give it a try. what do you mean with "default output"? Only plain link without div and sourrounding []?

gnadelwartz commented 7 years ago

have done like sugested: open Console in FF, make shure right frame is selected and input:

f__lnk_t_btn(['/majordomo/', '/majordomo/index.cgi'], 'form table tbody td', 'a[href*="edit_info.cgi?"], a[href*="edit_members.cgi?"]', 'btn btn-transparent btn-transparent-link-force btn-borderless btn-xxs vertical-align-top margined-top-2', 0, '(~)', ' ~ ', '(~..)');

Result was: undefined

same happen when I enter /majordomo/index.cgi in the browser and repeat console input

iliajie commented 7 years ago

It's alright with any output, if you already made a change.

It's messy either way. There is only one clean way to build it. JSON response from the server and then drawing it on the client side using MVVMs. No iframes, no loading/reloading stuff on each page load.

Meanwhile it's not possible, so we deal with bunch of the mess.

We're heading to this direction.

iliajie commented 7 years ago

Can you please post complete page HTML? Including the page's windows location?

gnadelwartz commented 7 years ago

sorry for late resposne, but today is "fathers day" in germany and we went to my father to wish him care :-)

attached you find an zip archive with an example HTML. the frame locations can be /majordomo/ and /majordomo/index.cgi. The links I like to be replaced are edit_info.cgi? and edit_members.cgi? I think about replacing them with an Edit icon like in file manager:
grafik

majordomo.zip

iliajie commented 7 years ago

You could add:

f__lnk_t_btn(['/majordomo/', '/majordomo/index.cgi'], 'table tbody td em', 'a[href*="edit_info.cgi?"], a[href*="edit_members.cgi?"]', 'btn btn-transparent btn-xxs vertical-align-top margined-top-2', 'fa-edit fa-xs');

Wrapping links in [ ] is not very good, I think. You might need to run some other script to remove it.

gnadelwartz commented 7 years ago

Hi again, with a little bit of modification and some aditional JS and CSS I made it working, you can see the result in https://github.com/webmin/webmin/pull/574

iliajie commented 7 years ago

👍