-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re #76 refactored all the articles/ pages , still need to update the …
…javascript part of tatoeba skins
- Loading branch information
1 parent
d51feb0
commit f75cd91
Showing
22 changed files
with
356 additions
and
629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<% c++ #include "contents/Articles.h" %> | ||
<% skin %> | ||
<% view common_articles_create uses contents::articles::Create extends article_edition %> | ||
<% template title() %><% gt "Create a new article" %><% end template %> | ||
|
||
<% template css() %> | ||
<% include css_link("articles/create.css") %> | ||
<% end template %> | ||
|
||
|
||
<% template main_content() %> | ||
<% include begin_module() %> | ||
<h2><% gt "Create a new article" %></h2> | ||
<form method="POST" action="/articles/create_treat" > | ||
<% form input createForm.slug %> | ||
<table> | ||
<% include title_area(createForm) %> | ||
<% include editor_area(createForm) %> | ||
<% include summary_text(createForm) %> | ||
</table> | ||
<% include save_buttons(createForm) %> | ||
</form> | ||
<% include end_module() %> | ||
<% include preview_module() %> | ||
<% end template %> | ||
|
||
/** | ||
* | ||
*/ | ||
<% template annexe_content() %> | ||
<% include markdown_help() %> | ||
<% end template %> | ||
|
||
|
||
|
||
<% end view %> | ||
<% end skin %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<% c++ #include "contents/Articles.h" %> | ||
<% skin %> | ||
<% view common_articles_edit uses contents::articles::Edit extends article_edition %> | ||
<% template title() %><% gt "Edit article" %><% end template %> | ||
|
||
|
||
<% template local_css() %> | ||
<% include css_link("articles/create.css") %> | ||
<% end template %> | ||
|
||
|
||
|
||
<% template main_content() %> | ||
<% include begin_module() %> | ||
<h2><% gt "Edit article" %></h2> | ||
<form method="POST" action="/articles/edit_treat" > | ||
<% form input editForm.slug %> | ||
<% form input editForm.lastVersion %> | ||
<table> | ||
<% include title_area(editForm) %> | ||
<% include editor_area(editForm) %> | ||
<% include summary_text(editForm) %> | ||
</table> | ||
<% include save_buttons(editForm) %> | ||
</form> | ||
<% include end_module() %> | ||
<% include preview_module() %> | ||
<% end template %> | ||
|
||
|
||
<% end view %> | ||
<% end skin %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<% c++ #include <cppcms_skel/generics/Languages.h> %> | ||
<% c++ #include "contents/Articles.h" %> | ||
<% skin %> | ||
<% view common_articles_show uses contents::articles::Show extends master %> | ||
<% template title() %><%= article.title %><% end template %> | ||
|
||
|
||
<% template main_content() %> | ||
<% cache cacheKey %> | ||
<% include begin_module() %> | ||
<%= article.content | ext markdown %> | ||
<% include end_module() %> | ||
<%end cache %> | ||
<% end template %> | ||
|
||
<% template annexe_content() %> | ||
<% include begin_module() %> | ||
<h2><%gt "Actions" %></h2> | ||
|
||
<ul class="annexeMenu"> | ||
<li> | ||
<a href="/articles/edit/<%= article.slug | urlencode %>"> | ||
<%gt "Edit" %> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="/articles/translate/<%= article.slug | urlencode %>"> | ||
<%gt "Translate" %> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="/history/all-versions-of/<%= article.slug | urlencode %>"> | ||
<%gt "History" %> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="/articles/remove/<%= article.slug | urlencode %>"> | ||
<%gt "Remove" %> | ||
</a> | ||
</li> | ||
</ul> | ||
<% include end_module() %> | ||
<% include begin_module() %> | ||
<h2><%gt "Article available in:" %></h2> | ||
|
||
<% foreach translation in translatedIn %> | ||
<ul> | ||
<% item %> | ||
<li> | ||
<% include link_to_translation(translation.first, translation.second) %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% end foreach %> | ||
<% include end_module() %> | ||
<% end template %> | ||
|
||
/** | ||
* | ||
* @brief Generate the html link to an article, giving its lang and slug | ||
* | ||
* @param lang The code of the language in which the article is written | ||
* @param slug The slug of that article | ||
* | ||
* @since 28 December 2012 | ||
*/ | ||
<% template link_to_translation(std::string lang, std::string slug) %> | ||
<a | ||
href="<% include article_url(lang,slug) %>" | ||
> | ||
<% c++ out() << Languages::get_instance()->get_interface_lang_from_code(lang); %> | ||
</a> | ||
<% end template %> | ||
|
||
|
||
|
||
<% end view %> | ||
<% end skin %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<% c++ #include "contents/Articles.h" %> | ||
<% c++ #include "generics/Config.h" %> | ||
<% skin %> | ||
<% view common_articles_show_all uses contents::articles::ShowAll extends master %> | ||
<% template title() %><% gt "All articles" %><% end template %> | ||
|
||
|
||
<% template main_content() %> | ||
<% include begin_module() %> | ||
<h1><% gt "All articles" %></h1> | ||
<% foreach article in articles %> | ||
<ul> | ||
<% item %> | ||
<li> | ||
<%= article.lang %>: | ||
<a href="<% include article_url(article.lang,article.slug) %>"> | ||
<%= article.title %> | ||
</a> | ||
( <%= article.slug %> ) | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% end foreach %> | ||
<% include end_module() %> | ||
<% end template %> | ||
|
||
<% template annexe_content() %> | ||
<% include begin_module() %> | ||
<h2><%gt "Actions" %></h2> | ||
|
||
<ul class="annexeMenu"> | ||
<li> | ||
<!-- TODO replace by application root !--> | ||
<a href="/"> | ||
<%gt "Go back to main page" %> | ||
</a> | ||
</li> | ||
</ul> | ||
<% include end_module() %> | ||
<% end template %> | ||
|
||
<% end view %> | ||
<% end skin %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<% c++ #include "contents/Articles.h" %> | ||
<% skin %> | ||
<% view common_articles_show_conflict uses contents::articles::ShowConflict extends master %> | ||
<% template title() %><% gt "Show conflict" %><% end template %> | ||
|
||
<% template main_content() %> | ||
<% include begin_module() %> | ||
<h1><% gt "Notice" %></h1> | ||
<% gt "You're seeing this page because someone has saved a modified version while you were edidting." %> | ||
<% gt "In order to prevent conflicts, your version has been saved there." %> | ||
<% gt "Note that for the moment unfortunately we don't provide tools to resolve it automatically, so you may need to transpose your changes manually." %> | ||
<% include end_module() %> | ||
<% include begin_module() %> | ||
<%= article.content | ext markdown %> | ||
<% include end_module() %> | ||
<% end template %> | ||
|
||
|
||
|
||
|
||
|
||
<% end view %> | ||
<% end skin %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<% c++ #include "contents/Articles.h" %> | ||
<% skin %> | ||
<% view common_articles_translate uses contents::articles::Translate extends article_edition %> | ||
<% template title() %><% gt "Translate article" %><% end template %> | ||
|
||
<% template local_css() %> | ||
<% include css_link("articles/create.css") %> | ||
<% end template %> | ||
|
||
<% template main_content() %> | ||
<% include begin_module() %> | ||
<h2><% gt "Translate article" %></h2> | ||
<form | ||
id="translateform" | ||
method="POST" | ||
action="/articles/translate_treat" | ||
> | ||
<% form input translateForm.slug %> | ||
<table> | ||
<% include title_area(translateForm) %> | ||
<% include widget_row(translateForm.transLang) %> | ||
<% include slug_text(translateForm) %> | ||
<% include editor_area(translateForm) %> | ||
<% include summary_text(translateForm) %> | ||
</table> | ||
<% include save_buttons(translateForm) %> | ||
</form> | ||
<% include end_module() %> | ||
<% include preview_module() %> | ||
<% end template %> | ||
|
||
<% template slug_text(forms::articles::Translate & form) %> | ||
<% include widget_row_text(form.translationSlug, "<span>http://.../articles/show/</span>") %> | ||
<% end template %> | ||
|
||
<% end view %> | ||
<% end skin %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<% c++ #ifndef SKIN_COMMONS_LAYOUT_ARTICLE_EDITION %> | ||
<% c++ #define SKIN_COMMONS_LAYOUT_ARTICLE_EDITION %> | ||
<% c++ #include "contents/Articles.h" %> | ||
<% skin %> | ||
/** | ||
* @brief Common template used by all the page related to | ||
* article edition | ||
*/ | ||
|
||
<% view common_article_edition uses contents::BaseContent extends master %> | ||
|
||
<% template group_css() %> | ||
<% include css_link("external/jquery-ui.css") %> | ||
<% include css_link("external/jquery.markedit.css") %> | ||
<% end template %> | ||
|
||
|
||
<% template footer_js() %> | ||
<% include js_link("external/showdown.js") %> | ||
<% include js_link("external/jquery.min.js") %> | ||
<% include js_link("external/jquery-ui.js") %> | ||
<% include js_link("external/jquery.form.js") %> | ||
<% include js_link("external/jquery.markedit.js") %> | ||
<% include js_link("mardown_editor.js") %> | ||
<% end template %> | ||
|
||
<% template title_area(forms::articles::BaseArticleForm & form) %> | ||
<% include widget_row(form.title) %> | ||
<% end template %> | ||
|
||
<% template summary_text(forms::articles::BaseArticleForm & form) %> | ||
<% include widget_row(form.summary) %> | ||
<% end template %> | ||
|
||
|
||
|
||
<% template editor_area(forms::articles::BaseArticleForm & form) %> | ||
<%include widget_row_text(form.content, "<div id='editor-button-bar'></div>") %> | ||
<% end template %> | ||
|
||
<% template save_buttons(forms::articles::BaseArticleForm & form) %> | ||
<div class="submit"> | ||
|
||
<% form input form.saveAndView %> | ||
</div> | ||
<div class="submit"> | ||
<% form input form.saveAndContinue %> | ||
</div> | ||
<% end template %> | ||
|
||
<% template preview_module() %> | ||
<% include begin_module() %> | ||
<h2><% gt "Preview" %></h2> | ||
<div id="editor-preview"></div> | ||
<% include end_module() %> | ||
<% end template %> | ||
/** | ||
* | ||
*/ | ||
<% template annexe_content() %> | ||
<% include begin_module() %> | ||
<h2><%gt "Actions" %></h2> | ||
|
||
<ul class="annexeMenu"> | ||
<li> | ||
<a href="upload-image"> | ||
<%gt "Upload a new image" %> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="list-all"> | ||
<%gt "View all images" %> | ||
</a> | ||
</li> | ||
|
||
</ul> | ||
<% include end_module() %> | ||
<% include markdown_help() %> | ||
<% end template %> | ||
|
||
<% end view %> | ||
<% end skin %> | ||
<% c++ #endif %> |
Oops, something went wrong.