shaarli / Shaarli

The personal, minimalist, super-fast, database free, bookmarking service - community repo
https://shaarli.readthedocs.io/
Other
3.41k stars 287 forks source link

Remove hardcoded CSS from html templates #29

Closed virtualtam closed 9 years ago

virtualtam commented 9 years ago

Some style info is hardcoded in the RainTPL templates, which:

Why not just declare the style in, well, the stylesheet? ;-)

$ grep style tpl/*.html

tpl/addlink.html:           <input type="text" name="post" style="width:50%;"> 
tpl/changetag.html: <input type="text" name="totag" style="margin-left:40px;"><input type="submit" name="renametag" value="Rename tag" class="bigbutton">
tpl/daily.html:   <a href="?do=dailyrss" title="1 RSS entry per day"><img src="images/feed-icon-14x14.png#" width="14" height="14" style="position:relative;top:3px; margin-right:4px;">Daily RSS Feed</a>
tpl/daily.html:    <div style="clear:both;"></div>
tpl/daily.html:            <div style="float:right;position:relative;top:-1px;"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
tpl/daily.html:            <div style="float:right;position:relative;top:-1px;"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
tpl/daily.html:            <div style="float:right;position:relative;top:-1px;"><a href="?{$value.linkdate|smallHash}"><img src="../images/squiggle2.png" width="25" height="26" title="permalink" alt="permalink"></a></div>
tpl/daily.html:         <div style="text-align:center; padding:40px 0px 90px 0px;">No articles on this day.</div>
tpl/daily.html:    <div style="clear:both;"></div>
tpl/daily.html:    <div style="text-align:center; padding-bottom:20px;"><img src="../images/squiggle_closing.png" width="66" height="61" alt="-"></div>
tpl/editlink.html:          <i>URL</i><br><input type="text" name="lf_url" value="{$link.url|htmlspecialchars}" style="width:100%"><br>
tpl/editlink.html:          <i>Title</i><br><input type="text" name="lf_title" value="{$link.title|htmlspecialchars}" style="width:100%"><br>
tpl/editlink.html:          <i>Description</i><br><textarea name="lf_description" rows="4" cols="25" style="width:100%">{$link.description|htmlspecialchars}</textarea><br>
tpl/editlink.html:          <i>Tags</i><br><input type="text" id="lf_tags" name="lf_tags" value="{$link.tags|htmlspecialchars}" style="width:100%"><br>
tpl/editlink.html:          <input type="submit" value="Save" name="save_edit" class="bigbutton" style="margin-left:40px;">
tpl/editlink.html:          <input type="submit" value="Cancel" name="cancel_edit" class="bigbutton" style="margin-left:40px;">
tpl/editlink.html:          {if condition="!$link_is_new"}<input type="submit" value="Delete" name="delete_link" class="bigbutton" style="margin-left:180px;" onClick="return confirmDeleteLink();">{/if}
tpl/export.html:        <a href="?do=export&what=private"><b>Export private</b> <span>: Export private links only</a><br><br style="clear:both;">
tpl/includes.html:<link type="text/css" rel="stylesheet" href="inc/shaarli.css?version={$version|urlencode}#" />
tpl/includes.html:{if condition="is_file('inc/user.css')"}<link type="text/css" rel="stylesheet" href="inc/user.css?version={$version}#" />{/if}
tpl/install.html:<div style="margin-left:20px;">
tpl/install.html:<div style="color:white !important;">
tpl/install.html:<form method="POST" action="" name="installform" id="installform" style="border:1px solid black; padding:10 10 10 10;">
tpl/linklist.html:    <div id="headerform" style="width:100%; white-space:nowrap;">
tpl/linklist.html:        <form method="GET" class="searchform" name="searchform" style="display:inline;"><input type="text" id="searchform_value" name="searchterm" style="width:30%" value=""> <input type="submit" value="Search" class="bigbutton"></form>
tpl/linklist.html:        <form method="GET" class="tagfilter" name="tagfilter" style="display:inline;margin-left:24px;"><input type="text" name="searchtags" id="tagfilter_value" style="width:10%" value=""> <input type="submit" value="Filter by tag" class="bigbutton"></form>
tpl/linklist.html:                <span class="linktag" title="Remove tag"><a href="?removetag={$value|htmlspecialchars}">{$value|htmlspecialchars} <span style="border-left:1px solid #aaa; padding-left:5px; color:#6767A7;">x</span></a></span>
tpl/linklist.html:                {if="$value.description"}<div class="linkdescription"{if condition="$search_type=='permalink'"} style="max-height:none !important;"{/if}>{$value.description}</div>{/if}
tpl/linklist.html:                <div style="position:relative;display:inline;"><a href="http://qrfree.kaywa.com/?l=1&s=8&d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}" 
tpl/linklist.paging.html:        <form method="GET" style="display:inline;" class="linksperpage"><input type="text" name="linksperpage" size="2" style="height:15px;"></form>
tpl/loginform.html:    <input style="margin:10 0 0 40;" type="checkbox" name="longlastingsession" id="longlastingsession"  tabindex="3"><label for="longlastingsession">&nbsp;Stay signed in (Do not check on public computers)</label>
tpl/page.footer.html:    <div id="newversion"><span style="text-decoration:blink;">&#x25CF;</span> Shaarli {$newversion|htmlspecialchars} is <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli#download">available</a>.</div>
tpl/page.header.html:    <div style="float:right; font-style:italic; color:#bbb; text-align:right; padding:0 5 0 0;" class="nomobile">Shaare your links...<br>
tpl/page.header.html:    <a href="{$feedurl}?do=atom{$searchcrits}" style="padding-left:10px;" class="nomobile">ATOM Feed</a>
tpl/picwall2.html:<div style="background-color:#003;">
tpl/picwall2.html:    <div style="float:left;width:48%;border-right:2px solid white;height:120px;overflow:hide;">
tpl/picwall2.html:      <div style="float:left;width:120px;text-align:center">{$value.thumbnail}</div>
tpl/picwall2.html:      <a href="{$value.permalink}" style="color:yellow;font-weight:bold;text-decoration:none;">{$value.title|htmlspecialchars}</a><br>
tpl/picwall2.html:      <span style="font-size:8pt;color:#eee;">{$value.description|htmlspecialchars}</span>
tpl/picwall2.html:      <div style="clear:both;"></div>
tpl/tagcloud.html:    <span style="color:#99f; font-size:9pt; padding-left:5px; padding-right:2px;">{$value.count}</span><a href="?searchtags={$key|htmlspecialchars}" style="font-size:{$value.size}pt; font-weight:bold; color:black; text-decoration:none">{$key|htmlspecialchars}</a>
tpl/tools.html: <a class="smallbutton" onclick="alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');return false;" href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+'&amp;title='%20+%20encodeURIComponent(title)+'&amp;description='%20+%20encodeURIComponent(document.getSelection())+'&amp;source=bookmarklet','_blank','menubar=no,height=390,width=600,toolbar=no,scrollbars=no,status=no,dialog=1');})();"><b>Shaare link</b></a> <a href="#" style="clear:none;"><span>&#x21D0; Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).<br>&nbsp;&nbsp;&nbsp;&nbsp;Then click "Shaare link" button in any page you want to share.</span></a><br><br>
nodiscc commented 9 years ago

Right, I noticed this when working on https://github.com/shaarli/Shaarli/pull/25. I'd like other contributors to review the pull request, then we can start working on moving the CSS blocks to the appropriate file.

everyone, ping.

e2jk commented 9 years ago

I like the idea, however I'm a bit perplexed about doing this now, while we are still waiting on sebsauvage's reaction. This might be a change that has low intrinsic value (no visible change for the end user) but might make it more difficult for an eventual merge (more code changes to review and understand).

I support this change, but would not necessarily suggest merging it yet.

Other thoughts? +Emilien

nodiscc commented 9 years ago

Low priority then.

virtualtam commented 9 years ago

@nodiscc thanks for merging #28! May I start working on this issue?