Skip to content

Commit

Permalink
Merge pull request #4 from caelum/junglecss
Browse files Browse the repository at this point in the history
Junglecss
  • Loading branch information
mariofts committed Jul 1, 2013
2 parents bf6af6a + be2a5dc commit 988e437
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
import br.com.caelum.vraptor.interceptor.download.Download;
import br.com.caelum.vraptor.interceptor.download.FileDownload;
import br.com.caelum.vraptor.interceptor.multipart.UploadedFile;
import br.com.caelum.vraptor.musicjungle.converter.Musics;
import br.com.caelum.vraptor.musicjungle.dao.MusicDao;
import br.com.caelum.vraptor.musicjungle.files.Musics;
import br.com.caelum.vraptor.musicjungle.interceptor.Public;
import br.com.caelum.vraptor.musicjungle.interceptor.UserInfo;
import br.com.caelum.vraptor.musicjungle.model.Music;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.caelum.vraptor.musicjungle.converter;
package br.com.caelum.vraptor.musicjungle.files;

import java.io.File;
import java.io.FileOutputStream;
Expand Down
1 change: 1 addition & 0 deletions vraptor-musicjungle/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ music.title=Title
music.description=Description
music.type=Type
music.owners = Owners
music.upload = Music

your_musics=Your musics
new_music=Add new musics to your collection
Expand Down
59 changes: 17 additions & 42 deletions vraptor-musicjungle/src/main/webapp/WEB-INF/jsp/home/login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,24 @@
<span class="logo-message">a place to upload, download and share your favorite musics.</span>
</div>

<div class="container pull-right">

<form action="<c:url value="/home/login"/>" method="post" class="form-inline">

<fieldset class="pull-right">

<legend>Sign In</legend>

<input type="text" name="login"
placeholder="<fmt:message key="login"/>"/>

<input type="password" name="password"
placeholder="<fmt:message key="password"/>"/>

<button type="submit" id="submit" class="btn btn-primary">
<fmt:message key="send"/>
</button>

</fieldset>

<div class="container">
<form action="${linkTo[HomeController].login}" method="post" class="form form-sign">
<h3>Sign in</h3>
<input id="login" class="input-block-level" type="text" name="login" placeholder="<fmt:message key="login"/>"/>
<input id="password" class="input-block-level" type="password" name="password" placeholder="<fmt:message key="password"/>"/>
<button type="submit" id="submit" class="btn btn-large btn-primary">
<fmt:message key="send"/>
</button>
</form>

<form action="<c:url value="/users"/>" method="post" class="form-inline">

<fieldset class="pull-right">

<legend>Sign Up</legend>

<input type="text" name="user.name" value="${user.name}"
placeholder="<fmt:message key="name"/>"/>

<input type="text" name="user.login" value="${user.login}"
placeholder="<fmt:message key="login"/>"/>

<input type="password" name="user.password" value="${user.password}"
placeholder="<fmt:message key="password"/>"/>

<button type="submit" class="btn btn-primary">
<fmt:message key="send"/>
</button>

</fieldset>

<form action="${linkTo[UsersController].add}" method="post" class="form form-sign">
<h3>Sign Up</h3>
<input type="text" class="input-block-level" id="newname" name="user.name" value="${user.name}" placeholder="<fmt:message key="name"/>"/>
<input type="text" class="input-block-level" id="newlogin" name="user.login" value="${user.login}" placeholder="<fmt:message key="login"/>"/>
<input type="password" class="input-block-level" id="newpass" name="user.password" value="${user.password}" placeholder="<fmt:message key="password"/>"/>
<button type="submit" class="btn btn-large btn-primary">
<fmt:message key="send"/>
</button>
</form>
</div>

<%@ include file="../../../footer.jsp" %>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<tbody>
<c:forEach var="music" items="${musics}">
<tr>
<td><a href="<c:url value="/musics/${music.id}"/>">${music.title}</a></td>
<td><a href="${linkTo[MusicController].show[music]}">${music.title}</a></td>
<td>${music.description}</td>
<td><fmt:message key="${music.type}"/></td>
<td>
Expand All @@ -24,14 +24,14 @@
</c:forEach>
</td>
<td class="td-options">
<form action="<c:url value="/users/${userInfo.user.login}/musics/${music.id}"/>" method="post">
<form action="${linkTo[MusicOwnerController].addToMyList[userInfo.user][music]}" method="post">
<input type="hidden" name="_method" value="PUT"/>
<button type="submit" class="btn btn-primary">
<span class="icon icon-plus icon-white"></span>
<fmt:message key="add_to_my_list"/>
</button>
</form>
<a href="<c:url value="/musics/download/${music.id}"/>" class="btn btn-primary" download>
<a href="${linkTo[MusicController].download[music]}" class="btn btn-primary" download>
<i class="icon-download-alt icon-white"></i>
download
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</strong>

<c:forEach items="${music.musicOwners}" var="mo" varStatus="s">
<a href="<c:url value="/users/${user.login}"/>">${mo.owner.name}</a>
<a href="<c:url value="/users/${mo.owner.login}"/>">${mo.owner.name}</a>
${s.last ? '.' : ', ' }
</c:forEach>

Expand Down
38 changes: 18 additions & 20 deletions vraptor-musicjungle/src/main/webapp/WEB-INF/jsp/users/home.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,35 @@

<div class="well">

<form action="<c:url value="/musics"/>" class="form-inline pull-right" enctype="multipart/form-data" method="post">
<form action="${linkTo[MusicController].add}" class="form form-music" enctype="multipart/form-data" method="post">
<label for="title"><fmt:message key="music.title"/>
<input type="text" name="music.title" value="${music.title}"/>
</label>
<input type="text" name="music.title" value="${music.title}"/>

<label for="description"><fmt:message key="music.description"/>
<input type="text" name="music.description" value="${music.description}"/>
</label>
<input type="text" name="music.description" value="${music.description}"/>

<label for="type"><fmt:message key="music.type"/>
</label>
<select name="music.type" id="type">
<c:forEach items="${musicTypes}" var="type">
<option value="${type}"><fmt:message key="${type}"/></option>
</c:forEach>
</select>
</label>

<div class="fileupload fileupload-new div-inline" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input span3 div-inline">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"></span>
</div><span class="btn btn-file">
<span class="fileupload-new">Select file</span>
<span class="fileupload-exists">Change</span>
<input type="file" name="file"/></span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>

<div class="fileupload fileupload-new" data-provides="fileupload">
<label for="upload"><fmt:message key="music.upload"/>
</label>
<span class="btn btn-file">
<span class="fileupload-new">Select file</span>
<span class="fileupload-exists">Change</span>
<input type="file" name="file" />
</span>
<span class="fileupload-preview"></span>
<a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>
</div>
</div>

<button type="submit" class="btn btn-primary"><fmt:message key="add_music"/></button>
<button type="submit" class="btn btn-primary pull-left"><fmt:message key="add_music"/></button>
</form>
</div>

Expand All @@ -53,10 +51,10 @@
<tbody>
<c:forEach var="music" items="${userInfo.user.musics}" varStatus="s">
<tr>
<td><a href="<c:url value="/musics/${music.id}"/>">${music.title}</a></td>
<td><a href="${linkTo[MusicController].show[music]}">${music.title}</a></td>
<td>${music.description}</td>
<td><fmt:message key="${music.type}"/></td>
<td><a href="<c:url value="/musics/download/${music.id}"/>">download</a></td>
<td><a href="${linkTo[MusicController].download[music]}" download>download</a></td>
</tr>
</c:forEach>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<c:forEach items="${users}" var="user">
<tr>
<td>
<a href="<c:url value="/users/${user.login}"/>">
<a href="${linkTo[UsersController].view[user]}">
<fmt:message key="view"/>
</a>
</td>
Expand Down
11 changes: 4 additions & 7 deletions vraptor-musicjungle/src/main/webapp/WEB-INF/jsp/users/view.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@
<td>${music.description}</td>
<td><fmt:message key="${music.type}"/></td>
<td class="td-options">
<form action="<c:url value="/users/${userInfo
.user.login}/musics/${music.id}"/>" method="post">

<form action="${linkTo[MusicOwnerController].addToMyList[userInfo.user][music]}" method="post">
<input type="hidden" name="_method" value="PUT"/>
<button type="submit" class="btn btn-primary">
<input type="hidden" name="_method" value="PUT"/>
<span class="icon icon-plus icon-white"></span>
<fmt:message key="add_to_my_list"/>
</button>
</form>

<button class="btn btn-primary">
<a href="${linkTo[MusicController].download[music]}" class="btn btn-primary" download>
<span class="icon icon-download-alt icon-white"></span>
download
</button>
</a>
</td>
</tr>
</c:forEach>
Expand Down
37 changes: 29 additions & 8 deletions vraptor-musicjungle/src/main/webapp/css/musicjungle.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,17 @@ a.brand.logo {
font-size: xx-large;
}

form[method='post'] {
display: inline;
}

.td-options {
width: 340px;
}

div.navbar-fixed-bottom {
.v-footer {
height: 40px;
background-color: #004568;
color: white;
}

div.navbar-fixed-bottom a {
.v-footer a {
color: white;
}

Expand All @@ -59,7 +56,7 @@ div.navbar-fixed-bottom a {

div.well.login-logo {
margin-top: -60px;
margin-bottom: 75px;
margin-bottom: 20 px;
border: solid 1px #004568;
color: #004568;
}
Expand All @@ -75,4 +72,28 @@ span.logo {
span.logo-message {
font-size: 25px;
margin-left: 200px;
}
}

.form{
margin: 10px auto 20px;
border: 1px solid #e5e5e5;
padding: 20px 20px 30px;
border-radius: 5px;
}

.form label, .form input {
display:inline-block;
}

.form label {
width: 150px;
}

.form-sign{
width: 300px;
}

.form-music{
width: 500px;
}

11 changes: 5 additions & 6 deletions vraptor-musicjungle/src/main/webapp/footer.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@

</div>

<div class="navbar navbar-fixed-bottom">
<div class="footer v-footer">
<p>
<a href="http://www.apache.org/licenses/LICENSE-2.0">
Licença Apache
</a> | VRaptor ©2009 Caelum - Ensino e Inovação
</p>
</div>
</div>
Licença Apache
</a> | VRaptor ©2009 Caelum - Ensino e Inovação
</p>
</div>

</body>
</html>
4 changes: 2 additions & 2 deletions vraptor-musicjungle/src/main/webapp/header.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<li class="active"><a href="${path}"></i> Home</a></li>
<li><a href="${path}"></i> About</a></li>
<li>
<a href="<c:url value="/users"/>">
<a href="${linkTo[UsersController].list}">
<fmt:message key="list_users" />
</a>
</li>
Expand All @@ -63,7 +63,7 @@
</ul>

<span class="pull-right ${not empty userInfo.user ? '' : 'hidden'}">
${userInfo.user.name} (<a href="<c:url value='/home/logout'/>">Logout</a>)
${userInfo.user.name} (<a href="${linkTo[HomeController].logout}">Logout</a>)
</span>

</div>
Expand Down

0 comments on commit 988e437

Please sign in to comment.