summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-04-18 14:32:27 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2015-04-18 14:32:27 +0200
commit84a3e2f6bcb4da4ab156e39d79f0f8a36c2a0e90 (patch)
treea84f9620a087c3a2d924e5a14b404a88c0186d29
parentde50c30a936b87d79f816790230856347b0dff7e (diff)
downloadaCms-84a3e2f6bcb4da4ab156e39d79f0f8a36c2a0e90.tar.gz
aCms-84a3e2f6bcb4da4ab156e39d79f0f8a36c2a0e90.tar.bz2
added placeholders for directories
added user app and content (empty for now) added storage and sqlite script
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt1
-rw-r--r--config.js3
-rw-r--r--media/basic-profile.css1
-rw-r--r--sql/sqlite3.sql7
-rw-r--r--src/content.hpp1
-rw-r--r--src/strusCms.cpp5
-rw-r--r--src/strusCms.hpp3
-rw-r--r--src/user.cpp21
-rw-r--r--src/user.hpp16
-rw-r--r--src/user_content.hpp13
-rw-r--r--storage/db/.gitkeep0
-rw-r--r--storage/strus/.gitkeep0
-rw-r--r--templates/main.tmpl16
14 files changed, 70 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e166442
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.gitkeep
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ee6c80..659dfed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ set(SRC
src/strusCms.cpp
src/master.cpp
src/intro.cpp
+ src/user.cpp
)
add_custom_command(
diff --git a/config.js b/config.js
index ee20fc7..412111b 100644
--- a/config.js
+++ b/config.js
@@ -1,7 +1,8 @@
{
"strusCms" : {
"script" : "/strusCms",
- "media" : "/media"
+ "media" : "/media",
+ "db_connection" : "sqlite3:db=./storage/db/strusCms.db;@pool_size=16",
},
"service" : {
diff --git a/media/basic-profile.css b/media/basic-profile.css
index b9813c9..961c63c 100644
--- a/media/basic-profile.css
+++ b/media/basic-profile.css
@@ -29,4 +29,3 @@ h1,h2,h3 {font-weight:700; line-height:1.4em;}
.credits {display:block; clear:left; font-size:0.9em; color:#aaa; margin:20px 0;}
.credits a {color:#888;}
.clear {clear:both;}
-
diff --git a/sql/sqlite3.sql b/sql/sqlite3.sql
new file mode 100644
index 0000000..e524ce6
--- /dev/null
+++ b/sql/sqlite3.sql
@@ -0,0 +1,7 @@
+drop table if exists users;
+
+create table users(
+ id integer primary key autoincrement not null,
+ username varchar(32) unique not null,
+ password varchar(32) not null
+);
diff --git a/src/content.hpp b/src/content.hpp
index 13cc61d..ad8753d 100644
--- a/src/content.hpp
+++ b/src/content.hpp
@@ -3,5 +3,6 @@
#include "master_content.hpp"
#include "intro_content.hpp"
+#include "user_content.hpp"
#endif
diff --git a/src/strusCms.cpp b/src/strusCms.cpp
index 64cc235..db715f4 100644
--- a/src/strusCms.cpp
+++ b/src/strusCms.cpp
@@ -8,12 +8,15 @@ namespace apps {
strusCms::strusCms( cppcms::service &srv )
: cppcms::application( srv ),
- intro( *this )
+ conn( settings( ).get<std::string>( "strusCms.db_connection" ) ),
+ intro( *this ),
+ user( *this )
{
locale_name = "en";
script = settings( ).get<std::string>( "strusCms.script" );
add( intro );
+ add( user );
mapper( ).root( "/strusCms" );
}
diff --git a/src/strusCms.hpp b/src/strusCms.hpp
index db7f0d9..539833e 100644
--- a/src/strusCms.hpp
+++ b/src/strusCms.hpp
@@ -4,6 +4,7 @@
#include <cppcms/application.h>
#include "intro.hpp"
+#include "user.hpp"
namespace apps {
@@ -15,8 +16,10 @@ class strusCms : public cppcms::application {
private:
std::string script;
std::string locale_name;
+ std::string conn;
apps::intro intro;
+ apps::user user;
};
}
diff --git a/src/user.cpp b/src/user.cpp
new file mode 100644
index 0000000..746e123
--- /dev/null
+++ b/src/user.cpp
@@ -0,0 +1,21 @@
+#include "content.hpp"
+#include "user.hpp"
+#include "strusCms.hpp"
+
+#include <cppcms/url_dispatcher.h>
+#include <cppcms/url_mapper.h>
+
+namespace apps {
+
+user::user( strusCms &cms )
+ : master( cms )
+{
+ cms.dispatcher( ).assign( "/login", &user::login, this );
+ cms.mapper( ).assign( "/login" );
+}
+
+void user::login( )
+{
+}
+
+}
diff --git a/src/user.hpp b/src/user.hpp
index 99a0894..041585e 100644
--- a/src/user.hpp
+++ b/src/user.hpp
@@ -1,14 +1,16 @@
-#ifndef USER_CONTENT_HPP
-#define USER_CONTENT_HPP
+#ifndef USER_HPP
+#define USER_HPP
-#include <cppcms/view.h>
+#include "master.hpp"
-#include <string>
+namespace apps {
-namespace content {
+class user : public master {
+ public:
+ user( strusCms &cms );
-struct user : public cppcms::base_content {
- std::string title;
+ private:
+ void login( );
};
}
diff --git a/src/user_content.hpp b/src/user_content.hpp
new file mode 100644
index 0000000..cac0755
--- /dev/null
+++ b/src/user_content.hpp
@@ -0,0 +1,13 @@
+#ifndef USER_CONTENT_HPP
+#define USER_CONTENT_HPP
+
+#include "master.hpp"
+
+namespace content {
+
+struct user : public master {
+};
+
+}
+
+#endif
diff --git a/storage/db/.gitkeep b/storage/db/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/storage/db/.gitkeep
diff --git a/storage/strus/.gitkeep b/storage/strus/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/storage/strus/.gitkeep
diff --git a/templates/main.tmpl b/templates/main.tmpl
index 0d949d7..48b6984 100644
--- a/templates/main.tmpl
+++ b/templates/main.tmpl
@@ -14,15 +14,7 @@
</head>
<body>
<div id="wrap">
- <h2><% include title( ) %></h2>
- <div id="content">
- <% include page_content( ) %>
- <p class="credits">&copy; 2015 Patrick Frey<br />
- Template design by <a href="http://andreasviklund.com/">Andreas Viklund</a> / Best hosted at <a href="https://www.svenskadomaner.se/?ref=mall&amp;ling=en" title="Svenska Domäner AB">www.svenskadomaner.se</a></p>
-
- </div>
-
<div id="sidebar">
<img src="/media/images/strus_big.jpg" width="280" height="280" alt="Strus logo" /></a>
<h1><a href="index.htm">Strus CMS</a></h1>
@@ -33,6 +25,14 @@
</ul>
</div>
+ <div id="content">
+ <h2><% include title( ) %></h2>
+ <% include page_content( ) %>
+
+ <p class="credits">&copy; 2015 Patrick Frey<br />
+ Template design by <a href="http://andreasviklund.com/">Andreas Viklund</a> / Best hosted at <a href="https://www.svenskadomaner.se/?ref=mall&amp;ling=en" title="Svenska Domäner AB">www.svenskadomaner.se</a></p>
+ </div>
+
</body>
</html>
<% end template %>