diff --git a/Gemfile b/Gemfile index 136a9f9..603e4b9 100644 --- a/Gemfile +++ b/Gemfile @@ -39,9 +39,12 @@ gem 'devise', '~> 3.1.0' # Kalibro integration gem 'kalibro_entities', "~> 0.0.1.rc2" -#PostgreSQL integration +# PostgreSQL integration gem "pg", "~> 0.17.0" +# Twitter Bootstrap for layout +gem "twitter-bootstrap-rails", "~> 2.2.8" + group :doc do # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 2d8884c..87a0954 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -221,6 +221,11 @@ GEM polyglot (>= 0.3.1) turbolinks (1.3.0) coffee-rails + twitter-bootstrap-rails (2.2.8) + actionpack (>= 3.1) + execjs + rails (>= 3.1) + railties (>= 3.1) tzinfo (0.3.38) uglifier (2.2.1) execjs (>= 0.3.0) @@ -264,4 +269,5 @@ DEPENDENCIES sqlite3 therubyracer turbolinks + twitter-bootstrap-rails (~> 2.2.8) uglifier (>= 1.3.0) diff --git a/app/assets/images/agplv3-88x31.png b/app/assets/images/agplv3-88x31.png new file mode 100644 index 0000000..7a472a0 Binary files /dev/null and b/app/assets/images/agplv3-88x31.png differ diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png new file mode 100644 index 0000000..63ba480 Binary files /dev/null and b/app/assets/images/logo.png differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d6925fa..3885622 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,5 +12,6 @@ // //= require jquery //= require jquery_ujs +//= require twitter/bootstrap //= require turbolinks //= require_tree . diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee new file mode 100644 index 0000000..9440679 --- /dev/null +++ b/app/assets/javascripts/bootstrap.js.coffee @@ -0,0 +1,3 @@ +jQuery -> + $("a[rel~=popover], .has-popover").popover() + $("a[rel~=tooltip], .has-tooltip").tooltip() diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 88df5f2..e18e183 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -8,7 +8,7 @@ * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * - *= boilerplate/main.css + *= boilerplate/main.css *= boilerplate/normalize.css *= require_self *= require_tree . diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css b/app/assets/stylesheets/bootstrap_and_overrides.css new file mode 100644 index 0000000..f2cbec2 --- /dev/null +++ b/app/assets/stylesheets/bootstrap_and_overrides.css @@ -0,0 +1,20 @@ +/* + =require twitter-bootstrap-static/bootstrap + + Use Font Awesome icons (default) + To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites" + =require twitter-bootstrap-static/fontawesome + */ + +footer div { + width: 50%; +} + +.footer-right { + float: right; + text-align: right; +} + +.footer-left { + float: left; +} \ No newline at end of file diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 9c27eb7..5eaafcd 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,4 +1,4 @@ -

Resend confirmation instructions

+

Resend confirmation instructions

<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> <%= devise_error_messages! %> @@ -6,7 +6,7 @@
<%= f.label :email %>
<%= f.email_field :email, :autofocus => true %>
-
<%= f.submit "Resend confirmation instructions" %>
+
<%= f.submit "Resend confirmation instructions", class: 'btn btn-default' %>
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 34a4960..07a1901 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -1,4 +1,4 @@ -

Change your password

+

Change your password

<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> <%= devise_error_messages! %> @@ -10,7 +10,7 @@
<%= f.label :password_confirmation, "Confirm new password" %>
<%= f.password_field :password_confirmation %>
-
<%= f.submit "Change my password" %>
+
<%= f.submit "Change my password", class: 'btn btn-warning' %>
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 5a400df..1b7d872 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,4 +1,4 @@ -

Forgot your password?

+

Forgot your password?

<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> <%= devise_error_messages! %> @@ -6,7 +6,7 @@
<%= f.label :email %>
<%= f.email_field :email, :autofocus => true %>
-
<%= f.submit "Send me reset password instructions" %>
+
<%= f.submit "Send me reset password instructions", class: 'btn btn-warning' %>
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 720339d..7acec70 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,4 +1,4 @@ -

Edit <%= resource_name.to_s.humanize %>

+

Edit <%= resource_name.to_s.humanize %>

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> <%= devise_error_messages! %> @@ -22,11 +22,9 @@
<%= f.label :current_password %> (we need your current password to confirm your changes)
<%= f.password_field :current_password %>
-
<%= f.submit "Update" %>
+
<%= f.submit "Update", class: 'btn btn-primary' %>
<% end %> -

Cancel my account

+

Cancel my account

-

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>

- -<%= link_to "Back", root_path %> +

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete, class: 'btn btn-danger' %>

diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 9a9a71d..307c920 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,4 +1,4 @@ -

Sign up

+

Sign up

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> <%= devise_error_messages! %> @@ -15,7 +15,7 @@
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %>
-
<%= f.submit "Sign up" %>
+
<%= f.submit "Sign up", class: 'btn btn-primary' %>
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index f9bc2c1..cd75405 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,4 +1,4 @@ -

Sign in

+

Sign in

<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<%= f.label :email %>
@@ -11,7 +11,7 @@
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
<% end -%> -
<%= f.submit "Sign in" %>
+
<%= f.submit "Sign in", class: 'btn btn-primary' %>
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index 020787f..9482404 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -1,4 +1,4 @@ -

Resend unlock instructions

+

Resend unlock instructions

<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> <%= devise_error_messages! %> @@ -6,7 +6,7 @@
<%= f.label :email %>
<%= f.email_field :email, :autofocus => true %>
-
<%= f.submit "Resend unlock instructions" %>
+
<%= f.submit "Resend unlock instructions", class: 'btn btn-primary' %>
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 3fab7c9..dc7606e 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,16 +1,15 @@ -<% if user_signed_in? %> - <%= link_to('Edit', edit_user_registration_path) %> - <%= link_to('New Project', new_project_path) %> - <%= link_to('Logout', destroy_user_session_path, :method => :delete) %> -<% else %> - <%= link_to('Login', new_user_session_path) %> - <%= link_to('Sign Up', new_user_registration_path) %> -<% end %> +
+

Hello world!

-

Latest Projects

+

This is Mezuro! A free (with the same meaning as freedom) web platform for collaborative source code evalution.

+ +

Here you can evaluate your source code with most of the SCM, just by giving it's URL. For now you can evaluate Java, C/C++ and Python source-code, but soon we hope to support more languages!

+ +
+ +

Latest projects

-

<%= link_to('All Projects', projects_path) %>

\ No newline at end of file + \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9b03823..07ba868 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,30 +1,106 @@ - - - - + - - + + + - Base Rails App + <%= content_for?(:title) ? yield(:title) : "Mezuro" %> + <%= javascript_include_tag :modernizr %> - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> + + + + <%= stylesheet_link_tag "application", :media => "all" %> + + + + <%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %> + + + + <%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %> + + + + <%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %> - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> + + + <%= favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %> + + + + <%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %> + + <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> - -

<%= notice %>

-

<%= alert %>

+ + +
+
+
+ +
+
+ <%= bootstrap_flash %> + <%= yield %> +
+
+ +
+ + +
- <%= yield %> +
diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb index 496ba49..8851f2c 100644 --- a/app/views/projects/_form.html.erb +++ b/app/views/projects/_form.html.erb @@ -1,17 +1,15 @@ -<%= form_for(@project) do |f| %> +<%= form_for(@project, :html => { role: 'form' }) do |f| %> <%= render :partial => 'shared/form_errors', :locals => {:object => @project} %> -
+
<%= f.label :name %>
- <%= f.text_field :name %> + <%= f.text_field :name, class: 'form-control' %>
-
+
<%= f.label :description %>
- <%= f.text_area :description %> + <%= f.text_area :description, class: 'form-control' %>
-
- <%= f.submit %> -
+ <%= f.submit 'Save', class: 'btn btn-default' %> <% end %> diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 541f27d..027ffa6 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -1,6 +1,8 @@

Listing Projects

- +

<%= link_to 'New Project', new_project_path, class: 'btn btn-primary' %>

+ +
@@ -14,15 +16,13 @@ - - <% if project_owner? project.id %> - - <% end %> + + <% end %>
Name
<%= project.name %> <%= project.description %><%= link_to 'Show', project_path(project.id) %><%= link_to 'Edit', edit_project_path(project.id) %><%= link_to 'Show', project_path(project.id), class: 'btn btn-info' %> + <% if project_owner? project.id %> + <%= link_to 'Edit', edit_project_path(project.id), class: 'btn btn-info' %> + <% end %> +
- -
- -<%= link_to 'New Project', new_project_path %> diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index 8965061..90fbe5e 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -1,5 +1,3 @@

New Project

<%= render 'form' %> - -<%= link_to 'Back', root_path %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 3c6b10c..cfa89cc 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -10,8 +10,6 @@

<% if project_owner? @project.id %> - <%= link_to 'Destroy', project_path(@project.id), method: :delete, data: { confirm: 'Are you sure?' } %> + <%= link_to 'Destroy', project_path(@project.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %> <% end %>

- -<%= link_to 'Back', projects_path %> diff --git a/app/views/shared/_short_about.html.erb b/app/views/shared/_short_about.html.erb new file mode 100644 index 0000000..8b27f0b --- /dev/null +++ b/app/views/shared/_short_about.html.erb @@ -0,0 +1,4 @@ + +
  • +Mezuro is the front-end for the <%= link_to 'Kalibro Project', 'https://github.com/mezuro/kalibro' %>. It is intended to be a service where you can evaluate your code quality and, if you want, define wich set of metrics you want to use. +
  • \ No newline at end of file diff --git a/config/locales/en.bootstrap.yml b/config/locales/en.bootstrap.yml new file mode 100644 index 0000000..c98d8d8 --- /dev/null +++ b/config/locales/en.bootstrap.yml @@ -0,0 +1,18 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + helpers: + actions: "Actions" + links: + back: "Back" + cancel: "Cancel" + confirm: "Are you sure?" + destroy: "Delete" + new: "New" + edit: "Edit" + titles: + edit: "Edit %{model}" + save: "Save %{model}" + new: "New %{model}" + delete: "Delete %{model}" diff --git a/features/homepage.feature b/features/homepage.feature index e02928b..1c52dcd 100644 --- a/features/homepage.feature +++ b/features/homepage.feature @@ -7,8 +7,8 @@ Feature: Homepage Given I am at the homepage Then I should see Login And I should see Sign Up - And I should see Latest Projects - And I should see All Projects + And I should see Latest projects + And I should see Project Scenario: Signed in Given I am a regular user @@ -16,5 +16,5 @@ Feature: Homepage And I am at the homepage Then I should see Edit And I should see Logout - And I should see Latest Projects - And I should see All Projects \ No newline at end of file + And I should see Latest projects + And I should see Project \ No newline at end of file diff --git a/features/project/create.feature b/features/project/create.feature index 8485346..21cbecb 100644 --- a/features/project/create.feature +++ b/features/project/create.feature @@ -17,7 +17,7 @@ Feature: Project Creation And I am at the New Project page And I fill the Name field with "Kalibro" And I fill the Description field with "Web Service to collect metrics" - When I press the Create Project button + When I press the Save button Then I should see Kalibro And I should see Web Service to collect metrics @@ -29,7 +29,7 @@ Feature: Project Creation And I am at the New Project page And I fill the Name field with "Kalibro" And I fill the Description field with "Web Service to collect metrics" - When I press the Create Project button + When I press the Save button Then I should see There's already @kalibro_restart @@ -39,5 +39,5 @@ Feature: Project Creation And I am at the New Project page And I fill the Name field with " " And I fill the Description field with "Web Service to collect metrics" - When I press the Create Project button + When I press the Save button Then I should see Name can't be blank \ No newline at end of file diff --git a/features/project/edition.feature b/features/project/edition.feature index b76b1d1..a0357fa 100644 --- a/features/project/edition.feature +++ b/features/project/edition.feature @@ -18,8 +18,8 @@ Feature: Project And I am signed in And I have a sample project And I am at the All Projects page - Then I should not see Edit - + Then I should not see "Edit" within "table tr td" + @kalibro_restart Scenario: Should not render the edit page if the project doesn't belongs to the current user Given I am a regular user @@ -47,7 +47,7 @@ Feature: Project And I am at the sample project edit page And I fill the Name field with "Kalibro" And I fill the Description field with "Web Service to collect metrics" - When I press the Update button + When I press the Save button Then I should see Kalibro And I should see Web Service to collect metrics @@ -59,7 +59,7 @@ Feature: Project And I own a project named "Kalibro" And I am at the sample project edit page And I fill the Name field with "Qt-Calculator" - When I press the Update button + When I press the Save button Then I should see There's already @kalibro_restart @@ -69,7 +69,7 @@ Feature: Project And I own a sample project And I am at the sample project edit page And I fill the Description field with "Web Service to collect metrics" - When I press the Update button + When I press the Save button And I should see Web Service to collect metrics @kalibro_restart @@ -79,5 +79,5 @@ Feature: Project And I own a sample project And I am at the sample project edit page And I fill the Name field with " " - When I press the Update button + When I press the Save button Then I should see Name can't be blank diff --git a/features/project/listing.feature b/features/project/listing.feature index de6fcee..c12a381 100644 --- a/features/project/listing.feature +++ b/features/project/listing.feature @@ -5,7 +5,7 @@ Feature: Project listing Scenario: Listing projects Given I am at the homepage - When I click the All Projects link + When I click the Project link Then I should see Listing Projects And I should see Name And I should see Description @@ -27,14 +27,4 @@ Feature: Project listing When I click the Show link Then I should see Name And I should see Description - And I should see Back - And the sample project should be there - - @wip @kalibro_restart - Scenario: Should go back to the All Projects page from show project view - Given I am a regular user - And I am signed in - And I have a sample project - And I am at the Sample Project page - When I click the Back link - Then I should be in the All Projects page \ No newline at end of file + And the sample project should be there \ No newline at end of file diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index 624ca8d..a57c590 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -42,6 +42,10 @@ Then(/^I should not see (.+)$/) do |text| page.should_not have_content(text) end +Then(/^I should not see "(.+)"" within "(.+)"$/) do |text, selector| + page.find(selector).should_not have_content(text) +end + Then(/^the sample project should be there$/) do page.should have_content(@project.name) page.should have_content(@project.description) -- libgit2 0.21.2