close to prerelase
This commit is contained in:
parent
e55fbb5b67
commit
31022358ed
181 changed files with 2118 additions and 141 deletions
33
werc/apps/cssedit/app.rc
Normal file
33
werc/apps/cssedit/app.rc
Normal file
|
@ -0,0 +1,33 @@
|
|||
fn conf_enable_cssedit {
|
||||
enable_cssedit=yes
|
||||
cssedit_editors_groups=$*
|
||||
conf_enable_app cssedit
|
||||
css_file='_werc/style.css' # Default location, can be changed
|
||||
}
|
||||
|
||||
fn cssedit_init {
|
||||
if(! ~ $#enable_cssedit 0 && check_user $cssedit_editors_groups) {
|
||||
lp=$local_path
|
||||
lp=`{echo $lp | sed 's/index$//'}
|
||||
cssedit_file=$"lp$"css_file
|
||||
|
||||
if(~ 1 $#post_arg_cssedit_edit $#post_arg_cssedit_preview) {
|
||||
handler_body_main=(tpl_handler `{get_lib_file cssedit/edit.tpl apps/cssedit/edit.tpl})
|
||||
}
|
||||
|
||||
if not if(! ~ '' $"post_arg_cssedit_save $"post_arg_css_text) {
|
||||
save_css
|
||||
}
|
||||
|
||||
if not if(~ $"handler_body_main '' || {~ $REQUEST_METHOD GET && test -f $cssedit_file}) {
|
||||
ll_add handlers_bar_left tpl_handler apps/cssedit/sidebar_controls.tpl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn save_css {
|
||||
umask 002
|
||||
echo $post_arg_css_text > $cssedit_file
|
||||
post_redirect $base_url^$req_path
|
||||
}
|
||||
|
27
werc/apps/cssedit/edit.tpl
Normal file
27
werc/apps/cssedit/edit.tpl
Normal file
|
@ -0,0 +1,27 @@
|
|||
<div>
|
||||
<h1>Editing CSS: <a href="%($css_file%)">%($css_file%)</a></h1>
|
||||
<br>
|
||||
<form action="" method="POST">
|
||||
<fieldset>
|
||||
<textarea name="css_text" id="css_text" cols="80" rows="43">%{
|
||||
if(~ $#post_arg_css_text 0 && test -f $cssedit_file)
|
||||
cat $cssedit_file | escape_html
|
||||
if not
|
||||
echo -n $post_arg_css_text | escape_html
|
||||
%}</textarea>
|
||||
<br>
|
||||
<a class="bu" href="%($css_file%)" download="%(style`{date -n}.css%)">Download Stylesheet</a>
|
||||
<hr>
|
||||
<input type="submit" name="cssedit_save" value="Save">
|
||||
<small><strong>Note:</strong> Saved changes are final, historical versions of stylesheet are not kept.</small>
|
||||
</fieldset>
|
||||
</form>
|
||||
<h2>Tips</h2>
|
||||
<div class="info">
|
||||
<ul>
|
||||
<li>Pressing <code>F12</code> in your browser and editing the style.css that way is a good way to test/preview your changes out before committing to them using this tool.</li>
|
||||
<li>Using a computer is suggested for these kind of changes</li>
|
||||
<li>Learn css: <a href="https://www.w3schools.com/Css/css_intro.asp">w3schools</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
3
werc/apps/cssedit/sidebar_controls.tpl
Normal file
3
werc/apps/cssedit/sidebar_controls.tpl
Normal file
|
@ -0,0 +1,3 @@
|
|||
<form action="" method="POST">
|
||||
<input type="submit" name="cssedit_edit" value="Edit CSS" />
|
||||
</form>
|
Loading…
Add table
Add a link
Reference in a new issue