cyclid-ui 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54597e4a74f4231ac7751cbe80cd08cafca83c7a
4
- data.tar.gz: 2dd3f1258e59e0842cbda74b7f58df4268795524
3
+ metadata.gz: cd6a99f9802100c3fe15f93e3803c624106d7c62
4
+ data.tar.gz: 83257bb0735724017e9f6f6276e34a359ecd9d72
5
5
  SHA512:
6
- metadata.gz: 32fcd54d76df4ed9a5d08e53db10749ab1dfe54dd5aadcb924ae19e23d54a53fdaca4aac9d799680358333c86859480b51674333960000a7bccdf6fdf4e1576e
7
- data.tar.gz: 4b2b95a1077b6409aa51bcf1406adbd5f0d33b1fcf4ed91d13faec2d1a3149da45941247d9270973e0cb12ef73a448c1cd1b290667b04f341eca5788dccd72b8
6
+ metadata.gz: 3d0377e09d764eaa4faca71fbc86667d25f854581bf3c7866392f17d81c97531fe5d760b81a5c0e6cc258b82d28cb42e01bcc328d8c1ea3e9be003285063848e
7
+ data.tar.gz: e547570fe202d684e48be60f3dc36f79835c18c76c89f192bc54c76f3ac5ff18da8ad03cd337ec42b9904afecc43bba6105ef03cf1a93f8230b7dba32dad9c5e
@@ -133,6 +133,8 @@ module Cyclid
133
133
  # it sees the 401 response
134
134
  env['warden'].custom_failure!
135
135
  flash[:login_error] = 'Invalid username or password'
136
+ session[:request_uri] = env['REQUEST_URI'] \
137
+ unless session.key? :request_uri
136
138
  cookies.delete 'cyclid.token'
137
139
  redirect to '/login'
138
140
  end
@@ -71,8 +71,16 @@ module Cyclid
71
71
  # Pick the first organization from the users membership and
72
72
  # redirect; if the user doesn't belong to any organizations,
73
73
  # redirect them to their user page
74
- initial_page = if user.organizations.empty?
75
- "/user/#{username}"
74
+ request_uri = session[:request_uri]
75
+ Cyclid.logger.debug "request_uri=#{request_uri}"
76
+ initial_page = if request_uri
77
+ request_uri
78
+ elsif user.organizations.empty?
79
+ if Cyclid.config.signup
80
+ "/user/#{username}/intro"
81
+ else
82
+ "/user/#{username}"
83
+ end
76
84
  else
77
85
  user.organizations.first
78
86
  end
@@ -36,6 +36,22 @@ module Cyclid
36
36
 
37
37
  mustache :user
38
38
  end
39
+
40
+ get '/user/:username/intro' do
41
+ authenticate!
42
+
43
+ # Build breadcrumbs
44
+ username = params[:username]
45
+
46
+ @crumbs = []
47
+ @crumbs << { 'name' => 'User' }
48
+ @crumbs << { 'url' => "/user/#{username}", 'name' => username }
49
+ @crumbs << { 'url' => "/user/#{username}/intro", 'name' => 'Introduction' }
50
+
51
+ @current_user = current_user
52
+
53
+ mustache :intro
54
+ end
39
55
  end
40
56
  end
41
57
  end
@@ -0,0 +1,22 @@
1
+ <div class="container" id="intro">
2
+ <div class="row">
3
+ <div class="col-md-8">
4
+ <h1>Welcome to Cyclid!</h1>
5
+ <p><span style="font-size:140%;">You currently don't belong to any organizations. Without an organization, you won't be able to run any jobs!</span></p>
6
+ <p>You can either <a href="{{signup}}/organization">create a new organization</a>, or ask someone to add you to an existing organization.</p>
7
+ <hr>
8
+ <p>While you're here, there are some useful links which can help you get the most from Cyclid:</p>
9
+ <ul style="line-height: 1.75;">
10
+ <li>The official Cyclid documentation at <a href="//docs.cyclid.io">docs.cyclid.io</a>.</li>
11
+ <li>Cyclid source code at <a href="//github.com/Cyclid/">Github</a>, including example projects.</li>
12
+ <li>The <a href="//cyclid.io/blog/">Cyclid Blog</a> for news and articles about Cyclid & Continuous Integration.</li>
13
+ <li>You can follow <a href="//twitter.com/cyclidci">@cyclidci</a> on Twitter for news & updates.</li>
14
+ </ul>
15
+ <p>If you'd like to get in touch, just email us at <a href="mailto:contact@cyclid.io">contact@cyclid.io</a>.</p>
16
+ </div>
17
+
18
+ <div class="col-md-4">
19
+ <img style="padding-top: 90px;" src="/images/cyclid-logo-large.png">
20
+ </div>
21
+ </div>
22
+ </div>
@@ -32,7 +32,7 @@
32
32
 
33
33
  <div class="container">
34
34
  <div class="row">
35
- <img class="center-block" src="images/cyclid-logo-large.png">
35
+ <img class="center-block" src="/images/cyclid-logo-large.png">
36
36
  </div>
37
37
  </div>
38
38
 
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ # Copyright 2016 Liqwyd Ltd.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ module Cyclid
17
+ module UI
18
+ module Views
19
+ # New user introduction view
20
+ class Intro < Layout
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Cyclid
3
3
  module UI
4
- VERSION = '0.2.3'
4
+ VERSION = '0.2.4'
5
5
  end
6
6
  end
@@ -44,7 +44,7 @@ function user_update_details(user){
44
44
  var config = `server: ${gblAPIURL}\n` +
45
45
  `organization: ${org}\n` +
46
46
  `username: ${user.username}\n` +
47
- `secret: `;
47
+ `secret: ${user.secret}\n`;
48
48
 
49
49
  console.log(`${org} was clicked: ${config}`);
50
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyclid-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristian Van Der Vliet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-10 00:00:00.000000000 Z
11
+ date: 2017-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: require_all
@@ -228,6 +228,7 @@ files:
228
228
  - app/cyclid_ui/models/user.rb
229
229
  - app/cyclid_ui/templates/config.mustache
230
230
  - app/cyclid_ui/templates/footer.mustache
231
+ - app/cyclid_ui/templates/intro.mustache
231
232
  - app/cyclid_ui/templates/job.mustache
232
233
  - app/cyclid_ui/templates/job_info.mustache
233
234
  - app/cyclid_ui/templates/layout.mustache
@@ -235,6 +236,7 @@ files:
235
236
  - app/cyclid_ui/templates/organization.mustache
236
237
  - app/cyclid_ui/templates/user.mustache
237
238
  - app/cyclid_ui/views/config.rb
239
+ - app/cyclid_ui/views/intro.rb
238
240
  - app/cyclid_ui/views/job.rb
239
241
  - app/cyclid_ui/views/layout.rb
240
242
  - app/cyclid_ui/views/login.rb