added: "edit" button on threads
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@616 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
16bb238518
commit
d9f5fbaf04
|
@ -129,15 +129,16 @@ void Content::PostFunEmacs()
|
|||
bool adding = !request.is_item;
|
||||
bool edit_with_url = ReadItem(request.item, Item::file);
|
||||
|
||||
if( adding )
|
||||
SetUser(request.item); // set user before checking the rebus
|
||||
|
||||
if( !PostEmacsCheckAbuse(adding) )
|
||||
return;
|
||||
|
||||
|
||||
if( adding )
|
||||
{
|
||||
request.is_item = true;
|
||||
request.item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
||||
SetUser(request.item);
|
||||
PostFunEmacsAdd(request.item);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
[for item_tab]
|
||||
<div class="threadbox[if-index item_tab odd] threadboxcolor[end]">
|
||||
[if-one item_tab_can_use_emacs]<a class="threadedit" href="[item_tab_link]/emacs">\[{edit}\]</a>[end]
|
||||
[is mount_thread_is "subject"]<h2[is mount_thread_is "info"] class="withinfo"[end]>[item_tab_subject]</h2>[end]
|
||||
[is mount_thread_is "info"][item_tab_info][end]
|
||||
[item_tab_print_content]
|
||||
|
|
|
@ -590,6 +590,13 @@ border-radius: 8px;
|
|||
}
|
||||
|
||||
|
||||
div.threadbox a.threadedit {
|
||||
margin: 0.5em 0 0 0;
|
||||
float: right;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
|
||||
table.forum {
|
||||
border: 1px solid #D1D1E1;
|
||||
}
|
||||
|
|
|
@ -440,6 +440,17 @@ void item_tab_can_read(Info & i)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void item_tab_can_write(Info & i)
|
||||
{
|
||||
if( item_index < request.item_table.size() )
|
||||
{
|
||||
if( request.HasWriteAccess(request.item_table[item_index]) )
|
||||
i.res = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void item_tab_info(Info & i)
|
||||
{
|
||||
if( static_cast<size_t>(locale.GetLang()) >= patterns.size() )
|
||||
|
@ -574,6 +585,15 @@ void item_tab_run(Info & i)
|
|||
}
|
||||
|
||||
|
||||
void item_tab_can_use_emacs(Info & i)
|
||||
{
|
||||
if( item_index < request.item_table.size() )
|
||||
{
|
||||
i.res = request.CanUseEmacs(request.item_table[item_index], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -240,6 +240,7 @@ void Templates::CreateFunctions()
|
|||
functions.Insert("item_tab_link", item_tab_link);
|
||||
functions.Insert("item_tab_link_auth", item_tab_link_auth);
|
||||
functions.Insert("item_tab_can_read", item_tab_can_read);
|
||||
functions.Insert("item_tab_can_write", item_tab_can_write);
|
||||
functions.Insert("item_tab_info", item_tab_info);
|
||||
functions.Insert("item_tab_user", item_tab_user);
|
||||
functions.Insert("item_tab_modification_user", item_tab_modification_user);
|
||||
|
@ -251,7 +252,7 @@ void Templates::CreateFunctions()
|
|||
functions.Insert("item_tab_date_modification_nice", item_tab_date_modification_nice);
|
||||
functions.Insert("item_tab_dates_equal", item_tab_dates_equal);
|
||||
functions.Insert("item_tab_run", item_tab_run);
|
||||
|
||||
functions.Insert("item_tab_can_use_emacs", item_tab_can_use_emacs);
|
||||
|
||||
/*
|
||||
dir
|
||||
|
|
|
@ -151,6 +151,7 @@ namespace TemplatesFunctions
|
|||
void item_tab_link(Info & i);
|
||||
void item_tab_link_auth(Info & i);
|
||||
void item_tab_can_read(Info & i);
|
||||
void item_tab_can_write(Info & i);
|
||||
void item_tab_info(Info & i);
|
||||
void item_tab_user(Info & i);
|
||||
void item_tab_modification_user(Info & i);
|
||||
|
@ -162,6 +163,7 @@ namespace TemplatesFunctions
|
|||
void item_tab_date_modification_nice(Info & i);
|
||||
void item_tab_dates_equal(Info & i);
|
||||
void item_tab_run(Info & i);
|
||||
void item_tab_can_use_emacs(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue