Skip to content

Commit

Permalink
re #77 started to have a basecontent common for the wiki , in order t…
Browse files Browse the repository at this point in the history
…o put in it the wiki's general customizable stuff (logo, copyright information etc. )
  • Loading branch information
allan-simon committed Sep 15, 2013
1 parent e9c14b8 commit 2f90b81
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 23 deletions.
4 changes: 2 additions & 2 deletions app/src/contents/Admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef TATOWIKI_CONTENTS_ADMIN_H
#define TATOWIKI_CONTENTS_ADMIN_H

#include "cppcms_skel/contents/content.h"
#include "contents/BaseContent.h"

#include "contents/forms/change_brand.h"
//%%%NEXT_CONTENT_FORM_INCLUDE_MARKER%%%
Expand All @@ -26,7 +26,7 @@ namespace admin {
* @brief Base content for every action of Admin controller
* @since 10 August 2013
*/
struct Admin : public BaseContent {
struct Admin : public tatowiki::contents::BaseContent {
};

/**
Expand Down
5 changes: 3 additions & 2 deletions app/src/contents/Articles.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
#define TATOWIKI_CONTENTS_ARTICLES_H

#include <booster/function.h>
#include <cppcms_skel/contents/content.h>

#include "contents/BaseContent.h"
#include "contents/forms/edit.h"
#include "contents/forms/create.h"
#include "contents/forms/translate.h"
//%%%NEXT_CONTENT_FORM_INCLUDE_MARKER%%%

#include "results/Articles.h"

namespace contents {
namespace articles {

Expand All @@ -30,7 +31,7 @@ namespace articles {
* @brief Base content for every action of Articles controller
* @since 30 October 2012
*/
struct Articles : public BaseContent {
struct Articles : public ::tatowiki::contents::BaseContent {
};


Expand Down
5 changes: 2 additions & 3 deletions app/src/contents/History.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#ifndef TATOEBACPP_CONTENTS_HISTORY_H
#define TATOEBACPP_CONTENTS_HISTORY_H

#include <cppcms_skel/contents/content.h>

#include "contents/BaseContent.h"
#include "contents/forms/diff_between.h"
#include "results/History.h"
//%%%NEXT_CONTENT_FORM_INCLUDE_MARKER%%%
Expand All @@ -28,7 +27,7 @@ namespace history {
* @brief Base content for every action of History controller
* @since 30 October 2012
*/
struct History : public BaseContent {
struct History : public ::tatowiki::contents::BaseContent {
};

/**
Expand Down
4 changes: 2 additions & 2 deletions app/src/contents/Media.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#ifndef TATOWIKI_CONTENTS_MEDIA_H
#define TATOWIKI_CONTENTS_MEDIA_H

#include <cppcms_skel/contents/content.h>
#include <cppcms_skel/results/Uploads.h>

#include "contents/BaseContent.h"
#include "contents/forms/upload_image.h"
//%%%NEXT_CONTENT_FORM_INCLUDE_MARKER%%%

Expand All @@ -28,7 +28,7 @@ namespace media {
* @brief Base content for every action of Media controller
* @since 19 May 2013
*/
struct Media : public BaseContent {
struct Media : public ::tatowiki::contents::BaseContent {
};

/**
Expand Down
4 changes: 2 additions & 2 deletions app/src/contents/Search.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#define TATOWIKI_CONTENTS_SEARCH_H

#include <booster/function.h>
#include <cppcms_skel/contents/content.h>

#include "contents/BaseContent.h"
#include "contents/forms/simple.h"
#include "results/Articles.h"
//%%%NEXT_CONTENT_FORM_INCLUDE_MARKER%%%
Expand All @@ -28,7 +28,7 @@ namespace search {
* @class Search Base content for every action of Search controller
* @since 18 June 2013
*/
struct Search : public BaseContent {
struct Search : public ::tatowiki::contents::BaseContent {
};

/**
Expand Down
4 changes: 2 additions & 2 deletions app/src/contents/Users.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#ifndef TATOEBACPP_CONTENTS_USERS_H
#define TATOEBACPP_CONTENTS_USERS_H

#include <cppcms_skel/contents/content.h>

#include "contents/BaseContent.h"
#include "contents/forms/login.h"
#include "contents/forms/register_new.h"
#include "contents/forms/change_password.h"
Expand All @@ -28,7 +28,7 @@ namespace users {
* @brief Base content for every action of Users controller
* @since 30 October 2012
*/
struct Users : public BaseContent {
struct Users : public ::tatowiki::contents::BaseContent {
};

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/views/webs/commons/layouts/article_edition.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* article edition
*/

<% view common_article_edition uses contents::BaseContent extends master %>
<% view common_article_edition uses tatowiki::contents::BaseContent extends master %>

<% template group_css() %>
<% include css_link("commons/css/external/jquery-ui.css") %>
Expand Down
19 changes: 16 additions & 3 deletions app/src/views/webs/commons/layouts/master.tmpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<% c++ #ifndef COMMONS_SKIN_LAYOUT_MASTER %>
<% c++ #define COMMONS_SKIN_LAYOUT_MASTER %>
<% c++ #include <cppcms_skel/generics/Config.h> %>
<% c++ #include "cppcms_skel/contents/content.h" %>
<% c++ #include "contents/BaseContent.h" %>
<% c++ #include "generics/Config.h" %>
<% c++ #include "results/Articles.h" %>
<% skin %>
<% view common_master uses contents::BaseContent %>
<% view common_master uses tatowiki::contents::BaseContent %>

<% template render() %><!DOCTYPE html>
<html lang="<%= lang %>">
Expand Down Expand Up @@ -48,6 +48,19 @@
*/
<% template title() %>TODO: replace this<% end template %>

/**
*
*/
<% template brand () %>
<a class="brand" href="/">
<% if wiki.logo.isImage %>
<% include img_tag(wiki.logo.url, wiki.logo.width, wiki.logo.height, wiki.logo.text) %>
<% else %>
<%= wiki.logo.text %>
<% end %>
<%= wiki.logoUrl </a>
<% end template %>


<% template asset_url(std::string const& type, std::string const& file) %><% c++ out() << Config::get_assets_url(); %><%= type %>/<%= file %><% end template %>
/**
Expand All @@ -68,7 +81,7 @@
type="text/css"
/><% end template %>

<% template img_tag(std::string const& imgFile, int width, int height, std::string const& alt) %><img
<% template img_tag(std::string const& imgFile, unsigned width, unsigned height, std::string const& alt) %><img
src="<% include asset_url("img",imgFile) %>"
width="<%= width %>"
height="<%= height %>"
Expand Down
2 changes: 1 addition & 1 deletion app/src/views/webs/responsive/layouts/article_edition.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% c++ #define SKIN_RESPONSIVE_LAYOUT_ARTICLE_EDITION %>
<% c++ #include "contents/Articles.h" %>
<% skin %>
<% view article_edition uses contents::BaseContent extends common_article_edition %>
<% view article_edition uses tatowiki::contents::BaseContent extends common_article_edition %>

<% template skin_group_css() %>
<% include css_link("skins/responsive/css/articles/create.css") %>
Expand Down
4 changes: 2 additions & 2 deletions app/src/views/webs/responsive/layouts/master.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<% c++ #include "generics/Config.h" %>
<% c++ #include "results/Articles.h" %>
<% skin responsive %>
<% view master uses contents::BaseContent extends common_master %>
<% view master uses tatowiki::contents::BaseContent extends common_master %>

/**
*
Expand Down Expand Up @@ -88,7 +88,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="TODO">TODO</a>
<% include brand() %>
<div class="nav-collapse"><% include navigation_menu() %></div>
<% include user_menu() %>
<% include search() %>
Expand Down
2 changes: 1 addition & 1 deletion app/src/views/webs/tatoeba/layouts/article_edition.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% c++ #define LAYOUT_ARTICLE_EDITION %>
<% c++ #include "contents/Articles.h" %>
<% skin %>
<% view article_edition uses contents::BaseContent extends common_article_edition %>
<% view article_edition uses tatowiki::contents::BaseContent extends common_article_edition %>

<% template skin_group_css() %>
<% include css_link("skins/tatoeba/css/articles/create.css") %>
Expand Down
7 changes: 5 additions & 2 deletions app/src/views/webs/tatoeba/layouts/master.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<% c++ #ifndef LAYOUT_MASTER %>
<% c++ #define LAYOUT_MASTER %>
<% c++ #include <cppcms_skel/generics/Config.h> %>
<% c++ #include "cppcms_skel/contents/content.h" %>
<% c++ #include "contents/BaseContent.h" %>
<% c++ #include "generics/Config.h" %>
<% skin %>
<% view master uses contents::BaseContent extends common_master %>
<% view master uses tatowiki::contents::BaseContent extends common_master %>

/**
*
Expand All @@ -22,9 +22,12 @@
<% include top_menu() %>
<div id="container1">
<div id="header">
<% include brand() %>
<!--
<a href="/">
<% include img_tag("skins/tatoeba/img/logo.png", 72, 450, "Tatowiki's logo") %>
</a>
!-->
</div>
<div id="container">
<% include container() %>
Expand Down

0 comments on commit 2f90b81

Please sign in to comment.