Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user fixes #8

Merged
merged 1 commit into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ app.use(cookieParser());
app.use(passport.initialize());
var date = new Date();
app.events = [{
title: "<h3>OpenFuel</h3>",
text: "<h4>Launching soon...</h4>",
title: "OpenFuel",
text: "Launching soon...",
img: "/images/universe.png",
time:[date,date.setDate(date.getDate() + 1)] ,
link: {
Expand Down
7 changes: 1 addition & 6 deletions routes/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ var image_types = ["png","jpeg","gif"];

/* GET users listing. */
router.get('/', function(req, res, next) {
db.findOne({_id:req.session._id}, (err, user) => {
res.render('me/index', {
title: req.app.conf.name,
user: user
});
})
res.redirect("/u/@" + req.session.user.username)
});

router.get('/settings', function(req, res, next) {
Expand Down
8 changes: 4 additions & 4 deletions views/main.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<% for(var y=0;y<events.length;y++) { %>
<ul class="list-group" style="background-color:black;background-image: url('<%= events[y].img %>');background-repeat: no-repeat;border-radius:10px;">
<li class="list-group-item list-group-item-primary" style="background: transparent; color:#fff;">
<%- events[y].title %>
<%- events[y].text %>
<h3><%- events[y].title %></h3>
<h4><%- events[y].text %></h4>
<a class="float-right" style="color:#fff" href="<%= events[y].link.link_url %>"><%= events[y].link.link_text %></a> <br>
</li>

Expand Down Expand Up @@ -53,7 +53,7 @@
</div>
<div class="gram-card-content">

<p><a class="gram-card-content-user" href="/u/@<%= people[i].posts[z].author %>"></a><%= people[i].posts[z].author %></a>
<p><a class="gram-card-content-user" href="/u/@<%= people[i].posts[z].author %>"><%= people[i].posts[z].author %></a>
<%= people[i].posts[z].caption %>
<span class="label label-info"><%= people[i].posts[z].category %></span>

Expand All @@ -72,7 +72,7 @@
<%= people[i].posts[z].comments[c].text %>
<br>
<% } %>
</div>
</div>

</div>
<hr>
Expand Down
17 changes: 9 additions & 8 deletions views/me/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%- include('../navbar') -%>
<br>
<div class="container" id="mainPage">
<img src="<%= user.profile_pic %>" class="logo">
<img src="<%= user.profile_picture %>" class="logo">
<a class="gram-card-user-name" href="">@<%= user.username %></a>
(<%= user.name %>)

Expand All @@ -21,14 +21,15 @@
<br><br><br>


</div>

<div class="container">
<center>
<% for(var x=0;x<user.posts.length;x++) { %>
<h1>Posts</h1>
<% if(user.posts) { for(var x=0;x<user.posts.length;x++) {
if(user.posts[x].static_url) { %>
<img src="<%= user.posts[x].static_url %>" class="feed-view-img">
<% } %>
</center>
<%} else { %>
<blockquote>
<a href="/post/<%= user.posts[x]._id %>"><%= user.posts[x].caption.length > 10 ? user.posts[x].caption.slice(0, 10) + "..." : user.posts[x].caption %></a> posted on <%= user.posts[x].createdAt.toString().split("T")[0] %>
</blockquote>
<% } }} %>
</div>
<div class="container">
<br><br>
Expand Down
31 changes: 23 additions & 8 deletions views/user/profile.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,39 @@
</div>
<br>
<div class="container">
<img src="<%= user.profile_picture %>" class="logo">
<a class="gram-card-user-name" href="">@<%= user.username %></a>
(<%= user.name %>)
<div class="row"><h2>
<div class="col-md-2">
<img src="<%= user.profile_picture %>" width="100px" style="border-radius: 50%">
</div>
<div class="col-md-10">
<a style="margin: 0" href="">@<%= user.username %></a> (<%= user.name %>)<br>
<a class="btn btn-action btn-sm btn-primary" style="margin-left: 0" href="/chat/<%= user._id %>">Text</a>
</div>
</h2>
</div>
<br><br>
<span class="bio"><%- user.bio %></span><br>
<h3>About</h3><br><span class="bio"><%- user.bio %></span><br><br>
<blockquote>
Github: <a href="<%- user.profile_url %>"><%- user.profile_url %></a><br>
Followers: <%- user.followers %><br>
Following: <%- user.following %>
<br>
<% if(user.website) { %>
Website: <a href="<%- user.website %>"><%- user.website %></a>
Website: <a style="margin: 0" href="<%- user.website %>"><%- user.website %></a>
<% } %>
</blockquote>
<h1>Posts</h1><br>
<% if(user.posts) { for(var x=0;x<user.posts.length;x++) {
if(user.posts[x].static_url) { %>
<blockquote>
<img src="<%= user.posts[x].static_url %>" class="feed-view-img">
</blockquote>
<%} else { %>
<blockquote>
<a href="/post/<%= user.posts[x]._id %>"><%= user.posts[x].caption.length > 10 ? user.posts[x].caption.slice(0, 10) + "..." : user.posts[x].caption %></a> posted on <%= new Date(user.posts[x].createdAt.toString()).toISOString().split("T")[0] %>
</blockquote>
<% } }} %>
<br><br>
<div class="float-right margin-right-10">
<a class="btn btn-action btn-sm btn-danger" href="/chat/<%= user._id %>">Talk</a>
</div>
<br><br><br>
</div>
<div class="container">
Expand Down